diff options
Diffstat (limited to 'kexi/kexidb/drivers/mySQL/mysqldriver.cpp')
-rw-r--r-- | kexi/kexidb/drivers/mySQL/mysqldriver.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/kexi/kexidb/drivers/mySQL/mysqldriver.cpp b/kexi/kexidb/drivers/mySQL/mysqldriver.cpp index c27681c0..9a1213b0 100644 --- a/kexi/kexidb/drivers/mySQL/mysqldriver.cpp +++ b/kexi/kexidb/drivers/mySQL/mysqldriver.cpp @@ -19,16 +19,16 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ -#ifdef Q_WS_WIN +#ifdef TQ_WS_WIN # include <mysql/config-win.h> #endif #include <mysql_version.h> #include <mysql.h> #define BOOL bool -#include <qvariant.h> -#include <qfile.h> -#include <qdict.h> +#include <tqvariant.h> +#include <tqfile.h> +#include <tqdict.h> #include <kgenericfactory.h> #include <kdebug.h> @@ -54,7 +54,7 @@ KEXIDB_DRIVER_INFO( MySqlDriver, mysql ) * * See: http://dev.mysql.com/doc/mysql/en/Column_types.html */ -MySqlDriver::MySqlDriver(QObject *parent, const char *name, const QStringList &args) : Driver(parent, name,args) +MySqlDriver::MySqlDriver(TQObject *tqparent, const char *name, const TQStringList &args) : Driver(tqparent, name,args) { // KexiDBDrvDbg << "MySqlDriver::MySqlDriver()" << endl; @@ -63,9 +63,9 @@ MySqlDriver::MySqlDriver(QObject *parent, const char *name, const QStringList &a beh->ROW_ID_FIELD_NAME="LAST_INSERT_ID()"; beh->ROW_ID_FIELD_RETURNS_LAST_AUTOINCREMENTED_VALUE=true; - beh->_1ST_ROW_READ_AHEAD_REQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY=false; - beh->USING_DATABASE_REQUIRED_TO_CONNECT=false; - beh->QUOTATION_MARKS_FOR_IDENTIFIER='`'; + beh->_1ST_ROW_READ_AHEAD_RETQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY=false; + beh->USING_DATABASE_RETQUIRED_TO_CONNECT=false; + beh->TQUOTATION_MARKS_FOR_IDENTIFIER='`'; beh->SQL_KEYWORDS = keywords; initSQLKeywords(331); @@ -103,16 +103,16 @@ MySqlDriver::drv_createConnection( ConnectionData &conn_data ) return new MySqlConnection( this, conn_data ); } -bool MySqlDriver::isSystemDatabaseName(const QString &n) const +bool MySqlDriver::isSystemDatabaseName(const TQString &n) const { return n.lower()=="mysql" || Driver::isSystemObjectName(n); } -bool MySqlDriver::drv_isSystemFieldName(const QString&) const { +bool MySqlDriver::drv_isSystemFieldName(const TQString&) const { return false; } -QString MySqlDriver::escapeString(const QString& str) const +TQString MySqlDriver::escapeString(const TQString& str) const { //escape as in http://dev.mysql.com/doc/refman/5.0/en/string-syntax.html //! @todo support more characters, like %, _ @@ -120,20 +120,20 @@ QString MySqlDriver::escapeString(const QString& 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 QString::fromLatin1("'") + str + QString::fromLatin1("'"); + return TQString::tqfromLatin1("'") + str + TQString::tqfromLatin1("'"); } - QChar *new_string = new QChar[ old_length * 3 + 1 ]; // a worst case approximation + TQChar *new_string = new TQChar[ old_length * 3 + 1 ]; // a worst case approximation //! @todo move new_string to Driver::m_new_string or so... 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] = '\\'; @@ -175,37 +175,37 @@ QString MySqlDriver::escapeString(const QString& str) const } new_string[new_length++] = '\''; //append ' - QString result(new_string, new_length); + TQString result(new_string, new_length); delete [] new_string; return result; } -QString MySqlDriver::escapeBLOB(const QByteArray& array) const +TQString MySqlDriver::escapeBLOB(const TQByteArray& array) const { return KexiDB::escapeBLOB(array, KexiDB::BLOBEscape0xHex); } -QCString MySqlDriver::escapeString(const QCString& str) const +TQCString MySqlDriver::escapeString(const TQCString& str) const { //! @todo optimize using mysql_real_escape_string()? //! see http://dev.mysql.com/doc/refman/5.0/en/string-syntax.html - return QCString("'")+QCString(str) - .replace( '\\', "\\\\" ) - .replace( '\'', "\\''" ) - .replace( '"', "\\\"" ) - + QCString("'"); + return TQCString("'")+TQCString(str) + .tqreplace( '\\', "\\\\" ) + .tqreplace( '\'', "\\''" ) + .tqreplace( '"', "\\\"" ) + + TQCString("'"); } /*! Add back-ticks to an identifier, and replace any back-ticks within * the name with single quotes. */ -QString MySqlDriver::drv_escapeIdentifier( const QString& str) const { - return QString(str).replace('`', "'"); +TQString MySqlDriver::drv_escapeIdentifier( const TQString& str) const { + return TQString(str).tqreplace('`', "'"); } -QCString MySqlDriver::drv_escapeIdentifier( const QCString& str) const { - return QCString(str).replace('`', "'"); +TQCString MySqlDriver::drv_escapeIdentifier( const TQCString& str) const { + return TQCString(str).tqreplace('`', "'"); } #include "mysqldriver.moc" |