diff options
Diffstat (limited to 'kopete/kopete/contactlist/kopetemetacontactlvi.cpp')
-rw-r--r-- | kopete/kopete/contactlist/kopetemetacontactlvi.cpp | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/kopete/kopete/contactlist/kopetemetacontactlvi.cpp b/kopete/kopete/contactlist/kopetemetacontactlvi.cpp index 4bc67acd..2afe4fe9 100644 --- a/kopete/kopete/contactlist/kopetemetacontactlvi.cpp +++ b/kopete/kopete/contactlist/kopetemetacontactlvi.cpp @@ -22,7 +22,7 @@ #include <tqtimer.h> #include <tqvariant.h> #include <tqmime.h> -#include <stylesheet.h> +#include <tqstylesheet.h> #include "knotification.h" #include <kdebug.h> @@ -82,18 +82,18 @@ public: { // We begin with the meta contact display name at the top of the tooltip - TQString toolTip = TQString::fromLatin1("<qt><table cellpadding=\"0\" cellspacing=\"1\">"); + TQString toolTip = TQString::tqfromLatin1("<qt><table cellpadding=\"0\" cellspacing=\"1\">"); - toolTip += TQString::fromLatin1("<tr><td>"); + toolTip += TQString::tqfromLatin1("<tr><td>"); if ( ! metaContact->photo().isNull() ) { - TQString photoName = TQString::fromLatin1("kopete-metacontact-photo:%1").arg( KURL::encode_string( metaContact->metaContactId() )); + TQString photoName = TQString::tqfromLatin1("kopete-metacontact-photo:%1").tqarg( KURL::encode_string( metaContact->metaContactId() )); //TQMimeSourceFactory::defaultFactory()->setImage( "contactimg", metaContact->photo() ); - toolTip += TQString::fromLatin1("<img src=\"%1\">").arg( photoName ); + toolTip += TQString::tqfromLatin1("<img src=\"%1\">").tqarg( photoName ); } - toolTip += TQString::fromLatin1("</td><td>"); + toolTip += TQString::tqfromLatin1("</td><td>"); TQString displayName; Kopete::Emoticons *e = Kopete::Emoticons::self(); @@ -110,32 +110,32 @@ public: } } - toolTip += TQString::fromLatin1("<b><font size=\"+1\">%1</font></b><br><br>").arg( displayName ); + toolTip += TQString::tqfromLatin1("<b><font size=\"+1\">%1</font></b><br><br>").tqarg( displayName ); TQPtrList<Contact> contacts = metaContact->contacts(); if ( contacts.count() == 1 ) { - return toolTip + contacts.first()->toolTip() + TQString::fromLatin1("</td></tr></table></qt>"); + return toolTip + contacts.first()->toolTip() + TQString::tqfromLatin1("</td></tr></table></qt>"); } - toolTip += TQString::fromLatin1("<table>"); + toolTip += TQString::tqfromLatin1("<table>"); // We are over a metacontact with > 1 child contacts, and not over a specific contact - // Iterate through children and display a summary tooltip + // Iterate through tqchildren and display a summary tooltip for(Contact *c = contacts.first(); c; c = contacts.next()) { - TQString iconName = TQString::fromLatin1("kopete-contact-icon:%1:%2:%3") - .arg( KURL::encode_string( c->protocol()->pluginId() ), + TQString iconName = TQString::tqfromLatin1("kopete-contact-icon:%1:%2:%3") + .tqarg( KURL::encode_string( c->protocol()->pluginId() ), KURL::encode_string( c->account()->accountId() ), KURL::encode_string( c->contactId() ) ); toolTip += i18n("<tr><td>STATUS ICON <b>PROTOCOL NAME</b> (ACCOUNT NAME)</td><td>STATUS DESCRIPTION</td></tr>", "<tr><td><img src=\"%1\"> <nobr><b>%2</b></nobr> <nobr>(%3)</nobr></td><td align=\"right\"><nobr>%4</nobr></td></tr>") - .arg( iconName, Kopete::Emoticons::parseEmoticons(c->property(Kopete::Global::Properties::self()->nickName()).value().toString()) , c->contactId(), c->onlineStatus().description() ); + .tqarg( iconName, Kopete::Emoticons::parseEmoticons(c->property(Kopete::Global::Properties::self()->nickName()).value().toString()) , c->contactId(), c->onlinetqStatus().description() ); } - return toolTip + TQString::fromLatin1("</table></td></tr></table></qt>"); + return toolTip + TQString::tqfromLatin1("</table></td></tr></table></qt>"); } private: MetaContact *metaContact; @@ -212,7 +212,7 @@ void KopeteMetaContactLVI::initLVI() d->toolTipSource.reset( new ListView::MetaContactToolTipSource( m_metaContact ) ); - m_oldStatus = m_metaContact->status(); + m_oldtqStatus = m_metaContact->status(); connect( m_metaContact, TQT_SIGNAL( displayNameChanged( const TQString &, const TQString & ) ), TQT_SLOT( slotDisplayNameChanged() ) ); @@ -254,7 +254,7 @@ void KopeteMetaContactLVI::initLVI() mIsBlinkIcon = false; //if ( !mBlinkIcon ) - // mBlinkIcon = new TQPixmap( KGlobal::iconLoader()->loadIcon( TQString::fromLatin1( "newmsg" ), KIcon::Small ) ); + // mBlinkIcon = new TQPixmap( KGlobal::iconLoader()->loadIcon( TQString::tqfromLatin1( "newmsg" ), KIcon::Small ) ); slotConfigChanged(); // this calls slotIdleStateChanged(), which sets up the constituent components, spacing, fonts and indirectly, the contact icon slotDisplayNameChanged(); @@ -363,18 +363,18 @@ void KopeteMetaContactLVI::slotContactStatusChanged( Kopete::Contact *c ) // multiple times if the user is in multiple groups - Jason // comparing the status of the previous and new preferred contact is the determining factor in deciding to notify - Kopete::OnlineStatus newStatus; + Kopete::OnlineStatus newtqStatus; if ( m_metaContact->preferredContact() ) - newStatus = m_metaContact->preferredContact()->onlineStatus(); + newtqStatus = m_metaContact->preferredContact()->onlinetqStatus(); else { // the last child contact has gone offline or otherwise unreachable, so take the changed contact's online status - newStatus = c->onlineStatus(); + newtqStatus = c->onlinetqStatus(); } // ensure we are not suppressing notifications, because connecting or disconnected if ( !(c->account()->suppressStatusNotification() - || ( c->account()->myself()->onlineStatus().status() == Kopete::OnlineStatus::Connecting ) + || ( c->account()->myself()->onlinetqStatus().status() == Kopete::OnlineStatus::Connecting ) || !c->account()->isConnected() ) ) { if ( !c->account()->isAway() || KopetePrefs::prefs()->soundIfAway() ) @@ -382,47 +382,47 @@ void KopeteMetaContactLVI::slotContactStatusChanged( Kopete::Contact *c ) //int winId = KopeteSystemTray::systemTray() ? KopeteSystemTray::systemTray()->winId() : 0; TQString text = i18n( "<qt><i>%1</i> is now %2.</qt>" ) - .arg( Kopete::Emoticons::parseEmoticons( TQStyleSheet::escape(m_metaContact->displayName()) ) , - TQStyleSheet::escape(c->onlineStatus().description())); + .tqarg( Kopete::Emoticons::parseEmoticons( TQStyleSheet::escape(m_metaContact->displayName()) ) , + TQStyleSheet::escape(c->onlinetqStatus().description())); // figure out what's happened - enum ChangeType { noChange, noEvent, signedIn, changedStatus, signedOut }; + enum ChangeType { noChange, noEvent, signedIn, changedtqStatus, signedOut }; ChangeType t = noChange; //kdDebug( 14000 ) << k_funcinfo << m_metaContact->displayName() << - //" - Old MC Status: " << m_oldStatus.status() << ", New MC Status: " << newStatus.status() << endl; + //" - Old MC Status: " << m_oldtqStatus.status() << ", New MC Status: " << newtqStatus.status() << endl; // first, exclude changes due to blocking or subscription changes at the protocol level - if ( ( m_oldStatus.status() == Kopete::OnlineStatus::Unknown - || newStatus.status() == Kopete::OnlineStatus::Unknown ) ) + if ( ( m_oldtqStatus.status() == Kopete::OnlineStatus::Unknown + || newtqStatus.status() == Kopete::OnlineStatus::Unknown ) ) t = noEvent; // This means the contact's changed from or to unknown - due to a protocol state change, not a contact state change else // we're dealing with a genuine contact state change { - if ( m_oldStatus.status() == Kopete::OnlineStatus::Offline ) + if ( m_oldtqStatus.status() == Kopete::OnlineStatus::Offline ) { - if ( newStatus.status() != Kopete::OnlineStatus::Offline ) + if ( newtqStatus.status() != Kopete::OnlineStatus::Offline ) { //kdDebug( 14000 ) << "signed in" << endl; t = signedIn; // contact has gone from offline to something else, it's a sign-in } } - else if ( m_oldStatus.status() == Kopete::OnlineStatus::Online - || m_oldStatus.status() == Kopete::OnlineStatus::Away - || m_oldStatus.status() == Kopete::OnlineStatus::Invisible) + else if ( m_oldtqStatus.status() == Kopete::OnlineStatus::Online + || m_oldtqStatus.status() == Kopete::OnlineStatus::Away + || m_oldtqStatus.status() == Kopete::OnlineStatus::Invisible) { - if ( newStatus.status() == Kopete::OnlineStatus::Offline ) + if ( newtqStatus.status() == Kopete::OnlineStatus::Offline ) { //kdDebug( 14000 ) << "signed OUT" << endl; t = signedOut; // contact has gone from an online state to an offline state, it's a sign out } - else if ( m_oldStatus > newStatus || m_oldStatus < newStatus ) // operator!= is useless because it's an identity operator, not an equivalence operator + else if ( m_oldtqStatus > newtqStatus || m_oldtqStatus < newtqStatus ) // operator!= is useless because it's an identity operator, not an equivalence operator { // contact has changed online states, it's a status change, // and the preferredContact changed status, or there is a new preferredContacat // so it's worth notifying //kdDebug( 14000 ) << "changed status" << endl; - t = changedStatus; + t = changedtqStatus; } } - else if ( m_oldStatus != newStatus ) + else if ( m_oldtqStatus != newtqStatus ) { //kdDebug( 14000 ) << "non-event" << endl; // catch-all for any other status change we don't know about @@ -441,7 +441,7 @@ void KopeteMetaContactLVI::slotContactStatusChanged( Kopete::Contact *c ) connect(KNotification::event(m_metaContact, "kopete_contact_online", text, m_metaContact->photo(), KopeteSystemTray::systemTray(), i18n( "Chat" )) , TQT_SIGNAL(activated(unsigned int )) , this, TQT_SLOT( execute() ) ); break; - case changedStatus: + case changedtqStatus: connect(KNotification::event(m_metaContact, "kopete_contact_status_change", text, m_metaContact->photo(), KopeteSystemTray::systemTray(), i18n( "Chat" )) , TQT_SIGNAL(activated(unsigned int )) , this, TQT_SLOT( execute() )); break; @@ -468,7 +468,7 @@ void KopeteMetaContactLVI::slotContactStatusChanged( Kopete::Contact *c ) } // make a note of the current status for the next time we get a status change - m_oldStatus = newStatus; + m_oldtqStatus = newtqStatus; if ( m_parentGroup ) m_parentGroup->refreshDisplayName(); @@ -802,9 +802,9 @@ void KopeteMetaContactLVI::updateVisibility() void KopeteMetaContactLVI::slotContactPropertyChanged( Kopete::Contact *contact, const TQString &key, const TQVariant &old, const TQVariant &newVal ) { -// if ( key == TQString::fromLatin1("awayMessage") ) +// if ( key == TQString::tqfromLatin1("awayMessage") ) // kdDebug( 14000 ) << k_funcinfo << "contact=" << contact->contactId() << ", isonline=" << contact->isOnline() << ", alloffline=" << !m_metaContact->isOnline() << ", oldvalue=" << old.toString() << ", newvalue=" << newVal.toString() << endl; - if ( key == TQString::fromLatin1("awayMessage") && d->extraText && old != newVal ) + if ( key == TQString::tqfromLatin1("awayMessage") && d->extraText && old != newVal ) { bool allOffline = !m_metaContact->isOnline(); if ( newVal.toString().isEmpty() || ( !contact->isOnline() && !allOffline ) ) @@ -839,7 +839,7 @@ void KopeteMetaContactLVI::slotContactPropertyChanged( Kopete::Contact *contact, d->extraText->setText( newVal.toString() ); } } // wtf? KopeteMetaContact also connects this signals and emits photoChanged! why no connect photoChanged to slotPhotoChanged? - /*else if ( key == TQString::fromLatin1("photo") && (m_metaContact->photoSourceContact() == contact) && (m_metaContact->photoSource() == Kopete::MetaContact::SourceContact)) + /*else if ( key == TQString::tqfromLatin1("photo") && (m_metaContact->photoSourceContact() == contact) && (m_metaContact->photoSource() == Kopete::MetaContact::SourceContact)) { slotPhotoChanged(); }*/ @@ -855,8 +855,8 @@ void KopeteMetaContactLVI::slotContactAdded( Kopete::Contact *c ) updateContactIcon( c ); - slotContactPropertyChanged( c, TQString::fromLatin1("awayMessage"), - TQVariant(), c->property( TQString::fromLatin1("awayMessage") ).value() ); + slotContactPropertyChanged( c, TQString::tqfromLatin1("awayMessage"), + TQVariant(), c->property( TQString::tqfromLatin1("awayMessage") ).value() ); } void KopeteMetaContactLVI::slotContactRemoved( Kopete::Contact *c ) @@ -870,8 +870,8 @@ void KopeteMetaContactLVI::slotContactRemoved( Kopete::Contact *c ) if ( ListView::Component *comp = contactComponent( c ) ) delete comp; - slotContactPropertyChanged( c, TQString::fromLatin1("awayMessage"), - c->property( TQString::fromLatin1("awayMessage") ).value(), TQVariant() ); + slotContactPropertyChanged( c, TQString::tqfromLatin1("awayMessage"), + c->property( TQString::tqfromLatin1("awayMessage") ).value(), TQVariant() ); } void KopeteMetaContactLVI::updateContactIcons() @@ -884,9 +884,9 @@ void KopeteMetaContactLVI::updateContactIcons() void KopeteMetaContactLVI::updateContactIcon( Kopete::Contact *c ) { - KGlobal::config()->setGroup( TQString::fromLatin1("ContactList") ); + KGlobal::config()->setGroup( TQString::tqfromLatin1("ContactList") ); bool bHideOffline = KGlobal::config()->readBoolEntry( - TQString::fromLatin1("HideOfflineContacts"), false ); + TQString::tqfromLatin1("HideOfflineContacts"), false ); if ( KopetePrefs::prefs()->showOffline() ) bHideOffline = false; |