[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.5/kdenetwork/kopete/kopete
From:       Will Stephenson <wstephenson () kde ! org>
Date:       2006-12-16 0:12:38
Message-ID: 1166227958.378482.12402.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 614008 by wstephens:

Highly important dcop methods - why didn't we think of these before?

 M  +24 -0     kopeteiface.cpp  
 M  +12 -0     kopeteiface.h  


--- branches/KDE/3.5/kdenetwork/kopete/kopete/kopeteiface.cpp #614007:614008
@@ -316,5 +316,29 @@
 	}
 }
 
+QStringList KopeteIface::contactsForDisplayName( const QString & displayName )
+{
+	Kopete::MetaContact * mc = Kopete::ContactList::self()->findMetaContactByDisplayName( displayName );
+	QStringList contactIds;
+	if ( mc )
+	{
+		QPtrList<Kopete::Contact> contacts = mc->contacts();
+		QPtrListIterator<Kopete::Contact> it( contacts );
+		for( ; it.current(); ++it )
+		{
+			contactIds.append( (*it)->contactId() );
+    	}
+    }
+	return contactIds;
+}
+
+QStringList KopeteIface::metacontactsForContactId( const QString & contactId )
+{
+	Kopete::MetaContact * mc = Kopete::ContactList::self()->findMetaContactByContactId( contactId );
+	if ( mc )
+		return QStringList( mc->displayName() );
+	else
+		return QStringList();
+}
 // vim: set noet ts=4 sts=4 sw=4:
 
--- branches/KDE/3.5/kdenetwork/kopete/kopete/kopeteiface.h #614007:614008
@@ -155,6 +155,18 @@
 	 * @param photoUrl URL to the photo
 	 */
 	void setGlobalPhoto( const KURL &photoUrl );
+    
+    /**
+     * get the contactIds for a given display name
+     * @param displayName
+     */
+    QStringList contactsForDisplayName( const QString & displayName );
+
+    /**
+     * get the metacontactIds that have the given contactId
+     * @param contactId
+     */
+    QStringList metacontactsForContactId( const QString & contactId );
 };
 
 #endif
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic