summaryrefslogtreecommitdiffstats
path: root/kopete/libkopete/kopeteaccountmanager.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
commit47c8a359c5276062c4bc17f0e82410f29081b502 (patch)
tree2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /kopete/libkopete/kopeteaccountmanager.cpp
parent6f82532777a35e0e60bbd2b290b2e93e646f349b (diff)
downloadtdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz
tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/libkopete/kopeteaccountmanager.cpp')
-rw-r--r--kopete/libkopete/kopeteaccountmanager.cpp84
1 files changed, 42 insertions, 42 deletions
diff --git a/kopete/libkopete/kopeteaccountmanager.cpp b/kopete/libkopete/kopeteaccountmanager.cpp
index b00f080e..d12aa7ce 100644
--- a/kopete/libkopete/kopeteaccountmanager.cpp
+++ b/kopete/libkopete/kopeteaccountmanager.cpp
@@ -18,9 +18,9 @@
#include "kopeteaccountmanager.h"
-#include <qapplication.h>
-#include <qregexp.h>
-#include <qtimer.h>
+#include <tqapplication.h>
+#include <tqregexp.h>
+#include <tqtimer.h>
#include <kconfig.h>
#include <kdebug.h>
@@ -44,7 +44,7 @@ class AccountManager::Private
{
public:
- class AccountPtrList : public QPtrList<Account>
+ class AccountPtrList : public TQPtrList<Account>
{
protected:
int compareItems( AccountPtrList::Item a, AccountPtrList::Item b )
@@ -75,7 +75,7 @@ AccountManager * AccountManager::self()
AccountManager::AccountManager()
-: QObject( qApp, "KopeteAccountManager" )
+: TQObject( qApp, "KopeteAccountManager" )
{
d = new Private;
}
@@ -90,7 +90,7 @@ AccountManager::~AccountManager()
bool AccountManager::isAnyAccountConnected()
{
- for ( QPtrListIterator<Account> it( d->accounts ); it.current(); ++it )
+ for ( TQPtrListIterator<Account> it( d->accounts ); it.current(); ++it )
{
if(it.current()->isConnected())
return true;
@@ -100,17 +100,17 @@ bool AccountManager::isAnyAccountConnected()
void AccountManager::connectAll()
{
- for ( QPtrListIterator<Account> it( d->accounts ); it.current(); ++it )
+ for ( TQPtrListIterator<Account> it( d->accounts ); it.current(); ++it )
if(!it.current()->excludeConnect())
it.current()->connect();
}
-void AccountManager::setAvailableAll( const QString &awayReason )
+void AccountManager::setAvailableAll( const TQString &awayReason )
{
Away::setGlobalAway( false );
bool anyConnected = isAnyAccountConnected();
- for ( QPtrListIterator<Account> it( d->accounts ); it.current(); ++it )
+ for ( TQPtrListIterator<Account> it( d->accounts ); it.current(); ++it )
{
if ( anyConnected )
{
@@ -125,16 +125,16 @@ void AccountManager::setAvailableAll( const QString &awayReason )
void AccountManager::disconnectAll()
{
- for ( QPtrListIterator<Account> it( d->accounts ); it.current(); ++it )
+ for ( TQPtrListIterator<Account> it( d->accounts ); it.current(); ++it )
it.current()->disconnect();
}
-void AccountManager::setAwayAll( const QString &awayReason, bool away )
+void AccountManager::setAwayAll( const TQString &awayReason, bool away )
{
Away::setGlobalAway( true );
bool anyConnected = isAnyAccountConnected();
- for ( QPtrListIterator<Account> it( d->accounts ); it.current(); ++it )
+ for ( TQPtrListIterator<Account> it( d->accounts ); it.current(); ++it )
{
// FIXME: ICQ's invisible online should be set to invisible away
Contact *self = it.current()->myself();
@@ -152,12 +152,12 @@ void AccountManager::setAwayAll( const QString &awayReason, bool away )
}
}
-void AccountManager::setOnlineStatus( uint category , const QString& awayMessage, uint flags )
+void AccountManager::setOnlineStatus( uint category , const TQString& awayMessage, uint flags )
{
OnlineStatusManager::Categories katgor=(OnlineStatusManager::Categories)category;
bool anyConnected = isAnyAccountConnected();
- for ( QPtrListIterator<Account> it( d->accounts ); it.current(); ++it )
+ for ( TQPtrListIterator<Account> it( d->accounts ); it.current(); ++it )
{
Account *account = it.current();
Kopete::OnlineStatus status = OnlineStatusManager::self()->onlineStatus(account->protocol() , katgor);
@@ -175,25 +175,25 @@ void AccountManager::setOnlineStatus( uint category , const QString& awayMessage
}
-QColor AccountManager::guessColor( Protocol *protocol ) const
+TQColor AccountManager::guessColor( Protocol *protocol ) const
{
// In a perfect wold, we should check if the color is actually not used by the account.
// Anyway, this is not really required, It would be a difficult job for about nothing more.
// -- Olivier
int protocolCount = 0;
- for ( QPtrListIterator<Account> it( d->accounts ); it.current(); ++it )
+ for ( TQPtrListIterator<Account> it( d->accounts ); it.current(); ++it )
{
if ( it.current()->protocol()->pluginId() == protocol->pluginId() )
protocolCount++;
}
// let's figure a color
- QColor color;
+ TQColor color;
switch ( protocolCount % 7 )
{
case 0:
- color = QColor();
+ color = TQColor();
break;
case 1:
color = Qt::red;
@@ -230,7 +230,7 @@ Account* AccountManager::registerAccount( Account *account )
}
// If this account already exists, do nothing
- for ( QPtrListIterator<Account> it( d->accounts ); it.current(); ++it )
+ for ( TQPtrListIterator<Account> it( d->accounts ); it.current(); ++it )
{
if ( ( account->protocol() == it.current()->protocol() ) && ( account->accountId() == it.current()->accountId() ) )
{
@@ -243,12 +243,12 @@ Account* AccountManager::registerAccount( Account *account )
d->accounts.sort();
// Connect to the account's status changed signal
- connect(account->myself(), SIGNAL(onlineStatusChanged(Kopete::Contact *,
+ connect(account->myself(), TQT_SIGNAL(onlineStatusChanged(Kopete::Contact *,
const Kopete::OnlineStatus &, const Kopete::OnlineStatus &)),
- this, SLOT(slotAccountOnlineStatusChanged(Kopete::Contact *,
+ this, TQT_SLOT(slotAccountOnlineStatusChanged(Kopete::Contact *,
const Kopete::OnlineStatus &, const Kopete::OnlineStatus &)));
- connect(account, SIGNAL(accountDestroyed(const Kopete::Account *)) , this, SLOT( unregisterAccount(const Kopete::Account *) ));
+ connect(account, TQT_SIGNAL(accountDestroyed(const Kopete::Account *)) , this, TQT_SLOT( unregisterAccount(const Kopete::Account *) ));
emit accountRegistered( account );
return account;
@@ -261,15 +261,15 @@ void AccountManager::unregisterAccount( const Account *account )
emit accountUnregistered( account );
}
-const QPtrList<Account>& AccountManager::accounts() const
+const TQPtrList<Account>& AccountManager::accounts() const
{
return d->accounts;
}
-QDict<Account> AccountManager::accounts( const Protocol *protocol ) const
+TQDict<Account> AccountManager::accounts( const Protocol *protocol ) const
{
- QDict<Account> dict;
- for ( QPtrListIterator<Account> it( d->accounts ); it.current(); ++it )
+ TQDict<Account> dict;
+ for ( TQPtrListIterator<Account> it( d->accounts ); it.current(); ++it )
{
if ( it.current()->protocol() == protocol && !it.current()->accountId().isNull() )
dict.insert( it.current()->accountId(), it.current() );
@@ -278,9 +278,9 @@ QDict<Account> AccountManager::accounts( const Protocol *protocol ) const
return dict;
}
-Account * AccountManager::findAccount( const QString &protocolId, const QString &accountId )
+Account * AccountManager::findAccount( const TQString &protocolId, const TQString &accountId )
{
- for ( QPtrListIterator<Account> it( d->accounts ); it.current(); ++it )
+ for ( TQPtrListIterator<Account> it( d->accounts ); it.current(); ++it )
{
if ( it.current()->protocol()->pluginId() == protocolId && it.current()->accountId() == accountId )
return it.current();
@@ -299,7 +299,7 @@ void AccountManager::removeAccount( Account *account )
KConfigGroup *configgroup = account->configGroup();
// Clean up the contact list
- QDictIterator<Kopete::Contact> it( account->contacts() );
+ TQDictIterator<Kopete::Contact> it( account->contacts() );
for ( ; it.current(); ++it )
{
Contact* c = it.current();
@@ -312,7 +312,7 @@ void AccountManager::removeAccount( Account *account )
{
//get the first group and it's members
Group* group = mc->groups().first();
- QPtrList<MetaContact> groupMembers = group->members();
+ TQPtrList<MetaContact> groupMembers = group->members();
ContactList::self()->removeMetaContact( mc );
if ( groupMembers.count() == 1 && groupMembers.findRef( mc ) != -1 )
ContactList::self()->removeGroup( group );
@@ -332,7 +332,7 @@ void AccountManager::removeAccount( Account *account )
{
// FIXME: pluginId() should return the internal name and not the class name, so
// we can get rid of this hack - Olivier/Martijn
- QString protocolName = protocol->pluginId().remove( QString::fromLatin1( "Protocol" ) ).lower();
+ TQString protocolName = protocol->pluginId().remove( TQString::fromLatin1( "Protocol" ) ).lower();
PluginManager::self()->setPluginEnabled( protocolName, false );
PluginManager::self()->unloadPlugin( protocolName );
@@ -344,7 +344,7 @@ void AccountManager::save()
//kdDebug( 14010 ) << k_funcinfo << endl;
d->accounts.sort();
- for ( QPtrListIterator<Account> it( d->accounts ); it.current(); ++it )
+ for ( TQPtrListIterator<Account> it( d->accounts ); it.current(); ++it )
{
KConfigBase *config = it.current()->configGroup();
@@ -357,22 +357,22 @@ void AccountManager::save()
void AccountManager::load()
{
- connect( PluginManager::self(), SIGNAL( pluginLoaded( Kopete::Plugin * ) ),
- this, SLOT( slotPluginLoaded( Kopete::Plugin * ) ) );
+ connect( PluginManager::self(), TQT_SIGNAL( pluginLoaded( Kopete::Plugin * ) ),
+ this, TQT_SLOT( slotPluginLoaded( Kopete::Plugin * ) ) );
// Iterate over all groups that start with "Account_" as those are accounts
// and load the required protocols if the account is enabled.
// Don't try to optimize duplicate calls out, the plugin queue is smart enough
// (and fast enough) to handle that without adding complexity here
KConfig *config = KGlobal::config();
- QStringList accountGroups = config->groupList().grep( QRegExp( QString::fromLatin1( "^Account_" ) ) );
- for ( QStringList::Iterator it = accountGroups.begin(); it != accountGroups.end(); ++it )
+ TQStringList accountGroups = config->groupList().grep( TQRegExp( TQString::fromLatin1( "^Account_" ) ) );
+ for ( TQStringList::Iterator it = accountGroups.begin(); it != accountGroups.end(); ++it )
{
config->setGroup( *it );
- QString protocol = config->readEntry( "Protocol" );
- if ( protocol.endsWith( QString::fromLatin1( "Protocol" ) ) )
- protocol = QString::fromLatin1( "kopete_" ) + protocol.lower().remove( QString::fromLatin1( "protocol" ) );
+ TQString protocol = config->readEntry( "Protocol" );
+ if ( protocol.endsWith( TQString::fromLatin1( "Protocol" ) ) )
+ protocol = TQString::fromLatin1( "kopete_" ) + protocol.lower().remove( TQString::fromLatin1( "protocol" ) );
if ( config->readBoolEntry( "Enabled", true ) )
PluginManager::self()->loadPlugin( protocol, PluginManager::LoadAsync );
@@ -388,8 +388,8 @@ void AccountManager::slotPluginLoaded( Plugin *plugin )
// Iterate over all groups that start with "Account_" as those are accounts
// and parse them if they are from this protocol
KConfig *config = KGlobal::config();
- QStringList accountGroups = config->groupList().grep( QRegExp( QString::fromLatin1( "^Account_" ) ) );
- for ( QStringList::Iterator it = accountGroups.begin(); it != accountGroups.end(); ++it )
+ TQStringList accountGroups = config->groupList().grep( TQRegExp( TQString::fromLatin1( "^Account_" ) ) );
+ for ( TQStringList::Iterator it = accountGroups.begin(); it != accountGroups.end(); ++it )
{
config->setGroup( *it );
@@ -400,7 +400,7 @@ void AccountManager::slotPluginLoaded( Plugin *plugin )
if ( !config->readBoolEntry( "Enabled", true ) )
continue;
- QString accountId = config->readEntry( "AccountId" );
+ TQString accountId = config->readEntry( "AccountId" );
if ( accountId.isEmpty() )
{
kdWarning( 14010 ) << k_funcinfo <<