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 1c3295b6..b225f6ba 100644
--- a/kexi/migration/keximigrate.cpp
+++ b/kexi/migration/keximigrate.cpp
@@ -61,20 +61,20 @@ KexiMigrate::~KexiMigrate()
delete m_destPrj;
}
-bool KexiMigrate::checkIfDestinationDatabaseOverwritingNeedsAccepting(Kexi::ObjectStatus* result,
+bool KexiMigrate::checkIfDestinationDatabaseOverwritingNeedsAccepting(Kexi::ObjecttqStatus* result,
bool& acceptingNeeded)
{
acceptingNeeded = false;
if (result)
- result->clearStatus();
+ result->cleartqStatus();
KexiDB::DriverManager drvManager;
KexiDB::Driver *destDriver = drvManager.driver(
m_migrateData->destination->connectionData()->driverName);
if (!destDriver) {
- result->setStatus(&drvManager,
+ result->settqStatus(&drvManager,
i18n("Could not create database \"%1\".")
- .arg(m_migrateData->destination->databaseName()));
+ .tqarg(m_migrateData->destination->databaseName()));
return false;
}
@@ -113,18 +113,18 @@ bool KexiMigrate::isSourceAndDestinationDataSourceTheSame() const
//=============================================================================
// Perform Import operation
-bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
+bool KexiMigrate::performImport(Kexi::ObjecttqStatus* result)
{
if (result)
- result->clearStatus();
+ result->cleartqStatus();
KexiDB::DriverManager drvManager;
KexiDB::Driver *destDriver = drvManager.driver(
m_migrateData->destination->connectionData()->driverName);
if (!destDriver) {
- result->setStatus(&drvManager,
+ result->settqStatus(&drvManager,
i18n("Could not create database \"%1\".")
- .arg(m_migrateData->destination->databaseName()));
+ .tqarg(m_migrateData->destination->databaseName()));
return false;
}
@@ -135,8 +135,8 @@ bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
if (!drv_connect()) {
kdDebug() << "Couldnt connect to database server" << endl;
if (result)
- result->setStatus(i18n("Could not connect to data source \"%1\".")
- .arg(m_migrateData->source->serverInfoString()), "");
+ result->settqStatus(i18n("Could not connect to data source \"%1\".")
+ .tqarg(m_migrateData->source->serverInfoString()), "");
return false;
}
@@ -145,9 +145,9 @@ bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
if (!tableNames(tables)) {
kdDebug() << "Couldnt get list of tables" << endl;
if (result)
- result->setStatus(
+ result->settqStatus(
i18n("Could not get a list of table names for data source \"%1\".")
- .arg(m_migrateData->source->serverInfoString()), "");
+ .tqarg(m_migrateData->source->serverInfoString()), "");
return false;
}
@@ -155,9 +155,9 @@ bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
if (tables.isEmpty()) {
kdDebug() << "There were no tables to import" << endl;
if (result)
- result->setStatus(
+ result->settqStatus(
i18n("No tables to import found in data source \"%1\".")
- .arg(m_migrateData->source->serverInfoString()), "");
+ .tqarg(m_migrateData->source->serverInfoString()), "");
return false;
}
@@ -165,15 +165,15 @@ bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
tables.sort();
m_tableSchemas.clear();
if (!destDriver) {
- result->setStatus(&drvManager);
+ result->settqStatus(&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::fromLatin1("SELECT o_name FROM kexi__objects WHERE o_type=%1")
- .arg((int)KexiDB::TableObjectType), 0, kexiDBTables, -1);
+ TQString::tqfromLatin1("SELECT o_name FROM kexi__objects WHERE o_type=%1")
+ .tqarg((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::ObjectStatus* result)
if (!drv_readTableSchema(*it, *tableSchema)) {
delete tableSchema;
if (result)
- result->setStatus(
+ result->settqStatus(
i18n("Could not import project from data source \"%1\". Error reading table \"%2\".")
- .arg(m_migrateData->source->serverInfoString()).arg(tableName), "");
+ .tqarg(m_migrateData->source->serverInfoString()).tqarg(tableName), "");
return false;
}
//yeah, got a table
@@ -228,9 +228,9 @@ bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
if (trans.isNull()) {
ok = false;
if (result)
- result->setStatus(destConn,
+ result->settqStatus(destConn,
i18n("Could not create database \"%1\".")
- .arg(m_migrateData->destination->databaseName()));
+ .tqarg(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::ObjectStatus* 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").arg(*it).arg((int)KexiDB::TableObjectType),
+ "WHERE o_name='%1' AND o_type=%1").tqarg(*it).tqarg((int)KexiDB::TableObjectType),
data, firstRecord)
&& destConn->setupObjectSchemaData( data, *t ))
{
@@ -258,9 +258,9 @@ bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
//load schema for every field and add it
firstRecord = true;
TQString sql(
- TQString::fromLatin1("SELECT t_id, f_type, f_name, f_length, f_precision, f_constraints, "
+ TQString::tqfromLatin1("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").arg(t->id()) );
+ " FROM kexi__fields WHERE t_id=%1 ORDER BY f_order").tqarg(t->id()) );
while (ok) {
tristate res = drv_fetchRecordFromSQL(sql, data, firstRecord);
if (res != true) {
@@ -299,9 +299,9 @@ bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
kdDebug() << "Failed to create a table " << ts->name() << endl;
destConn->debugError();
if (result)
- result->setStatus(destConn,
+ result->settqStatus(destConn,
i18n("Could not create database \"%1\".")
- .arg(m_migrateData->destination->databaseName()));
+ .tqarg(m_migrateData->destination->databaseName()));
m_tableSchemas.remove(ts);
break;
}
@@ -329,9 +329,9 @@ bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
if (m_destPrj->error()) {
ok = false;
if (result)
- result->setStatus(m_destPrj,
+ result->settqStatus(m_destPrj,
i18n("Could not import project from data source \"%1\".")
- .arg(m_migrateData->source->serverInfoString()));
+ .tqarg(m_migrateData->source->serverInfoString()));
}
}
@@ -380,8 +380,8 @@ bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
if (!ok) {
kdDebug() << "Failed to copy table " << tname << endl;
if (result)
- result->setStatus(destConn,
- i18n("Could not copy table \"%1\" to destination database.").arg(tname));
+ result->settqStatus(destConn,
+ i18n("Could not copy table \"%1\" to destination database.").tqarg(tname));
break;
}
}//for
@@ -404,9 +404,9 @@ bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
// Finally: error handling
if (result && result->error())
- result->setStatus(destConn,
+ result->settqStatus(destConn,
i18n("Could not import data from data source \"%1\".")
- .arg(m_migrateData->source->serverInfoString()));
+ .tqarg(m_migrateData->source->serverInfoString()));
if (destConn) {
destConn->debugError();
destConn->rollbackTransaction(trans);
@@ -420,10 +420,10 @@ bool KexiMigrate::performImport(Kexi::ObjectStatus* result)
}
//=============================================================================
-bool KexiMigrate::performExport(Kexi::ObjectStatus* result)
+bool KexiMigrate::performExport(Kexi::ObjecttqStatus* result)
{
if (result)
- result->clearStatus();
+ result->cleartqStatus();
//! @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").arg(fname),
+ "types").tqarg(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.")
- .arg(name())
- .arg(TQString("%1.%2").arg(versionMajor()).arg(versionMinor()))
- .arg(TQString("%1.%2").arg(KexiMigration::versionMajor()).arg(KexiMigration::versionMinor())));
+ .tqarg(name())
+ .tqarg(TQString("%1.%2").tqarg(versionMajor()).tqarg(versionMinor()))
+ .tqarg(TQString("%1.%2").tqarg(KexiMigration::versionMajor()).tqarg(KexiMigration::versionMinor())));
return false;
}
return true;
@@ -588,8 +588,8 @@ bool KexiMigrate::drv_queryMaxNumber(const TQString& tableName,
{
TQString string;
tristate r = drv_querySingleStringFromSQL(
- TQString::fromLatin1("SELECT MAX(%1) FROM %2").arg(drv_escapeIdentifier(columnName))
- .arg(drv_escapeIdentifier(tableName)), 0, string);
+ TQString::tqfromLatin1("SELECT MAX(%1) FROM %2").tqarg(drv_escapeIdentifier(columnName))
+ .tqarg(drv_escapeIdentifier(tableName)), 0, string);
if (r == false)
return false;
if (~r) {