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/migration/migratemanager.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/migration/migratemanager.cpp')
-rw-r--r-- | kexi/migration/migratemanager.cpp | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/kexi/migration/migratemanager.cpp b/kexi/migration/migratemanager.cpp index 320ad718..8cd26c3c 100644 --- a/kexi/migration/migratemanager.cpp +++ b/kexi/migration/migratemanager.cpp @@ -32,7 +32,7 @@ #include <assert.h> -#include <qapplication.h> +#include <tqapplication.h> //remove debug #undef KexiDBDbg @@ -50,7 +50,7 @@ MigrateManagerInternal* MigrateManagerInternal::s_self = 0L; MigrateManager __manager; MigrateManagerInternal::MigrateManagerInternal() /* protected */ - : QObject( 0, "KexiMigrate::MigrateManagerInternal" ) + : TQObject( 0, "KexiMigrate::MigrateManagerInternal" ) , Object() , m_drivers(17, false) , m_refCount(0) @@ -72,7 +72,7 @@ MigrateManagerInternal::~MigrateManagerInternal() void MigrateManagerInternal::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 << "MigrateManagerInternal::slotAppQuits(): let's clear drivers..." << endl; m_drivers.clear(); @@ -91,8 +91,8 @@ bool MigrateManagerInternal::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; @@ -105,21 +105,21 @@ bool MigrateManagerInternal::lookupDrivers() for(; it != tlist.constEnd(); ++it) { KService::Ptr ptr = (*it); - QString srv_name = ptr->property("X-Kexi-MigrationDriverName").toString(); + TQString srv_name = ptr->property("X-Kexi-MigrationDriverName").toString(); if (srv_name.isEmpty()) { KexiDBWarn << "MigrateManagerInternal::lookupDrivers(): " "X-Kexi-MigrationDriverName must be set for migration 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())) { continue; } //! @todo could be merged. Copied from KexiDB::DriverManager. //<COPIED> - QString srv_ver_str = ptr->property("X-Kexi-KexiMigrationVersion").toString(); - QStringList lst( QStringList::split(".", srv_ver_str) ); + TQString srv_ver_str = ptr->property("X-Kexi-KexiMigrationVersion").toString(); + TQStringList lst( TQStringList::split(".", srv_ver_str) ); int minor_ver, major_ver; bool ok = (lst.count() == 2); if (ok) @@ -129,30 +129,30 @@ bool MigrateManagerInternal::lookupDrivers() if (!ok) { KexiDBWarn << "MigrateManagerInternal::lookupDrivers(): problem with detecting '" << srv_name.lower() << "' driver's version -- skipping it!" << endl; - possibleProblems += QString("\"%1\" migration driver has unrecognized version; " + possibleProblems += TQString("\"%1\" migration driver has unrecognized version; " "required driver version is \"%2.%3\"") - .arg(srv_name.lower()) - .arg(KexiMigration::versionMajor()).arg(KexiMigration::versionMinor()); + .tqarg(srv_name.lower()) + .tqarg(KexiMigration::versionMajor()).tqarg(KexiMigration::versionMinor()); continue; } if (major_ver != KexiMigration::versionMajor() || minor_ver != KexiMigration::versionMinor()) { - KexiDBWarn << QString("MigrateManagerInternal::lookupDrivers(): '%1' driver" + KexiDBWarn << TQString("MigrateManagerInternal::lookupDrivers(): '%1' driver" " has version '%2' but required migration driver version is '%3.%4'\n" - " -- skipping this driver!").arg(srv_name.lower()).arg(srv_ver_str) - .arg(KexiMigration::versionMajor()).arg(KexiMigration::versionMinor()) << endl; - possibleProblems += QString("\"%1\" migration driver has version \"%2\" " + " -- skipping this driver!").tqarg(srv_name.lower()).tqarg(srv_ver_str) + .tqarg(KexiMigration::versionMajor()).tqarg(KexiMigration::versionMinor()) << endl; + possibleProblems += TQString("\"%1\" migration driver has version \"%2\" " "but required driver version is \"%3.%4\"") - .arg(srv_name.lower()).arg(srv_ver_str) - .arg(KexiMigration::versionMajor()).arg(KexiMigration::versionMinor()); + .tqarg(srv_name.lower()).tqarg(srv_ver_str) + .tqarg(KexiMigration::versionMajor()).tqarg(KexiMigration::versionMinor()); continue; } //</COPIED> - QString mime = ptr->property("X-Kexi-FileDBDriverMime").toString().lower(); - QString drvType = ptr->property("X-Kexi-MigrationDriverType").toString().lower(); + TQString mime = ptr->property("X-Kexi-FileDBDriverMime").toString().lower(); + TQString drvType = ptr->property("X-Kexi-MigrationDriverType").toString().lower(); if (drvType=="file") { if (!mime.isEmpty()) { - if (!m_services_by_mimetype.contains(mime)) { + if (!m_services_by_mimetype.tqcontains(mime)) { m_services_by_mimetype.insert(mime, ptr); } else { @@ -175,7 +175,7 @@ bool MigrateManagerInternal::lookupDrivers() return true; } -KexiMigrate* MigrateManagerInternal::driver(const QString& name) +KexiMigrate* MigrateManagerInternal::driver(const TQString& name) { if (!lookupDrivers()) return 0; @@ -183,25 +183,25 @@ KexiMigrate* MigrateManagerInternal::driver(const QString& name) clearError(); KexiDBDbg << "MigrationrManagerInternal::migrationDriver(): loading " << name << endl; - KexiMigrate *drv = name.isEmpty() ? 0 : m_drivers.find(name.latin1()); + KexiMigrate *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 import/export database driver \"%1\".").arg(name) ); + if (!m_services_lcase.tqcontains(name.lower())) { + setError(ERR_DRIVERMANAGER, i18n("Could not find import/export database driver \"%1\".").tqarg(name) ); return 0; } - KService::Ptr ptr= *(m_services_lcase.find(name.lower())); - QString srv_name = ptr->property("X-Kexi-MigrationDriverName").toString(); + KService::Ptr ptr= *(m_services_lcase.tqfind(name.lower())); + TQString srv_name = ptr->property("X-Kexi-MigrationDriverName").toString(); KexiDBDbg << "MigrateManagerInternal::driver(): library: "<<ptr->library()<<endl; drv = KParts::ComponentFactory::createInstanceFromService<KexiMigrate>(ptr, - this, srv_name.latin1(), QStringList(),&m_serverResultNum); + this, srv_name.latin1(), TQStringList(),&m_serverResultNum); if (!drv) { setError(ERR_DRIVERMANAGER, i18n("Could not load import/export 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"; @@ -252,7 +252,7 @@ void MigrateManagerInternal::decRefCount() // --------------------------- MigrateManager::MigrateManager() - : QObject( 0, "KexiMigrate::MigrateManager" ) + : TQObject( 0, "KexiMigrate::MigrateManager" ) , Object() , d_int( MigrateManagerInternal::self() ) { @@ -284,27 +284,27 @@ MigrateManager::~MigrateManager() } -const QStringList MigrateManager::driverNames() +const TQStringList MigrateManager::driverNames() { if (!d_int->lookupDrivers()) { kdDebug() << "MigrateManager::driverNames() lookupDrivers failed" << endl; - return QStringList(); + return TQStringList(); } if (d_int->m_services.isEmpty()) { kdDebug() << "MigrateManager::driverNames() MigrateManager::ServicesMap is empty" << endl; - return QStringList(); + return TQStringList(); } if (d_int->error()) { kdDebug() << "MigrateManager::driverNames() Error: " << d_int->errorMsg() << endl; - return QStringList(); + return TQStringList(); } return d_int->m_services.keys(); } -QString MigrateManager::driverForMimeType(const QString &mimeType) +TQString MigrateManager::driverForMimeType(const TQString &mimeType) { if (!d_int->lookupDrivers()) { kdDebug() << "MigrateManager::driverForMimeType() lookupDrivers() failed" << endl; @@ -314,24 +314,24 @@ QString MigrateManager::driverForMimeType(const QString &mimeType) KService::Ptr ptr = d_int->m_services_by_mimetype[mimeType.lower()]; if (!ptr) { - kdDebug() << QString("MigrateManager::driverForMimeType(%1) No such mimetype").arg(mimeType) << endl; - return QString::null; + kdDebug() << TQString("MigrateManager::driverForMimeType(%1) No such mimetype").tqarg(mimeType) << endl; + return TQString(); } return ptr->property("X-Kexi-MigrationDriverName").toString(); } -KexiMigrate* MigrateManager::driver(const QString& name) +KexiMigrate* MigrateManager::driver(const TQString& name) { KexiMigrate *drv = d_int->driver(name); if (d_int->error()) { - kdDebug() << QString("MigrateManager::driver(%1) Error: %2").arg(name).arg(d_int->errorMsg()) << endl; + kdDebug() << TQString("MigrateManager::driver(%1) Error: %2").tqarg(name).tqarg(d_int->errorMsg()) << endl; setError(d_int); } return drv; } -QString MigrateManager::serverErrorMsg() +TQString MigrateManager::serverErrorMsg() { return d_int->m_serverErrMsg; } @@ -341,29 +341,29 @@ int MigrateManager::serverResult() return d_int->m_serverResultNum; } -QString MigrateManager::serverResultName() +TQString MigrateManager::serverResultName() { return d_int->m_serverResultName; } void MigrateManager::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 MigrateManager::possibleProblemsInfoMsg() const +TQString MigrateManager::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; |