diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kexi/kexidb/dbproperties.cpp | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kexi/kexidb/dbproperties.cpp')
-rw-r--r-- | kexi/kexidb/dbproperties.cpp | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/kexi/kexidb/dbproperties.cpp b/kexi/kexidb/dbproperties.cpp index c5780542..44b69192 100644 --- a/kexi/kexidb/dbproperties.cpp +++ b/kexi/kexidb/dbproperties.cpp @@ -32,117 +32,117 @@ DatabaseProperties::~DatabaseProperties() { } -bool DatabaseProperties::setValue( const QString& _name, const QVariant& value ) +bool DatabaseProperties::setValue( const TQString& _name, const TQVariant& value ) { - QString name(_name.stripWhiteSpace()); + TQString name(_name.stripWhiteSpace()); bool ok; //we need to know whether update or insert bool exists = m_conn->resultExists( - QString::fromLatin1("SELECT 1 FROM kexi__db WHERE db_property=%1") - .arg(m_conn->driver()->escapeString(name)), ok); + TQString::tqfromLatin1("SELECT 1 FROM kexi__db WHERE db_property=%1") + .tqarg(m_conn->driver()->escapeString(name)), ok); if (!ok) { - setError(m_conn, i18n("Could not set value of database property \"%1\".").arg(name)); + setError(m_conn, i18n("Could not set value of database property \"%1\".").tqarg(name)); return false; } if (exists) { if (!m_conn->executeSQL( - QString::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)))) + 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)))) { - setError(m_conn, i18n("Could not set value of database property \"%1\".").arg(name)); + setError(m_conn, i18n("Could not set value of database property \"%1\".").tqarg(name)); return false; } return true; } if (!m_conn->executeSQL( - QString::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())))) + 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())))) { - setError(m_conn, i18n("Could not set value of database property \"%1\".").arg(name)); + setError(m_conn, i18n("Could not set value of database property \"%1\".").tqarg(name)); return false; } return true; } -bool DatabaseProperties::setCaption( const QString& _name, const QString& caption ) +bool DatabaseProperties::setCaption( const TQString& _name, const TQString& caption ) { - QString name(_name.stripWhiteSpace()); + TQString name(_name.stripWhiteSpace()); //captions have ' ' prefix name.prepend(" "); bool ok; //we need to know whether update or insert bool exists = m_conn->resultExists( - QString::fromLatin1("SELECT 1 FROM kexi__db WHERE db_property=%1") - .arg(m_conn->driver()->escapeString(name)), ok); + TQString::tqfromLatin1("SELECT 1 FROM kexi__db WHERE db_property=%1") + .tqarg(m_conn->driver()->escapeString(name)), ok); if (!ok) { - setError(m_conn, i18n("Could not set caption for database property \"%1\".").arg(name)); + setError(m_conn, i18n("Could not set caption for database property \"%1\".").tqarg(name)); return false; } if (exists) { if (!m_conn->executeSQL( - QString::fromLatin1("UPDATE kexi__db SET db_value=%1 WHERE db_property=%2") - .arg(m_conn->driver()->escapeString(caption)) - .arg(m_conn->driver()->escapeString(name)))) + 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)))) { - setError(m_conn, i18n("Could not set caption for database property \"%1\".").arg(name)); + setError(m_conn, i18n("Could not set caption for database property \"%1\".").tqarg(name)); return false; } return true; } if (!m_conn->executeSQL( - QString::fromLatin1("INSERT INTO kexi__db (db_property, db_value) VALUES (%1, %2)") - .arg(m_conn->driver()->escapeString(name)) - .arg(m_conn->driver()->escapeString(caption)))) + 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)))) { - setError(m_conn, i18n("Could not set caption for database property \"%1\".").arg(name)); + setError(m_conn, i18n("Could not set caption for database property \"%1\".").tqarg(name)); return false; } return true; } -QVariant DatabaseProperties::value( const QString& _name ) +TQVariant DatabaseProperties::value( const TQString& _name ) { - QString result; - QString name(_name.stripWhiteSpace()); + TQString result; + TQString name(_name.stripWhiteSpace()); if (true!=m_conn->querySingleString( - QString::fromLatin1("SELECT db_value FROM kexi__db WHERE db_property=") + TQString::tqfromLatin1("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\".").arg(name)); - return QVariant(); + m_conn->setError(ERR_NO_DB_PROPERTY, i18n("Could not read database property \"%1\".").tqarg(name)); + return TQVariant(); } return result; } -QString DatabaseProperties::caption( const QString& _name ) +TQString DatabaseProperties::caption( const TQString& _name ) { - QString result; - QString name(_name.stripWhiteSpace()); + TQString result; + TQString name(_name.stripWhiteSpace()); //captions have ' ' prefix name.prepend(" "); if (true!=m_conn->querySingleString( - QString::fromLatin1("SELECT db_value FROM kexi__db WHERE db_property=") + TQString::tqfromLatin1("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\".").arg(name)); - return QString::null; + setError(m_conn, i18n("Could not read database property \"%1\".").tqarg(name)); + return TQString(); } return result; } -QStringList DatabaseProperties::names() +TQStringList DatabaseProperties::names() { - QStringList result; + TQStringList result; if (true!=m_conn->queryStringList( - QString::fromLatin1("SELECT db_value FROM kexi__db WHERE db_property NOT LIKE ") - + m_conn->driver()->escapeString(QString::fromLatin1(" %%")), result, 0 /*0-th*/)) { + TQString::tqfromLatin1("SELECT db_value FROM kexi__db WHERE db_property NOT LIKE ") + + m_conn->driver()->escapeString(TQString::tqfromLatin1(" %%")), result, 0 /*0-th*/)) { // ^^ exclude captions setError(m_conn, i18n("Could not read database properties.")); - return QStringList(); + return TQStringList(); } return result; } |