From 69cac65817d949cda2672ec4f0aa73d5e66a0ba1 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 22 Jun 2011 00:30:31 +0000 Subject: TQt4 port kdenetwork This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1237912 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kopete/libkopete/kopetepluginmanager.cpp | 52 ++++++++++++++++---------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'kopete/libkopete/kopetepluginmanager.cpp') diff --git a/kopete/libkopete/kopetepluginmanager.cpp b/kopete/libkopete/kopetepluginmanager.cpp index 1aff9e9f..d11e413b 100644 --- a/kopete/libkopete/kopetepluginmanager.cpp +++ b/kopete/libkopete/kopetepluginmanager.cpp @@ -89,10 +89,10 @@ PluginManager* PluginManager::self() return s_self; } -PluginManager::PluginManager() : TQObject( qApp ), d( new Private ) +PluginManager::PluginManager() : TQObject( tqApp ), d( new Private ) { - d->plugins = KPluginInfo::fromServices( KTrader::self()->query( TQString::fromLatin1( "Kopete/Plugin" ), - TQString::fromLatin1( "[X-Kopete-Version] == 1000900" ) ) ); + d->plugins = KPluginInfo::fromServices( KTrader::self()->query( TQString::tqfromLatin1( "Kopete/Plugin" ), + TQString::tqfromLatin1( "[X-Kopete-Version] == 1000900" ) ) ); // We want to add a reference to the application's event loop so we // can remain in control when all windows are removed. @@ -188,7 +188,7 @@ void PluginManager::shutdown() it != d->loadedPlugins.end(); /* EMPTY */ ) { // Plugins could emit their ready for unload signal directly in response to this, - // which would invalidate the current iterator. Therefore, we copy the iterator + // which would tqinvalidate the current iterator. Therefore, we copy the iterator // and increment it beforehand. Private::InfoToPluginMap::ConstIterator current( it ); ++it; @@ -215,7 +215,7 @@ void PluginManager::slotPluginReadyForUnload() // less clean for plugin authors // FIXME: I don't buy the above argument. Add a Kopete::Plugin::emitReadyForUnload(void), // and make readyForUnload be passed a plugin. - Richard - Plugin *plugin = dynamic_cast( const_cast( sender() ) ); + Plugin *plugin = dynamic_cast( TQT_TQOBJECT(const_cast( sender() ) ) ); kdDebug( 14010 ) << k_funcinfo << plugin->pluginId() << "ready for unload" << endl; if ( !plugin ) { @@ -239,7 +239,7 @@ void PluginManager::slotShutdownTimeout() remaining.append( it.data()->pluginId() ); kdWarning( 14010 ) << k_funcinfo << "Some plugins didn't shutdown in time!" << endl - << "Remaining plugins: " << remaining.join( TQString::fromLatin1( ", " ) ) << endl + << "Remaining plugins: " << remaining.join( TQString::tqfromLatin1( ", " ) ) << endl << "Forcing Kopete shutdown now." << endl; slotShutdownDone(); @@ -259,30 +259,30 @@ void PluginManager::loadAllPlugins() // FIXME: We need session management here - Martijn KConfig *config = KGlobal::config(); - if ( config->hasGroup( TQString::fromLatin1( "Plugins" ) ) ) + if ( config->hasGroup( TQString::tqfromLatin1( "Plugins" ) ) ) { TQMap pluginsMap; - TQMap entries = config->entryMap( TQString::fromLatin1( "Plugins" ) ); + TQMap entries = config->entryMap( TQString::tqfromLatin1( "Plugins" ) ); TQMap::Iterator it; for ( it = entries.begin(); it != entries.end(); ++it ) { TQString key = it.key(); - if ( key.endsWith( TQString::fromLatin1( "Enabled" ) ) ) - pluginsMap.insert( key.left( key.length() - 7 ), (it.data() == TQString::fromLatin1( "true" )) ); + if ( key.endsWith( TQString::tqfromLatin1( "Enabled" ) ) ) + pluginsMap.insert( key.left( key.length() - 7 ), (it.data() == TQString::tqfromLatin1( "true" )) ); } - TQValueList plugins = availablePlugins( TQString::null ); + TQValueList plugins = availablePlugins( TQString() ); TQValueList::ConstIterator it2 = plugins.begin(); TQValueList::ConstIterator end = plugins.end(); for ( ; it2 != end; ++it2 ) { // Protocols are loaded automatically so they aren't always in Plugins group. (fixes bug 167113) - if ( (*it2)->category() == TQString::fromLatin1( "Protocols" ) ) + if ( (*it2)->category() == TQString::tqfromLatin1( "Protocols" ) ) continue; TQString pluginName = (*it2)->pluginName(); - bool inMap = pluginsMap.contains( pluginName ); + bool inMap = pluginsMap.tqcontains( pluginName ); if ( (inMap && pluginsMap[pluginName]) || (!inMap && (*it2)->isPluginEnabledByDefault()) ) { if ( !plugin( pluginName ) ) @@ -301,7 +301,7 @@ void PluginManager::loadAllPlugins() else { // we had no config, so we load any plugins that should be loaded by default. - TQValueList plugins = availablePlugins( TQString::null ); + TQValueList plugins = availablePlugins( TQString() ); TQValueList::ConstIterator it = plugins.begin(); TQValueList::ConstIterator end = plugins.end(); for ( ; it != end; ++it ) @@ -343,10 +343,10 @@ Plugin * PluginManager::loadPlugin( const TQString &_pluginId, PluginLoadMode mo // Try to find legacy code // FIXME: Find any cases causing this, remove them, and remove this too - Richard - if ( pluginId.endsWith( TQString::fromLatin1( ".desktop" ) ) ) + if ( pluginId.endsWith( TQString::tqfromLatin1( ".desktop" ) ) ) { kdWarning( 14010 ) << "Trying to use old-style API!" << endl << kdBacktrace() << endl; - pluginId = pluginId.remove( TQRegExp( TQString::fromLatin1( ".desktop$" ) ) ); + pluginId = pluginId.remove( TQRegExp( TQString::tqfromLatin1( ".desktop$" ) ) ); } if ( mode == LoadSync ) @@ -372,12 +372,12 @@ Plugin *PluginManager::loadPluginInternal( const TQString &pluginId ) return 0L; } - if ( d->loadedPlugins.contains( info ) ) + if ( d->loadedPlugins.tqcontains( info ) ) return d->loadedPlugins[ info ]; int error = 0; - Plugin *plugin = KParts::ComponentFactory::createInstanceFromQuery( TQString::fromLatin1( "Kopete/Plugin" ), - TQString::fromLatin1( "[X-KDE-PluginInfo-Name]=='%1'" ).arg( pluginId ), this, 0, TQStringList(), &error ); + Plugin *plugin = KParts::ComponentFactory::createInstanceFromQuery( TQString::tqfromLatin1( "Kopete/Plugin" ), + TQString::tqfromLatin1( "[X-KDE-PluginInfo-Name]=='%1'" ).tqarg( pluginId ), this, 0, TQStringList(), &error ); if ( plugin ) { @@ -465,21 +465,21 @@ Plugin* PluginManager::plugin( const TQString &_pluginId ) const { // Hack for compatibility with Plugin::pluginId(), which returns // classname() instead of the internal name. Changing that is not easy - // as it invalidates the config file, the contact list, and most likely + // as it tqinvalidates the config file, the contact list, and most likely // other code as well. // For now, just transform FooProtocol to kopete_foo. // FIXME: In the future we'll need to change this nevertheless to unify // the handling - Martijn TQString pluginId = _pluginId; - if ( pluginId.endsWith( TQString::fromLatin1( "Protocol" ) ) ) - pluginId = TQString::fromLatin1( "kopete_" ) + _pluginId.lower().remove( TQString::fromLatin1( "protocol" ) ); + if ( pluginId.endsWith( TQString::tqfromLatin1( "Protocol" ) ) ) + pluginId = TQString::tqfromLatin1( "kopete_" ) + _pluginId.lower().remove( TQString::tqfromLatin1( "protocol" ) ); // End hack KPluginInfo *info = infoForPluginId( pluginId ); if ( !info ) return 0L; - if ( d->loadedPlugins.contains( info ) ) + if ( d->loadedPlugins.tqcontains( info ) ) return d->loadedPlugins[ info ]; else return 0L; @@ -506,13 +506,13 @@ bool PluginManager::setPluginEnabled( const TQString &_pluginId, bool enabled /* config->setGroup( "Plugins" ); // FIXME: What is this for? This sort of thing is kconf_update's job - Richard - if ( !pluginId.startsWith( TQString::fromLatin1( "kopete_" ) ) ) - pluginId.prepend( TQString::fromLatin1( "kopete_" ) ); + if ( !pluginId.startsWith( TQString::tqfromLatin1( "kopete_" ) ) ) + pluginId.prepend( TQString::tqfromLatin1( "kopete_" ) ); if ( !infoForPluginId( pluginId ) ) return false; - config->writeEntry( pluginId + TQString::fromLatin1( "Enabled" ), enabled ); + config->writeEntry( pluginId + TQString::tqfromLatin1( "Enabled" ), enabled ); config->sync(); return true; -- cgit v1.2.1