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/drivermanager.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/drivermanager.cpp')
-rw-r--r-- | kexi/kexidb/drivermanager.cpp | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/kexi/kexidb/drivermanager.cpp b/kexi/kexidb/drivermanager.cpp index e7e5b2bb..1afcbd64 100644 --- a/kexi/kexidb/drivermanager.cpp +++ b/kexi/kexidb/drivermanager.cpp @@ -35,7 +35,7 @@ #include <assert.h> -#include <qapplication.h> +#include <tqapplication.h> //remove debug #undef KexiDBDbg @@ -47,7 +47,7 @@ DriverManagerInternal* DriverManagerInternal::s_self = 0L; DriverManagerInternal::DriverManagerInternal() /* protected */ - : QObject( 0, "KexiDB::DriverManager" ) + : TQObject( 0, "KexiDB::DriverManager" ) , Object() , m_drivers(17, false) , m_refCount(0) @@ -69,7 +69,7 @@ DriverManagerInternal::~DriverManagerInternal() void DriverManagerInternal::slotAppQuits() { - if (qApp->mainWidget() && qApp->mainWidget()->isVisible()) + if (tqApp->mainWidget() && tqApp->mainWidget()->isVisible()) return; //what a hack! - we give up when app is still there KexiDBDbg << "DriverManagerInternal::slotAppQuits(): let's clear drivers..." << endl; m_drivers.clear(); @@ -88,8 +88,8 @@ bool DriverManagerInternal::lookupDrivers() if (!lookupDriversNeeded) return true; - if (qApp) { - connect(qApp,SIGNAL(aboutToQuit()),this,SLOT(slotAppQuits())); + if (tqApp) { + connect(tqApp,TQT_SIGNAL(aboutToQuit()),this,TQT_SLOT(slotAppQuits())); } //TODO: for QT-only version check for KInstance wrapper // KexiDBWarn << "DriverManagerInternal::lookupDrivers(): cannot work without KInstance (KGlobal::instance()==0)!" << endl; @@ -108,21 +108,21 @@ bool DriverManagerInternal::lookupDrivers() << ": no \"kexidb_\" prefix -- skipped to avoid potential conflicts!" << endl; continue; } - QString srv_name = ptr->property("X-Kexi-DriverName").toString(); + TQString srv_name = ptr->property("X-Kexi-DriverName").toString(); if (srv_name.isEmpty()) { KexiDBWarn << "DriverManagerInternal::lookupDrivers():" " X-Kexi-DriverName must be set for KexiDB driver \"" << ptr->property("Name").toString() << "\" service!\n -- skipped!" << endl; continue; } - if (m_services_lcase.contains(srv_name.lower())) { + if (m_services_lcase.tqcontains(srv_name.lower())) { KexiDBWarn << "DriverManagerInternal::lookupDrivers(): more than one driver named '" << srv_name.lower() << "'\n -- skipping this one!" << endl; continue; } - QString srv_ver_str = ptr->property("X-Kexi-KexiDBVersion").toString(); - QStringList lst( QStringList::split(".", srv_ver_str) ); + TQString srv_ver_str = ptr->property("X-Kexi-KexiDBVersion").toString(); + TQStringList lst( TQStringList::split(".", srv_ver_str) ); uint minor_ver, major_ver; bool ok = (lst.count() == 2); if (ok) @@ -135,32 +135,32 @@ bool DriverManagerInternal::lookupDrivers() continue; } if (major_ver != KexiDB::version().major || minor_ver != KexiDB::version().minor) { - KexiDBWarn << QString("DriverManagerInternal::lookupDrivers(): '%1' driver" + KexiDBWarn << TQString("DriverManagerInternal::lookupDrivers(): '%1' driver" " has version '%2' but required KexiDB driver version is '%3.%4'\n" - " -- skipping this driver!").arg(srv_name.lower()).arg(srv_ver_str) - .arg(KexiDB::version().major).arg(KexiDB::version().minor) << endl; - possibleProblems += QString("\"%1\" database driver has version \"%2\" " + " -- skipping this driver!").tqarg(srv_name.lower()).tqarg(srv_ver_str) + .tqarg(KexiDB::version().major).tqarg(KexiDB::version().minor) << endl; + possibleProblems += TQString("\"%1\" database driver has version \"%2\" " "but required driver version is \"%3.%4\"") - .arg(srv_name.lower()).arg(srv_ver_str) - .arg(KexiDB::version().major).arg(KexiDB::version().minor); + .tqarg(srv_name.lower()).tqarg(srv_ver_str) + .tqarg(KexiDB::version().major).tqarg(KexiDB::version().minor); continue; } - QString drvType = ptr->property("X-Kexi-DriverType").toString().lower(); + TQString drvType = ptr->property("X-Kexi-DriverType").toString().lower(); if (drvType=="file") { //new property: a list of supported mime types - QStringList mimes( ptr->property("X-Kexi-FileDBDriverMimeList").toStringList() ); + TQStringList mimes( ptr->property("X-Kexi-FileDBDriverMimeList").toStringList() ); //single mime is obsolete, but we're handling it: { - QString mime( ptr->property("X-Kexi-FileDBDriverMime").toString().lower() ); + TQString mime( ptr->property("X-Kexi-FileDBDriverMime").toString().lower() ); if (!mime.isEmpty()) mimes.append( mime ); } //store association of this driver with all listed mime types - for (QStringList::ConstIterator mime_it = mimes.constBegin(); mime_it!=mimes.constEnd(); ++mime_it) { - QString mime( (*mime_it).lower() ); - if (!m_services_by_mimetype.contains(mime)) { + for (TQStringList::ConstIterator mime_it = mimes.constBegin(); mime_it!=mimes.constEnd(); ++mime_it) { + TQString mime( (*mime_it).lower() ); + if (!m_services_by_mimetype.tqcontains(mime)) { m_services_by_mimetype.insert(mime, ptr); } else { @@ -182,15 +182,15 @@ bool DriverManagerInternal::lookupDrivers() return true; } -KexiDB::Driver::Info DriverManagerInternal::driverInfo(const QString &name) +KexiDB::Driver::Info DriverManagerInternal::driverInfo(const TQString &name) { KexiDB::Driver::Info i = m_driversInfo[name.lower()]; if (!error() && i.name.isEmpty()) - setError(ERR_DRIVERMANAGER, i18n("Could not find database driver \"%1\".").arg(name) ); + setError(ERR_DRIVERMANAGER, i18n("Could not find database driver \"%1\".").tqarg(name) ); return i; } -Driver* DriverManagerInternal::driver(const QString& name) +Driver* DriverManagerInternal::driver(const TQString& name) { if (!lookupDrivers()) return 0; @@ -198,25 +198,25 @@ Driver* DriverManagerInternal::driver(const QString& name) clearError(); KexiDBDbg << "DriverManager::driver(): loading " << name << endl; - Driver *drv = name.isEmpty() ? 0 : m_drivers.find(name.latin1()); + Driver *drv = name.isEmpty() ? 0 : m_drivers.tqfind(name.latin1()); if (drv) return drv; //cached - if (!m_services_lcase.contains(name.lower())) { - setError(ERR_DRIVERMANAGER, i18n("Could not find database driver \"%1\".").arg(name) ); + if (!m_services_lcase.tqcontains(name.lower())) { + setError(ERR_DRIVERMANAGER, i18n("Could not find database driver \"%1\".").tqarg(name) ); return 0; } - KService::Ptr ptr= *(m_services_lcase.find(name.lower())); - QString srv_name = ptr->property("X-Kexi-DriverName").toString(); + KService::Ptr ptr= *(m_services_lcase.tqfind(name.lower())); + TQString srv_name = ptr->property("X-Kexi-DriverName").toString(); KexiDBDbg << "KexiDBInterfaceManager::load(): library: "<<ptr->library()<<endl; drv = KParts::ComponentFactory::createInstanceFromService<KexiDB::Driver>(ptr, - this, srv_name.latin1(), QStringList(),&m_serverResultNum); + this, srv_name.latin1(), TQStringList(),&m_serverResultNum); if (!drv) { setError(ERR_DRIVERMANAGER, i18n("Could not load database driver \"%1\".") - .arg(name) ); + .tqarg(name) ); if (m_componentLoadingErrors.isEmpty()) {//fill errtable on demand m_componentLoadingErrors[KParts::ComponentFactory::ErrNoServiceFound]="ErrNoServiceFound"; m_componentLoadingErrors[KParts::ComponentFactory::ErrServiceProvidesNoLibrary]="ErrServiceProvidesNoLibrary"; @@ -273,7 +273,7 @@ void DriverManagerInternal::aboutDelete( Driver* drv ) // --------------------------- DriverManager::DriverManager() - : QObject( 0, "KexiDB::DriverManager" ) + : TQObject( 0, "KexiDB::DriverManager" ) , Object() , d_int( DriverManagerInternal::self() ) { @@ -323,24 +323,24 @@ const KexiDB::Driver::InfoMap DriverManager::driversInfo() info.fileBased = (ptr->property("X-Kexi-DriverType").toString().lower()=="file"); if (info.fileBased) info.fileDBMimeType = ptr->property("X-Kexi-FileDBDriverMime").toString().lower(); - QVariant v = ptr->property("X-Kexi-DoNotAllowProjectImportingTo"); + TQVariant v = ptr->property("X-Kexi-DoNotAllowProjectImportingTo"); info.allowImportingTo = v.isNull() ? true : !v.toBool(); d_int->m_driversInfo.insert(info.name.lower(), info); } return d_int->m_driversInfo; } -const QStringList DriverManager::driverNames() +const TQStringList DriverManager::driverNames() { if (!d_int->lookupDrivers()) - return QStringList(); + return TQStringList(); if (d_int->m_services.isEmpty() && d_int->error()) - return QStringList(); + return TQStringList(); return d_int->m_services.keys(); } -KexiDB::Driver::Info DriverManager::driverInfo(const QString &name) +KexiDB::Driver::Info DriverManager::driverInfo(const TQString &name) { driversInfo(); KexiDB::Driver::Info i = d_int->driverInfo(name); @@ -349,7 +349,7 @@ KexiDB::Driver::Info DriverManager::driverInfo(const QString &name) return i; } -KService::Ptr DriverManager::serviceInfo(const QString &name) +KService::Ptr DriverManager::serviceInfo(const TQString &name) { if (!d_int->lookupDrivers()) { setError(d_int); @@ -357,10 +357,10 @@ KService::Ptr DriverManager::serviceInfo(const QString &name) } clearError(); - if (d_int->m_services_lcase.contains(name.lower())) { - return *d_int->m_services_lcase.find(name.lower()); + if (d_int->m_services_lcase.tqcontains(name.lower())) { + return *d_int->m_services_lcase.tqfind(name.lower()); } else { - setError(ERR_DRIVERMANAGER, i18n("No such driver service: \"%1\".").arg(name) ); + setError(ERR_DRIVERMANAGER, i18n("No such driver service: \"%1\".").tqarg(name) ); return KService::Ptr(); } } @@ -372,7 +372,7 @@ const DriverManager::ServicesMap& DriverManager::services() return d_int->m_services; } -QString DriverManager::lookupByMime(const QString &mimeType) +TQString DriverManager::lookupByMime(const TQString &mimeType) { if (!d_int->lookupDrivers()) { setError(d_int); @@ -381,11 +381,11 @@ QString DriverManager::lookupByMime(const QString &mimeType) KService::Ptr ptr = d_int->m_services_by_mimetype[mimeType.lower()]; if (!ptr) - return QString::null; + return TQString(); return ptr->property("X-Kexi-DriverName").toString(); } -Driver* DriverManager::driver(const QString& name) +Driver* DriverManager::driver(const TQString& name) { Driver *drv = d_int->driver(name); if (d_int->error()) @@ -393,7 +393,7 @@ Driver* DriverManager::driver(const QString& name) return drv; } -QString DriverManager::serverErrorMsg() +TQString DriverManager::serverErrorMsg() { return d_int->m_serverErrMsg; } @@ -403,29 +403,29 @@ int DriverManager::serverResult() return d_int->m_serverResultNum; } -QString DriverManager::serverResultName() +TQString DriverManager::serverResultName() { return d_int->m_serverResultName; } void DriverManager::drv_clearServerResult() { - d_int->m_serverErrMsg=QString::null; + d_int->m_serverErrMsg=TQString(); d_int->m_serverResultNum=0; - d_int->m_serverResultName=QString::null; + d_int->m_serverResultName=TQString(); } -QString DriverManager::possibleProblemsInfoMsg() const +TQString DriverManager::possibleProblemsInfoMsg() const { if (d_int->possibleProblems.isEmpty()) - return QString::null; - QString str; + return TQString(); + TQString str; str.reserve(1024); str = "<ul>"; - for (QStringList::ConstIterator it = d_int->possibleProblems.constBegin(); + for (TQStringList::ConstIterator it = d_int->possibleProblems.constBegin(); it!=d_int->possibleProblems.constEnd(); ++it) { - str += (QString::fromLatin1("<li>") + *it + QString::fromLatin1("</li>")); + str += (TQString::tqfromLatin1("<li>") + *it + TQString::tqfromLatin1("</li>")); } str += "</ul>"; return str; |