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/plugins/scripting/kexidb/kexidbdrivermanager.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/plugins/scripting/kexidb/kexidbdrivermanager.cpp')
-rw-r--r-- | kexi/plugins/scripting/kexidb/kexidbdrivermanager.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/kexi/plugins/scripting/kexidb/kexidbdrivermanager.cpp b/kexi/plugins/scripting/kexidb/kexidbdrivermanager.cpp index 66a0df26..c2475276 100644 --- a/kexi/plugins/scripting/kexidb/kexidbdrivermanager.cpp +++ b/kexi/plugins/scripting/kexidb/kexidbdrivermanager.cpp @@ -25,7 +25,7 @@ #include <api/exception.h> -#include <qguardedptr.h> +#include <tqguardedptr.h> #include <kdebug.h> #include <kmimetype.h> @@ -40,7 +40,7 @@ using namespace Kross::KexiDB; KexiDBDriverManager::KexiDBDriverManager() : Kross::Api::Class<KexiDBDriverManager>("DriverManager") { - //krossdebug( QString("Kross::KexiDB::KexiDBDriverManager::KexiDBDriverManager()") ); + //krossdebug( TQString("Kross::KexiDB::KexiDBDriverManager::KexiDBDriverManager()") ); this->addFunction0< Kross::Api::Variant >("driverNames", this, &KexiDBDriverManager::driverNames); @@ -56,37 +56,37 @@ KexiDBDriverManager::KexiDBDriverManager() } KexiDBDriverManager::~KexiDBDriverManager() { - //krossdebug( QString("Kross::KexiDB::KexiDBDriverManager::~KexiDBDriverManager()") ); + //krossdebug( TQString("Kross::KexiDB::KexiDBDriverManager::~KexiDBDriverManager()") ); } -const QString KexiDBDriverManager::getClassName() const { +const TQString KexiDBDriverManager::getClassName() const { return "Kross::KexiDB::KexiDBDriverManager"; } KexiDB::DriverManager& KexiDBDriverManager::driverManager() { if(m_drivermanager.error()) - throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("KexiDB::DriverManager error: %1").arg(m_drivermanager.errorMsg())) ); + throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("KexiDB::DriverManager error: %1").tqarg(m_drivermanager.errorMsg())) ); return m_drivermanager; } -const QStringList KexiDBDriverManager::driverNames() { +const TQStringList KexiDBDriverManager::driverNames() { return driverManager().driverNames(); } -KexiDBDriver* KexiDBDriverManager::driver(const QString& drivername) { - QGuardedPtr< ::KexiDB::Driver > driver = driverManager().driver(drivername); // caching is done by the DriverManager +KexiDBDriver* KexiDBDriverManager::driver(const TQString& drivername) { + TQGuardedPtr< ::KexiDB::Driver > driver = driverManager().driver(drivername); // caching is done by the DriverManager if(! driver) return 0; - if(driver->error()) throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("KexiDB::Driver error for drivername '%1': %2").arg(drivername).arg(driver->errorMsg())) ); + if(driver->error()) throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("KexiDB::Driver error for drivername '%1': %2").tqarg(drivername).tqarg(driver->errorMsg())) ); return new KexiDBDriver(driver); } -const QString KexiDBDriverManager::lookupByMime(const QString& mimetype) { +const TQString KexiDBDriverManager::lookupByMime(const TQString& mimetype) { return driverManager().lookupByMime(mimetype); } -const QString KexiDBDriverManager::mimeForFile(const QString& filename) { - QString mimename = KMimeType::findByFileContent( filename )->name(); +const TQString KexiDBDriverManager::mimeForFile(const TQString& filename) { + TQString mimename = KMimeType::findByFileContent( filename )->name(); if(mimename.isEmpty() || mimename=="application/octet-stream" || mimename=="text/plain") mimename = KMimeType::findByURL(filename)->name(); return mimename; @@ -96,18 +96,18 @@ KexiDBConnectionData* KexiDBDriverManager::createConnectionData() { return new KexiDBConnectionData( new ::KexiDB::ConnectionData() ); } -KexiDBConnectionData* KexiDBDriverManager::createConnectionDataByFile(const QString& filename) { +KexiDBConnectionData* KexiDBDriverManager::createConnectionDataByFile(const TQString& filename) { //! @todo reuse the original code! - QString mimename = KMimeType::findByFileContent(filename)->name(); + TQString mimename = KMimeType::findByFileContent(filename)->name(); if(mimename.isEmpty() || mimename=="application/octet-stream" || mimename=="text/plain") mimename = KMimeType::findByURL(filename)->name(); if(mimename == "application/x-kexiproject-shortcut" || mimename == "application/x-kexi-connectiondata") { KConfig config(filename, true, false); - QString groupkey; - QStringList groups(config.groupList()); - QStringList::ConstIterator it, end( groups.constEnd() ); + TQString groupkey; + TQStringList groups(config.groupList()); + TQStringList::ConstIterator it, end( groups.constEnd() ); for( it = groups.constBegin(); it != end; ++it) { if((*it).lower()!="file information") { groupkey = *it; @@ -120,15 +120,15 @@ KexiDBConnectionData* KexiDBDriverManager::createConnectionDataByFile(const QStr } config.setGroup(groupkey); - //QString type( config.readEntry("type", "database").lower() ); + //TQString type( config.readEntry("type", "database").lower() ); //bool isDatabaseShortcut = (type == "database"); ::KexiDB::ConnectionData* data = new ::KexiDB::ConnectionData(); int version = config.readNumEntry("version", 2); //KexiDBShortcutFile_version - data->setFileName(QString::null); + data->setFileName(TQString()); data->caption = config.readEntry("caption"); data->description = config.readEntry("comment"); - QString dbname = config.readEntry("name"); + TQString dbname = config.readEntry("name"); data->driverName = config.readEntry("engine"); data->hostName = config.readEntry("server"); data->port = config.readNumEntry("port", 0); @@ -139,7 +139,7 @@ KexiDBConnectionData* KexiDBDriverManager::createConnectionDataByFile(const QStr data->password = config.readEntry("encryptedPassword"); uint len = data->password.length(); for (uint i=0; i<len; i++) - data->password[i] = QChar( data->password[i].unicode() - 47 - i ); + data->password[i] = TQChar( data->password[i].tqunicode() - 47 - i ); } if(data->password.isEmpty()) data->password = config.readEntry("password"); @@ -152,7 +152,7 @@ KexiDBConnectionData* KexiDBDriverManager::createConnectionDataByFile(const QStr return c; } - QString const drivername = driverManager().lookupByMime(mimename); + TQString const drivername = driverManager().lookupByMime(mimename); if(! drivername) { kdDebug() << "No driver in KexiDBDriverManager::createConnectionDataByFile filename=" << filename << " mimename=" << mimename << endl; return 0; @@ -168,7 +168,7 @@ KexiDBField* KexiDBDriverManager::field() { return new KexiDBField( new ::KexiDB::Field() ); } -KexiDBTableSchema* KexiDBDriverManager::tableSchema(const QString& tablename) { +KexiDBTableSchema* KexiDBDriverManager::tableSchema(const TQString& tablename) { return new KexiDBTableSchema( new ::KexiDB::TableSchema(tablename) ); } |