summaryrefslogtreecommitdiffstats
path: root/kopete/libkopete/kopetepluginmanager.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-22 00:30:31 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-22 00:30:31 +0000
commit69cac65817d949cda2672ec4f0aa73d5e66a0ba1 (patch)
tree073fde0496ea90eb5bf5cffe66a8da43a9f55fbc /kopete/libkopete/kopetepluginmanager.cpp
parent3467e6464beac3a162839bf7078e22e3a74d73e7 (diff)
downloadtdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.tar.gz
tdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.zip
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
Diffstat (limited to 'kopete/libkopete/kopetepluginmanager.cpp')
-rw-r--r--kopete/libkopete/kopetepluginmanager.cpp52
1 files changed, 26 insertions, 26 deletions
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<Plugin *>( const_cast<TQObject *>( sender() ) );
+ Plugin *plugin = dynamic_cast<Plugin *>( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>( 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<TQString, bool> pluginsMap;
- TQMap<TQString, TQString> entries = config->entryMap( TQString::fromLatin1( "Plugins" ) );
+ TQMap<TQString, TQString> entries = config->entryMap( TQString::tqfromLatin1( "Plugins" ) );
TQMap<TQString, TQString>::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<KPluginInfo *> plugins = availablePlugins( TQString::null );
+ TQValueList<KPluginInfo *> plugins = availablePlugins( TQString() );
TQValueList<KPluginInfo *>::ConstIterator it2 = plugins.begin();
TQValueList<KPluginInfo *>::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<KPluginInfo *> plugins = availablePlugins( TQString::null );
+ TQValueList<KPluginInfo *> plugins = availablePlugins( TQString() );
TQValueList<KPluginInfo *>::ConstIterator it = plugins.begin();
TQValueList<KPluginInfo *>::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<Plugin>( TQString::fromLatin1( "Kopete/Plugin" ),
- TQString::fromLatin1( "[X-KDE-PluginInfo-Name]=='%1'" ).arg( pluginId ), this, 0, TQStringList(), &error );
+ Plugin *plugin = KParts::ComponentFactory::createInstanceFromQuery<Plugin>( 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;