summaryrefslogtreecommitdiffstats
path: root/kexi/kexidb/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'kexi/kexidb/drivers')
-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
9 files changed, 32 insertions, 32 deletions
diff --git a/kexi/kexidb/drivers/mySQL/mysqlconnection.cpp b/kexi/kexidb/drivers/mySQL/mysqlconnection.cpp
index 44853163..18682a4f 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")
- .arg(driver()->escapeString(tableName)), success) && success;
+ .tqarg(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 0f2bcf9b..01d326af 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].unicode();
+ const unsigned int ch = str[i].tqunicode();
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::fromLatin1("'") + str + TQString::fromLatin1("'");
+ return TQString::tqfromLatin1("'") + str + TQString::tqfromLatin1("'");
}
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].unicode();
+ const unsigned int ch = str[i].tqunicode();
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 d6262bef..c81f04ad 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::fromLatin1 (N.c_str());
+ list << TQString::tqfromLatin1 (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::fromLatin1(" port='%1'").arg(data()->port);
+ conninfo += TQString::tqfromLatin1(" port='%1'").tqarg(data()->port);
- conninfo += TQString::fromLatin1(" dbname='%1'").arg(dbName);
+ conninfo += TQString::tqfromLatin1(" dbname='%1'").tqarg(dbName);
if (!data()->userName.isNull())
- conninfo += TQString::fromLatin1(" user='%1'").arg(data()->userName);
+ conninfo += TQString::tqfromLatin1(" user='%1'").tqarg(data()->userName);
if (!data()->password.isNull())
- conninfo += TQString::fromLatin1(" password='%1'").arg(data()->password);
+ conninfo += TQString::tqfromLatin1(" password='%1'").tqarg(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")
- .arg(driver()->escapeString(tableName)), success) && success;
+ .tqarg(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 8a61978d..637a33f3 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::fromLatin1(r.c_str(), r.size())=="true"; //TODO check formatting
+ return TQString::tqfromLatin1(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 8967bc5e..333df590 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::fromLatin1("'")
+ return TQString::tqfromLatin1("'")
+ TQString::fromAscii( pqxx::sqlesc(std::string(str.utf8())).c_str() )
- + TQString::fromLatin1("'");
+ + TQString::tqfromLatin1("'");
}
//==================================================================================
@@ -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::fromLatin1("FALSE") : TQString::fromLatin1("TRUE");
+ return v.toInt()==0 ? TQString::tqfromLatin1("FALSE") : TQString::tqfromLatin1("TRUE");
}
return Driver::valueToSQL(ftype, v);
}
diff --git a/kexi/kexidb/drivers/sqlite/sqliteadmin.cpp b/kexi/kexidb/drivers/sqlite/sqliteadmin.cpp
index 1fb33233..14d2217a 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\".").arg(TQDir::convertSeparators(databaseName)) );
+ TQString title( i18n("Could not compact database \"%1\".").tqarg(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 cf478b94..631f3bc6 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")
- .arg(driver()->escapeString(tableName)), success) && success;
+ .tqarg(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(), /* unicode expected since SQLite 3.1 */
+ data()->fileName().utf8(), /* tqunicode 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?")
- .arg(TQDir::convertSeparators(data()->fileName()))
+ .tqarg(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\".")
- .arg(TQDir::convertSeparators(filename)) + " "
+ .tqarg(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::fromLatin1( sqlite_error_string(d->res) );
+ TQString::tqfromLatin1( sqlite_error_string(d->res) );
#else //SQLITE3
- TQString(); //fromLatin1( d->result_name );
+ TQString(); //tqfromLatin1( 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::fromLatin1("INSERT INTO %1 SELECT * FROM %2")
- .arg(escapeIdentifier(tableSchema.name())).arg(escapeIdentifier(oldTableName))))
+ if (!executeSQL(TQString::tqfromLatin1("INSERT INTO %1 SELECT * FROM %2")
+ .tqarg(escapeIdentifier(tableSchema.name())).tqarg(escapeIdentifier(oldTableName))))
{
drv_alterTableName_ERR;
return false;
diff --git a/kexi/kexidb/drivers/sqlite/sqlitecursor.cpp b/kexi/kexidb/drivers/sqlite/sqlitecursor.cpp
index 20d80f9c..5239127c 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::fromLatin1(*col).toLongLong() );
+ data[i] = TQVariant( TQString::tqfromLatin1(*col).toLongLong() );
case Field::Boolean:
- data[i] = TQVariant( sqliteStringToBool(TQString::fromLatin1(*col)), 1 );
+ data[i] = TQVariant( sqliteStringToBool(TQString::tqfromLatin1(*col)), 1 );
break;
case Field::Date:
- data[i] = TQDate::fromString( TQString::fromLatin1(*col), Qt::ISODate );
+ data[i] = TQDate::fromString( TQString::tqfromLatin1(*col), Qt::ISODate );
break;
case Field::Time:
//TQDateTime - a hack needed because TQVariant(TQTime) has broken isNull()
- data[i] = KexiUtils::stringToHackedTQTime(TQString::fromLatin1(*col));
+ data[i] = KexiUtils::stringToHackedTQTime(TQString::tqfromLatin1(*col));
break;
case Field::DateTime: {
- TQString tmp( TQString::fromLatin1(*col) );
+ TQString tmp( TQString::tqfromLatin1(*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::fromLatin1( sqlite_error_string(d->res) );
+ return TQString::tqfromLatin1( sqlite_error_string(d->res) );
#else //SQLITE3
- return TQString::fromLatin1( d->result_name );
+ return TQString::tqfromLatin1( d->result_name );
#endif
}
diff --git a/kexi/kexidb/drivers/sqlite/sqlitevacuum.cpp b/kexi/kexidb/drivers/sqlite/sqlitevacuum.cpp
index 96802596..d24d906d 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\"...")
- .arg("<nobr>"+TQDir::convertSeparators(TQFileInfo(m_filePath).fileName())+"</nobr>")
+ .tqarg("<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.")
- .arg(decrease).arg(KIO::convertSize(newSize)));
+ .tqarg(decrease).tqarg(KIO::convertSize(newSize)));
}
return m_result;
}