diff options
Diffstat (limited to 'kopete/libkopete/kopeteaccount.cpp')
-rw-r--r-- | kopete/libkopete/kopeteaccount.cpp | 116 |
1 files changed, 58 insertions, 58 deletions
diff --git a/kopete/libkopete/kopeteaccount.cpp b/kopete/libkopete/kopeteaccount.cpp index 52bb26bc..acce1da1 100644 --- a/kopete/libkopete/kopeteaccount.cpp +++ b/kopete/libkopete/kopeteaccount.cpp @@ -16,8 +16,8 @@ ************************************************************************* */ -#include <qapplication.h> -#include <qtimer.h> +#include <tqapplication.h> +#include <tqtimer.h> #include <kconfig.h> #include <kdebug.h> @@ -54,7 +54,7 @@ namespace Kopete class Account::Private { public: - Private( Protocol *protocol, const QString &accountId ) + Private( Protocol *protocol, const TQString &accountId ) : protocol( protocol ), id( accountId ) , excludeconnect( true ), priority( 0 ), myself( 0 ) , suppressStatusTimer( 0 ), suppressStatusNotification( false ) @@ -66,38 +66,38 @@ public: ~Private() { delete blackList; } Protocol *protocol; - QString id; - QString accountLabel; + TQString id; + TQString accountLabel; bool excludeconnect; uint priority; - QDict<Contact> contacts; - QColor color; + TQDict<Contact> contacts; + TQColor color; Contact *myself; - QTimer suppressStatusTimer; + TQTimer suppressStatusTimer; bool suppressStatusNotification; Kopete::BlackLister *blackList; KConfigGroup *configGroup; uint connectionTry; - QString customIcon; + TQString customIcon; Kopete::OnlineStatus restoreStatus; - QString restoreMessage; + TQString restoreMessage; }; -Account::Account( Protocol *parent, const QString &accountId, const char *name ) - : QObject( parent, name ), d( new Private( parent, accountId ) ) +Account::Account( Protocol *parent, const TQString &accountId, const char *name ) + : TQObject( parent, name ), d( new Private( parent, accountId ) ) { - d->configGroup=new KConfigGroup(KGlobal::config(), QString::fromLatin1( "Account_%1_%2" ).arg( d->protocol->pluginId(), d->id )); + d->configGroup=new KConfigGroup(KGlobal::config(), TQString::fromLatin1( "Account_%1_%2" ).arg( d->protocol->pluginId(), d->id )); d->excludeconnect = d->configGroup->readBoolEntry( "ExcludeConnect", false ); d->color = d->configGroup->readColorEntry( "Color", &d->color ); - d->customIcon = d->configGroup->readEntry( "Icon", QString() ); + d->customIcon = d->configGroup->readEntry( "Icon", TQString() ); d->priority = d->configGroup->readNumEntry( "Priority", 0 ); d->restoreStatus = Kopete::OnlineStatus::Online; d->restoreMessage = ""; - QObject::connect( &d->suppressStatusTimer, SIGNAL( timeout() ), - this, SLOT( slotStopSuppression() ) ); + TQObject::connect( &d->suppressStatusTimer, TQT_SIGNAL( timeout() ), + this, TQT_SLOT( slotStopSuppression() ) ); } Account::~Account() @@ -106,7 +106,7 @@ Account::~Account() // Delete all registered child contacts first while ( !d->contacts.isEmpty() ) - delete *QDictIterator<Contact>( d->contacts ); + delete *TQDictIterator<Contact>( d->contacts ); kdDebug( 14010 ) << k_funcinfo << " account '" << d->id << "' about to emit accountDestroyed " << endl; emit accountDestroyed(this); @@ -128,14 +128,14 @@ void Account::disconnected( DisconnectReason reason ) //reconnect if needed if(reason == BadPassword ) { - QTimer::singleShot(0, this, SLOT(reconnect())); + TQTimer::singleShot(0, this, TQT_SLOT(reconnect())); } else if ( KopetePrefs::prefs()->reconnectOnDisconnect() == true && reason > Manual ) { d->connectionTry++; //use a timer to allow the plugins to clean up after return if(d->connectionTry < 3) - QTimer::singleShot(10000, this, SLOT(reconnect())); // wait 10 seconds before reconnect + TQTimer::singleShot(10000, this, TQT_SLOT(reconnect())); // wait 10 seconds before reconnect } if(reason== OtherClient) { @@ -148,17 +148,17 @@ Protocol *Account::protocol() const return d->protocol; } -QString Account::accountId() const +TQString Account::accountId() const { return d->id; } -const QColor Account::color() const +const TQColor Account::color() const { return d->color; } -void Account::setColor( const QColor &color ) +void Account::setColor( const TQColor &color ) { d->color = color; if ( d->color.isValid() ) @@ -180,12 +180,12 @@ uint Account::priority() const } -QPixmap Account::accountIcon(const int size) const +TQPixmap Account::accountIcon(const int size) const { - QString icon= d->customIcon.isEmpty() ? d->protocol->pluginIcon() : d->customIcon; + TQString icon= d->customIcon.isEmpty() ? d->protocol->pluginIcon() : d->customIcon; // FIXME: this code is duplicated with OnlineStatus, can we merge it somehow? - QPixmap base = KGlobal::instance()->iconLoader()->loadIcon( + TQPixmap base = KGlobal::instance()->iconLoader()->loadIcon( icon, KIcon::Small, size ); if ( d->color.isValid() ) @@ -196,7 +196,7 @@ QPixmap Account::accountIcon(const int size) const if ( size > 0 && base.width() != size ) { - base = QPixmap( base.convertToImage().smoothScale( size, size ) ); + base = TQPixmap( base.convertToImage().smoothScale( size, size ) ); } return base; @@ -207,12 +207,12 @@ KConfigGroup* Kopete::Account::configGroup() const return d->configGroup; } -void Account::setAccountLabel( const QString &label ) +void Account::setAccountLabel( const TQString &label ) { d->accountLabel = label; } -QString Account::accountLabel() const +TQString Account::accountLabel() const { if( d->accountLabel.isNull() ) return d->id; @@ -233,8 +233,8 @@ bool Account::excludeConnect() const void Account::registerContact( Contact *c ) { d->contacts.insert( c->contactId(), c ); - QObject::connect( c, SIGNAL( contactDestroyed( Kopete::Contact * ) ), - SLOT( contactDestroyed( Kopete::Contact * ) ) ); + TQObject::connect( c, TQT_SIGNAL( contactDestroyed( Kopete::Contact * ) ), + TQT_SLOT( contactDestroyed( Kopete::Contact * ) ) ); } void Account::contactDestroyed( Contact *c ) @@ -243,13 +243,13 @@ void Account::contactDestroyed( Contact *c ) } -const QDict<Contact>& Account::contacts() +const TQDict<Contact>& Account::contacts() { return d->contacts; } -Kopete::MetaContact* Account::addContact( const QString &contactId, const QString &displayName , Group *group, AddMode mode ) +Kopete::MetaContact* Account::addContact( const TQString &contactId, const TQString &displayName , Group *group, AddMode mode ) { if ( contactId == d->myself->contactId() ) @@ -316,7 +316,7 @@ Kopete::MetaContact* Account::addContact( const QString &contactId, const QStrin return parentContact; } -bool Account::addContact(const QString &contactId , MetaContact *parent, AddMode mode ) +bool Account::addContact(const TQString &contactId , MetaContact *parent, AddMode mode ) { if ( contactId == myself()->contactId() ) { @@ -362,7 +362,7 @@ KActionMenu * Account::actionMenu() { //default implementation KActionMenu *menu = new KActionMenu( accountId(), myself()->onlineStatus().iconFor( this ), this ); - QString nick = myself()->property( Kopete::Global::Properties::self()->nickName()).value().toString(); + TQString nick = myself()->property( Kopete::Global::Properties::self()->nickName()).value().toString(); menu->popupMenu()->insertTitle( myself()->onlineStatus().iconFor( myself() ), nick.isNull() ? accountLabel() : i18n( "%2 <%1>" ).arg( accountLabel(), nick ) @@ -370,7 +370,7 @@ KActionMenu * Account::actionMenu() OnlineStatusManager::self()->createAccountStatusActions(this, menu); menu->popupMenu()->insertSeparator(); - menu->insert( new KAction ( i18n( "Properties" ), 0, this, SLOT( editAccount() ), menu, "actionAccountProperties" ) ); + menu->insert( new KAction ( i18n( "Properties" ), 0, this, TQT_SLOT( editAccount() ), menu, "actionAccountProperties" ) ); return menu; } @@ -397,20 +397,20 @@ void Account::setMyself( Contact *myself ) if ( d->myself ) { - QObject::disconnect( d->myself, SIGNAL( onlineStatusChanged( Kopete::Contact *, const Kopete::OnlineStatus &, const Kopete::OnlineStatus & ) ), - this, SLOT( slotOnlineStatusChanged( Kopete::Contact *, const Kopete::OnlineStatus &, const Kopete::OnlineStatus & ) ) ); - QObject::disconnect( d->myself, SIGNAL( propertyChanged( Kopete::Contact *, const QString &, const QVariant &, const QVariant & ) ), - this, SLOT( slotContactPropertyChanged( Kopete::Contact *, const QString &, const QVariant &, const QVariant & ) ) ); + TQObject::disconnect( d->myself, TQT_SIGNAL( onlineStatusChanged( Kopete::Contact *, const Kopete::OnlineStatus &, const Kopete::OnlineStatus & ) ), + this, TQT_SLOT( slotOnlineStatusChanged( Kopete::Contact *, const Kopete::OnlineStatus &, const Kopete::OnlineStatus & ) ) ); + TQObject::disconnect( d->myself, TQT_SIGNAL( propertyChanged( Kopete::Contact *, const TQString &, const TQVariant &, const TQVariant & ) ), + this, TQT_SLOT( slotContactPropertyChanged( Kopete::Contact *, const TQString &, const TQVariant &, const TQVariant & ) ) ); } d->myself = myself; // d->contacts.remove( myself->contactId() ); - QObject::connect( d->myself, SIGNAL( onlineStatusChanged( Kopete::Contact *, const Kopete::OnlineStatus &, const Kopete::OnlineStatus & ) ), - this, SLOT( slotOnlineStatusChanged( Kopete::Contact *, const Kopete::OnlineStatus &, const Kopete::OnlineStatus & ) ) ); - QObject::connect( d->myself, SIGNAL( propertyChanged( Kopete::Contact *, const QString &, const QVariant &, const QVariant & ) ), - this, SLOT( slotContactPropertyChanged( Kopete::Contact *, const QString &, const QVariant &, const QVariant & ) ) ); + TQObject::connect( d->myself, TQT_SIGNAL( onlineStatusChanged( Kopete::Contact *, const Kopete::OnlineStatus &, const Kopete::OnlineStatus & ) ), + this, TQT_SLOT( slotOnlineStatusChanged( Kopete::Contact *, const Kopete::OnlineStatus &, const Kopete::OnlineStatus & ) ) ); + TQObject::connect( d->myself, TQT_SIGNAL( propertyChanged( Kopete::Contact *, const TQString &, const TQVariant &, const TQVariant & ) ), + this, TQT_SLOT( slotContactPropertyChanged( Kopete::Contact *, const TQString &, const TQVariant &, const TQVariant & ) ) ); if ( isConnected() != wasConnected ) emit isConnectedChanged(); @@ -454,15 +454,15 @@ void Account::setAllContactsStatus( const Kopete::OnlineStatus &status ) d->suppressStatusNotification = true; d->suppressStatusTimer.start( 5000, true ); - for ( QDictIterator<Contact> it( d->contacts ); it.current(); ++it ) + for ( TQDictIterator<Contact> it( d->contacts ); it.current(); ++it ) if ( it.current() != d->myself ) it.current()->setOnlineStatus( status ); } void Account::slotContactPropertyChanged( Contact * /* contact */, - const QString &key, const QVariant &old, const QVariant &newVal ) + const TQString &key, const TQVariant &old, const TQVariant &newVal ) { - if ( key == QString::fromLatin1("awayMessage") && old != newVal && isConnected() ) + if ( key == TQString::fromLatin1("awayMessage") && old != newVal && isConnected() ) { d->restoreMessage = newVal.toString(); // kdDebug( 14010 ) << k_funcinfo << "account " << d->id << " restoreMessage " << d->restoreMessage << endl; @@ -493,22 +493,22 @@ BlackLister* Account::blackLister() return d->blackList; } -void Account::block( const QString &contactId ) +void Account::block( const TQString &contactId ) { d->blackList->addContact( contactId ); } -void Account::unblock( const QString &contactId ) +void Account::unblock( const TQString &contactId ) { d->blackList->removeContact( contactId ); } -bool Account::isBlocked( const QString &contactId ) +bool Account::isBlocked( const TQString &contactId ) { return d->blackList->isBlocked( contactId ); } -void Account::editAccount(QWidget *parent) +void Account::editAccount(TQWidget *parent) { KDialogBase *editDialog = new KDialogBase( parent, "KopeteAccountConfig::editDialog", true, i18n( "Edit Account" ), KDialogBase::Ok | KDialogBase::Cancel, @@ -521,15 +521,15 @@ void Account::editAccount(QWidget *parent) // FIXME: Why the #### is EditAccountWidget not a QWidget?!? This sideways casting // is braindead and error-prone. Looking at MSN the only reason I can see is // because it allows direct subclassing of designer widgets. But what is - // wrong with embedding the designer widget in an empty QWidget instead? + // wrong with embedding the designer widget in an empty TQWidget instead? // Also, if this REALLY has to be a pure class and not a widget, then the // class should at least be renamed to EditAccountIface instead - Martijn - QWidget *w = dynamic_cast<QWidget *>( m_accountWidget ); + TQWidget *w = dynamic_cast<TQWidget *>( m_accountWidget ); if ( !w ) return; editDialog->setMainWidget( w ); - if ( editDialog->exec() == QDialog::Accepted ) + if ( editDialog->exec() == TQDialog::Accepted ) { if( m_accountWidget->validateData() ) m_accountWidget->apply(); @@ -538,22 +538,22 @@ void Account::editAccount(QWidget *parent) editDialog->deleteLater(); } -void Account::setPluginData( Plugin* /*plugin*/, const QString &key, const QString &value ) +void Account::setPluginData( Plugin* /*plugin*/, const TQString &key, const TQString &value ) { configGroup()->writeEntry(key,value); } -QString Account::pluginData( Plugin* /*plugin*/, const QString &key ) const +TQString Account::pluginData( Plugin* /*plugin*/, const TQString &key ) const { return configGroup()->readEntry(key); } -void Account::setAway(bool away, const QString& reason) +void Account::setAway(bool away, const TQString& reason) { setOnlineStatus( OnlineStatusManager::self()->onlineStatus(protocol() , away ? OnlineStatusManager::Away : OnlineStatusManager::Online) , reason ); } -void Account::setCustomIcon( const QString & i) +void Account::setCustomIcon( const TQString & i) { d->customIcon = i; if(!i.isEmpty()) @@ -563,7 +563,7 @@ void Account::setCustomIcon( const QString & i) emit colorChanged( color() ); } -QString Account::customIcon() const +TQString Account::customIcon() const { return d->customIcon; } |