summaryrefslogtreecommitdiffstats
path: root/kexi/migration/keximigrate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kexi/migration/keximigrate.cpp')
-rw-r--r--kexi/migration/keximigrate.cpp80
1 files changed, 40 insertions, 40 deletions
diff --git a/kexi/migration/keximigrate.cpp b/kexi/migration/keximigrate.cpp
index b225f6ba..1c3295b6 100644
--- a/kexi/migration/keximigrate.cpp
+++ b/kexi/migration/keximigrate.cpp
@@ -61,20 +61,20 @@ KexiMigrate::~KexiMigrate()
delete m_destPrj;
}
-bool KexiMigrate::checkIfDestinationDatabaseOverwritingNeedsAccepting(Kexi::ObjecttqStatus* result,
+bool KexiMigrate::checkIfDestinationDatabaseOverwritingNeedsAccepting(Kexi::ObjectStatus* result,
bool& acceptingNeeded)
{
acceptingNeeded = false;
if (result)
- result->cleartqStatus();
+ result->clearStatus();
KexiDB::DriverManager drvManager;
KexiDB::Driver *destDriver = drvManager.driver(
m_migrateData->destination->connectionData()->driverName);
if (!destDriver) {
- result->settqStatus(&drvManager,
+ result->setStatus(&drvManager,
i18n("Could not create database \"%1\".")
- .tqarg(m_migrateData->destination->databaseName()));
+ .arg(m_migrateData->destination->databaseName()));
return false;
}
@@ -113,18 +113,18 @@ bool KexiMigrate::isSourceAndDestinationDataSourceTheSame() const
//=============================================================================
// Perform Import operation
-bool KexiMigrate::performImport(Kexi::ObjecttqStatus* result)
+bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
{
if (result)
- result->cleartqStatus();
+ result->clearStatus();
KexiDB::DriverManager drvManager;
KexiDB::Driver *destDriver = drvManager.driver(
m_migrateData->destination->connectionData()->driverName);
if (!destDriver) {
- result->settqStatus(&drvManager,
+ result->setStatus(&drvManager,
i18n("Could not create database \"%1\".")
- .tqarg(m_migrateData->destination->databaseName()));
+ .arg(m_migrateData->destination->databaseName()));
return false;
}
@@ -135,8 +135,8 @@ bool KexiMigrate::performImport(Kexi::ObjecttqStatus* result)
if (!drv_connect()) {
kdDebug() << "Couldnt connect to database server" << endl;
if (result)
- result->settqStatus(i18n("Could not connect to data source \"%1\".")
- .tqarg(m_migrateData->source->serverInfoString()), "");
+ result->setStatus(i18n("Could not connect to data source \"%1\".")
+ .arg(m_migrateData->source->serverInfoString()), "");
return false;
}
@@ -145,9 +145,9 @@ bool KexiMigrate::performImport(Kexi::ObjecttqStatus* result)
if (!tableNames(tables)) {
kdDebug() << "Couldnt get list of tables" << endl;
if (result)
- result->settqStatus(
+ result->setStatus(
i18n("Could not get a list of table names for data source \"%1\".")
- .tqarg(m_migrateData->source->serverInfoString()), "");
+ .arg(m_migrateData->source->serverInfoString()), "");
return false;
}
@@ -155,9 +155,9 @@ bool KexiMigrate::performImport(Kexi::ObjecttqStatus* result)
if (tables.isEmpty()) {
kdDebug() << "There were no tables to import" << endl;
if (result)
- result->settqStatus(
+ result->setStatus(
i18n("No tables to import found in data source \"%1\".")
- .tqarg(m_migrateData->source->serverInfoString()), "");
+ .arg(m_migrateData->source->serverInfoString()), "");
return false;
}
@@ -165,15 +165,15 @@ bool KexiMigrate::performImport(Kexi::ObjecttqStatus* result)
tables.sort();
m_tableSchemas.clear();
if (!destDriver) {
- result->settqStatus(&drvManager);
+ result->setStatus(&drvManager);
return false;
}
const bool kexi__objects_exists = tables.find("kexi__objects")!=tables.end();
TQStringList kexiDBTables;
if (kexi__objects_exists) {
tristate res = drv_queryStringListFromSQL(
- TQString::tqfromLatin1("SELECT o_name FROM kexi__objects WHERE o_type=%1")
- .tqarg((int)KexiDB::TableObjectType), 0, kexiDBTables, -1);
+ TQString::fromLatin1("SELECT o_name FROM kexi__objects WHERE o_type=%1")
+ .arg((int)KexiDB::TableObjectType), 0, kexiDBTables, -1);
if (res == true) {
// prepend KexiDB-compatible tables to 'tables' list, so we'll copy KexiDB-compatible tables first,
// to make sure existing IDs will not be in conflict with IDs newly generated for non-KexiDB tables
@@ -199,9 +199,9 @@ bool KexiMigrate::performImport(Kexi::ObjecttqStatus* result)
if (!drv_readTableSchema(*it, *tableSchema)) {
delete tableSchema;
if (result)
- result->settqStatus(
+ result->setStatus(
i18n("Could not import project from data source \"%1\". Error reading table \"%2\".")
- .tqarg(m_migrateData->source->serverInfoString()).tqarg(tableName), "");
+ .arg(m_migrateData->source->serverInfoString()).arg(tableName), "");
return false;
}
//yeah, got a table
@@ -228,9 +228,9 @@ bool KexiMigrate::performImport(Kexi::ObjecttqStatus* result)
if (trans.isNull()) {
ok = false;
if (result)
- result->settqStatus(destConn,
+ result->setStatus(destConn,
i18n("Could not create database \"%1\".")
- .tqarg(m_migrateData->destination->databaseName()));
+ .arg(m_migrateData->destination->databaseName()));
//later destConn->dropDatabase(m_migrateData->destination->databaseName());
//don't delete prj, otherwise eror message will be deleted delete prj;
//later return m_destPrj;
@@ -250,7 +250,7 @@ bool KexiMigrate::performImport(Kexi::ObjecttqStatus* result)
bool firstRecord = true;
if (true == drv_fetchRecordFromSQL(
TQString("SELECT o_id, o_type, o_name, o_caption, o_desc FROM kexi__objects "
- "WHERE o_name='%1' AND o_type=%1").tqarg(*it).tqarg((int)KexiDB::TableObjectType),
+ "WHERE o_name='%1' AND o_type=%1").arg(*it).arg((int)KexiDB::TableObjectType),
data, firstRecord)
&& destConn->setupObjectSchemaData( data, *t ))
{
@@ -258,9 +258,9 @@ bool KexiMigrate::performImport(Kexi::ObjecttqStatus* result)
//load schema for every field and add it
firstRecord = true;
TQString sql(
- TQString::tqfromLatin1("SELECT t_id, f_type, f_name, f_length, f_precision, f_constraints, "
+ TQString::fromLatin1("SELECT t_id, f_type, f_name, f_length, f_precision, f_constraints, "
"f_options, f_default, f_order, f_caption, f_help"
- " FROM kexi__fields WHERE t_id=%1 ORDER BY f_order").tqarg(t->id()) );
+ " FROM kexi__fields WHERE t_id=%1 ORDER BY f_order").arg(t->id()) );
while (ok) {
tristate res = drv_fetchRecordFromSQL(sql, data, firstRecord);
if (res != true) {
@@ -299,9 +299,9 @@ bool KexiMigrate::performImport(Kexi::ObjecttqStatus* result)
kdDebug() << "Failed to create a table " << ts->name() << endl;
destConn->debugError();
if (result)
- result->settqStatus(destConn,
+ result->setStatus(destConn,
i18n("Could not create database \"%1\".")
- .tqarg(m_migrateData->destination->databaseName()));
+ .arg(m_migrateData->destination->databaseName()));
m_tableSchemas.remove(ts);
break;
}
@@ -329,9 +329,9 @@ bool KexiMigrate::performImport(Kexi::ObjecttqStatus* result)
if (m_destPrj->error()) {
ok = false;
if (result)
- result->settqStatus(m_destPrj,
+ result->setStatus(m_destPrj,
i18n("Could not import project from data source \"%1\".")
- .tqarg(m_migrateData->source->serverInfoString()));
+ .arg(m_migrateData->source->serverInfoString()));
}
}
@@ -380,8 +380,8 @@ bool KexiMigrate::performImport(Kexi::ObjecttqStatus* result)
if (!ok) {
kdDebug() << "Failed to copy table " << tname << endl;
if (result)
- result->settqStatus(destConn,
- i18n("Could not copy table \"%1\" to destination database.").tqarg(tname));
+ result->setStatus(destConn,
+ i18n("Could not copy table \"%1\" to destination database.").arg(tname));
break;
}
}//for
@@ -404,9 +404,9 @@ bool KexiMigrate::performImport(Kexi::ObjecttqStatus* result)
// Finally: error handling
if (result && result->error())
- result->settqStatus(destConn,
+ result->setStatus(destConn,
i18n("Could not import data from data source \"%1\".")
- .tqarg(m_migrateData->source->serverInfoString()));
+ .arg(m_migrateData->source->serverInfoString()));
if (destConn) {
destConn->debugError();
destConn->rollbackTransaction(trans);
@@ -420,10 +420,10 @@ bool KexiMigrate::performImport(Kexi::ObjecttqStatus* result)
}
//=============================================================================
-bool KexiMigrate::performExport(Kexi::ObjecttqStatus* result)
+bool KexiMigrate::performExport(Kexi::ObjectStatus* result)
{
if (result)
- result->cleartqStatus();
+ result->clearStatus();
//! @todo performExport
@@ -512,7 +512,7 @@ KexiDB::Field::Type KexiMigrate::userType(const TQString& fname)
res = dlg->getItem( i18n("Field Type"),
i18n("The data type for %1 could not be determined. "
"Please select one of the following data "
- "types").tqarg(fname),
+ "types").arg(fname),
types, 0, false);
//! @todo use TQMap<TQCString, KexiDB::Field::Type> here!
@@ -575,9 +575,9 @@ bool KexiMigrate::isValid()
{
setError(ERR_INCOMPAT_DRIVER_VERSION,
i18n("Incompatible migration driver's \"%1\" version: found version %2, expected version %3.")
- .tqarg(name())
- .tqarg(TQString("%1.%2").tqarg(versionMajor()).tqarg(versionMinor()))
- .tqarg(TQString("%1.%2").tqarg(KexiMigration::versionMajor()).tqarg(KexiMigration::versionMinor())));
+ .arg(name())
+ .arg(TQString("%1.%2").arg(versionMajor()).arg(versionMinor()))
+ .arg(TQString("%1.%2").arg(KexiMigration::versionMajor()).arg(KexiMigration::versionMinor())));
return false;
}
return true;
@@ -588,8 +588,8 @@ bool KexiMigrate::drv_queryMaxNumber(const TQString& tableName,
{
TQString string;
tristate r = drv_querySingleStringFromSQL(
- TQString::tqfromLatin1("SELECT MAX(%1) FROM %2").tqarg(drv_escapeIdentifier(columnName))
- .tqarg(drv_escapeIdentifier(tableName)), 0, string);
+ TQString::fromLatin1("SELECT MAX(%1) FROM %2").arg(drv_escapeIdentifier(columnName))
+ .arg(drv_escapeIdentifier(tableName)), 0, string);
if (r == false)
return false;
if (~r) {