summaryrefslogtreecommitdiffstats
path: root/kexi/kexidb
diff options
context:
space:
mode:
Diffstat (limited to 'kexi/kexidb')
-rw-r--r--kexi/kexidb/alter.cpp32
-rw-r--r--kexi/kexidb/connection.cpp246
-rw-r--r--kexi/kexidb/cursor.cpp2
-rw-r--r--kexi/kexidb/dbobjectnamevalidator.cpp2
-rw-r--r--kexi/kexidb/dbproperties.cpp56
-rw-r--r--kexi/kexidb/driver.cpp14
-rw-r--r--kexi/kexidb/driver_p.cpp2
-rw-r--r--kexi/kexidb/drivermanager.cpp18
-rw-r--r--kexi/kexidb/drivers/mySQL/mysqlconnection.cpp2
-rw-r--r--kexi/kexidb/drivers/mySQL/mysqldriver.cpp6
-rw-r--r--kexi/kexidb/drivers/pqxx/pqxxconnection.cpp12
-rw-r--r--kexi/kexidb/drivers/pqxx/pqxxcursor.h2
-rw-r--r--kexi/kexidb/drivers/pqxx/pqxxdriver.cpp6
-rw-r--r--kexi/kexidb/drivers/sqlite/sqliteadmin.cpp2
-rw-r--r--kexi/kexidb/drivers/sqlite/sqliteconnection.cpp16
-rw-r--r--kexi/kexidb/drivers/sqlite/sqlitecursor.cpp14
-rw-r--r--kexi/kexidb/drivers/sqlite/sqlitevacuum.cpp4
-rw-r--r--kexi/kexidb/expression.cpp44
-rw-r--r--kexi/kexidb/field.cpp22
-rw-r--r--kexi/kexidb/fieldlist.cpp6
-rw-r--r--kexi/kexidb/fieldlist.h4
-rw-r--r--kexi/kexidb/lookupfieldschema.cpp12
-rw-r--r--kexi/kexidb/parser/parser_p.cpp36
-rw-r--r--kexi/kexidb/parser/sqlparser.cpp2
-rw-r--r--kexi/kexidb/parser/sqlparser.y4
-rw-r--r--kexi/kexidb/queryschema.cpp42
-rw-r--r--kexi/kexidb/queryschemaparameter.cpp4
-rw-r--r--kexi/kexidb/schemadata.cpp2
-rw-r--r--kexi/kexidb/simplecommandlineapp.cpp2
-rw-r--r--kexi/kexidb/utils.cpp40
-rw-r--r--kexi/kexidb/utils.h6
31 files changed, 331 insertions, 331 deletions
diff --git a/kexi/kexidb/alter.cpp b/kexi/kexidb/alter.cpp
index 5386d3d6..f4a1346f 100644
--- a/kexi/kexidb/alter.cpp
+++ b/kexi/kexidb/alter.cpp
@@ -181,7 +181,7 @@ int AlterTableHandler::alteringTypeForProperty(const TQCString& propertyName)
if (KexiDB::isExtendedTableFieldProperty(propertyName))
return (int)ExtendedSchemaAlteringRequired;
KexiDBWarn << TQString("AlterTableHandler::alteringTypeForProperty(): property \"%1\" not found!")
- .tqarg(propertyName.data()) << endl;
+ .arg(propertyName.data()) << endl;
}
return res;
}
@@ -214,9 +214,9 @@ void AlterTableHandler::ChangeFieldPropertyAction::updateAlteringRequirements()
TQString AlterTableHandler::ChangeFieldPropertyAction::debugString(const DebugOptions& debugOptions)
{
TQString s = TQString("Set \"%1\" property for table field \"%2\" to \"%3\"")
- .tqarg(m_propertyName).tqarg(fieldName()).tqarg(m_newValue.toString());
+ .arg(m_propertyName).arg(fieldName()).arg(m_newValue.toString());
if (debugOptions.showUID)
- s.append(TQString(" (UID=%1)").tqarg(m_fieldUID));
+ s.append(TQString(" (UID=%1)").arg(m_fieldUID));
return s;
}
@@ -267,7 +267,7 @@ static void debugActionDict(AlterTableHandler::ActionDict *dict, int fieldUID, b
else
fieldName = "??";
TQString dbg = TQString("Action dict for field \"%1\" (%2, UID=%3):")
- .tqarg(fieldName).tqarg(dict->count()).tqarg(fieldUID);
+ .arg(fieldName).arg(dict->count()).arg(fieldUID);
KexiDBDbg << dbg << endl;
#ifdef KEXI_DEBUG_GUI
if (simulate)
@@ -495,9 +495,9 @@ void AlterTableHandler::RemoveFieldAction::updateAlteringRequirements()
TQString AlterTableHandler::RemoveFieldAction::debugString(const DebugOptions& debugOptions)
{
- TQString s = TQString("Remove table field \"%1\"").tqarg(fieldName());
+ TQString s = TQString("Remove table field \"%1\"").arg(fieldName());
if (debugOptions.showUID)
- s.append(TQString(" (UID=%1)").tqarg(uid()));
+ s.append(TQString(" (UID=%1)").arg(uid()));
return s;
}
@@ -583,11 +583,11 @@ void AlterTableHandler::InsertFieldAction::updateAlteringRequirements()
TQString AlterTableHandler::InsertFieldAction::debugString(const DebugOptions& debugOptions)
{
TQString s = TQString("Insert table field \"%1\" at position %2")
- .tqarg(m_field->name()).tqarg(m_index);
+ .arg(m_field->name()).arg(m_index);
if (debugOptions.showUID)
- s.append(TQString(" (UID=%1)").tqarg(m_fieldUID));
+ s.append(TQString(" (UID=%1)").arg(m_fieldUID));
if (debugOptions.showFieldDebug)
- s.append(TQString(" (%1)").tqarg(m_field->debugString()));
+ s.append(TQString(" (%1)").arg(m_field->debugString()));
return s;
}
@@ -710,9 +710,9 @@ void AlterTableHandler::MoveFieldPositionAction::updateAlteringRequirements()
TQString AlterTableHandler::MoveFieldPositionAction::debugString(const DebugOptions& debugOptions)
{
TQString s = TQString("Move table field \"%1\" to position %2")
- .tqarg(fieldName()).tqarg(m_index);
+ .arg(fieldName()).arg(m_index);
if (debugOptions.showUID)
- s.append(TQString(" (UID=%1)").tqarg(uid()));
+ s.append(TQString(" (UID=%1)").arg(uid()));
return s;
}
@@ -878,7 +878,7 @@ TableSchema* AlterTableHandler::execute(const TQString& tableName, ExecutionArgu
}
}
// - Debug
- TQString dbg = TQString("** Overall altering requirements: %1").tqarg(args.requirements);
+ TQString dbg = TQString("** Overall altering requirements: %1").arg(args.requirements);
KexiDBDbg << dbg << endl;
if (args.onlyComputeRequirements) {
@@ -892,14 +892,14 @@ TableSchema* AlterTableHandler::execute(const TQString& tableName, ExecutionArgu
if (args.simulate)
KexiUtils::addAlterTableActionDebug(dbg, 0);
#endif
- dbg = TQString("** Ordered, simplified actions (%1, was %2):").tqarg(currentActionsCount).tqarg(allActionsCount);
+ dbg = TQString("** Ordered, simplified actions (%1, was %2):").arg(currentActionsCount).arg(allActionsCount);
KexiDBDbg << dbg << endl;
#ifdef KEXI_DEBUG_GUI
if (args.simulate)
KexiUtils::addAlterTableActionDebug(dbg, 0);
#endif
for (int i=0; i<allActionsCount; i++) {
- debugAction(actionsVector[i], 1, args.simulate, TQString("%1: ").tqarg(i+1), args.debugString);
+ debugAction(actionsVector[i], 1, args.simulate, TQString("%1: ").arg(i+1), args.debugString);
}
if (args.requirements == 0) {//nothing to do
@@ -918,7 +918,7 @@ TableSchema* AlterTableHandler::execute(const TQString& tableName, ExecutionArgu
if (recreateTable) {
TQString tempDestTableName;
while (true) {
- tempDestTableName = TQString("%1_temp%2%3").tqarg(newTable->name()).tqarg(TQString::number(rand(), 16)).tqarg(TQString::number(rand(), 16));
+ tempDestTableName = TQString("%1_temp%2%3").arg(newTable->name()).arg(TQString::number(rand(), 16)).arg(TQString::number(rand(), 16));
if (!d->conn->tableSchema(tempDestTableName))
break;
}
@@ -1007,7 +1007,7 @@ TableSchema* AlterTableHandler::execute(const TQString& tableName, ExecutionArgu
// -Some source fields can be skipped in case when there are deleted fields.
// -Some destination fields can be skipped in case when there
// are new empty fields without fixed/default value.
- TQString sql = TQString("INSERT INTO %1 (").tqarg(d->conn->escapeIdentifier(newTable->name()));
+ TQString sql = TQString("INSERT INTO %1 (").arg(d->conn->escapeIdentifier(newTable->name()));
//insert list of dest. fields
bool first = true;
TQString sourceFields;
diff --git a/kexi/kexidb/connection.cpp b/kexi/kexidb/connection.cpp
index 4af6cae6..017e75e4 100644
--- a/kexi/kexidb/connection.cpp
+++ b/kexi/kexidb/connection.cpp
@@ -254,8 +254,8 @@ bool Connection::connect()
d->serverVersion.clear();
if (!(d->isConnected = drv_connect(d->serverVersion))) {
setError(m_driver->isFileDriver() ?
- i18n("Could not open \"%1\" project file.").tqarg(TQDir::convertSeparators(d->conn_data->fileName()))
- : i18n("Could not connect to \"%1\" database server.").tqarg(d->conn_data->serverInfoString()) );
+ i18n("Could not open \"%1\" project file.").arg(TQDir::convertSeparators(d->conn_data->fileName()))
+ : i18n("Could not connect to \"%1\" database server.").arg(d->conn_data->serverInfoString()) );
}
return d->isConnected;
}
@@ -363,7 +363,7 @@ bool Connection::drv_databaseExists( const TQString &dbName, bool ignoreErrors )
if (list.find( dbName )==list.end()) {
if (!ignoreErrors)
- setError(ERR_OBJECT_NOT_FOUND, i18n("The database \"%1\" does not exist.").tqarg(dbName));
+ setError(ERR_OBJECT_NOT_FOUND, i18n("The database \"%1\" does not exist.").arg(dbName));
return false;
}
@@ -384,19 +384,19 @@ bool Connection::databaseExists( const TQString &dbName, bool ignoreErrors )
if (!file.exists() || ( !file.isFile() && !file.isSymLink()) ) {
if (!ignoreErrors)
setError(ERR_OBJECT_NOT_FOUND, i18n("Database file \"%1\" does not exist.")
- .tqarg(TQDir::convertSeparators(d->conn_data->fileName())) );
+ .arg(TQDir::convertSeparators(d->conn_data->fileName())) );
return false;
}
if (!file.isReadable()) {
if (!ignoreErrors)
setError(ERR_ACCESS_RIGHTS, i18n("Database file \"%1\" is not readable.")
- .tqarg(TQDir::convertSeparators(d->conn_data->fileName())) );
+ .arg(TQDir::convertSeparators(d->conn_data->fileName())) );
return false;
}
if (!file.isWritable()) {
if (!ignoreErrors)
setError(ERR_ACCESS_RIGHTS, i18n("Database file \"%1\" is not writable.")
- .tqarg(TQDir::convertSeparators(d->conn_data->fileName())) );
+ .arg(TQDir::convertSeparators(d->conn_data->fileName())) );
return false;
}
return true;
@@ -424,7 +424,7 @@ bool Connection::databaseExists( const TQString &dbName, bool ignoreErrors )
#define createDatabase_CLOSE \
{ if (!closeDatabase()) { \
- setError(i18n("Database \"%1\" created but could not be closed after creation.").tqarg(dbName) ); \
+ setError(i18n("Database \"%1\" created but could not be closed after creation.").arg(dbName) ); \
return false; \
} }
@@ -438,12 +438,12 @@ bool Connection::createDatabase( const TQString &dbName )
return false;
if (databaseExists( dbName )) {
- setError(ERR_OBJECT_EXISTS, i18n("Database \"%1\" already exists.").tqarg(dbName) );
+ setError(ERR_OBJECT_EXISTS, i18n("Database \"%1\" already exists.").arg(dbName) );
return false;
}
if (m_driver->isSystemDatabaseName( dbName )) {
setError(ERR_SYSTEM_NAME_RESERVED,
- i18n("Cannot create database \"%1\". This name is reserved for system database.").tqarg(dbName) );
+ i18n("Cannot create database \"%1\". This name is reserved for system database.").arg(dbName) );
return false;
}
if (m_driver->isFileDriver()) {
@@ -458,7 +458,7 @@ bool Connection::createDatabase( const TQString &dbName )
//low-level create
if (!drv_createDatabase( dbName )) {
- setError(i18n("Error creating database \"%1\" on the server.").tqarg(dbName) );
+ setError(i18n("Error creating database \"%1\" on the server.").arg(dbName) );
closeDatabase();//sanity
return false;
}
@@ -472,7 +472,7 @@ bool Connection::createDatabase( const TQString &dbName )
if (!tmpdbName.isEmpty() || !m_driver->d->isDBOpenedAfterCreate) {
//db need to be opened
if (!useDatabase( dbName, false/*not yet kexi compatible!*/ )) {
- setError(i18n("Database \"%1\" created but could not be opened.").tqarg(dbName) );
+ setError(i18n("Database \"%1\" created but could not be opened.").arg(dbName) );
return false;
}
}
@@ -566,7 +566,7 @@ bool Connection::useDatabase( const TQString &dbName, bool kexiCompatible, bool
if (!drv_useDatabase( my_dbName, cancelled, msgHandler )) {
if (cancelled && *cancelled)
return false;
- TQString msg(i18n("Opening database \"%1\" failed.").tqarg( my_dbName ));
+ TQString msg(i18n("Opening database \"%1\" failed.").arg( my_dbName ));
if (error())
setError( this, msg );
else
@@ -589,7 +589,7 @@ bool Connection::useDatabase( const TQString &dbName, bool kexiCompatible, bool
d->databaseVersion.major = num;
/* if (true!=querySingleNumber(
"select db_value from kexi__db where db_property=" + m_driver->escapeString(TQString("kexidb_major_ver")), num)) {
- d->errorInvalidDBContents(notfound_str.tqarg("kexidb_major_ver"));
+ d->errorInvalidDBContents(notfound_str.arg("kexidb_major_ver"));
return false;
}*/
num = d->dbProperties->value("kexidb_minor_ver").toInt(&ok);
@@ -598,7 +598,7 @@ bool Connection::useDatabase( const TQString &dbName, bool kexiCompatible, bool
d->databaseVersion.minor = num;
/* if (true!=querySingleNumber(
"select db_value from kexi__db where db_property=" + m_driver->escapeString(TQString("kexidb_minor_ver")), num)) {
- d->errorInvalidDBContents(notfound_str.tqarg("kexidb_minor_ver"));
+ d->errorInvalidDBContents(notfound_str.arg("kexidb_minor_ver"));
return false;
}*/
@@ -607,8 +607,8 @@ bool Connection::useDatabase( const TQString &dbName, bool kexiCompatible, bool
if (m_driver->versionMajor()!=KexiDB::versionMajor()) {
setError(ERR_INCOMPAT_DATABASE_VERSION,
i18n("Database version (%1) does not match Kexi application's version (%2)")
- .tqarg( TQString("%1.%2").tqarg(versionMajor()).tqarg(versionMinor()) )
- .tqarg( TQString("%1.%2").tqarg(KexiDB::versionMajor()).tqarg(KexiDB::versionMinor()) ) );
+ .arg( TQString("%1.%2").arg(versionMajor()).arg(versionMinor()) )
+ .arg( TQString("%1.%2").arg(KexiDB::versionMajor()).arg(KexiDB::versionMinor()) ) );
return false;
}
if (m_driver->versionMinor()!=KexiDB::versionMinor()) {
@@ -686,7 +686,7 @@ bool Connection::useTemporaryDatabaseIfNeeded(TQString &tmpdbName)
if (!ret) {
setError(errorNum(),
i18n("Error during starting temporary connection using \"%1\" database name.")
- .tqarg(tmpdbName) );
+ .arg(tmpdbName) );
return false;
}
}
@@ -725,7 +725,7 @@ bool Connection::dropDatabase( const TQString &dbName )
}
if (m_driver->isSystemDatabaseName( dbToDrop )) {
- setError(ERR_SYSTEM_NAME_RESERVED, i18n("Cannot delete system database \"%1\".").tqarg(dbToDrop) );
+ setError(ERR_SYSTEM_NAME_RESERVED, i18n("Cannot delete system database \"%1\".").arg(dbToDrop) );
return false;
}
@@ -765,7 +765,7 @@ TQStringList Connection::objectNames(int objType, bool* ok)
if (objType==KexiDB::AnyObjectType)
sql = "SELECT o_name FROM kexi__objects";
else
- sql = TQString::tqfromLatin1("SELECT o_name FROM kexi__objects WHERE o_type=%1").tqarg(objType);
+ sql = TQString::fromLatin1("SELECT o_name FROM kexi__objects WHERE o_type=%1").arg(objType);
Cursor *c = executeQuery(sql);
if (!c) {
@@ -852,7 +852,7 @@ TQValueList<int> Connection::objectIds(int objType)
return list;
Cursor *c = executeQuery(
- TQString::tqfromLatin1("SELECT o_id, o_name FROM kexi__objects WHERE o_type=%1").tqarg(objType));
+ TQString::fromLatin1("SELECT o_id, o_name FROM kexi__objects WHERE o_type=%1").arg(objType));
if (!c)
return list;
for (c->moveFirst(); !c->eof(); c->moveNext())
@@ -903,12 +903,12 @@ TQString Connection::createTableStatement( const KexiDB::TableSchema& tableSchem
if (field->isFPNumericType() && field->precision()>0) {
if (field->scale()>0)
- v += TQString::tqfromLatin1("(%1,%2)").tqarg(field->precision()).tqarg(field->scale());
+ v += TQString::fromLatin1("(%1,%2)").arg(field->precision()).arg(field->scale());
else
- v += TQString::tqfromLatin1("(%1)").tqarg(field->precision());
+ v += TQString::fromLatin1("(%1)").arg(field->precision());
}
else if (field->type()==Field::Text && field->length()>0)
- v += TQString::tqfromLatin1("(%1)").tqarg(field->length());
+ v += TQString::fromLatin1("(%1)").arg(field->length());
if (autoinc)
v += (" " +
@@ -925,7 +925,7 @@ TQString Connection::createTableStatement( const KexiDB::TableSchema& tableSchem
if (field->defaultValue().isValid()) {
TQString valToSQL( m_driver->valueToSQL( field, field->defaultValue() ) );
if (!valToSQL.isEmpty()) //for sanity
- v += TQString::tqfromLatin1(" DEFAULT ") + valToSQL;
+ v += TQString::fromLatin1(" DEFAULT ") + valToSQL;
}
}
sql += v;
@@ -1106,14 +1106,14 @@ TQString Connection::selectStatement( KexiDB::QuerySchema& querySchema,
for (Field::ListIterator it = querySchema.fieldsIterator(); (f = it.current()); ++it, number++) {
if (querySchema.isColumnVisible(number)) {
if (!sql.isEmpty())
- sql += TQString::tqfromLatin1(", ");
+ sql += TQString::fromLatin1(", ");
if (f->isQueryAsterisk()) {
if (!singleTable && static_cast<QueryAsterisk*>(f)->isSingleTableAsterisk()) //single-table *
sql += escapeIdentifier(f->table()->name(), options.identifierEscaping) +
- TQString::tqfromLatin1(".*");
+ TQString::fromLatin1(".*");
else //all-tables * (or simplified table.* when there's only one table)
- sql += TQString::tqfromLatin1("*");
+ sql += TQString::fromLatin1("*");
}
else {
if (f->isExpression()) {
@@ -1137,7 +1137,7 @@ TQString Connection::selectStatement( KexiDB::QuerySchema& querySchema,
}
TQString aliasString = TQString(querySchema.columnAlias(number));
if (!aliasString.isEmpty())
- sql += (TQString::tqfromLatin1(" AS ") + aliasString);
+ sql += (TQString::fromLatin1(" AS ") + aliasString);
//! @todo add option that allows to omit "AS" keyword
}
LookupFieldSchema *lookupFieldSchema = (options.addVisibleLookupColumns && f->table())
@@ -1159,16 +1159,16 @@ TQString Connection::selectStatement( KexiDB::QuerySchema& querySchema,
{
//add LEFT OUTER JOIN
if (!s_additional_joins.isEmpty())
- s_additional_joins += TQString::tqfromLatin1(" ");
+ s_additional_joins += TQString::fromLatin1(" ");
TQString internalUniqueTableAlias( TQString("__kexidb_") + lookupTable->name() + "_"
+ TQString::number(internalUniqueTableAliasNumber++) );
s_additional_joins += TQString("LEFT OUTER JOIN %1 AS %2 ON %3.%4=%5.%6")
- .tqarg(escapeIdentifier(lookupTable->name(), options.identifierEscaping))
- .tqarg(internalUniqueTableAlias)
- .tqarg(escapeIdentifier(f->table()->name(), options.identifierEscaping))
- .tqarg(escapeIdentifier(f->name(), options.identifierEscaping))
- .tqarg(internalUniqueTableAlias)
- .tqarg(escapeIdentifier(boundField->name(), options.identifierEscaping));
+ .arg(escapeIdentifier(lookupTable->name(), options.identifierEscaping))
+ .arg(internalUniqueTableAlias)
+ .arg(escapeIdentifier(f->table()->name(), options.identifierEscaping))
+ .arg(escapeIdentifier(f->name(), options.identifierEscaping))
+ .arg(internalUniqueTableAlias)
+ .arg(escapeIdentifier(boundField->name(), options.identifierEscaping));
//add visibleField to the list of SELECTed fields //if it is not yet present there
//not needed if (!querySchema.findTableField( visibleField->table()->name()+"."+visibleField->name() )) {
@@ -1177,13 +1177,13 @@ TQString Connection::selectStatement( KexiDB::QuerySchema& querySchema,
/* not true
//table should be added after FROM
if (!s_from_additional.isEmpty())
- s_from_additional += TQString::tqfromLatin1(", ");
+ s_from_additional += TQString::fromLatin1(", ");
s_from_additional += escapeIdentifier(visibleField->table()->name(), options.identifierEscaping);
*/
}
#endif
if (!s_additional_fields.isEmpty())
- s_additional_fields += TQString::tqfromLatin1(", ");
+ s_additional_fields += TQString::fromLatin1(", ");
// s_additional_fields += (internalUniqueTableAlias + "." //escapeIdentifier(visibleField->table()->name(), options.identifierEscaping) + "."
// escapeIdentifier(visibleField->name(), options.identifierEscaping));
//! @todo Add lookup schema option for separator other than ' ' or even option for placeholders like "Name ? ?"
@@ -1216,20 +1216,20 @@ TQString Connection::selectStatement( KexiDB::QuerySchema& querySchema,
}
//add LEFT OUTER JOIN
if (!s_additional_joins.isEmpty())
- s_additional_joins += TQString::tqfromLatin1(" ");
+ s_additional_joins += TQString::fromLatin1(" ");
TQString internalUniqueQueryAlias(
kexidb_subquery_prefix + lookupQuery->name() + "_"
+ TQString::number(internalUniqueQueryAliasNumber++) );
s_additional_joins += TQString("LEFT OUTER JOIN (%1) AS %2 ON %3.%4=%5.%6")
- .tqarg(selectStatement( *lookupQuery, params, options ))
- .tqarg(internalUniqueQueryAlias)
- .tqarg(escapeIdentifier(f->table()->name(), options.identifierEscaping))
- .tqarg(escapeIdentifier(f->name(), options.identifierEscaping))
- .tqarg(internalUniqueQueryAlias)
- .tqarg(escapeIdentifier(boundColumnInfo->aliasOrName(), options.identifierEscaping));
+ .arg(selectStatement( *lookupQuery, params, options ))
+ .arg(internalUniqueQueryAlias)
+ .arg(escapeIdentifier(f->table()->name(), options.identifierEscaping))
+ .arg(escapeIdentifier(f->name(), options.identifierEscaping))
+ .arg(internalUniqueQueryAlias)
+ .arg(escapeIdentifier(boundColumnInfo->aliasOrName(), options.identifierEscaping));
if (!s_additional_fields.isEmpty())
- s_additional_fields += TQString::tqfromLatin1(", ");
+ s_additional_fields += TQString::fromLatin1(", ");
const TQValueList<uint> visibleColumns( lookupFieldSchema->visibleColumns() );
TQString expression;
foreach (TQValueList<uint>::ConstIterator, visibleColumnsIt, visibleColumns) {
@@ -1260,12 +1260,12 @@ TQString Connection::selectStatement( KexiDB::QuerySchema& querySchema,
//add lookup fields
if (!s_additional_fields.isEmpty())
- sql += (TQString::tqfromLatin1(", ") + s_additional_fields);
+ sql += (TQString::fromLatin1(", ") + s_additional_fields);
if (options.alsoRetrieveROWID) { //append rowid column
TQString s;
if (!sql.isEmpty())
- s = TQString::tqfromLatin1(", ");
+ s = TQString::fromLatin1(", ");
if (querySchema.masterTable())
s += (escapeIdentifier(querySchema.masterTable()->name())+".");
s += m_driver->beh->ROW_ID_FIELD_NAME;
@@ -1275,7 +1275,7 @@ TQString Connection::selectStatement( KexiDB::QuerySchema& querySchema,
sql.prepend("SELECT ");
TableSchema::List* tables = querySchema.tables();
if ((tables && !tables->isEmpty()) || !subqueries_for_lookup_data.isEmpty()) {
- sql += TQString::tqfromLatin1(" FROM ");
+ sql += TQString::fromLatin1(" FROM ");
TQString s_from;
if (tables) {
TableSchema *table;
@@ -1284,15 +1284,15 @@ TQString Connection::selectStatement( KexiDB::QuerySchema& querySchema,
++it, number++)
{
if (!s_from.isEmpty())
- s_from += TQString::tqfromLatin1(", ");
+ s_from += TQString::fromLatin1(", ");
s_from += escapeIdentifier(table->name(), options.identifierEscaping);
TQString aliasString = TQString(querySchema.tableAlias(number));
if (!aliasString.isEmpty())
- s_from += (TQString::tqfromLatin1(" AS ") + aliasString);
+ s_from += (TQString::fromLatin1(" AS ") + aliasString);
}
/*unused if (!s_from_additional.isEmpty()) {//additional tables list needed for lookup fields
if (!s_from.isEmpty())
- s_from += TQString::tqfromLatin1(", ");
+ s_from += TQString::fromLatin1(", ");
s_from += s_from_additional;
}*/
}
@@ -1302,11 +1302,11 @@ TQString Connection::selectStatement( KexiDB::QuerySchema& querySchema,
subqueries_for_lookup_data.current(); ++it, subqueries_for_lookup_data_counter++)
{
if (!s_from.isEmpty())
- s_from += TQString::tqfromLatin1(", ");
- s_from += TQString::tqfromLatin1("(");
+ s_from += TQString::fromLatin1(", ");
+ s_from += TQString::fromLatin1("(");
s_from += selectStatement( *it.current(), params, options );
- s_from += TQString::tqfromLatin1(") AS %1%2")
- .tqarg(kexidb_subquery_prefix).tqarg(subqueries_for_lookup_data_counter);
+ s_from += TQString::fromLatin1(") AS %1%2")
+ .arg(kexidb_subquery_prefix).arg(subqueries_for_lookup_data_counter);
}
sql += s_from;
}
@@ -1315,7 +1315,7 @@ TQString Connection::selectStatement( KexiDB::QuerySchema& querySchema,
//JOINS
if (!s_additional_joins.isEmpty()) {
- sql += TQString::tqfromLatin1(" ") + s_additional_joins + TQString::tqfromLatin1(" ");
+ sql += TQString::fromLatin1(" ") + s_additional_joins + TQString::fromLatin1(" ");
}
//@todo: we're using WHERE for joins now; use INNER/LEFT/RIGHT JOIN later
@@ -1328,24 +1328,24 @@ TQString Connection::selectStatement( KexiDB::QuerySchema& querySchema,
wasWhere = true;
}
else
- s_where += TQString::tqfromLatin1(" AND ");
+ s_where += TQString::fromLatin1(" AND ");
Field::Pair *pair;
TQString s_where_sub;
for (TQPtrListIterator<Field::Pair> p_it(*rel->fieldPairs()); (pair = p_it.current()); ++p_it) {
if (!s_where_sub.isEmpty())
- s_where_sub += TQString::tqfromLatin1(" AND ");
+ s_where_sub += TQString::fromLatin1(" AND ");
s_where_sub += (
escapeIdentifier(pair->first->table()->name(), options.identifierEscaping) +
- TQString::tqfromLatin1(".") +
+ TQString::fromLatin1(".") +
escapeIdentifier(pair->first->name(), options.identifierEscaping) +
- TQString::tqfromLatin1(" = ") +
+ TQString::fromLatin1(" = ") +
escapeIdentifier(pair->second->table()->name(), options.identifierEscaping) +
- TQString::tqfromLatin1(".") +
+ TQString::fromLatin1(".") +
escapeIdentifier(pair->second->name(), options.identifierEscaping));
}
if (rel->fieldPairs()->count()>1) {
s_where_sub.prepend("(");
- s_where_sub += TQString::tqfromLatin1(")");
+ s_where_sub += TQString::fromLatin1(")");
}
s_where += s_where_sub;
}
@@ -1362,7 +1362,7 @@ TQString Connection::selectStatement( KexiDB::QuerySchema& querySchema,
}
}
if (!s_where.isEmpty())
- sql += TQString::tqfromLatin1(" WHERE ") + s_where;
+ sql += TQString::fromLatin1(" WHERE ") + s_where;
//! \todo (js) add other sql parts
//(use wasWhere here)
@@ -1424,8 +1424,8 @@ TQ_ULLONG Connection::lastInsertedAutoIncValue(const TQString& aiFieldName, cons
}
RowData rdata;
if (row_id<=0 || true!=querySingleRecord(
- TQString::tqfromLatin1("SELECT ") + tableName + TQString::tqfromLatin1(".") + aiFieldName + TQString::tqfromLatin1(" FROM ") + tableName
- + TQString::tqfromLatin1(" WHERE ") + m_driver->beh->ROW_ID_FIELD_NAME + TQString::tqfromLatin1("=") + TQString::number(row_id), rdata))
+ TQString::fromLatin1("SELECT ") + tableName + TQString::fromLatin1(".") + aiFieldName + TQString::fromLatin1(" FROM ") + tableName
+ + TQString::fromLatin1(" WHERE ") + m_driver->beh->ROW_ID_FIELD_NAME + TQString::fromLatin1("=") + TQString::number(row_id), rdata))
{
// KexiDBDbg << "Connection::lastInsertedAutoIncValue(): row_id<=0 || true!=querySingleRecord()" << endl;
return (TQ_ULLONG)-1; //ULL;
@@ -1541,7 +1541,7 @@ bool Connection::createTable( KexiDB::TableSchema* tableSchema, bool replaceExis
if (m_driver->isSystemObjectName( tableName )) {
clearError();
setError(ERR_SYSTEM_NAME_RESERVED, i18n("System name \"%1\" cannot be used as table name.")
- .tqarg(tableSchema->name()));
+ .arg(tableSchema->name()));
return false;
}
@@ -1550,7 +1550,7 @@ bool Connection::createTable( KexiDB::TableSchema* tableSchema, bool replaceExis
clearError();
setError(ERR_SYSTEM_NAME_RESERVED,
i18n("System name \"%1\" cannot be used as one of fields in \"%2\" table.")
- .tqarg(sys_field->name()).tqarg(tableName));
+ .arg(sys_field->name()).arg(tableName));
return false;
}
}
@@ -1565,7 +1565,7 @@ bool Connection::createTable( KexiDB::TableSchema* tableSchema, bool replaceExis
if (existingTable == tableSchema) {
clearError();
setError(ERR_OBJECT_EXISTS,
- i18n("Could not create the same table \"%1\" twice.").tqarg(tableSchema->name()) );
+ i18n("Could not create the same table \"%1\" twice.").arg(tableSchema->name()) );
return false;
}
//TODO(js): update any structure (e.g. queries) that depend on this table!
@@ -1579,7 +1579,7 @@ bool Connection::createTable( KexiDB::TableSchema* tableSchema, bool replaceExis
else {
if (this->tableSchema( tableSchema->name() ) != 0) {
clearError();
- setError(ERR_OBJECT_EXISTS, i18n("Table \"%1\" already exists.").tqarg(tableSchema->name()) );
+ setError(ERR_OBJECT_EXISTS, i18n("Table \"%1\" already exists.").arg(tableSchema->name()) );
return false;
}
}
@@ -1707,7 +1707,7 @@ tristate Connection::dropTable( KexiDB::TableSchema* tableSchema, bool alsoRemov
|| this->tableSchema(tableSchema->name())!=tableSchema
|| this->tableSchema(tableSchema->id())!=tableSchema)
{
- setError(ERR_OBJECT_NOT_FOUND, errmsg.tqarg(tableSchema->name())
+ setError(ERR_OBJECT_NOT_FOUND, errmsg.arg(tableSchema->name())
+i18n("Unexpected name or identifier."));
return false;
}
@@ -1718,7 +1718,7 @@ tristate Connection::dropTable( KexiDB::TableSchema* tableSchema, bool alsoRemov
//sanity checks:
if (m_driver->isSystemObjectName( tableSchema->name() )) {
- setError(ERR_SYSTEM_NAME_RESERVED, errmsg.tqarg(tableSchema->name()) + d->strItIsASystemObject());
+ setError(ERR_SYSTEM_NAME_RESERVED, errmsg.arg(tableSchema->name()) + d->strItIsASystemObject());
return false;
}
@@ -1757,7 +1757,7 @@ tristate Connection::dropTable( const TQString& table )
TableSchema* ts = tableSchema( table );
if (!ts) {
setError(ERR_OBJECT_NOT_FOUND, i18n("Table \"%1\" does not exist.")
- .tqarg(table));
+ .arg(table));
return false;
}
return dropTable(ts);
@@ -1772,7 +1772,7 @@ tristate Connection::alterTable( TableSchema& tableSchema, TableSchema& newTable
if (&tableSchema == &newTableSchema) {
setError(ERR_OBJECT_THE_SAME, i18n("Could not alter table \"%1\" using the same table.")
- .tqarg(tableSchema.name()));
+ .arg(tableSchema.name()));
return false;
}
//TODO(js): implement real altering
@@ -1793,18 +1793,18 @@ bool Connection::alterTableName(TableSchema& tableSchema, const TQString& newNam
{
clearError();
if (&tableSchema!=d->tables[tableSchema.id()]) {
- setError(ERR_OBJECT_NOT_FOUND, i18n("Unknown table \"%1\"").tqarg(tableSchema.name()));
+ setError(ERR_OBJECT_NOT_FOUND, i18n("Unknown table \"%1\"").arg(tableSchema.name()));
return false;
}
if (newName.isEmpty() || !KexiUtils::isIdentifier(newName)) {
- setError(ERR_INVALID_IDENTIFIER, i18n("Invalid table name \"%1\"").tqarg(newName));
+ setError(ERR_INVALID_IDENTIFIER, i18n("Invalid table name \"%1\"").arg(newName));
return false;
}
const TQString oldTableName = tableSchema.name();
const TQString newTableName = newName.lower().stripWhiteSpace();
if (oldTableName.lower().stripWhiteSpace() == newTableName) {
setError(ERR_OBJECT_THE_SAME, i18n("Could rename table \"%1\" using the same name.")
- .tqarg(newTableName));
+ .arg(newTableName));
return false;
}
//TODO: alter table name for server DB backends!
@@ -1816,7 +1816,7 @@ bool Connection::alterTableName(TableSchema& tableSchema, const TQString& newNam
if (!replace && destTableExists) {
setError(ERR_OBJECT_EXISTS,
i18n("Could not rename table \"%1\" to \"%2\". Table \"%3\" already exists.")
- .tqarg(tableSchema.name()).tqarg(newName).tqarg(newName));
+ .arg(tableSchema.name()).arg(newName).arg(newName));
return false;
}
@@ -1838,13 +1838,13 @@ bool Connection::alterTableName(TableSchema& tableSchema, const TQString& newNam
}
// the new table owns the previous table's id:
- if (!executeSQL(TQString::tqfromLatin1("UPDATE kexi__objects SET o_id=%1 WHERE o_id=%2 AND o_type=%3")
- .tqarg(origID).tqarg(tableSchema.id()).tqarg((int)TableObjectType)))
+ if (!executeSQL(TQString::fromLatin1("UPDATE kexi__objects SET o_id=%1 WHERE o_id=%2 AND o_type=%3")
+ .arg(origID).arg(tableSchema.id()).arg((int)TableObjectType)))
{
return false;
}
- if (!executeSQL(TQString::tqfromLatin1("UPDATE kexi__fields SET t_id=%1 WHERE t_id=%2")
- .tqarg(origID).tqarg(tableSchema.id())))
+ if (!executeSQL(TQString::fromLatin1("UPDATE kexi__fields SET t_id=%1 WHERE t_id=%2")
+ .arg(origID).arg(tableSchema.id())))
{
return false;
}
@@ -1861,8 +1861,8 @@ bool Connection::alterTableName(TableSchema& tableSchema, const TQString& newNam
// Update kexi__objects
//TODO
- if (!executeSQL(TQString::tqfromLatin1("UPDATE kexi__objects SET o_name=%1 WHERE o_id=%2")
- .tqarg(m_driver->escapeString(tableSchema.name())).tqarg(tableSchema.id())))
+ if (!executeSQL(TQString::fromLatin1("UPDATE kexi__objects SET o_name=%1 WHERE o_id=%2")
+ .arg(m_driver->escapeString(tableSchema.name())).arg(tableSchema.id())))
{
alterTableName_ERR;
return false;
@@ -1889,8 +1889,8 @@ bool Connection::drv_alterTableName(TableSchema& tableSchema, const TQString& ne
const TQString oldTableName = tableSchema.name();
tableSchema.setName(newName);
- if (!executeSQL(TQString::tqfromLatin1("ALTER TABLE %1 RENAME TO %2")
- .tqarg(escapeIdentifier(oldTableName)).tqarg(escapeIdentifier(newName))))
+ if (!executeSQL(TQString::fromLatin1("ALTER TABLE %1 RENAME TO %2")
+ .arg(escapeIdentifier(oldTableName)).arg(escapeIdentifier(newName))))
{
tableSchema.setName(oldTableName); //restore old name
return false;
@@ -1938,7 +1938,7 @@ bool Connection::dropQuery( const TQString& query )
QuerySchema* qs = querySchema( query );
if (!qs) {
setError(ERR_OBJECT_NOT_FOUND, i18n("Query \"%1\" does not exist.")
- .tqarg(query));
+ .arg(query));
return false;
}
return dropQuery(qs);
@@ -2014,7 +2014,7 @@ bool Connection::rollbackAutoCommitTransaction(const Transaction& trans)
#define SET_ERR_TRANS_NOT_SUPP \
{ setError(ERR_UNSUPPORTED_DRV_FEATURE, \
- i18n("Transactions are not supported for \"%1\" driver.").tqarg(m_driver->name() )); }
+ i18n("Transactions are not supported for \"%1\" driver.").arg(m_driver->name() )); }
#define SET_BEGIN_TR_ERROR \
{ if (!error()) \
@@ -2270,7 +2270,7 @@ bool Connection::setupObjectSchemaData( const RowData &data, SchemaData &sdata )
{
//not found: retrieve schema
/* KexiDB::Cursor *cursor;
- if (!(cursor = executeQuery( TQString("select * from kexi__objects where o_id='%1'").tqarg(objId) )))
+ if (!(cursor = executeQuery( TQString("select * from kexi__objects where o_id='%1'").arg(objId) )))
return false;
if (!cursor->moveFirst()) {
deleteCursor(cursor);
@@ -2287,7 +2287,7 @@ bool Connection::setupObjectSchemaData( const RowData &data, SchemaData &sdata )
}
sdata.m_name = data[2].toString();
if (!KexiUtils::isIdentifier( sdata.m_name )) {
- setError(ERR_INVALID_IDENTIFIER, i18n("Invalid object name \"%1\"").tqarg(sdata.m_name));
+ setError(ERR_INVALID_IDENTIFIER, i18n("Invalid object name \"%1\"").arg(sdata.m_name));
return false;
}
sdata.m_caption = data[3].toString();
@@ -2300,9 +2300,9 @@ bool Connection::setupObjectSchemaData( const RowData &data, SchemaData &sdata )
tristate Connection::loadObjectSchemaData( int objectID, SchemaData &sdata )
{
RowData data;
- if (true!=querySingleRecord(TQString::tqfromLatin1(
+ if (true!=querySingleRecord(TQString::fromLatin1(
"SELECT o_id, o_type, o_name, o_caption, o_desc FROM kexi__objects WHERE o_id=%1")
- .tqarg(objectID), data))
+ .arg(objectID), data))
return cancelled;
return setupObjectSchemaData( data, sdata );
}
@@ -2310,9 +2310,9 @@ tristate Connection::loadObjectSchemaData( int objectID, SchemaData &sdata )
tristate Connection::loadObjectSchemaData( int objectType, const TQString& objectName, SchemaData &sdata )
{
RowData data;
- if (true!=querySingleRecord(TQString::tqfromLatin1("SELECT o_id, o_type, o_name, o_caption, o_desc "
+ if (true!=querySingleRecord(TQString::fromLatin1("SELECT o_id, o_type, o_name, o_caption, o_desc "
"FROM kexi__objects WHERE o_type=%1 AND lower(o_name)=%2")
- .tqarg(objectType).tqarg(m_driver->valueToSQL(Field::Text, objectName.lower())), data))
+ .arg(objectType).arg(m_driver->valueToSQL(Field::Text, objectName.lower())), data))
return cancelled;
return setupObjectSchemaData( data, sdata );
}
@@ -2324,9 +2324,9 @@ bool Connection::storeObjectSchemaData( SchemaData &sdata, bool newObject )
return false;
if (newObject) {
int existingID;
- if (true == querySingleNumber(TQString::tqfromLatin1(
+ if (true == querySingleNumber(TQString::fromLatin1(
"SELECT o_id FROM kexi__objects WHERE o_type=%1 AND lower(o_name)=%2")
- .tqarg(sdata.type()).tqarg(m_driver->valueToSQL(Field::Text, sdata.name().lower())), existingID))
+ .arg(sdata.type()).arg(m_driver->valueToSQL(Field::Text, sdata.name().lower())), existingID))
{
//we already have stored a schema data with the same name and type:
//just update it's properties as it would be existing object
@@ -2366,9 +2366,9 @@ bool Connection::storeObjectSchemaData( SchemaData &sdata, bool newObject )
}
//existing object:
return executeSQL(TQString("UPDATE kexi__objects SET o_type=%2, o_caption=%3, o_desc=%4 WHERE o_id=%1")
- .tqarg(sdata.id()).tqarg(sdata.type())
- .tqarg(m_driver->valueToSQL(KexiDB::Field::Text, sdata.caption()))
- .tqarg(m_driver->valueToSQL(KexiDB::Field::Text, sdata.description())) );
+ .arg(sdata.id()).arg(sdata.type())
+ .arg(m_driver->valueToSQL(KexiDB::Field::Text, sdata.caption()))
+ .arg(m_driver->valueToSQL(KexiDB::Field::Text, sdata.description())) );
}
tristate Connection::querySingleRecordInternal(RowData &data, const TQString* sql, QuerySchema* query,
@@ -2407,7 +2407,7 @@ tristate Connection::querySingleRecord(QuerySchema& query, RowData &data, bool a
bool Connection::checkIfColumnExists(Cursor *cursor, uint column)
{
if (column >= cursor->fieldCount()) {
- setError(ERR_CURSOR_RECORD_FETCHING, i18n("Column %1 does not exist for the query.").tqarg(column));
+ setError(ERR_CURSOR_RECORD_FETCHING, i18n("Column %1 does not exist for the query.").arg(column));
return false;
}
return true;
@@ -2695,7 +2695,7 @@ bool Connection::loadExtendedTableSchemaData(TableSchema& tableSchema)
int errorLine, errorColumn;
if (!doc.setContent( extendedTableSchemaString, &errorMsg, &errorLine, &errorColumn ))
loadExtendedTableSchemaData_ERR2( i18n("Error in XML data: \"%1\" in line %2, column %3.\nXML data: ")
- .tqarg(errorMsg).tqarg(errorLine).tqarg(errorColumn) + extendedTableSchemaString.left(1024));
+ .arg(errorMsg).arg(errorLine).arg(errorColumn) + extendedTableSchemaString.left(1024));
//! @todo look at the current format version (KEXIDB_EXTENDED_TABLE_SCHEMA_VERSION)
@@ -2777,7 +2777,7 @@ KexiDB::Field* Connection::setupField( const RowData &data )
if (!KexiUtils::isIdentifier( data.at(2).toString() )) {
setError(ERR_INVALID_IDENTIFIER, i18n("Invalid object name \"%1\"")
- .tqarg( data.at(2).toString() ));
+ .arg( data.at(2).toString() ));
ok = false;
return 0;
}
@@ -2807,9 +2807,9 @@ KexiDB::TableSchema* Connection::setupTableSchema( const RowData &data )
KexiDB::Cursor *cursor;
if (!(cursor = executeQuery(
- 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->m_id) )))
+ " FROM kexi__fields WHERE t_id=%1 ORDER BY f_order").arg(t->m_id) )))
{
delete t;
return 0;
@@ -2867,9 +2867,9 @@ TableSchema* Connection::tableSchema( const TQString& tableName )
return t;
//not found: retrieve schema
RowData data;
- if (true!=querySingleRecord(TQString::tqfromLatin1(
+ if (true!=querySingleRecord(TQString::fromLatin1(
"SELECT o_id, o_type, o_name, o_caption, o_desc FROM kexi__objects WHERE lower(o_name)='%1' AND o_type=%2")
- .tqarg(m_tableName).tqarg(KexiDB::TableObjectType), data))
+ .arg(m_tableName).arg(KexiDB::TableObjectType), data))
return 0;
return setupTableSchema(data);
@@ -2882,9 +2882,9 @@ TableSchema* Connection::tableSchema( int tableId )
return t;
//not found: retrieve schema
RowData data;
- if (true!=querySingleRecord(TQString::tqfromLatin1(
+ if (true!=querySingleRecord(TQString::fromLatin1(
"SELECT o_id, o_type, o_name, o_caption, o_desc FROM kexi__objects WHERE o_id=%1")
- .tqarg(tableId), data))
+ .arg(tableId), data))
return 0;
return setupTableSchema(data);
@@ -2904,7 +2904,7 @@ bool Connection::storeDataBlock( int objectID, const TQString &dataString, const
{
if (objectID<=0)
return false;
- TQString sql(TQString::tqfromLatin1("SELECT kexi__objectdata.o_id FROM kexi__objectdata WHERE o_id=%1").tqarg(objectID));
+ TQString sql(TQString::fromLatin1("SELECT kexi__objectdata.o_id FROM kexi__objectdata WHERE o_id=%1").arg(objectID));
TQString sql_sub( KexiDB::sqlWhere(m_driver, KexiDB::Field::Text, "o_sub_id", dataID) );
bool ok, exists;
@@ -2917,7 +2917,7 @@ bool Connection::storeDataBlock( int objectID, const TQString &dataString, const
+ " WHERE o_id=" + TQString::number(objectID) + " AND " + sql_sub );
}
return executeSQL(
- TQString::tqfromLatin1("INSERT INTO kexi__objectdata (o_id, o_data, o_sub_id) VALUES (")
+ TQString::fromLatin1("INSERT INTO kexi__objectdata (o_id, o_data, o_sub_id) VALUES (")
+ TQString::number(objectID) +"," + m_driver->valueToSQL( KexiDB::Field::LongText, dataString )
+ "," + m_driver->valueToSQL( KexiDB::Field::Text, dataID ) + ")" );
}
@@ -2943,7 +2943,7 @@ KexiDB::QuerySchema* Connection::setupQuerySchema( const RowData &data )
if (!loadDataBlock( objID, sqlText, "sql" )) {
setError(ERR_OBJECT_NOT_FOUND,
i18n("Could not find definition for query \"%1\". Removing this query is recommended.")
- .tqarg(data[2].toString()));
+ .arg(data[2].toString()));
return 0;
}
d->parser()->parse( sqlText );
@@ -2953,8 +2953,8 @@ KexiDB::QuerySchema* Connection::setupQuerySchema( const RowData &data )
setError(ERR_SQL_PARSE_ERROR,
i18n("<p>Could not load definition for query \"%1\". "
"SQL statement for this query is invalid:<br><tt>%2</tt></p>\n"
- "<p>You can open this query in Text View and correct it.</p>").tqarg(data[2].toString())
- .tqarg(d->parser()->statement()));
+ "<p>You can open this query in Text View and correct it.</p>").arg(data[2].toString())
+ .arg(d->parser()->statement()));
return 0;
}
if (!setupObjectSchemaData( data, *query )) {
@@ -2974,9 +2974,9 @@ QuerySchema* Connection::querySchema( const TQString& queryName )
return q;
//not found: retrieve schema
RowData data;
- if (true!=querySingleRecord(TQString::tqfromLatin1(
+ if (true!=querySingleRecord(TQString::fromLatin1(
"SELECT o_id, o_type, o_name, o_caption, o_desc FROM kexi__objects WHERE lower(o_name)='%1' AND o_type=%2")
- .tqarg(m_queryName).tqarg(KexiDB::QueryObjectType), data))
+ .arg(m_queryName).arg(KexiDB::QueryObjectType), data))
return 0;
return setupQuerySchema(data);
@@ -2990,8 +2990,8 @@ QuerySchema* Connection::querySchema( int queryId )
//not found: retrieve schema
clearError();
RowData data;
- if (true!=querySingleRecord(TQString::tqfromLatin1(
- "SELECT o_id, o_type, o_name, o_caption, o_desc FROM kexi__objects WHERE o_id=%1").tqarg(queryId), data))
+ if (true!=querySingleRecord(TQString::fromLatin1(
+ "SELECT o_id, o_type, o_name, o_caption, o_desc FROM kexi__objects WHERE o_id=%1").arg(queryId), data))
return 0;
return setupQuerySchema(data);
@@ -3207,7 +3207,7 @@ bool Connection::updateRow(QuerySchema &query, RowData& data, RowEditBuffer& buf
TQVariant val = data[ pkeyFieldsOrder[i] ];
if (val.isNull() || !val.isValid()) {
setError(ERR_UPDATE_NULL_PKEY_FIELD,
- i18n("Primary key's field \"%1\" cannot be empty.").tqarg(it.current()->name()));
+ i18n("Primary key's field \"%1\" cannot be empty.").arg(it.current()->name()));
//js todo: pass the field's name somewhere!
return false;
}
@@ -3291,7 +3291,7 @@ bool Connection::insertRow(QuerySchema &query, RowData& data, RowEditBuffer& buf
KexiDBWarn << "NO ENTIRE MASTER TABLE's PKEY SPECIFIED!" << endl;
setError(ERR_INSERT_NO_ENTIRE_MASTER_TABLES_PKEY,
i18n("Could not insert row because it does not contain entire master table's primary key.")
- .tqarg(query.name()));
+ .arg(query.name()));
return false;
}
}
@@ -3351,11 +3351,11 @@ bool Connection::insertRow(QuerySchema &query, RowData& data, RowEditBuffer& buf
return false;
}
RowData aif_data;
- TQString getAutoIncForInsertedValue = TQString::tqfromLatin1("SELECT ")
+ TQString getAutoIncForInsertedValue = TQString::fromLatin1("SELECT ")
+ query.autoIncrementSQLFieldsList(m_driver)
- + TQString::tqfromLatin1(" FROM ")
+ + TQString::fromLatin1(" FROM ")
+ escapeIdentifier(id_columnInfo->field->table()->name())
- + TQString::tqfromLatin1(" WHERE ")
+ + TQString::fromLatin1(" WHERE ")
+ escapeIdentifier(id_columnInfo->field->name()) + "="
+ TQString::number(last_id);
if (true!=querySingleRecord(getAutoIncForInsertedValue, aif_data)) {
@@ -3395,7 +3395,7 @@ bool Connection::deleteRow(QuerySchema &query, RowData& data, bool useROWID)
KexiDBWarn << " -- NO MASTER TABLE!" << endl;
setError(ERR_DELETE_NO_MASTER_TABLE,
i18n("Could not delete row because there is no master table defined.")
- .tqarg(query.name()));
+ .arg(query.name()));
return false;
}
IndexSchema *pkey = (mt->primaryKey() && !mt->primaryKey()->fields()->isEmpty()) ? mt->primaryKey() : 0;
@@ -3429,7 +3429,7 @@ bool Connection::deleteRow(QuerySchema &query, RowData& data, bool useROWID)
TQVariant val = data[ pkeyFieldsOrder[i] ];
if (val.isNull() || !val.isValid()) {
setError(ERR_DELETE_NULL_PKEY_FIELD, i18n("Primary key's field \"%1\" cannot be empty.")
- .tqarg(it.current()->name()));
+ .arg(it.current()->name()));
//js todo: pass the field's name somewhere!
return false;
}
diff --git a/kexi/kexidb/cursor.cpp b/kexi/kexidb/cursor.cpp
index dc95e30f..75c30cfa 100644
--- a/kexi/kexidb/cursor.cpp
+++ b/kexi/kexidb/cursor.cpp
@@ -57,7 +57,7 @@ Cursor::Cursor(Connection* conn, QuerySchema& query, uint options )
, m_options(options)
{
#ifdef KEXI_DEBUG_GUI
- KexiUtils::addKexiDBDebug(TQString("Create cursor for query \"%1\": ").tqarg(query.name())+query.debugString());
+ KexiUtils::addKexiDBDebug(TQString("Create cursor for query \"%1\": ").arg(query.name())+query.debugString());
#endif
init();
}
diff --git a/kexi/kexidb/dbobjectnamevalidator.cpp b/kexi/kexidb/dbobjectnamevalidator.cpp
index 1edf5a25..9e384deb 100644
--- a/kexi/kexidb/dbobjectnamevalidator.cpp
+++ b/kexi/kexidb/dbobjectnamevalidator.cpp
@@ -45,7 +45,7 @@ Validator::Result ObjectNameValidator::internalCheck(
return Validator::Ok;
message = i18n("You cannot use name \"%1\" for your object.\n"
"It is reserved for internal Kexi objects. Please choose another name.")
- .tqarg(v.toString());
+ .arg(v.toString());
details = i18n("Names of internal Kexi objects are starting with \"kexi__\".");
return Validator::Error;
}
diff --git a/kexi/kexidb/dbproperties.cpp b/kexi/kexidb/dbproperties.cpp
index 44b69192..490a7390 100644
--- a/kexi/kexidb/dbproperties.cpp
+++ b/kexi/kexidb/dbproperties.cpp
@@ -38,31 +38,31 @@ bool DatabaseProperties::setValue( const TQString& _name, const TQVariant& value
bool ok;
//we need to know whether update or insert
bool exists = m_conn->resultExists(
- TQString::tqfromLatin1("SELECT 1 FROM kexi__db WHERE db_property=%1")
- .tqarg(m_conn->driver()->escapeString(name)), ok);
+ TQString::fromLatin1("SELECT 1 FROM kexi__db WHERE db_property=%1")
+ .arg(m_conn->driver()->escapeString(name)), ok);
if (!ok) {
- setError(m_conn, i18n("Could not set value of database property \"%1\".").tqarg(name));
+ setError(m_conn, i18n("Could not set value of database property \"%1\".").arg(name));
return false;
}
if (exists) {
if (!m_conn->executeSQL(
- TQString::tqfromLatin1("UPDATE kexi__db SET db_value=%1 WHERE db_property=%2")
- .tqarg(m_conn->driver()->escapeString(value.toString()))
- .tqarg(m_conn->driver()->escapeString(name))))
+ TQString::fromLatin1("UPDATE kexi__db SET db_value=%1 WHERE db_property=%2")
+ .arg(m_conn->driver()->escapeString(value.toString()))
+ .arg(m_conn->driver()->escapeString(name))))
{
- setError(m_conn, i18n("Could not set value of database property \"%1\".").tqarg(name));
+ setError(m_conn, i18n("Could not set value of database property \"%1\".").arg(name));
return false;
}
return true;
}
if (!m_conn->executeSQL(
- TQString::tqfromLatin1("INSERT INTO kexi__db (db_property, db_value) VALUES (%1, %2)")
- .tqarg(m_conn->driver()->escapeString(name))
- .tqarg(m_conn->driver()->escapeString(value.toString()))))
+ TQString::fromLatin1("INSERT INTO kexi__db (db_property, db_value) VALUES (%1, %2)")
+ .arg(m_conn->driver()->escapeString(name))
+ .arg(m_conn->driver()->escapeString(value.toString()))))
{
- setError(m_conn, i18n("Could not set value of database property \"%1\".").tqarg(name));
+ setError(m_conn, i18n("Could not set value of database property \"%1\".").arg(name));
return false;
}
return true;
@@ -76,31 +76,31 @@ bool DatabaseProperties::setCaption( const TQString& _name, const TQString& capt
bool ok;
//we need to know whether update or insert
bool exists = m_conn->resultExists(
- TQString::tqfromLatin1("SELECT 1 FROM kexi__db WHERE db_property=%1")
- .tqarg(m_conn->driver()->escapeString(name)), ok);
+ TQString::fromLatin1("SELECT 1 FROM kexi__db WHERE db_property=%1")
+ .arg(m_conn->driver()->escapeString(name)), ok);
if (!ok) {
- setError(m_conn, i18n("Could not set caption for database property \"%1\".").tqarg(name));
+ setError(m_conn, i18n("Could not set caption for database property \"%1\".").arg(name));
return false;
}
if (exists) {
if (!m_conn->executeSQL(
- TQString::tqfromLatin1("UPDATE kexi__db SET db_value=%1 WHERE db_property=%2")
- .tqarg(m_conn->driver()->escapeString(caption))
- .tqarg(m_conn->driver()->escapeString(name))))
+ TQString::fromLatin1("UPDATE kexi__db SET db_value=%1 WHERE db_property=%2")
+ .arg(m_conn->driver()->escapeString(caption))
+ .arg(m_conn->driver()->escapeString(name))))
{
- setError(m_conn, i18n("Could not set caption for database property \"%1\".").tqarg(name));
+ setError(m_conn, i18n("Could not set caption for database property \"%1\".").arg(name));
return false;
}
return true;
}
if (!m_conn->executeSQL(
- TQString::tqfromLatin1("INSERT INTO kexi__db (db_property, db_value) VALUES (%1, %2)")
- .tqarg(m_conn->driver()->escapeString(name))
- .tqarg(m_conn->driver()->escapeString(caption))))
+ TQString::fromLatin1("INSERT INTO kexi__db (db_property, db_value) VALUES (%1, %2)")
+ .arg(m_conn->driver()->escapeString(name))
+ .arg(m_conn->driver()->escapeString(caption))))
{
- setError(m_conn, i18n("Could not set caption for database property \"%1\".").tqarg(name));
+ setError(m_conn, i18n("Could not set caption for database property \"%1\".").arg(name));
return false;
}
return true;
@@ -111,9 +111,9 @@ TQVariant DatabaseProperties::value( const TQString& _name )
TQString result;
TQString name(_name.stripWhiteSpace());
if (true!=m_conn->querySingleString(
- TQString::tqfromLatin1("SELECT db_value FROM kexi__db WHERE db_property=")
+ TQString::fromLatin1("SELECT db_value FROM kexi__db WHERE db_property=")
+ m_conn->driver()->escapeString(name), result)) {
- m_conn->setError(ERR_NO_DB_PROPERTY, i18n("Could not read database property \"%1\".").tqarg(name));
+ m_conn->setError(ERR_NO_DB_PROPERTY, i18n("Could not read database property \"%1\".").arg(name));
return TQVariant();
}
return result;
@@ -126,9 +126,9 @@ TQString DatabaseProperties::caption( const TQString& _name )
//captions have ' ' prefix
name.prepend(" ");
if (true!=m_conn->querySingleString(
- TQString::tqfromLatin1("SELECT db_value FROM kexi__db WHERE db_property=")
+ TQString::fromLatin1("SELECT db_value FROM kexi__db WHERE db_property=")
+ m_conn->driver()->escapeString(name), result)) {
- setError(m_conn, i18n("Could not read database property \"%1\".").tqarg(name));
+ setError(m_conn, i18n("Could not read database property \"%1\".").arg(name));
return TQString();
}
return result;
@@ -138,8 +138,8 @@ TQStringList DatabaseProperties::names()
{
TQStringList result;
if (true!=m_conn->queryStringList(
- TQString::tqfromLatin1("SELECT db_value FROM kexi__db WHERE db_property NOT LIKE ")
- + m_conn->driver()->escapeString(TQString::tqfromLatin1(" %%")), result, 0 /*0-th*/)) {
+ TQString::fromLatin1("SELECT db_value FROM kexi__db WHERE db_property NOT LIKE ")
+ + m_conn->driver()->escapeString(TQString::fromLatin1(" %%")), result, 0 /*0-th*/)) {
// ^^ exclude captions
setError(m_conn, i18n("Could not read database properties."));
return TQStringList();
diff --git a/kexi/kexidb/driver.cpp b/kexi/kexidb/driver.cpp
index 4db1b400..d760a004 100644
--- a/kexi/kexidb/driver.cpp
+++ b/kexi/kexidb/driver.cpp
@@ -106,16 +106,16 @@ bool Driver::isValid()
{
setError(ERR_INCOMPAT_DRIVER_VERSION,
i18n("Incompatible database driver's \"%1\" version: found version %2, expected version %3.")
- .tqarg(name())
- .tqarg(TQString("%1.%2").tqarg(version().major).tqarg(version().minor))
- .tqarg(TQString("%1.%2").tqarg(KexiDB::version().major).tqarg(KexiDB::version().minor)));
+ .arg(name())
+ .arg(TQString("%1.%2").arg(version().major).arg(version().minor))
+ .arg(TQString("%1.%2").arg(KexiDB::version().major).arg(KexiDB::version().minor)));
return false;
}
- TQString inv_impl = i18n("Invalid database driver's \"%1\" implementation:\n").tqarg(name());
+ TQString inv_impl = i18n("Invalid database driver's \"%1\" implementation:\n").arg(name());
TQString not_init = i18n("Value of \"%1\" is not initialized for the driver.");
if (beh->ROW_ID_FIELD_NAME.isEmpty()) {
- setError(ERR_INVALID_DRIVER_IMPL, inv_impl + not_init.tqarg("DriverBehaviour::ROW_ID_FIELD_NAME"));
+ setError(ERR_INVALID_DRIVER_IMPL, inv_impl + not_init.arg("DriverBehaviour::ROW_ID_FIELD_NAME"));
return false;
}
@@ -135,7 +135,7 @@ TQString Driver::fileDBDriverMimeType() const
{ return d->fileDBDriverMimeType; }
TQString Driver::defaultFileBasedDriverMimeType()
-{ return TQString::tqfromLatin1("application/x-kexiproject-sqlite3"); }
+{ return TQString::fromLatin1("application/x-kexiproject-sqlite3"); }
TQString Driver::defaultFileBasedDriverName()
{
@@ -282,7 +282,7 @@ TQString Driver::valueToSQL( uint ftype, const TQVariant& v ) const
return dateTimeToSQL( v.toDateTime() );
case Field::BLOB: {
if (v.toByteArray().isEmpty())
- return TQString::tqfromLatin1("NULL");
+ return TQString::fromLatin1("NULL");
if (v.type()==TQVariant::String)
return escapeBLOB(v.toString().utf8());
return escapeBLOB(v.toByteArray());
diff --git a/kexi/kexidb/driver_p.cpp b/kexi/kexidb/driver_p.cpp
index 8c7f096a..462ce608 100644
--- a/kexi/kexidb/driver_p.cpp
+++ b/kexi/kexidb/driver_p.cpp
@@ -85,7 +85,7 @@ void DriverPrivate::initInternalProperties()
propertyCaptions["transaction_nested"] = i18n("Nested transactions support");
properties["kexidb_driver_version"] =
- TQString("%1.%2").tqarg(version().major).tqarg(version().minor);
+ TQString("%1.%2").arg(version().major).arg(version().minor);
propertyCaptions["kexidb_driver_version"] =
i18n("KexiDB driver version");
}
diff --git a/kexi/kexidb/drivermanager.cpp b/kexi/kexidb/drivermanager.cpp
index 0a7ff574..1f348ddf 100644
--- a/kexi/kexidb/drivermanager.cpp
+++ b/kexi/kexidb/drivermanager.cpp
@@ -137,12 +137,12 @@ bool DriverManagerInternal::lookupDrivers()
if (major_ver != KexiDB::version().major || minor_ver != KexiDB::version().minor) {
KexiDBWarn << TQString("DriverManagerInternal::lookupDrivers(): '%1' driver"
" has version '%2' but required KexiDB driver version is '%3.%4'\n"
- " -- skipping this driver!").tqarg(srv_name.lower()).tqarg(srv_ver_str)
- .tqarg(KexiDB::version().major).tqarg(KexiDB::version().minor) << endl;
+ " -- skipping this driver!").arg(srv_name.lower()).arg(srv_ver_str)
+ .arg(KexiDB::version().major).arg(KexiDB::version().minor) << endl;
possibleProblems += TQString("\"%1\" database driver has version \"%2\" "
"but required driver version is \"%3.%4\"")
- .tqarg(srv_name.lower()).tqarg(srv_ver_str)
- .tqarg(KexiDB::version().major).tqarg(KexiDB::version().minor);
+ .arg(srv_name.lower()).arg(srv_ver_str)
+ .arg(KexiDB::version().major).arg(KexiDB::version().minor);
continue;
}
@@ -186,7 +186,7 @@ KexiDB::Driver::Info DriverManagerInternal::driverInfo(const TQString &name)
{
KexiDB::Driver::Info i = m_driversInfo[name.lower()];
if (!error() && i.name.isEmpty())
- setError(ERR_DRIVERMANAGER, i18n("Could not find database driver \"%1\".").tqarg(name) );
+ setError(ERR_DRIVERMANAGER, i18n("Could not find database driver \"%1\".").arg(name) );
return i;
}
@@ -203,7 +203,7 @@ Driver* DriverManagerInternal::driver(const TQString& name)
return drv; //cached
if (!m_services_lcase.contains(name.lower())) {
- setError(ERR_DRIVERMANAGER, i18n("Could not find database driver \"%1\".").tqarg(name) );
+ setError(ERR_DRIVERMANAGER, i18n("Could not find database driver \"%1\".").arg(name) );
return 0;
}
@@ -216,7 +216,7 @@ Driver* DriverManagerInternal::driver(const TQString& name)
if (!drv) {
setError(ERR_DRIVERMANAGER, i18n("Could not load database driver \"%1\".")
- .tqarg(name) );
+ .arg(name) );
if (m_componentLoadingErrors.isEmpty()) {//fill errtable on demand
m_componentLoadingErrors[KParts::ComponentFactory::ErrNoServiceFound]="ErrNoServiceFound";
m_componentLoadingErrors[KParts::ComponentFactory::ErrServiceProvidesNoLibrary]="ErrServiceProvidesNoLibrary";
@@ -360,7 +360,7 @@ KService::Ptr DriverManager::serviceInfo(const TQString &name)
if (d_int->m_services_lcase.contains(name.lower())) {
return *d_int->m_services_lcase.find(name.lower());
} else {
- setError(ERR_DRIVERMANAGER, i18n("No such driver service: \"%1\".").tqarg(name) );
+ setError(ERR_DRIVERMANAGER, i18n("No such driver service: \"%1\".").arg(name) );
return KService::Ptr();
}
}
@@ -425,7 +425,7 @@ TQString DriverManager::possibleProblemsInfoMsg() const
for (TQStringList::ConstIterator it = d_int->possibleProblems.constBegin();
it!=d_int->possibleProblems.constEnd(); ++it)
{
- str += (TQString::tqfromLatin1("<li>") + *it + TQString::tqfromLatin1("</li>"));
+ str += (TQString::fromLatin1("<li>") + *it + TQString::fromLatin1("</li>"));
}
str += "</ul>";
return str;
diff --git a/kexi/kexidb/drivers/mySQL/mysqlconnection.cpp b/kexi/kexidb/drivers/mySQL/mysqlconnection.cpp
index 18682a4f..44853163 100644
--- a/kexi/kexidb/drivers/mySQL/mysqlconnection.cpp
+++ b/kexi/kexidb/drivers/mySQL/mysqlconnection.cpp
@@ -175,7 +175,7 @@ bool MySqlConnection::drv_containsTable( const TQString &tableName )
{
bool success;
return resultExists(TQString("show tables like %1")
- .tqarg(driver()->escapeString(tableName)), success) && success;
+ .arg(driver()->escapeString(tableName)), success) && success;
}
bool MySqlConnection::drv_getTablesList( TQStringList &list )
diff --git a/kexi/kexidb/drivers/mySQL/mysqldriver.cpp b/kexi/kexidb/drivers/mySQL/mysqldriver.cpp
index 01d326af..0f2bcf9b 100644
--- a/kexi/kexidb/drivers/mySQL/mysqldriver.cpp
+++ b/kexi/kexidb/drivers/mySQL/mysqldriver.cpp
@@ -120,12 +120,12 @@ TQString MySqlDriver::escapeString(const TQString& str) const
const int old_length = str.length();
int i;
for ( i = 0; i < old_length; i++ ) { //anything to escape?
- const unsigned int ch = str[i].tqunicode();
+ const unsigned int ch = str[i].unicode();
if (ch == '\\' || ch == '\'' || ch == '"' || ch == '\n' || ch == '\r' || ch == '\t' || ch == '\b' || ch == '\0')
break;
}
if (i >= old_length) { //no characters to escape
- return TQString::tqfromLatin1("'") + str + TQString::tqfromLatin1("'");
+ return TQString::fromLatin1("'") + str + TQString::fromLatin1("'");
}
TQChar *new_string = new TQChar[ old_length * 3 + 1 ]; // a worst case approximation
@@ -133,7 +133,7 @@ TQString MySqlDriver::escapeString(const TQString& str) const
int new_length = 0;
new_string[new_length++] = '\''; //prepend '
for ( i = 0; i < old_length; i++, new_length++ ) {
- const unsigned int ch = str[i].tqunicode();
+ const unsigned int ch = str[i].unicode();
if (ch == '\\') {
new_string[new_length++] = '\\';
new_string[new_length] = '\\';
diff --git a/kexi/kexidb/drivers/pqxx/pqxxconnection.cpp b/kexi/kexidb/drivers/pqxx/pqxxconnection.cpp
index c81f04ad..d6262bef 100644
--- a/kexi/kexidb/drivers/pqxx/pqxxconnection.cpp
+++ b/kexi/kexidb/drivers/pqxx/pqxxconnection.cpp
@@ -128,7 +128,7 @@ bool pqxxSqlConnection::drv_getDatabasesList( TQStringList &list )
// Read value of column 0 into a string N
c[0].to(N);
// Copy the result into the return list
- list << TQString::tqfromLatin1 (N.c_str());
+ list << TQString::fromLatin1 (N.c_str());
}
return true;
}
@@ -190,15 +190,15 @@ bool pqxxSqlConnection::drv_useDatabase( const TQString &dbName, bool *cancelled
if (data()->port == 0)
data()->port = 5432;
- conninfo += TQString::tqfromLatin1(" port='%1'").tqarg(data()->port);
+ conninfo += TQString::fromLatin1(" port='%1'").arg(data()->port);
- conninfo += TQString::tqfromLatin1(" dbname='%1'").tqarg(dbName);
+ conninfo += TQString::fromLatin1(" dbname='%1'").arg(dbName);
if (!data()->userName.isNull())
- conninfo += TQString::tqfromLatin1(" user='%1'").tqarg(data()->userName);
+ conninfo += TQString::fromLatin1(" user='%1'").arg(data()->userName);
if (!data()->password.isNull())
- conninfo += TQString::tqfromLatin1(" password='%1'").tqarg(data()->password);
+ conninfo += TQString::fromLatin1(" password='%1'").arg(data()->password);
try
{
@@ -346,7 +346,7 @@ bool pqxxSqlConnection::drv_containsTable( const TQString &tableName )
{
bool success;
return resultExists(TQString("select 1 from pg_class where relkind='r' and relname LIKE %1")
- .tqarg(driver()->escapeString(tableName)), success) && success;
+ .arg(driver()->escapeString(tableName)), success) && success;
}
bool pqxxSqlConnection::drv_getTablesList( TQStringList &list )
diff --git a/kexi/kexidb/drivers/pqxx/pqxxcursor.h b/kexi/kexidb/drivers/pqxx/pqxxcursor.h
index 637a33f3..8a61978d 100644
--- a/kexi/kexidb/drivers/pqxx/pqxxcursor.h
+++ b/kexi/kexidb/drivers/pqxx/pqxxcursor.h
@@ -79,7 +79,7 @@ inline TQVariant pgsqlCStrToVariant(const pqxx::result::field& r)
switch(r.type())
{
case BOOLOID:
- return TQString::tqfromLatin1(r.c_str(), r.size())=="true"; //TODO check formatting
+ return TQString::fromLatin1(r.c_str(), r.size())=="true"; //TODO check formatting
case INT2OID:
case INT4OID:
case INT8OID:
diff --git a/kexi/kexidb/drivers/pqxx/pqxxdriver.cpp b/kexi/kexidb/drivers/pqxx/pqxxdriver.cpp
index 333df590..8967bc5e 100644
--- a/kexi/kexidb/drivers/pqxx/pqxxdriver.cpp
+++ b/kexi/kexidb/drivers/pqxx/pqxxdriver.cpp
@@ -133,9 +133,9 @@ bool pqxxSqlDriver::isSystemDatabaseName( const TQString& n ) const
//
TQString pqxxSqlDriver::escapeString( const TQString& str) const
{
- return TQString::tqfromLatin1("'")
+ return TQString::fromLatin1("'")
+ TQString::fromAscii( pqxx::sqlesc(std::string(str.utf8())).c_str() )
- + TQString::tqfromLatin1("'");
+ + TQString::fromLatin1("'");
}
//==================================================================================
@@ -172,7 +172,7 @@ TQString pqxxSqlDriver::valueToSQL( uint ftype, const TQVariant& v ) const
// use SQL compliant TRUE or FALSE as described here
// http://www.postgresql.org/docs/8.0/interactive/datatype-boolean.html
// 1 or 0 does not work
- return v.toInt()==0 ? TQString::tqfromLatin1("FALSE") : TQString::tqfromLatin1("TRUE");
+ return v.toInt()==0 ? TQString::fromLatin1("FALSE") : TQString::fromLatin1("TRUE");
}
return Driver::valueToSQL(ftype, v);
}
diff --git a/kexi/kexidb/drivers/sqlite/sqliteadmin.cpp b/kexi/kexidb/drivers/sqlite/sqliteadmin.cpp
index 14d2217a..1fb33233 100644
--- a/kexi/kexidb/drivers/sqlite/sqliteadmin.cpp
+++ b/kexi/kexidb/drivers/sqlite/sqliteadmin.cpp
@@ -46,7 +46,7 @@ bool SQLiteAdminTools::vacuum(const KexiDB::ConnectionData& data, const TQString
#else
KexiDB::DriverManager manager;
KexiDB::Driver *drv = manager.driver(data.driverName);
- TQString title( i18n("Could not compact database \"%1\".").tqarg(TQDir::convertSeparators(databaseName)) );
+ TQString title( i18n("Could not compact database \"%1\".").arg(TQDir::convertSeparators(databaseName)) );
if (!drv) {
setError(&manager, title);
return false;
diff --git a/kexi/kexidb/drivers/sqlite/sqliteconnection.cpp b/kexi/kexidb/drivers/sqlite/sqliteconnection.cpp
index 631f3bc6..cf478b94 100644
--- a/kexi/kexidb/drivers/sqlite/sqliteconnection.cpp
+++ b/kexi/kexidb/drivers/sqlite/sqliteconnection.cpp
@@ -130,7 +130,7 @@ bool SQLiteConnection::drv_containsTable( const TQString &tableName )
{
bool success;
return resultExists(TQString("select name from sqlite_master where type='table' and name LIKE %1")
- .tqarg(driver()->escapeString(tableName)), success) && success;
+ .arg(driver()->escapeString(tableName)), success) && success;
}
bool SQLiteConnection::drv_getTablesList( TQStringList &list )
@@ -188,7 +188,7 @@ bool SQLiteConnection::drv_useDatabase( const TQString &dbName, bool *cancelled,
d->res = sqlite3_open(
//TQFile::encodeName( data()->fileName() ),
- data()->fileName().utf8(), /* tqunicode expected since SQLite 3.1 */
+ data()->fileName().utf8(), /* unicode expected since SQLite 3.1 */
&d->data,
exclusiveFlag,
allowReadonly /* If 1 and locking fails, try opening in read-only mode */
@@ -200,7 +200,7 @@ bool SQLiteConnection::drv_useDatabase( const TQString &dbName, bool *cancelled,
if (KMessageBox::Continue !=
askQuestion(
i18n("Do you want to open file \"%1\" as read-only?")
- .tqarg(TQDir::convertSeparators(data()->fileName()))
+ .arg(TQDir::convertSeparators(data()->fileName()))
+ "\n\n"
+ i18n("The file is probably already open on this or another computer.") + " "
+ i18n("Could not gain exclusive access for writing the file."),
@@ -264,7 +264,7 @@ bool SQLiteConnection::drv_dropDatabase( const TQString &dbName )
const TQString filename = data()->fileName();
if (TQFile(filename).exists() && !TQDir().remove(filename)) {
setError(ERR_ACCESS_RIGHTS, i18n("Could not remove file \"%1\".")
- .tqarg(TQDir::convertSeparators(filename)) + " "
+ .arg(TQDir::convertSeparators(filename)) + " "
+ i18n("Check the file's permissions and whether it is already opened and locked by another application."));
return false;
}
@@ -324,9 +324,9 @@ TQString SQLiteConnection::serverResultName()
{
TQString r =
#ifdef SQLITE2
- TQString::tqfromLatin1( sqlite_error_string(d->res) );
+ TQString::fromLatin1( sqlite_error_string(d->res) );
#else //SQLITE3
- TQString(); //tqfromLatin1( d->result_name );
+ TQString(); //fromLatin1( d->result_name );
#endif
return r.isEmpty() ? Connection::serverResultName() : r;
}
@@ -395,8 +395,8 @@ bool SQLiteConnection::drv_alterTableName(TableSchema& tableSchema, const TQStri
//TODO indices, etc.???
// 3. copy all rows to the new table
- if (!executeSQL(TQString::tqfromLatin1("INSERT INTO %1 SELECT * FROM %2")
- .tqarg(escapeIdentifier(tableSchema.name())).tqarg(escapeIdentifier(oldTableName))))
+ if (!executeSQL(TQString::fromLatin1("INSERT INTO %1 SELECT * FROM %2")
+ .arg(escapeIdentifier(tableSchema.name())).arg(escapeIdentifier(oldTableName))))
{
drv_alterTableName_ERR;
return false;
diff --git a/kexi/kexidb/drivers/sqlite/sqlitecursor.cpp b/kexi/kexidb/drivers/sqlite/sqlitecursor.cpp
index 5239127c..20d80f9c 100644
--- a/kexi/kexidb/drivers/sqlite/sqlitecursor.cpp
+++ b/kexi/kexidb/drivers/sqlite/sqlitecursor.cpp
@@ -476,19 +476,19 @@ void SQLiteCursor::storeCurrentRow(RowData &data) const
case Field::Integer:
data[i] = TQVariant( TQCString(*col).toInt() );
case Field::BigInteger:
- data[i] = TQVariant( TQString::tqfromLatin1(*col).toLongLong() );
+ data[i] = TQVariant( TQString::fromLatin1(*col).toLongLong() );
case Field::Boolean:
- data[i] = TQVariant( sqliteStringToBool(TQString::tqfromLatin1(*col)), 1 );
+ data[i] = TQVariant( sqliteStringToBool(TQString::fromLatin1(*col)), 1 );
break;
case Field::Date:
- data[i] = TQDate::fromString( TQString::tqfromLatin1(*col), Qt::ISODate );
+ data[i] = TQDate::fromString( TQString::fromLatin1(*col), Qt::ISODate );
break;
case Field::Time:
//TQDateTime - a hack needed because TQVariant(TQTime) has broken isNull()
- data[i] = KexiUtils::stringToHackedTQTime(TQString::tqfromLatin1(*col));
+ data[i] = KexiUtils::stringToHackedTQTime(TQString::fromLatin1(*col));
break;
case Field::DateTime: {
- TQString tmp( TQString::tqfromLatin1(*col) );
+ TQString tmp( TQString::fromLatin1(*col) );
tmp[10] = 'T';
data[i] = TQDateTime::fromString( tmp, Qt::ISODate );
break;
@@ -548,9 +548,9 @@ int SQLiteCursor::serverResult()
TQString SQLiteCursor::serverResultName()
{
#ifdef SQLITE2
- return TQString::tqfromLatin1( sqlite_error_string(d->res) );
+ return TQString::fromLatin1( sqlite_error_string(d->res) );
#else //SQLITE3
- return TQString::tqfromLatin1( d->result_name );
+ return TQString::fromLatin1( d->result_name );
#endif
}
diff --git a/kexi/kexidb/drivers/sqlite/sqlitevacuum.cpp b/kexi/kexidb/drivers/sqlite/sqlitevacuum.cpp
index d24d906d..96802596 100644
--- a/kexi/kexidb/drivers/sqlite/sqlitevacuum.cpp
+++ b/kexi/kexidb/drivers/sqlite/sqlitevacuum.cpp
@@ -79,7 +79,7 @@ tristate SQLiteVacuum::run()
}
m_dlg = new KProgressDialog(0, 0, i18n("Compacting database"),
"<qt>"+i18n("Compacting database \"%1\"...")
- .tqarg("<nobr>"+TQDir::convertSeparators(TQFileInfo(m_filePath).fileName())+"</nobr>")
+ .arg("<nobr>"+TQDir::convertSeparators(TQFileInfo(m_filePath).fileName())+"</nobr>")
);
m_dlg->adjustSize();
m_dlg->resize(300, m_dlg->height());
@@ -98,7 +98,7 @@ tristate SQLiteVacuum::run()
const uint newSize = TQFileInfo(m_filePath).size();
const uint decrease = 100-100*newSize/origSize;
KMessageBox::information(0, i18n("The database has been compacted. Current size decreased by %1% to %2.")
- .tqarg(decrease).tqarg(KIO::convertSize(newSize)));
+ .arg(decrease).arg(KIO::convertSize(newSize)));
}
return m_result;
}
diff --git a/kexi/kexidb/expression.cpp b/kexi/kexidb/expression.cpp
index 35ab8d70..d9a33b4c 100644
--- a/kexi/kexidb/expression.cpp
+++ b/kexi/kexidb/expression.cpp
@@ -82,7 +82,7 @@ Field::Type BaseExpr::type()
TQString BaseExpr::debugString()
{
- return TQString("BaseExpr(%1,type=%1)").tqarg(m_token).tqarg(Driver::defaultSQLTypeName(type()));
+ return TQString("BaseExpr(%1,type=%1)").arg(m_token).arg(Driver::defaultSQLTypeName(type()));
}
bool BaseExpr::validate(ParseInfo& /*parseInfo*/)
@@ -241,7 +241,7 @@ TQString UnaryExpr::debugString()
return "UnaryExpr('"
+ tokenToDebugString() + "', "
+ (m_arg ? m_arg->debugString() : TQString("<NONE>"))
- + TQString(",type=%1)").tqarg(Driver::defaultSQLTypeName(type()));
+ + TQString(",type=%1)").arg(Driver::defaultSQLTypeName(type()));
}
TQString UnaryExpr::toString(QuerySchemaParameterValueListIterator* params)
@@ -256,7 +256,7 @@ TQString UnaryExpr::toString(QuerySchemaParameterValueListIterator* params)
return (m_arg ? m_arg->toString(params) : "<NULL>") + " IS NULL";
if (m_token==SQL_IS_NOT_NULL)
return (m_arg ? m_arg->toString(params) : "<NULL>") + " IS NOT NULL";
- return TQString("{INVALID_OPERATOR#%1} ").tqarg(m_token) + (m_arg ? m_arg->toString(params) : "<NULL>");
+ return TQString("{INVALID_OPERATOR#%1} ").arg(m_token) + (m_arg ? m_arg->toString(params) : "<NULL>");
}
void UnaryExpr::getQueryParameters(QuerySchemaParameterList& params)
@@ -419,7 +419,7 @@ TQString BinaryExpr::debugString()
+ "," + (m_larg ? m_larg->debugString() : TQString("<NONE>"))
+ ",'" + tokenToDebugString() + "',"
+ (m_rarg ? m_rarg->debugString() : TQString("<NONE>"))
- + TQString(",type=%1)").tqarg(Driver::defaultSQLTypeName(type()));
+ + TQString(",type=%1)").arg(Driver::defaultSQLTypeName(type()));
}
TQString BinaryExpr::tokenToString()
@@ -449,7 +449,7 @@ TQString BinaryExpr::tokenToString()
/* not handled here */
default:;
}
- return TQString("{INVALID_BINARY_OPERATOR#%1} ").tqarg(m_token);
+ return TQString("{INVALID_BINARY_OPERATOR#%1} ").arg(m_token);
}
TQString BinaryExpr::toString(QuerySchemaParameterValueListIterator* params)
@@ -529,7 +529,7 @@ Field::Type ConstExpr::type()
TQString ConstExpr::debugString()
{
return TQString("ConstExpr('") + tokenToDebugString() +"'," + toString()
- + TQString(",type=%1)").tqarg(Driver::defaultSQLTypeName(type()));
+ + TQString(",type=%1)").arg(Driver::defaultSQLTypeName(type()));
}
TQString ConstExpr::toString(QuerySchemaParameterValueListIterator* params)
@@ -601,13 +601,13 @@ void QueryParameterExpr::setType(Field::Type type)
TQString QueryParameterExpr::debugString()
{
- return TQString("QueryParameterExpr('") + TQString::tqfromLatin1("[%2]").tqarg(value.toString())
- + TQString("',type=%1)").tqarg(Driver::defaultSQLTypeName(type()));
+ return TQString("QueryParameterExpr('") + TQString::fromLatin1("[%2]").arg(value.toString())
+ + TQString("',type=%1)").arg(Driver::defaultSQLTypeName(type()));
}
TQString QueryParameterExpr::toString(QuerySchemaParameterValueListIterator* params)
{
- return params ? params->getPreviousValueAsString(type()) : TQString::tqfromLatin1("[%2]").tqarg(value.toString());
+ return params ? params->getPreviousValueAsString(type()) : TQString::fromLatin1("[%2]").arg(value.toString());
}
void QueryParameterExpr::getQueryParameters(QuerySchemaParameterList& params)
@@ -656,7 +656,7 @@ VariableExpr* VariableExpr::copy() const
TQString VariableExpr::debugString()
{
return TQString("VariableExpr(") + name
- + TQString(",type=%1)").tqarg(field ? Driver::defaultSQLTypeName(type()) : TQString("FIELD NOT DEFINED YET"));
+ + TQString(",type=%1)").arg(field ? Driver::defaultSQLTypeName(type()) : TQString("FIELD NOT DEFINED YET"));
}
TQString VariableExpr::toString(QuerySchemaParameterValueListIterator* params)
@@ -719,15 +719,15 @@ bool VariableExpr::validate(ParseInfo& parseInfo)
parseInfo.errMsg = i18n("Ambiguous field name");
parseInfo.errDescr = i18n("Both table \"%1\" and \"%2\" have defined \"%3\" field. "
"Use \"<tableName>.%4\" notation to specify table name.")
- .tqarg(firstField->table()->name()).tqarg(f->table()->name())
- .tqarg(fieldName).tqarg(fieldName);
+ .arg(firstField->table()->name()).arg(f->table()->name())
+ .arg(fieldName).arg(fieldName);
return false;
}
}
}
if (!firstField) {
parseInfo.errMsg = i18n("Field not found");
- parseInfo.errDescr = i18n("Table containing \"%1\" field not found").tqarg(fieldName);
+ parseInfo.errDescr = i18n("Table containing \"%1\" field not found").arg(fieldName);
return false;
}
//ok
@@ -754,8 +754,8 @@ bool VariableExpr::validate(ParseInfo& parseInfo)
if (covered) {
parseInfo.errMsg = i18n("Could not access the table directly using its name");
parseInfo.errDescr = i18n("Table \"%1\" is covered by aliases. Instead of \"%2\", "
- "you can write \"%3\"").tqarg(tableName)
- .tqarg(TQString(tableName+"."+fieldName)).tqarg(TQString(tableAlias+"."+fieldName.latin1()));
+ "you can write \"%3\"").arg(tableName)
+ .arg(TQString(tableName+"."+fieldName)).arg(TQString(tableAlias+"."+fieldName.latin1()));
return false;
}
}
@@ -773,7 +773,7 @@ bool VariableExpr::validate(ParseInfo& parseInfo)
if (!ts) {
parseInfo.errMsg = i18n("Table not found");
- parseInfo.errDescr = i18n("Unknown table \"%1\"").tqarg(tableName);
+ parseInfo.errDescr = i18n("Unknown table \"%1\"").arg(tableName);
return false;
}
@@ -786,8 +786,8 @@ bool VariableExpr::validate(ParseInfo& parseInfo)
//it's a table.*
if (fieldName=="*") {
if (positionsList->count()>1) {
- parseInfo.errMsg = i18n("Ambiguous \"%1.*\" expression").tqarg(tableName);
- parseInfo.errDescr = i18n("More than one \"%1\" table or alias defined").tqarg(tableName);
+ parseInfo.errMsg = i18n("Ambiguous \"%1.*\" expression").arg(tableName);
+ parseInfo.errDescr = i18n("More than one \"%1\" table or alias defined").arg(tableName);
return false;
}
tableForQueryAsterisk = ts;
@@ -800,7 +800,7 @@ bool VariableExpr::validate(ParseInfo& parseInfo)
if (!realField) {
parseInfo.errMsg = i18n("Field not found");
parseInfo.errDescr = i18n("Table \"%1\" has no \"%2\" field")
- .tqarg(tableName).tqarg(fieldName);
+ .arg(tableName).arg(fieldName);
return false;
}
@@ -815,9 +815,9 @@ bool VariableExpr::validate(ParseInfo& parseInfo)
numberOfTheSameFields++;
if (numberOfTheSameFields>1) {
parseInfo.errMsg = i18n("Ambiguous \"%1.%2\" expression")
- .tqarg(tableName).tqarg(fieldName);
+ .arg(tableName).arg(fieldName);
parseInfo.errDescr = i18n("More than one \"%1\" table or alias defined containing \"%2\" field")
- .tqarg(tableName).tqarg(fieldName);
+ .arg(tableName).arg(fieldName);
return false;
}
}
@@ -880,7 +880,7 @@ TQString FunctionExpr::debugString()
res.append( TQString("FunctionExpr(") + name );
if (args)
res.append(TQString(",") + args->debugString());
- res.append(TQString(",type=%1)").tqarg(Driver::defaultSQLTypeName(type())));
+ res.append(TQString(",type=%1)").arg(Driver::defaultSQLTypeName(type())));
return res;
}
diff --git a/kexi/kexidb/field.cpp b/kexi/kexidb/field.cpp
index 33e9e929..b12000ac 100644
--- a/kexi/kexidb/field.cpp
+++ b/kexi/kexidb/field.cpp
@@ -179,7 +179,7 @@ TQString Field::typeName(uint type)
TQString Field::typeString(uint type)
{
m_typeNames.init();
- return (type <= LastType) ? m_typeNames.at((int)LastType+1 + type) : TQString("Type%1").tqarg(type);
+ return (type <= LastType) ? m_typeNames.at((int)LastType+1 + type) : TQString("Type%1").arg(type);
}
TQString Field::typeGroupName(uint typeGroup)
@@ -191,7 +191,7 @@ TQString Field::typeGroupName(uint typeGroup)
TQString Field::typeGroupString(uint typeGroup)
{
m_typeGroupNames.init();
- return (typeGroup <= LastTypeGroup) ? m_typeGroupNames.at((int)LastTypeGroup+1 + typeGroup) : TQString("TypeGroup%1").tqarg(typeGroup);
+ return (typeGroup <= LastTypeGroup) ? m_typeGroupNames.at((int)LastTypeGroup+1 + typeGroup) : TQString("TypeGroup%1").arg(typeGroup);
}
Field::Type Field::typeForString(const TQString& typeString)
@@ -330,7 +330,7 @@ void
Field::setType(Type t)
{
if (m_expr) {
- KexiDBWarn << TQString("Field::setType(%1)").tqarg(t)
+ KexiDBWarn << TQString("Field::setType(%1)").arg(t)
<< " could not set type because the field has expression assigned!" << endl;
return;
}
@@ -589,12 +589,12 @@ TQString Field::debugString() const
dbg += (conn && conn->driver()) ? conn->driver()->sqlTypeName(type()) : Driver::defaultSQLTypeName(type());
if (isFPNumericType() && m_precision>0) {
if (scale()>0)
- dbg += TQString::tqfromLatin1("(%1,%2)").tqarg(m_precision).tqarg(scale());
+ dbg += TQString::fromLatin1("(%1,%2)").arg(m_precision).arg(scale());
else
- dbg += TQString::tqfromLatin1("(%1)").tqarg(m_precision);
+ dbg += TQString::fromLatin1("(%1)").arg(m_precision);
}
else if (m_type==Field::Text && m_length>0)
- dbg += TQString::tqfromLatin1("(%1)").tqarg(m_length);
+ dbg += TQString::fromLatin1("(%1)").arg(m_length);
if (m_constraints & Field::AutoInc)
dbg += " AUTOINC";
if (m_constraints & Field::Unique)
@@ -608,18 +608,18 @@ TQString Field::debugString() const
if (m_constraints & Field::NotEmpty)
dbg += " NOTEMPTY";
if (!m_defaultValue.isNull())
- dbg += TQString(" DEFAULT=[%1]").tqarg(m_defaultValue.typeName()) + KexiDB::variantToString(m_defaultValue);
+ dbg += TQString(" DEFAULT=[%1]").arg(m_defaultValue.typeName()) + KexiDB::variantToString(m_defaultValue);
if (m_expr)
dbg += " EXPRESSION=" + m_expr->debugString();
if (m_customProperties && !m_customProperties->isEmpty()) {
- dbg += TQString(" CUSTOM PROPERTIES (%1): ").tqarg(m_customProperties->count());
+ dbg += TQString(" CUSTOM PROPERTIES (%1): ").arg(m_customProperties->count());
bool first = true;
foreach (CustomPropertiesMap::ConstIterator, it, *m_customProperties) {
if (first)
first = false;
else
dbg += ", ";
- dbg += TQString("%1 = %2 (%3)").tqarg(TQString(it.key())).tqarg(TQString(it.data().toString())).tqarg(TQString(it.data().typeName()));
+ dbg += TQString("%1 = %2 (%3)").arg(TQString(it.key())).arg(TQString(it.data().toString())).arg(TQString(it.data().typeName()));
}
}
return dbg;
@@ -664,10 +664,10 @@ void Field::setCustomProperty(const TQCString& propertyName, const TQVariant& va
//-------------------------------------------------------
#define ADDTYPE(type, i18, str) this->at(Field::type) = i18; \
this->at(Field::type+Field::LastType+1) = str; \
- str2num.insert(TQString::tqfromLatin1(str).lower(), type)
+ str2num.insert(TQString::fromLatin1(str).lower(), type)
#define ADDGROUP(type, i18, str) this->at(Field::type) = i18; \
this->at(Field::type+Field::LastTypeGroup+1) = str; \
- str2num.insert(TQString::tqfromLatin1(str).lower(), type)
+ str2num.insert(TQString::fromLatin1(str).lower(), type)
Field::FieldTypeNames::FieldTypeNames()
: TQValueVector<TQString>()
diff --git a/kexi/kexidb/fieldlist.cpp b/kexi/kexidb/fieldlist.cpp
index dea19876..292ba75e 100644
--- a/kexi/kexidb/fieldlist.cpp
+++ b/kexi/kexidb/fieldlist.cpp
@@ -94,7 +94,7 @@ void FieldList::renameField(KexiDB::Field *field, const TQString& newName)
{
if (!field || field != m_fields_by_name[ field->name() ]) {
KexiDBFatal << "FieldList::renameField() no field found "
- << (field ? TQString("\"%1\"").tqarg(field->name()) : TQString()) << endl;
+ << (field ? TQString("\"%1\"").arg(field->name()) : TQString()) << endl;
return;
}
m_fields_by_name.take( field->name() );
@@ -157,7 +157,7 @@ void FieldList::debug()
}
static TQString subListWarning1(const TQString& fname) {
- return TQString("FieldList::subList() could not find field \"%1\"").tqarg(fname);
+ return TQString("FieldList::subList() could not find field \"%1\"").arg(fname);
}
FieldList* FieldList::subList(const TQString& n1, const TQString& n2,
@@ -212,7 +212,7 @@ FieldList* FieldList::subList(const TQValueList<uint>& list)
foreach(TQValueList<uint>::ConstIterator, it, list) {
f = field(*it);
if (!f) {
- KexiDBWarn << TQString("FieldList::subList() could not find field at position %1").tqarg(*it) << endl;
+ KexiDBWarn << TQString("FieldList::subList() could not find field at position %1").arg(*it) << endl;
delete fl;
return 0;
}
diff --git a/kexi/kexidb/fieldlist.h b/kexi/kexidb/fieldlist.h
index fbf303a9..9db4f5a6 100644
--- a/kexi/kexidb/fieldlist.h
+++ b/kexi/kexidb/fieldlist.h
@@ -143,13 +143,13 @@ class KEXI_DB_EXPORT FieldList
See @ref Connection::selectStatement() for example use.
\a drvEscaping can be used to alter default escaping type.
*/
- TQString sqlFieldsList(Driver *driver, const TQString& separator = TQString::tqfromLatin1(","),
+ TQString sqlFieldsList(Driver *driver, const TQString& separator = TQString::fromLatin1(","),
const TQString& tableAlias = TQString(),
int drvEscaping = Driver::EscapeDriver|Driver::EscapeAsNecessary);
/*! Like above, but this is convenient static function, so you can pass any \a list here. */
static TQString sqlFieldsList(Field::List* list, Driver *driver,
- const TQString& separator = TQString::tqfromLatin1(","), const TQString& tableAlias = TQString(),
+ const TQString& separator = TQString::fromLatin1(","), const TQString& tableAlias = TQString(),
int drvEscaping = Driver::EscapeDriver|Driver::EscapeAsNecessary);
/*! @internal Renames field \a oldName to \a newName.
diff --git a/kexi/kexidb/lookupfieldschema.cpp b/kexi/kexidb/lookupfieldschema.cpp
index 62a0665e..05728d00 100644
--- a/kexi/kexidb/lookupfieldschema.cpp
+++ b/kexi/kexidb/lookupfieldschema.cpp
@@ -91,7 +91,7 @@ void LookupFieldSchema::RowSource::setValues(const TQStringList& values)
TQString LookupFieldSchema::RowSource::debugString() const
{
return TQString("rowSourceType:'%1' rowSourceName:'%2' rowSourceValues:'%3'\n")
- .tqarg(typeName()).tqarg(name()).tqarg(m_values ? m_values->join("|") : TQString());
+ .arg(typeName()).arg(name()).arg(m_values ? m_values->join("|") : TQString());
}
void LookupFieldSchema::RowSource::debug() const
@@ -144,11 +144,11 @@ TQString LookupFieldSchema::debugString() const
" boundColumn:%2 visibleColumns:%3 maximumListRows:%4 displayWidget:%5\n"
" columnHeadersVisible:%6 limitToList:%7\n"
" columnWidths:%8 )")
- .tqarg(m_rowSource.debugString())
- .tqarg(m_boundColumn).tqarg(visibleColumnsString).tqarg(m_maximumListRows)
- .tqarg( m_displayWidget==ComboBox ? "ComboBox" : "ListBox")
- .tqarg(m_columnHeadersVisible).tqarg(m_limitToList)
- .tqarg(columnWidthsStr);
+ .arg(m_rowSource.debugString())
+ .arg(m_boundColumn).arg(visibleColumnsString).arg(m_maximumListRows)
+ .arg( m_displayWidget==ComboBox ? "ComboBox" : "ListBox")
+ .arg(m_columnHeadersVisible).arg(m_limitToList)
+ .arg(columnWidthsStr);
}
void LookupFieldSchema::debug() const
diff --git a/kexi/kexidb/parser/parser_p.cpp b/kexi/kexidb/parser/parser_p.cpp
index c2cece0b..38a7d386 100644
--- a/kexi/kexidb/parser/parser_p.cpp
+++ b/kexi/kexidb/parser/parser_p.cpp
@@ -142,10 +142,10 @@ void yyerror(const char *str)
if (parser->isReservedKeyword(ctoken.latin1()))
parser->setError( ParserError(i18n("Syntax Error"),
- i18n("\"%1\" is a reserved keyword").tqarg(ctoken)+lexerErr, ctoken, current) );
+ i18n("\"%1\" is a reserved keyword").arg(ctoken)+lexerErr, ctoken, current) );
else
parser->setError( ParserError(i18n("Syntax Error"),
- i18n("Syntax Error near \"%1\"").tqarg(ctoken)+lexerErr, ctoken, current) );
+ i18n("Syntax Error near \"%1\"").arg(ctoken)+lexerErr, ctoken, current) );
}
}
}
@@ -204,7 +204,7 @@ bool parseData(Parser *p, const char *data)
{
if(tableList.findRef(item->table()) == -1)
{
- ParserError err(i18n("Field List Error"), i18n("Unknown table '%1' in field list").tqarg(item->table()->name()), ctoken, current);
+ ParserError err(i18n("Field List Error"), i18n("Unknown table '%1' in field list").arg(item->table()->name()), ctoken, current);
parser->setError(err);
yyerror("fieldlisterror");
@@ -288,15 +288,15 @@ bool addColumn( ParseInfo& parseInfo, BaseExpr* columnExpr )
setError(i18n("Ambiguous field name"),
i18n("Both table \"%1\" and \"%2\" have defined \"%3\" field. "
"Use \"<tableName>.%4\" notation to specify table name.")
- .tqarg(firstField->table()->name()).tqarg(f->table()->name())
- .tqarg(fieldName).tqarg(fieldName));
+ .arg(firstField->table()->name()).arg(f->table()->name())
+ .arg(fieldName).arg(fieldName));
return false;
}
}
}
if (!firstField) {
setError(i18n("Field not found"),
- i18n("Table containing \"%1\" field not found").tqarg(fieldName));
+ i18n("Table containing \"%1\" field not found").arg(fieldName));
return false;
}
//ok
@@ -321,8 +321,8 @@ bool addColumn( ParseInfo& parseInfo, BaseExpr* columnExpr )
if (covered) {
setError(i18n("Could not access the table directly using its name"),
i18n("Table \"%1\" is covered by aliases. Instead of \"%2\", "
- "you can write \"%3\"").tqarg(tableName)
- .tqarg(tableName+"."+fieldName).tqarg(tableAlias+"."+fieldName.latin1()));
+ "you can write \"%3\"").arg(tableName)
+ .arg(tableName+"."+fieldName).arg(tableAlias+"."+fieldName.latin1()));
return false;
}
}
@@ -348,8 +348,8 @@ bool addColumn( ParseInfo& parseInfo, BaseExpr* columnExpr )
if (fieldName=="*") {
if (positionsList->count()>1) {
- setError(i18n("Ambiguous \"%1.*\" expression").tqarg(tableName),
- i18n("More than one \"%1\" table or alias defined").tqarg(tableName));
+ setError(i18n("Ambiguous \"%1.*\" expression").arg(tableName),
+ i18n("More than one \"%1\" table or alias defined").arg(tableName));
return false;
}
parseInfo.querySchema->addAsterisk( new QueryAsterisk(parseInfo.querySchema, ts) );
@@ -368,9 +368,9 @@ bool addColumn( ParseInfo& parseInfo, BaseExpr* columnExpr )
if (otherTS->field(fieldName))
numberOfTheSameFields++;
if (numberOfTheSameFields>1) {
- setError(i18n("Ambiguous \"%1.%2\" expression").tqarg(tableName).tqarg(fieldName),
+ setError(i18n("Ambiguous \"%1.%2\" expression").arg(tableName).arg(fieldName),
i18n("More than one \"%1\" table or alias defined containing \"%2\" field")
- .tqarg(tableName).tqarg(fieldName));
+ .arg(tableName).arg(fieldName));
return false;
}
}
@@ -379,7 +379,7 @@ bool addColumn( ParseInfo& parseInfo, BaseExpr* columnExpr )
}
else {
setError(i18n("Field not found"), i18n("Table \"%1\" has no \"%2\" field")
- .tqarg(tableName).tqarg(fieldName));
+ .arg(tableName).arg(fieldName));
return false;
}
}
@@ -436,7 +436,7 @@ QuerySchema* buildSelectQuery(
TableSchema *s = parser->db()->tableSchema(TQString(tname));
if(!s) {
setError(//i18n("Field List Error"),
- i18n("Table \"%1\" does not exist").tqarg(TQString(tname)));
+ i18n("Table \"%1\" does not exist").arg(TQString(tname)));
// yyerror("fieldlisterror");
CLEANUP;
return 0;
@@ -511,7 +511,7 @@ QuerySchema* buildSelectQuery(
aliasVariable = e->toBinary()->right()->toVariable();
if (!aliasVariable) {
setError(i18n("Invalid alias definition for column \"%1\"")
- .tqarg(columnExpr->toString())); //ok?
+ .arg(columnExpr->toString())); //ok?
CLEANUP;
return 0;
}
@@ -542,7 +542,7 @@ QuerySchema* buildSelectQuery(
e->toBinary()->m_larg = 0;
}
else {
- setError(i18n("Invalid \"%1\" column definition").tqarg(e->toString())); //ok?
+ setError(i18n("Invalid \"%1\" column definition").arg(e->toString())); //ok?
CLEANUP;
return 0;
}
@@ -610,7 +610,7 @@ QuerySchema* buildSelectQuery(
(*it).ascending, (*it).columnNumber-1 ))
{
setError(i18n("Could not define sorting - no column at position %1")
- .tqarg((*it).columnNumber));
+ .arg((*it).columnNumber));
CLEANUP;
return 0;
}
@@ -619,7 +619,7 @@ QuerySchema* buildSelectQuery(
Field * f = querySchema->findTableField((*it).aliasOrName);
if (!f) {
setError(i18n("Could not define sorting - "
- "column name or alias \"%1\" does not exist").tqarg((*it).aliasOrName));
+ "column name or alias \"%1\" does not exist").arg((*it).aliasOrName));
CLEANUP;
return 0;
}
diff --git a/kexi/kexidb/parser/sqlparser.cpp b/kexi/kexidb/parser/sqlparser.cpp
index 091d516b..c7c3aa99 100644
--- a/kexi/kexidb/parser/sqlparser.cpp
+++ b/kexi/kexidb/parser/sqlparser.cpp
@@ -3111,7 +3111,7 @@ YYACCEPT;
Field *f = item->table()->field(item->name());
if(!f)
{
- ParserError err(i18n("Field List Error"), i18n("Unknown column '%1' in table '%2'").tqarg(item->name()).tqarg(schema->name()), ctoken, current);
+ ParserError err(i18n("Field List Error"), i18n("Unknown column '%1' in table '%2'").arg(item->name()).arg(schema->name()), ctoken, current);
parser->setError(err);
yyerror("fieldlisterror");
}
diff --git a/kexi/kexidb/parser/sqlparser.y b/kexi/kexidb/parser/sqlparser.y
index 7775885d..5a8357f2 100644
--- a/kexi/kexidb/parser/sqlparser.y
+++ b/kexi/kexidb/parser/sqlparser.y
@@ -1201,7 +1201,7 @@ IDENTIFIER
Field *f = item->table()->field(item->name());
if(!f)
{
- ParserError err(i18n("Field List Error"), i18n("Unknown column '%1' in table '%2'").tqarg(item->name()).tqarg(schema->name()), ctoken, current);
+ ParserError err(i18n("Field List Error"), i18n("Unknown column '%1' in table '%2'").arg(item->name()).arg(schema->name()), ctoken, current);
parser->setError(err);
yyerror("fieldlisterror");
}
@@ -1360,7 +1360,7 @@ ColWildCard:
{
$$ = new VariableExpr($1);
KexiDBDbg << " Invalid identifier! " << $1 << endl;
- setError(i18n("Invalid identifier \"%1\"").tqarg($1));
+ setError(i18n("Invalid identifier \"%1\"").arg($1));
}*/
;
diff --git a/kexi/kexidb/queryschema.cpp b/kexi/kexidb/queryschema.cpp
index b77f76a3..47e5d95c 100644
--- a/kexi/kexidb/queryschema.cpp
+++ b/kexi/kexidb/queryschema.cpp
@@ -53,7 +53,7 @@ TQString QueryColumnInfo::debugString() const
{
return field->name() +
( alias.isEmpty() ? TQString()
- : (TQString::tqfromLatin1(" AS ") + TQString(alias)) );
+ : (TQString::fromLatin1(" AS ") + TQString(alias)) );
}
//=======================================
@@ -402,11 +402,11 @@ TQString OrderByColumn::debugString() const
if (m_column) {
if (m_pos>-1)
return TQString("COLUMN_AT_POSITION_%1(%2, %3)")
- .tqarg(m_pos+1).tqarg(m_column->debugString()).tqarg(orderString);
+ .arg(m_pos+1).arg(m_column->debugString()).arg(orderString);
else
- return TQString("COLUMN(%1, %2)").tqarg(m_column->debugString()).tqarg(orderString);
+ return TQString("COLUMN(%1, %2)").arg(m_column->debugString()).arg(orderString);
}
- return m_field ? TQString("FIELD(%1, %2)").tqarg(m_field->debugString()).tqarg(orderString)
+ return m_field ? TQString("FIELD(%1, %2)").arg(m_field->debugString()).arg(orderString)
: TQString("NONE");
}
@@ -801,7 +801,7 @@ TQString QuerySchema::debugString()
else {
dbg1 = "<NONE>\n";
}
- dbg1.prepend( TQString("(%1):\n").tqarg(fieldsExpandedCount) );
+ dbg1.prepend( TQString("(%1):\n").arg(fieldsExpandedCount) );
dbg += dbg1;
//it's safer to delete fieldsExpanded for now
@@ -816,7 +816,7 @@ TQString QuerySchema::debugString()
if (tablePos>=0) {
TQCString tAlias = tableAlias(tablePos);
if (!tAlias.isEmpty()) {
- dbg2 += (TQString::tqfromLatin1(" field \"") + FieldList::field(i)->name()
+ dbg2 += (TQString::fromLatin1(" field \"") + FieldList::field(i)->name()
+ "\" uses alias \"" + TQString(tAlias) + "\" of table \""
+ d->tables.at(tablePos)->name() + "\"\n");
}
@@ -847,7 +847,7 @@ TQString QuerySchema::debugString()
for (int i=0; it.current(); ++it, i++) {
TQCString *alias = d->columnAlias(i);
if (alias)
- aliases += (TQString("field #%1: ").tqarg(i)
+ aliases += (TQString("field #%1: ").arg(i)
+ (it.current()->name().isEmpty() ? "<noname>" : it.current()->name())
+ " -> " + (const char*)*alias + "\n");
}
@@ -862,7 +862,7 @@ TQString QuerySchema::debugString()
for (int i=0; t_it.current(); ++t_it, i++) {
TQCString *alias = d->tableAliases[i];
if (alias)
- aliases += (TQString("table #%1: ").tqarg(i)
+ aliases += (TQString("table #%1: ").arg(i)
+ (t_it.current()->name().isEmpty() ? "<noname>" : t_it.current()->name())
+ " -> " + (const char*)*alias + "\n");
}
@@ -872,7 +872,7 @@ TQString QuerySchema::debugString()
if (!where.isEmpty())
dbg += (TQString("\n-WHERE EXPRESSION:\n") + where);
if (!orderByColumnList().isEmpty())
- dbg += (TQString("\n-ORDER BY (%1):\n").tqarg(orderByColumnList().count())
+ dbg += (TQString("\n-ORDER BY (%1):\n").arg(orderByColumnList().count())
+ orderByColumnList().debugString());
return dbg;
}
@@ -1291,8 +1291,8 @@ void QuerySchema::computeFieldsExpanded()
// (the expression object will be owned by column info)
visibleColumn = new Field();
visibleColumn->setName(
- TQString::tqfromLatin1("[multiple_visible_fields_%1]")
- .tqarg( ++numberOfColumnsWithMultipleVisibleFields ));
+ TQString::fromLatin1("[multiple_visible_fields_%1]")
+ .arg( ++numberOfColumnsWithMultipleVisibleFields ));
visibleColumn->setExpression(
new ConstExpr(CHARACTER_STRING_LITERAL, TQVariant()/*not important*/));
if (!d->ownedVisibleColumns) {
@@ -1310,7 +1310,7 @@ void QuerySchema::computeFieldsExpanded()
if (!table( visibleField->table()->name() )) {
}
if (!sql.isEmpty())
- sql += TQString::tqfromLatin1(", ");
+ sql += TQString::fromLatin1(", ");
sql += (escapeIdentifier(visibleField->table()->name(), drvEscaping) + "."
+ escapeIdentifier(visibleField->name(), drvEscaping));
}*/
@@ -1351,8 +1351,8 @@ void QuerySchema::computeFieldsExpanded()
// (the expression object will be owned by column info)
visibleColumn = new Field();
visibleColumn->setName(
- TQString::tqfromLatin1("[multiple_visible_fields_%1]")
- .tqarg( ++numberOfColumnsWithMultipleVisibleFields ));
+ TQString::fromLatin1("[multiple_visible_fields_%1]")
+ .arg( ++numberOfColumnsWithMultipleVisibleFields ));
visibleColumn->setExpression(
new ConstExpr(CHARACTER_STRING_LITERAL, TQVariant()/*not important*/));
if (!d->ownedVisibleColumns) {
@@ -1370,7 +1370,7 @@ void QuerySchema::computeFieldsExpanded()
if (!table( visibleField->table()->name() )) {
}
if (!sql.isEmpty())
- sql += TQString::tqfromLatin1(", ");
+ sql += TQString::fromLatin1(", ");
sql += (escapeIdentifier(visibleField->table()->name(), drvEscaping) + "."
+ escapeIdentifier(visibleField->name(), drvEscaping));
}*/
@@ -1508,9 +1508,9 @@ void QuerySchema::computeFieldsExpanded()
ci->setIndexForVisibleLookupValue( d->fieldsExpanded->size() + *index );
}
else {
- const TQString key( TQString::tqfromLatin1("[multiple_visible_fields_%1]_%2.%3")
- .tqarg( ++numberOfColumnsWithMultipleVisibleFields )
- .tqarg(ci->field->table()->name()).tqarg(ci->field->name()) );
+ const TQString key( TQString::fromLatin1("[multiple_visible_fields_%1]_%2.%3")
+ .arg( ++numberOfColumnsWithMultipleVisibleFields )
+ .arg(ci->field->table()->name()).arg(ci->field->name()) );
uint *index = lookup_dict[ key ];
if (index)
ci->setIndexForVisibleLookupValue( d->fieldsExpanded->size() + *index );
@@ -1542,9 +1542,9 @@ void QuerySchema::computeFieldsExpanded()
ci->setIndexForVisibleLookupValue( d->fieldsExpanded->size() + *index );
}
else {
- const TQString key( TQString::tqfromLatin1("[multiple_visible_fields_%1]_%2.%3")
- .tqarg( ++numberOfColumnsWithMultipleVisibleFields )
- .tqarg(ci->field->table()->name()).tqarg(ci->field->name()) );
+ const TQString key( TQString::fromLatin1("[multiple_visible_fields_%1]_%2.%3")
+ .arg( ++numberOfColumnsWithMultipleVisibleFields )
+ .arg(ci->field->table()->name()).arg(ci->field->name()) );
uint *index = lookup_dict[ key ];
if (index)
ci->setIndexForVisibleLookupValue( d->fieldsExpanded->size() + *index );
diff --git a/kexi/kexidb/queryschemaparameter.cpp b/kexi/kexidb/queryschemaparameter.cpp
index 4cead962..4418f6e9 100644
--- a/kexi/kexidb/queryschemaparameter.cpp
+++ b/kexi/kexidb/queryschemaparameter.cpp
@@ -36,12 +36,12 @@ QuerySchemaParameter::~QuerySchemaParameter()
TQString QuerySchemaParameter::debugString() const
{
- return TQString("msg=\"%1\" type=\"%2\"").tqarg(Field::typeName(type)).tqarg(message);
+ return TQString("msg=\"%1\" type=\"%2\"").arg(Field::typeName(type)).arg(message);
}
void KexiDB::debug(const QuerySchemaParameterList& list)
{
- KexiDBDbg << TQString("Query parameters (%1):").tqarg(list.count()) << endl;
+ KexiDBDbg << TQString("Query parameters (%1):").arg(list.count()) << endl;
foreach(QuerySchemaParameterListConstIterator, it, list)
KexiDBDbg << " - " << (*it).debugString() << endl;
}
diff --git a/kexi/kexidb/schemadata.cpp b/kexi/kexidb/schemadata.cpp
index 9b691349..9370a3ac 100644
--- a/kexi/kexidb/schemadata.cpp
+++ b/kexi/kexidb/schemadata.cpp
@@ -51,5 +51,5 @@ TQString SchemaData::schemaDataDebugString() const
desc+="...";
}
return TQString("id=%1 name='%2' caption='%3' desc='%4'")
- .tqarg(m_id).tqarg(m_name).tqarg(m_caption).tqarg(desc);
+ .arg(m_id).arg(m_name).arg(m_caption).arg(desc);
}
diff --git a/kexi/kexidb/simplecommandlineapp.cpp b/kexi/kexidb/simplecommandlineapp.cpp
index 904469bc..570043fe 100644
--- a/kexi/kexidb/simplecommandlineapp.cpp
+++ b/kexi/kexidb/simplecommandlineapp.cpp
@@ -140,7 +140,7 @@ SimpleCommandLineApp::SimpleCommandLineApp(
userAtHost += "@";
userAtHost += (d->connData.hostName.isEmpty() ? "localhost" : d->connData.hostName);
TQTextStream cout(stdout,IO_WriteOnly);
- cout << i18n("Enter password for %1: ").tqarg(userAtHost);
+ cout << i18n("Enter password for %1: ").arg(userAtHost);
//! @todo make use of pty/tty here! (and care about portability)
TQTextStream cin(stdin,IO_ReadOnly);
cin >> d->connData.password;
diff --git a/kexi/kexidb/utils.cpp b/kexi/kexidb/utils.cpp
index 9fa9ca01..594773af 100644
--- a/kexi/kexidb/utils.cpp
+++ b/kexi/kexidb/utils.cpp
@@ -138,7 +138,7 @@ void KexiDB::getHTMLErrorMesage(Object* obj, TQString& msg, TQString &details)
if (!obj->serverErrorMsg().isEmpty())
details += "<p><b><nobr>" +i18n("Message from server:") + "</nobr></b><br>" + obj->serverErrorMsg();
if (!obj->recentSQLString().isEmpty())
- details += "<p><b><nobr>" +i18n("SQL statement:") + TQString("</nobr></b><br><tt>%1</tt>").tqarg(obj->recentSQLString());
+ details += "<p><b><nobr>" +i18n("SQL statement:") + TQString("</nobr></b><br><tt>%1</tt>").arg(obj->recentSQLString());
int serverResult;
TQString serverResultName;
if (obj->serverResult()!=0) {
@@ -159,9 +159,9 @@ void KexiDB::getHTMLErrorMesage(Object* obj, TQString& msg, TQString &details)
if (!details.isEmpty() && !details.startsWith("<qt>")) {
if (details.startsWith("<p>"))
- details = TQString::tqfromLatin1("<qt>")+details;
+ details = TQString::fromLatin1("<qt>")+details;
else
- details = TQString::tqfromLatin1("<qt><p>")+details;
+ details = TQString::fromLatin1("<qt><p>")+details;
}
}
@@ -179,7 +179,7 @@ int KexiDB::idForObjectName( Connection &conn, const TQString& objName, int objT
{
RowData data;
if (true!=conn.querySingleRecord(TQString("select o_id from kexi__objects where lower(o_name)='%1' and o_type=%2")
- .tqarg(objName.lower()).tqarg(objType), data))
+ .arg(objName.lower()).arg(objType), data))
return 0;
bool ok;
int id = data[0].toInt(&ok);
@@ -387,7 +387,7 @@ ConnectionTestDialog::ConnectionTestDialog(TQWidget* parent,
KexiDB::MessageHandler& msgHandler)
: KProgressDialog(parent, "testconn_dlg",
i18n("Test Connection"), i18n("<qt>Testing connection to <b>%1</b> database server...</qt>")
- .tqarg(data.serverInfoString(true)), true /*modal*/)
+ .arg(data.serverInfoString(true)), true /*modal*/)
, m_thread(new ConnectionTestThread(this, data))
, m_connData(data)
, m_msgHandler(&msgHandler)
@@ -441,13 +441,13 @@ void ConnectionTestDialog::slotTimeout()
else if (notResponding) {
KMessageBox::sorry(0,
i18n("<qt>Test connection to <b>%1</b> database server failed. The server is not responding.</qt>")
- .tqarg(m_connData.serverInfoString(true)),
+ .arg(m_connData.serverInfoString(true)),
i18n("Test Connection"));
}
else {
KMessageBox::information(0,
i18n("<qt>Test connection to <b>%1</b> database server established successfully.</qt>")
- .tqarg(m_connData.serverInfoString(true)),
+ .arg(m_connData.serverInfoString(true)),
i18n("Test Connection"));
}
// slotCancel();
@@ -493,7 +493,7 @@ void KexiDB::connectionTestDialog(TQWidget* parent, const KexiDB::ConnectionData
int KexiDB::rowCount(Connection &conn, const TQString& sql)
{
int count = -1; //will be changed only on success of querySingleNumber()
- TQString selectSql( TQString::tqfromLatin1("SELECT COUNT() FROM (") + sql + ")" );
+ TQString selectSql( TQString::fromLatin1("SELECT COUNT() FROM (") + sql + ")" );
conn.querySingleNumber(selectSql, count);
return count;
}
@@ -507,7 +507,7 @@ int KexiDB::rowCount(const KexiDB::TableSchema& tableSchema)
}
int count = -1; //will be changed only on success of querySingleNumber()
tableSchema.connection()->querySingleNumber(
- TQString::tqfromLatin1("SELECT COUNT(*) FROM ")
+ TQString::fromLatin1("SELECT COUNT(*) FROM ")
+ tableSchema.connection()->driver()->escapeIdentifier(tableSchema.name()),
count
);
@@ -523,7 +523,7 @@ int KexiDB::rowCount(KexiDB::QuerySchema& querySchema)
}
int count = -1; //will be changed only on success of querySingleNumber()
querySchema.connection()->querySingleNumber(
- TQString::tqfromLatin1("SELECT COUNT(*) FROM (")
+ TQString::fromLatin1("SELECT COUNT(*) FROM (")
+ querySchema.connection()->selectStatement(querySchema) + ")",
count
);
@@ -807,7 +807,7 @@ bool KexiDB::setFieldProperty( Field& field, const TQCString& propertyName, cons
else {
if (!field.table()) {
KexiDBWarn << TQString("KexiDB::setFieldProperty() Cannot set \"%1\" property - no table assinged for field!")
- .tqarg(propertyName.data()) << endl;
+ .arg(propertyName.data()) << endl;
}
else {
LookupFieldSchema *lookup = field.table()->lookupFieldSchema(field);
@@ -965,7 +965,7 @@ TQDomElement KexiDB::saveBooleanElementToDom(TQDomDocument& doc, TQDomElement& p
TQDomElement numberEl( doc.createElement("bool") );
el.appendChild( numberEl );
numberEl.appendChild( doc.createTextNode(
- value ? TQString::tqfromLatin1("true") : TQString::tqfromLatin1("false") ) );
+ value ? TQString::fromLatin1("true") : TQString::fromLatin1("false") ) );
return el;
}
@@ -998,9 +998,9 @@ TQVariant KexiDB::emptyValueForType( KexiDB::Field::Type type )
return val;
else { //special cases
if (type==Field::Date)
- return TQDate::tqcurrentDate();
+ return TQDate::currentDate();
if (type==Field::DateTime)
- return TQDateTime::tqcurrentDateTime();
+ return TQDateTime::currentDateTime();
if (type==Field::Time)
return TQTime::currentTime();
}
@@ -1047,9 +1047,9 @@ TQVariant KexiDB::notEmptyValueForType( KexiDB::Field::Type type )
return val;
else { //special cases
if (type==Field::Date)
- return TQDate::tqcurrentDate();
+ return TQDate::currentDate();
if (type==Field::DateTime)
- return TQDateTime::tqcurrentDateTime();
+ return TQDateTime::currentDateTime();
if (type==Field::Time)
return TQTime::currentTime();
}
@@ -1076,11 +1076,11 @@ TQString KexiDB::escapeBLOB(const TQByteArray& array, BLOBEscapingType type)
return TQString();
}
if (type == BLOBEscapeXHex)
- str = TQString::tqfromLatin1("X'");
+ str = TQString::fromLatin1("X'");
else if (type == BLOBEscape0xHex)
- str = TQString::tqfromLatin1("0x");
+ str = TQString::fromLatin1("0x");
else if (type == BLOBEscapeOctal)
- str = TQString::tqfromLatin1("'");
+ str = TQString::fromLatin1("'");
int new_length = str.length(); //after X' or 0x, etc.
if (type == BLOBEscapeOctal) {
@@ -1228,7 +1228,7 @@ void KexiDB::getLimitsForType(Field::Type type, int &minValue, int &maxValue)
void KexiDB::debugRowData(const RowData& rowData)
{
- KexiDBDbg << TQString("ROW DATA (%1 columns):").tqarg(rowData.count()) << endl;
+ KexiDBDbg << TQString("ROW DATA (%1 columns):").arg(rowData.count()) << endl;
foreach(RowData::ConstIterator, it, rowData)
KexiDBDbg << "- " << (*it) << endl;
}
diff --git a/kexi/kexidb/utils.h b/kexi/kexidb/utils.h
index ec807d34..334ea20c 100644
--- a/kexi/kexidb/utils.h
+++ b/kexi/kexidb/utils.h
@@ -454,11 +454,11 @@ namespace KexiDB
return TQString::fromUtf8(data, length);
if (f->isIntegerType()) {
if (f->type()==KexiDB::Field::BigInteger)
- return TQVariant( TQString::tqfromLatin1(data, length).toLongLong() );
- return TQVariant( TQString::tqfromLatin1(data, length).toInt() );
+ return TQVariant( TQString::fromLatin1(data, length).toLongLong() );
+ return TQVariant( TQString::fromLatin1(data, length).toInt() );
}
if (f->isFPNumericType())
- return TQString::tqfromLatin1(data, length).toDouble();
+ return TQString::fromLatin1(data, length).toDouble();
if (f->type()==KexiDB::Field::BLOB) {
TQByteArray ba;
ba.duplicate(data, length);