From 94844816550ad672ccfcdc25659c625546239998 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 15 Dec 2011 15:32:11 -0600 Subject: Rename a number of old tq methods that are no longer tq specific --- kexi/kexidb/drivers/mySQL/mysqlconnection.cpp | 2 +- kexi/kexidb/drivers/mySQL/mysqldriver.cpp | 6 +++--- kexi/kexidb/drivers/pqxx/pqxxconnection.cpp | 12 ++++++------ kexi/kexidb/drivers/pqxx/pqxxcursor.h | 2 +- kexi/kexidb/drivers/pqxx/pqxxdriver.cpp | 6 +++--- kexi/kexidb/drivers/sqlite/sqliteadmin.cpp | 2 +- kexi/kexidb/drivers/sqlite/sqliteconnection.cpp | 16 ++++++++-------- kexi/kexidb/drivers/sqlite/sqlitecursor.cpp | 14 +++++++------- kexi/kexidb/drivers/sqlite/sqlitevacuum.cpp | 4 ++-- 9 files changed, 32 insertions(+), 32 deletions(-) (limited to 'kexi/kexidb/drivers') 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"), ""+i18n("Compacting database \"%1\"...") - .tqarg(""+TQDir::convertSeparators(TQFileInfo(m_filePath).fileName())+"") + .arg(""+TQDir::convertSeparators(TQFileInfo(m_filePath).fileName())+"") ); 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; } -- cgit v1.2.1