[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [calligra/kexi-frameworks7-staniek] kexi: Kexi: Update for the recent KDb API changes
From:       Jaroslaw Staniek <staniek () kde ! org>
Date:       2015-06-30 20:24:31
Message-ID: E1ZA251-0006Ps-Gg () scm ! kde ! org
[Download RAW message or body]

Git commit c7eec27e6ece4de07ac201806c3b6589607866bb by Jaroslaw Staniek.
Committed on 30/06/2015 at 20:16.
Pushed by staniek into branch 'kexi-frameworks7-staniek'.

Kexi: Update for the recent KDb API changes

M  +3    -2    kexi/migration/mysql/mysqlmigrate.cpp
M  +1    -1    kexi/migration/pqxx/pqxxmigrate.cpp
M  +3    -2    kexi/migration/xbase/xbasemigrate.cpp
M  +4    -4    kexi/plugins/tables/kexitabledesignerview.cpp
M  +2    -2    kexi/widget/kexiqueryparameters.cpp

http://commits.kde.org/calligra/c7eec27e6ece4de07ac201806c3b6589607866bb

diff --git a/kexi/migration/mysql/mysqlmigrate.cpp \
b/kexi/migration/mysql/mysqlmigrate.cpp index 611c9cb..dcf55ec 100644
--- a/kexi/migration/mysql/mysqlmigrate.cpp
+++ b/kexi/migration/mysql/mysqlmigrate.cpp
@@ -258,8 +258,9 @@ bool MySQLMigrate::drv_copyTable(const QString& srcTable, \
KDbConnection *destCon  mysql_free_result(res);
             return false;
         }
-        for (int i = 0; i < numFields; i++)
-            vals.append(KDb::cstringToVariant(row[i], fieldsExpanded.at(i)->field, \
(int)lengths[i])); +        for (int i = 0; i < numFields; i++) {
+            vals.append(KDb::cstringToVariant(row[i], \
fieldsExpanded.at(i)->field->type(), 0, int(lengths[i]))); +        }
         if (!destConn->insertRecord(*dstTable, vals)) {
             mysql_free_result(res);
             return false;
diff --git a/kexi/migration/pqxx/pqxxmigrate.cpp \
b/kexi/migration/pqxx/pqxxmigrate.cpp index 758235b..63de11d 100644
--- a/kexi/migration/pqxx/pqxxmigrate.cpp
+++ b/kexi/migration/pqxx/pqxxmigrate.cpp
@@ -439,7 +439,7 @@ bool PqxxMigrate::drv_copyTable(const QString& srcTable, \
                KDbConnection *destConn
                 vals.append(QString((*i).c_str()).toLower() == "t" ? QVariant(true) \
: QVariant(false));  } else
                 vals.append(KDb::cstringToVariant((*i).c_str(),
-                                                     \
fieldsExpanded.at(index)->field, (*i).size())); +                                     \
fieldsExpanded.at(index)->field->type(), (*i).size()));  }
         if (!destConn->insertRecord(*dstTable, vals))
             return false;
diff --git a/kexi/migration/xbase/xbasemigrate.cpp \
b/kexi/migration/xbase/xbasemigrate.cpp index dda8c9a..84d463c 100644
--- a/kexi/migration/xbase/xbasemigrate.cpp
+++ b/kexi/migration/xbase/xbasemigrate.cpp
@@ -258,7 +258,8 @@ bool xBaseMigrate::drv_copyTable(const QString& srcTable, \
                KDbConnection *destCon
           if ( ( returnCode = tableDbf->GetMemoField( j , blobFieldLength, \
                memoBuffer, F_SETLKW ) ) != XB_NO_ERROR ) {
             qDebug()<<"Error reading blob field. Error code: "<<returnCode; // make \
error message more verbose  } else {
-            val = KDb::cstringToVariant( memoBuffer, fieldsExpanded.at(j)->field, \
blobFieldLength ); +            bool ok;
+            val = KDb::cstringToVariant( memoBuffer, \
fieldsExpanded.at(j)->field->type(), 0, blobFieldLength );  }
           #ifdef XB_LOCKING_ON
             tableDbf->LockMemoFile( F_SETLK, F_UNLCK );
@@ -270,7 +271,7 @@ bool xBaseMigrate::drv_copyTable(const QString& srcTable, \
KDbConnection *destCon  #endif
 
         default:
-          val = KDb::cstringToVariant(data, fieldsExpanded.at(j)->field, strlen( \
data ) ); +          val = KDb::cstringToVariant(data, \
fieldsExpanded.at(j)->field->type());  break;
       }
       vals.append( val );
diff --git a/kexi/plugins/tables/kexitabledesignerview.cpp \
b/kexi/plugins/tables/kexitabledesignerview.cpp index 6e40039..57a58a8 100644
--- a/kexi/plugins/tables/kexitabledesignerview.cpp
+++ b/kexi/plugins/tables/kexitabledesignerview.cpp
@@ -297,8 +297,8 @@ KexiTableDesignerView::getSubTypeListData(KDbField::TypeGroup \
fieldTypeGroup,  namesList << xi18n("Image object type", "Image");
       }
       else {*/
-    stringsList = KDb::typeStringsForGroup(fieldTypeGroup);
-    namesList = KDb::typeNamesForGroup(fieldTypeGroup);
+    stringsList = KDb::fieldTypeStringsForGroup(fieldTypeGroup);
+    namesList = KDb::fieldTypeNamesForGroup(fieldTypeGroup);
 // }
     qDebug() << "subType strings: " <<
         stringsList.join("|") << "\nnames: " << namesList.join("|");
@@ -695,7 +695,7 @@ void KexiTableDesignerView::slotBeforeCellChanged(
         fieldTypeGroup = static_cast<KDbField::TypeGroup>(i_fieldTypeGroup);
 
         //-get 1st type from this group, and update 'type' property
-        KDbField::Type fieldType = KDb::defaultTypeForGroup(fieldTypeGroup);
+        KDbField::Type fieldType = KDb::defaultFieldTypeForGroup(fieldTypeGroup);
         if (fieldType == KDbField::InvalidType)
             fieldType = KDbField::Text;
 
@@ -801,7 +801,7 @@ void KexiTableDesignerView::slotRecordUpdated(KDbRecordData \
*data)  //-- create a new field:
         KDbField::TypeGroup fieldTypeGroup = static_cast<KDbField::TypeGroup>(
                     data->at(COLUMN_ID_TYPE).toInt() + 1/*counting from 1*/);
-        int intFieldType = KDb::defaultTypeForGroup(fieldTypeGroup);
+        int intFieldType = KDb::defaultFieldTypeForGroup(fieldTypeGroup);
         if (intFieldType == 0)
             return;
 
diff --git a/kexi/widget/kexiqueryparameters.cpp \
b/kexi/widget/kexiqueryparameters.cpp index 33cd2e8..b91d1fc 100644
--- a/kexi/widget/kexiqueryparameters.cpp
+++ b/kexi/widget/kexiqueryparameters.cpp
@@ -48,9 +48,9 @@ QList<QVariant> KexiQueryParameters::getParameters(QWidget *parent,
         case KDbField::Integer:
         case KDbField::BigInteger: {
 //! @todo problem for ranges in case of BigInteger - will disappear when we remove \
                use of QInputDialog
-            int minValue, maxValue;
+            qlonglong minValue, maxValue;
 //! @todo add support for unsigned parameter here
-            KDb::getLimitsForType(parameter.type, &minValue, &maxValue);
+            KDb::getLimitsForFieldType(parameter.type, &minValue, &maxValue);
             const int result = QInputDialog::getInt(parent, caption, \
                parameter.message,
                                                     0, minValue, maxValue, \
1/*step*/, ok);  if (!*ok)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic