summaryrefslogtreecommitdiffstats
path: root/kopete/libkopete/kopetecontact.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/kopetecontact.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/kopetecontact.cpp')
-rw-r--r--kopete/libkopete/kopetecontact.cpp136
1 files changed, 68 insertions, 68 deletions
diff --git a/kopete/libkopete/kopetecontact.cpp b/kopete/libkopete/kopetecontact.cpp
index 546958ef..5dc2871d 100644
--- a/kopete/libkopete/kopetecontact.cpp
+++ b/kopete/libkopete/kopetecontact.cpp
@@ -63,7 +63,7 @@ struct Contact::Private
public:
bool fileCapable;
- OnlineStatus onlineStatus;
+ OnlineStatus onlinetqStatus;
Account *account;
MetaContact *metaContact;
@@ -79,15 +79,15 @@ public:
};
Contact::Contact( Account *account, const TQString &contactId,
- MetaContact *parent, const TQString &icon )
- : TQObject( parent )
+ MetaContact *tqparent, const TQString &icon )
+ : TQObject( tqparent )
{
d = new Private;
//kdDebug( 14010 ) << k_funcinfo << "Creating contact with id " << contactId << endl;
d->contactId = contactId;
- d->metaContact = parent;
+ d->metaContact = tqparent;
d->fileCapable = false;
d->account = account;
d->idleTime = 0;
@@ -101,15 +101,15 @@ Contact::Contact( Account *account, const TQString &contactId,
connect( account, TQT_SIGNAL( isConnectedChanged() ), TQT_SLOT( slotAccountIsConnectedChanged() ) );
}
- // Need to check this because myself() may have no parent
+ // Need to check this because myself() may have no tqparent
// Maybe too the metaContact doesn't have a valid protocol()
// (ex: for unit tests or chat window style preview)
- if( parent && protocol() )
+ if( tqparent && protocol() )
{
- connect( parent, TQT_SIGNAL( aboutToSave( Kopete::MetaContact * ) ),
+ connect( tqparent, TQT_SIGNAL( aboutToSave( Kopete::MetaContact * ) ),
protocol(), TQT_SLOT( slotMetaContactAboutToSave( Kopete::MetaContact * ) ) );
- parent->addContact( this );
+ tqparent->addContact( this );
}
@@ -124,45 +124,45 @@ Contact::~Contact()
-OnlineStatus Contact::onlineStatus() const
+OnlineStatus Contact::onlinetqStatus() const
{
if ( this == account()->myself() || account()->isConnected() )
- return d->onlineStatus;
+ return d->onlinetqStatus;
else
- return protocol()->accountOfflineStatus();
+ return protocol()->accountOfflinetqStatus();
}
void Contact::setOnlineStatus( const OnlineStatus &status )
{
- if( status == d->onlineStatus )
+ if( status == d->onlinetqStatus )
return;
- OnlineStatus oldStatus = d->onlineStatus;
- d->onlineStatus = status;
+ OnlineStatus oldtqStatus = d->onlinetqStatus;
+ d->onlinetqStatus = status;
Kopete::Global::Properties *globalProps = Kopete::Global::Properties::self();
// Contact changed from Offline to another status
- if( oldStatus.status() == OnlineStatus::Offline &&
+ if( oldtqStatus.status() == OnlineStatus::Offline &&
status.status() != OnlineStatus::Offline )
{
- setProperty( globalProps->onlineSince(), TQDateTime::currentDateTime() );
+ setProperty( globalProps->onlineSince(), TQDateTime::tqcurrentDateTime() );
/*kdDebug(14010) << k_funcinfo << "REMOVING lastSeen property for " <<
d->displayName << endl;*/
removeProperty( globalProps->lastSeen() );
}
- else if( oldStatus.status() != OnlineStatus::Offline &&
- oldStatus.status() != OnlineStatus::Unknown &&
+ else if( oldtqStatus.status() != OnlineStatus::Offline &&
+ oldtqStatus.status() != OnlineStatus::Unknown &&
status.status() == OnlineStatus::Offline ) // Contact went back offline
{
removeProperty( globalProps->onlineSince() );
/*kdDebug(14010) << k_funcinfo << "SETTING lastSeen property for " <<
d->displayName << endl;*/
- setProperty( globalProps->lastSeen(), TQDateTime::currentDateTime() );
+ setProperty( globalProps->lastSeen(), TQDateTime::tqcurrentDateTime() );
}
if ( this == account()->myself() || account()->isConnected() )
- emit onlineStatusChanged( this, status, oldStatus );
+ emit onlineStatusChanged( this, status, oldtqStatus );
}
void Contact::slotAccountIsConnectedChanged()
@@ -171,9 +171,9 @@ void Contact::slotAccountIsConnectedChanged()
return;
if ( account()->isConnected() )
- emit onlineStatusChanged( this, d->onlineStatus, protocol()->accountOfflineStatus() );
+ emit onlineStatusChanged( this, d->onlinetqStatus, protocol()->accountOfflinetqStatus() );
else
- emit onlineStatusChanged( this, protocol()->accountOfflineStatus(), d->onlineStatus );
+ emit onlineStatusChanged( this, protocol()->accountOfflinetqStatus(), d->onlinetqStatus );
}
@@ -202,15 +202,15 @@ KPopupMenu* Contact::popupMenu( ChatSession *manager )
TQString titleText;
TQString nick = property( Kopete::Global::Properties::self()->nickName() ).value().toString();
if( nick.isEmpty() )
- titleText = TQString::fromLatin1( "%1 (%2)" ).arg( contactId(), onlineStatus().description() );
+ titleText = TQString::tqfromLatin1( "%1 (%2)" ).tqarg( contactId(), onlinetqStatus().description() );
else
- titleText = TQString::fromLatin1( "%1 <%2> (%3)" ).arg( nick, contactId(), onlineStatus().description() );
+ titleText = TQString::tqfromLatin1( "%1 <%2> (%3)" ).tqarg( nick, contactId(), onlinetqStatus().description() );
menu->insertTitle( titleText );
if( metaContact() && metaContact()->isTemporary() && contactId() != account()->myself()->contactId() )
{
- KAction *actionAddContact = new KAction( i18n( "&Add to Your Contact List" ), TQString::fromLatin1( "add_user" ),
- 0, this, TQT_SLOT( slotAddContact() ), menu, "actionAddContact" );
+ KAction *actionAddContact = new KAction( i18n( "&Add to Your Contact List" ), TQString::tqfromLatin1( "add_user" ),
+ 0, TQT_TQOBJECT(this), TQT_SLOT( slotAddContact() ), TQT_TQOBJECT(menu), "actionAddContact" );
actionAddContact->plug( menu );
menu->insertSeparator();
}
@@ -219,15 +219,15 @@ KPopupMenu* Contact::popupMenu( ChatSession *manager )
bool reach = account()->isConnected() && isReachable();
bool myself = (this == account()->myself());
- KAction *actionSendMessage = KopeteStdAction::sendMessage( this, TQT_SLOT( sendMessage() ), menu, "actionSendMessage" );
+ KAction *actionSendMessage = KopeteStdAction::sendMessage( TQT_TQOBJECT(this), TQT_SLOT( sendMessage() ), TQT_TQOBJECT(menu), "actionSendMessage" );
actionSendMessage->setEnabled( reach && !myself );
actionSendMessage->plug( menu );
- KAction *actionChat = KopeteStdAction::chat( this, TQT_SLOT( startChat() ), menu, "actionChat" );
+ KAction *actionChat = KopeteStdAction::chat( TQT_TQOBJECT(this), TQT_SLOT( startChat() ), TQT_TQOBJECT(menu), "actionChat" );
actionChat->setEnabled( reach && !myself );
actionChat->plug( menu );
- KAction *actionSendFile = KopeteStdAction::sendFile( this, TQT_SLOT( sendFile() ), menu, "actionSendFile" );
+ KAction *actionSendFile = KopeteStdAction::sendFile( TQT_TQOBJECT(this), TQT_SLOT( sendFile() ), TQT_TQOBJECT(menu), "actionSendFile" );
actionSendFile->setEnabled( reach && d->fileCapable && !myself );
actionSendFile->plug( menu );
@@ -248,9 +248,9 @@ KPopupMenu* Contact::popupMenu( ChatSession *manager )
menu->insertSeparator();
if( metaContact() && !metaContact()->isTemporary() )
- KopeteStdAction::changeMetaContact( this, TQT_SLOT( changeMetaContact() ), menu, "actionChangeMetaContact" )->plug( menu );
+ KopeteStdAction::changeMetaContact( TQT_TQOBJECT(this), TQT_SLOT( changeMetaContact() ), TQT_TQOBJECT(menu), "actionChangeMetaContact" )->plug( menu );
- KopeteStdAction::contactInfo( this, TQT_SLOT( slotUserInfo() ), menu, "actionUserInfo" )->plug( menu );
+ KopeteStdAction::contactInfo( TQT_TQOBJECT(this), TQT_SLOT( slotUserInfo() ), TQT_TQOBJECT(menu), "actionUserInfo" )->plug( menu );
#if 0 //this is not fully implemented yet (and doesn't work). disable for now - Olivier 2005-01-11
if ( account()->isBlocked( d->contactId ) )
@@ -260,7 +260,7 @@ KPopupMenu* Contact::popupMenu( ChatSession *manager )
#endif
if( metaContact() && !metaContact()->isTemporary() )
- KopeteStdAction::deleteContact( this, TQT_SLOT( slotDelete() ), menu, "actionDeleteContact" )->plug( menu );
+ KopeteStdAction::deleteContact( TQT_TQOBJECT(this), TQT_SLOT( slotDelete() ), TQT_TQOBJECT(menu), "actionDeleteContact" )->plug( menu );
return menu;
}
@@ -314,8 +314,8 @@ void Contact::setMetaContact( MetaContact *m )
{ //only one contact, including this one, that mean the contact will be empty efter the move
result = KMessageBox::questionYesNoCancel( Kopete::UI::Global::mainWidget(), i18n( "You are moving the contact `%1' to the meta contact `%2'.\n"
"`%3' will be empty afterwards. Do you want to delete this contact?" )
- .arg(contactId(), m ? m->displayName() : TQString::null, old->displayName())
- , i18n( "Move Contact" ), KStdGuiItem::del(), i18n( "&Keep" ) , TQString::fromLatin1("delete_old_contact_when_move") );
+ .tqarg(contactId(), m ? m->displayName() : TQString(), old->displayName())
+ , i18n( "Move Contact" ), KStdGuiItem::del(), i18n( "&Keep" ) , TQString::tqfromLatin1("delete_old_contact_when_move") );
if(result==KMessageBox::Cancel)
return;
}
@@ -368,7 +368,7 @@ void Contact::serializeProperties(TQMap<TQString, TQString> &serializedData)
continue;
TQVariant val = it.data().value();
- TQString key = TQString::fromLatin1("prop_%1_%2").arg(TQString::fromLatin1(val.typeName()), it.key());
+ TQString key = TQString::tqfromLatin1("prop_%1_%2").tqarg(TQString::tqfromLatin1(val.typeName()), it.key());
serializedData[key] = val.toString();
@@ -383,7 +383,7 @@ void Contact::deserializeProperties(
{
TQString key = it.key();
- if ( !key.startsWith( TQString::fromLatin1("prop_") ) ) // avoid parsing other serialized data
+ if ( !key.startsWith( TQString::tqfromLatin1("prop_") ) ) // avoid parsing other serialized data
continue;
TQStringList keyList = TQStringList::split( TQChar('_'), key, false );
@@ -419,20 +419,20 @@ bool Contact::isReachable()
{
// The default implementation returns false when offline and true
// otherwise. Subclass if you need more control over the process.
- return onlineStatus().status() != OnlineStatus::Offline;
+ return onlinetqStatus().status() != OnlineStatus::Offline;
}
void Contact::startChat()
{
- KopeteView *v=manager( CanCreate )->view(true, TQString::fromLatin1("kopete_chatwindow") );
+ KopeteView *v=manager( CanCreate )->view(true, TQString::tqfromLatin1("kopete_chatwindow") );
if(v)
v->raise(true);
}
void Contact::sendMessage()
{
- KopeteView *v=manager( CanCreate )->view(true, TQString::fromLatin1("kopete_emailwindow") );
+ KopeteView *v=manager( CanCreate )->view(true, TQString::tqfromLatin1("kopete_emailwindow") );
if(v)
v->raise(true);
}
@@ -458,8 +458,8 @@ void Contact::slotDelete()
{
if ( KMessageBox::warningContinueCancel( Kopete::UI::Global::mainWidget(),
i18n( "Are you sure you want to remove the contact '%1' from your contact list?" ).
- arg( d->contactId ), i18n( "Remove Contact" ), KGuiItem(i18n("Remove"), TQString::fromLatin1("delete_user") ),
- TQString::fromLatin1("askRemoveContact"), KMessageBox::Notify | KMessageBox::Dangerous )
+ arg( d->contactId ), i18n( "Remove Contact" ), KGuiItem(i18n("Remove"), TQString::tqfromLatin1("delete_user") ),
+ TQString::tqfromLatin1("askRemoveContact"), KMessageBox::Notify | KMessageBox::Dangerous )
== KMessageBox::Continue )
{
deleteContact();
@@ -524,7 +524,7 @@ TQPtrList<KAction> *Contact::customContextMenuActions( ChatSession * /* manager
bool Contact::isOnline() const
{
- return onlineStatus().isDefinitelyOnline();
+ return onlinetqStatus().isDefinitelyOnline();
}
@@ -575,7 +575,7 @@ TQStringList Contact::properties() const
bool Contact::hasProperty(const TQString &key) const
{
- return d->properties.contains(key);
+ return d->properties.tqcontains(key);
}
const ContactProperty &Contact::property(const TQString &key) const
@@ -645,8 +645,8 @@ TQString Contact::toolTip() const
// --------------------------------------------------------------------------
// Fixed part of tooltip
- TQString iconName = TQString::fromLatin1("kopete-contact-icon:%1:%2:%3")
- .arg( KURL::encode_string( protocol()->pluginId() ),
+ TQString iconName = TQString::tqfromLatin1("kopete-contact-icon:%1:%2:%3")
+ .tqarg( KURL::encode_string( protocol()->pluginId() ),
KURL::encode_string( account()->accountId() ),
KURL::encode_string( contactId() ) );
@@ -656,14 +656,14 @@ TQString Contact::toolTip() const
{
tip = i18n( "<b>DISPLAY NAME</b><br><img src=\"%2\">&nbsp;CONTACT STATUS",
"<b><nobr>%3</nobr></b><br><img src=\"%2\">&nbsp;%1" ).
- arg( Kopete::Message::escape( onlineStatus().description() ), iconName,
+ arg( Kopete::Message::escape( onlinetqStatus().description() ), iconName,
Kopete::Message::escape( d->contactId ) );
}
else
{
tip = i18n( "<b>DISPLAY NAME</b> (CONTACT ID)<br><img src=\"%2\">&nbsp;CONTACT STATUS",
"<nobr><b>%4</b> (%3)</nobr><br><img src=\"%2\">&nbsp;%1" ).
- arg( Kopete::Message::escape( onlineStatus().description() ), iconName,
+ arg( Kopete::Message::escape( onlinetqStatus().description() ), iconName,
Kopete::Message::escape( contactId() ),
Kopete::Emoticons::parseEmoticons( Kopete::Message::escape( nick ) ) );
}
@@ -673,25 +673,25 @@ TQString Contact::toolTip() const
for(TQStringList::Iterator it=shownProps.begin(); it!=shownProps.end(); ++it)
{
- if((*it) == TQString::fromLatin1("FormattedName"))
+ if((*it) == TQString::tqfromLatin1("FormattedName"))
{
TQString name = formattedName();
if(!name.isEmpty())
{
tip += i18n("<br><b>Full Name:</b>&nbsp;FORMATTED NAME",
- "<br><b>Full Name:</b>&nbsp;<nobr>%1</nobr>").arg(TQStyleSheet::escape(name));
+ "<br><b>Full Name:</b>&nbsp;<nobr>%1</nobr>").tqarg(TQStyleSheet::escape(name));
}
}
- else if ((*it) == TQString::fromLatin1("FormattedIdleTime"))
+ else if ((*it) == TQString::tqfromLatin1("FormattedIdleTime"))
{
TQString time = formattedIdleTime();
if(!time.isEmpty())
{
tip += i18n("<br><b>Idle:</b>&nbsp;FORMATTED IDLE TIME",
- "<br><b>Idle:</b>&nbsp;<nobr>%1</nobr>").arg(time);
+ "<br><b>Idle:</b>&nbsp;<nobr>%1</nobr>").tqarg(time);
}
}
- else if ((*it) == TQString::fromLatin1("homePage"))
+ else if ((*it) == TQString::tqfromLatin1("homePage"))
{
TQString url = property(*it).value().toString();
if(!url.isEmpty())
@@ -701,7 +701,7 @@ TQString Contact::toolTip() const
arg( KURL::encode_string( url ), Kopete::Message::escape( TQStyleSheet::escape(url) ) );
}
}
- else if ((*it) == TQString::fromLatin1("awayMessage"))
+ else if ((*it) == TQString::tqfromLatin1("awayMessage"))
{
TQString awaymsg = property(*it).value().toString();
if(!awaymsg.isEmpty())
@@ -755,21 +755,21 @@ TQString Contact::toolTip() const
TQString Kopete::Contact::formattedName() const
{
- if( hasProperty(TQString::fromLatin1("FormattedName")) )
- return property(TQString::fromLatin1("FormattedName")).value().toString();
+ if( hasProperty(TQString::tqfromLatin1("FormattedName")) )
+ return property(TQString::tqfromLatin1("FormattedName")).value().toString();
TQString ret;
Kopete::ContactProperty first, last;
- first = property(TQString::fromLatin1("firstName"));
- last = property(TQString::fromLatin1("lastName"));
+ first = property(TQString::tqfromLatin1("firstName"));
+ last = property(TQString::tqfromLatin1("lastName"));
if(!first.isNull())
{
if(!last.isNull()) // contact has both first and last name
{
ret = i18n("firstName lastName", "%2 %1")
- .arg(last.value().toString())
- .arg(first.value().toString());
+ .tqarg(last.value().toString())
+ .tqarg(first.value().toString());
}
else // only first name set
{
@@ -804,23 +804,23 @@ TQString Kopete::Contact::formattedIdleTime() const
{
ret = i18n( "<days>d <hours>h <minutes>m <seconds>s",
"%4d %3h %2m %1s" )
- .arg( secs )
- .arg( mins )
- .arg( hours )
- .arg( days );
+ .tqarg( secs )
+ .tqarg( mins )
+ .tqarg( hours )
+ .tqarg( days );
}
else if ( hours != 0 )
{
ret = i18n( "<hours>h <minutes>m <seconds>s", "%3h %2m %1s" )
- .arg( secs )
- .arg( mins )
- .arg( hours );
+ .tqarg( secs )
+ .tqarg( mins )
+ .tqarg( hours );
}
else
{
ret = i18n( "<minutes>m <seconds>s", "%2m %1s" )
- .arg( secs )
- .arg( mins );
+ .tqarg( secs )
+ .tqarg( mins );
}
}
return ret;