diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-22 00:30:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-22 00:30:31 +0000 |
commit | 69cac65817d949cda2672ec4f0aa73d5e66a0ba1 (patch) | |
tree | 073fde0496ea90eb5bf5cffe66a8da43a9f55fbc /kopete/libkopete/kopeteaccount.cpp | |
parent | 3467e6464beac3a162839bf7078e22e3a74d73e7 (diff) | |
download | tdenetwork-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/kopeteaccount.cpp')
-rw-r--r-- | kopete/libkopete/kopeteaccount.cpp | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/kopete/libkopete/kopeteaccount.cpp b/kopete/libkopete/kopeteaccount.cpp index acce1da1..11f668d8 100644 --- a/kopete/libkopete/kopeteaccount.cpp +++ b/kopete/libkopete/kopeteaccount.cpp @@ -79,21 +79,21 @@ public: KConfigGroup *configGroup; uint connectionTry; TQString customIcon; - Kopete::OnlineStatus restoreStatus; + Kopete::OnlineStatus restoretqStatus; TQString restoreMessage; }; -Account::Account( Protocol *parent, const TQString &accountId, const char *name ) - : TQObject( parent, name ), d( new Private( parent, accountId ) ) +Account::Account( Protocol *tqparent, const TQString &accountId, const char *name ) + : TQObject( tqparent, name ), d( new Private( tqparent, accountId ) ) { - d->configGroup=new KConfigGroup(KGlobal::config(), TQString::fromLatin1( "Account_%1_%2" ).arg( d->protocol->pluginId(), d->id )); + d->configGroup=new KConfigGroup(KGlobal::config(), TQString::tqfromLatin1( "Account_%1_%2" ).tqarg( 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", TQString() ); d->priority = d->configGroup->readNumEntry( "Priority", 0 ); - d->restoreStatus = Kopete::OnlineStatus::Online; + d->restoretqStatus = Kopete::OnlineStatus::Online; d->restoreMessage = ""; TQObject::connect( &d->suppressStatusTimer, TQT_SIGNAL( timeout() ), @@ -118,8 +118,8 @@ Account::~Account() void Account::reconnect() { - kdDebug( 14010 ) << k_funcinfo << "account " << d->id << " restoreStatus " << d->restoreStatus.status() << " restoreMessage " << d->restoreMessage << endl; - setOnlineStatus( d->restoreStatus, d->restoreMessage ); + kdDebug( 14010 ) << k_funcinfo << "account " << d->id << " restoretqStatus " << d->restoretqStatus.status() << " restoreMessage " << d->restoreMessage << endl; + setOnlineStatus( d->restoretqStatus, d->restoreMessage ); } void Account::disconnected( DisconnectReason reason ) @@ -139,7 +139,7 @@ void Account::disconnected( DisconnectReason reason ) } if(reason== OtherClient) { - Kopete::Utils::notifyConnectionLost(this, i18n("You have been disconnected"), i18n( "You have connected from another client or computer to the account '%1'" ).arg(d->id), i18n("Most proprietary Instant Messaging services do not allow you to connect from more than one location. Check that nobody is using your account without your permission. If you need a service that supports connection from various locations at the same time, use the Jabber protocol.")); + Kopete::Utils::notifyConnectionLost(this, i18n("You have been disconnected"), i18n( "You have connected from another client or computer to the account '%1'" ).tqarg(d->id), i18n("Most proprietary Instant Messaging services do not allow you to connect from more than one location. Check that nobody is using your account without your permission. If you need a service that supports connection from various locations at the same time, use the Jabber protocol.")); } } @@ -255,7 +255,7 @@ Kopete::MetaContact* Account::addContact( const TQString &contactId, const TQStr if ( contactId == d->myself->contactId() ) { KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Error, - i18n("You are not allowed to add yourself to the contact list. The addition of \"%1\" to account \"%2\" will not take place.").arg(contactId,accountId()), i18n("Error Creating Contact") + i18n("You are not allowed to add yourself to the contact list. The addition of \"%1\" to account \"%2\" will not take place.").tqarg(contactId,accountId()), i18n("Error Creating Contact") ); return false; } @@ -278,55 +278,55 @@ Kopete::MetaContact* Account::addContact( const TQString &contactId, const TQStr } else { - // should we here add the contact to the parentContact if any? + // should we here add the contact to the tqparentContact if any? kdDebug( 14010 ) << k_funcinfo << "Contact already exists" << endl; } return c->metaContact(); } - MetaContact *parentContact = new MetaContact(); + MetaContact *tqparentContact = new MetaContact(); if(!displayName.isEmpty()) - parentContact->setDisplayName( displayName ); + tqparentContact->setDisplayName( displayName ); //Set it as a temporary contact if requested if ( isTemporary ) - parentContact->setTemporary( true ); + tqparentContact->setTemporary( true ); else - parentContact->addToGroup( group ); + tqparentContact->addToGroup( group ); if ( c ) { - c->setMetaContact( parentContact ); + c->setMetaContact( tqparentContact ); if ( mode == ChangeKABC ) { kdDebug( 14010 ) << k_funcinfo << " changing KABC" << endl; - KABCPersistence::self()->write( parentContact ); + KABCPersistence::self()->write( tqparentContact ); } } else { - if ( !createContact( contactId, parentContact ) ) + if ( !createContact( contactId, tqparentContact ) ) { - delete parentContact; + delete tqparentContact; return 0L; } } - ContactList::self()->addMetaContact( parentContact ); - return parentContact; + ContactList::self()->addMetaContact( tqparentContact ); + return tqparentContact; } -bool Account::addContact(const TQString &contactId , MetaContact *parent, AddMode mode ) +bool Account::addContact(const TQString &contactId , MetaContact *tqparent, AddMode mode ) { if ( contactId == myself()->contactId() ) { KMessageBox::error( Kopete::UI::Global::mainWidget(), - i18n("You are not allowed to add yourself to the contact list. The addition of \"%1\" to account \"%2\" will not take place.").arg(contactId,accountId()), i18n("Error Creating Contact") + i18n("You are not allowed to add yourself to the contact list. The addition of \"%1\" to account \"%2\" will not take place.").tqarg(contactId,accountId()), i18n("Error Creating Contact") ); return 0L; } - bool isTemporary= parent->isTemporary(); + bool isTemporary= tqparent->isTemporary(); Contact *c = d->contacts[ contactId ]; if ( c && c->metaContact() ) { @@ -336,23 +336,23 @@ bool Account::addContact(const TQString &contactId , MetaContact *parent, AddMod "Account::addContact: You are trying to add an existing temporary contact. Just add it on the list" << endl; //setMetaContact ill take care about the deletion of the old contact - c->setMetaContact(parent); + c->setMetaContact(tqparent); return true; } else { - // should we here add the contact to the parentContact if any? + // should we here add the contact to the tqparentContact if any? kdDebug( 14010 ) << "Account::addContact: Contact already exists" << endl; } return false; //(the contact is not in the correct metacontact, so false) } - bool success = createContact(contactId, parent); + bool success = createContact(contactId, tqparent); if ( success && mode == ChangeKABC ) { kdDebug( 14010 ) << k_funcinfo << " changing KABC" << endl; - KABCPersistence::self()->write( parent ); + KABCPersistence::self()->write( tqparent ); } return success; @@ -361,11 +361,11 @@ bool Account::addContact(const TQString &contactId , MetaContact *parent, AddMod KActionMenu * Account::actionMenu() { //default implementation - KActionMenu *menu = new KActionMenu( accountId(), myself()->onlineStatus().iconFor( this ), this ); + KActionMenu *menu = new KActionMenu( accountId(), myself()->onlinetqStatus().iconFor( this ), this ); 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 ) + menu->popupMenu()->insertTitle( myself()->onlinetqStatus().iconFor( myself() ), + nick.isNull() ? accountLabel() : i18n( "%2 <%1>" ).tqarg( accountLabel(), nick ) ); OnlineStatusManager::self()->createAccountStatusActions(this, menu); @@ -383,7 +383,7 @@ bool Account::isConnected() const bool Account::isAway() const { - return d->myself && ( d->myself->onlineStatus().status() == Kopete::OnlineStatus::Away ); + return d->myself && ( d->myself->onlinetqStatus().status() == Kopete::OnlineStatus::Away ); } Contact * Account::myself() const @@ -417,12 +417,12 @@ void Account::setMyself( Contact *myself ) } void Account::slotOnlineStatusChanged( Contact * /* contact */, - const OnlineStatus &newStatus, const OnlineStatus &oldStatus ) + const OnlineStatus &newtqStatus, const OnlineStatus &oldtqStatus ) { - bool wasOffline = !oldStatus.isDefinitelyOnline(); - bool isOffline = !newStatus.isDefinitelyOnline(); + bool wasOffline = !oldtqStatus.isDefinitelyOnline(); + bool isOffline = !newtqStatus.isDefinitelyOnline(); - if ( wasOffline || newStatus.status() == OnlineStatus::Offline ) + if ( wasOffline || newtqStatus.status() == OnlineStatus::Offline ) { // Wait for five seconds until we treat status notifications for contacts // as unrelated to our own status change. @@ -437,19 +437,19 @@ void Account::slotOnlineStatusChanged( Contact * /* contact */, if ( !isOffline ) { - d->restoreStatus = newStatus; + d->restoretqStatus = newtqStatus; d->restoreMessage = myself()->property( Kopete::Global::Properties::self()->awayMessage() ).value().toString(); -// kdDebug( 14010 ) << k_funcinfo << "account " << d->id << " restoreStatus " << d->restoreStatus.status() << " restoreMessage " << d->restoreMessage << endl; +// kdDebug( 14010 ) << k_funcinfo << "account " << d->id << " restoretqStatus " << d->restoretqStatus.status() << " restoreMessage " << d->restoreMessage << endl; } /* kdDebug(14010) << k_funcinfo << "account " << d->id << " changed status. was " - << Kopete::OnlineStatus::statusTypeToString(oldStatus.status()) << ", is " - << Kopete::OnlineStatus::statusTypeToString(newStatus.status()) << endl;*/ + << Kopete::OnlineStatus::statusTypeToString(oldtqStatus.status()) << ", is " + << Kopete::OnlineStatus::statusTypeToString(newtqStatus.status()) << endl;*/ if ( wasOffline != isOffline ) emit isConnectedChanged(); } -void Account::setAllContactsStatus( const Kopete::OnlineStatus &status ) +void Account::setAllContactstqStatus( const Kopete::OnlineStatus &status ) { d->suppressStatusNotification = true; d->suppressStatusTimer.start( 5000, true ); @@ -462,7 +462,7 @@ void Account::setAllContactsStatus( const Kopete::OnlineStatus &status ) void Account::slotContactPropertyChanged( Contact * /* contact */, const TQString &key, const TQVariant &old, const TQVariant &newVal ) { - if ( key == TQString::fromLatin1("awayMessage") && old != newVal && isConnected() ) + if ( key == TQString::tqfromLatin1("awayMessage") && old != newVal && isConnected() ) { d->restoreMessage = newVal.toString(); // kdDebug( 14010 ) << k_funcinfo << "account " << d->id << " restoreMessage " << d->restoreMessage << endl; @@ -508,9 +508,9 @@ bool Account::isBlocked( const TQString &contactId ) return d->blackList->isBlocked( contactId ); } -void Account::editAccount(TQWidget *parent) +void Account::editAccount(TQWidget *tqparent) { - KDialogBase *editDialog = new KDialogBase( parent, "KopeteAccountConfig::editDialog", true, + KDialogBase *editDialog = new KDialogBase( tqparent, "KopeteAccountConfig::editDialog", true, i18n( "Edit Account" ), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, true ); @@ -518,7 +518,7 @@ void Account::editAccount(TQWidget *parent) if ( !m_accountWidget ) return; - // FIXME: Why the #### is EditAccountWidget not a QWidget?!? This sideways casting + // FIXME: Why the #### is EditAccountWidget not a TQWidget?!? 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 TQWidget instead? @@ -550,7 +550,7 @@ TQString Account::pluginData( Plugin* /*plugin*/, const TQString &key ) const void Account::setAway(bool away, const TQString& reason) { - setOnlineStatus( OnlineStatusManager::self()->onlineStatus(protocol() , away ? OnlineStatusManager::Away : OnlineStatusManager::Online) , reason ); + setOnlineStatus( OnlineStatusManager::self()->onlinetqStatus(protocol() , away ? OnlineStatusManager::Away : OnlineStatusManager::Online) , reason ); } void Account::setCustomIcon( const TQString & i) |