summaryrefslogtreecommitdiffstats
path: root/kexi/kexidb/connection.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-19 11:38:41 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-19 11:38:41 -0600
commitf0de9e167e289ab7dc33e57f077c1f04ec7c68c8 (patch)
tree1fc538e179833e62caec21956bfe47a252be5a72 /kexi/kexidb/connection.cpp
parent11191ef0b9908604d1d7aaca382b011ef22c454c (diff)
downloadkoffice-f0de9e167e289ab7dc33e57f077c1f04ec7c68c8.tar.gz
koffice-f0de9e167e289ab7dc33e57f077c1f04ec7c68c8.zip
Remove additional unneeded tq method conversions
Diffstat (limited to 'kexi/kexidb/connection.cpp')
-rw-r--r--kexi/kexidb/connection.cpp156
1 files changed, 78 insertions, 78 deletions
diff --git a/kexi/kexidb/connection.cpp b/kexi/kexidb/connection.cpp
index 34add49a..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::fromLatin1("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::fromLatin1("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::fromLatin1("(%1,%2)").tqarg(field->precision()).tqarg(field->scale());
+ v += TQString::fromLatin1("(%1,%2)").arg(field->precision()).arg(field->scale());
else
- v += TQString::fromLatin1("(%1)").tqarg(field->precision());
+ v += TQString::fromLatin1("(%1)").arg(field->precision());
}
else if (field->type()==Field::Text && field->length()>0)
- v += TQString::fromLatin1("(%1)").tqarg(field->length());
+ v += TQString::fromLatin1("(%1)").arg(field->length());
if (autoinc)
v += (" " +
@@ -1163,12 +1163,12 @@ TQString Connection::selectStatement( KexiDB::QuerySchema& querySchema,
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() )) {
@@ -1221,12 +1221,12 @@ TQString Connection::selectStatement( KexiDB::QuerySchema& querySchema,
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::fromLatin1(", ");
@@ -1306,7 +1306,7 @@ TQString Connection::selectStatement( KexiDB::QuerySchema& querySchema,
s_from += TQString::fromLatin1("(");
s_from += selectStatement( *it.current(), params, options );
s_from += TQString::fromLatin1(") AS %1%2")
- .tqarg(kexidb_subquery_prefix).tqarg(subqueries_for_lookup_data_counter);
+ .arg(kexidb_subquery_prefix).arg(subqueries_for_lookup_data_counter);
}
sql += s_from;
}
@@ -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;
}
@@ -1839,12 +1839,12 @@ bool Connection::alterTableName(TableSchema& tableSchema, const TQString& newNam
// the new table owns the previous table's id:
if (!executeSQL(TQString::fromLatin1("UPDATE kexi__objects SET o_id=%1 WHERE o_id=%2 AND o_type=%3")
- .tqarg(origID).tqarg(tableSchema.id()).tqarg((int)TableObjectType)))
+ .arg(origID).arg(tableSchema.id()).arg((int)TableObjectType)))
{
return false;
}
if (!executeSQL(TQString::fromLatin1("UPDATE kexi__fields SET t_id=%1 WHERE t_id=%2")
- .tqarg(origID).tqarg(tableSchema.id())))
+ .arg(origID).arg(tableSchema.id())))
{
return false;
}
@@ -1862,7 +1862,7 @@ bool Connection::alterTableName(TableSchema& tableSchema, const TQString& newNam
// Update kexi__objects
//TODO
if (!executeSQL(TQString::fromLatin1("UPDATE kexi__objects SET o_name=%1 WHERE o_id=%2")
- .tqarg(m_driver->escapeString(tableSchema.name())).tqarg(tableSchema.id())))
+ .arg(m_driver->escapeString(tableSchema.name())).arg(tableSchema.id())))
{
alterTableName_ERR;
return false;
@@ -1890,7 +1890,7 @@ bool Connection::drv_alterTableName(TableSchema& tableSchema, const TQString& ne
tableSchema.setName(newName);
if (!executeSQL(TQString::fromLatin1("ALTER TABLE %1 RENAME TO %2")
- .tqarg(escapeIdentifier(oldTableName)).tqarg(escapeIdentifier(newName))))
+ .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();
@@ -2302,7 +2302,7 @@ tristate Connection::loadObjectSchemaData( int objectID, SchemaData &sdata )
RowData data;
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 );
}
@@ -2312,7 +2312,7 @@ tristate Connection::loadObjectSchemaData( int objectType, const TQString& objec
RowData data;
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 );
}
@@ -2326,7 +2326,7 @@ bool Connection::storeObjectSchemaData( SchemaData &sdata, bool newObject )
int existingID;
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;
}
@@ -2809,7 +2809,7 @@ KexiDB::TableSchema* Connection::setupTableSchema( const RowData &data )
if (!(cursor = executeQuery(
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;
@@ -2869,7 +2869,7 @@ TableSchema* Connection::tableSchema( const TQString& tableName )
RowData data;
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);
@@ -2884,7 +2884,7 @@ TableSchema* Connection::tableSchema( int tableId )
RowData data;
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::fromLatin1("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;
@@ -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 )) {
@@ -2976,7 +2976,7 @@ QuerySchema* Connection::querySchema( const TQString& queryName )
RowData data;
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);
@@ -2991,7 +2991,7 @@ QuerySchema* Connection::querySchema( int queryId )
clearError();
RowData data;
if (true!=querySingleRecord(TQString::fromLatin1(
- "SELECT o_id, o_type, o_name, o_caption, o_desc FROM kexi__objects WHERE o_id=%1").tqarg(queryId), data))
+ "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;
}
}
@@ -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;
}