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

List:       kopete-devel
Subject:    Re: [kopete-devel] [PATCH] DCOP interface to change global nickname
From:       Michaël_Larouche <kuramadoushi.shock () globetrotter ! net>
Date:       2005-07-02 18:34:36
Message-ID: 200507021435.02839.kuramadoushi.shock () globetrotter ! net
[Download RAW message or body]

[Attachment #2 (multipart/signed)]

[Attachment #4 (multipart/mixed)]


Le July 2, 2005 02:33 pm, Michaël Larouche a écrit :
> This patch implements this wishlist:
> http://bugs.kde.org/show_bug.cgi?id=94591
>
> Add two methods to Kopete DCOP interface:
> 	/**
> 	 * set the global nickname if global identity is enabled.
> 	 * @param nickname the new global nickname
> 	 */
> 	void setGlobalNickname( const QString &nickname );
>
> 	/**
> 	 * set the global photo if global identity is enabled.
> 	 * @param photoUrl URL to the photo
> 	 */
> 	void setGlobalPhoto( const KURL &photoUrl );

D'oh, forget to attach the patch !
-- 
Michaël Larouche (Shock The Dark Mage)
The C++ programmer on dial-up :P
--------------------------------------
Blog: http://mlarouche.blogspot.com/
MSN: shock@shockdev.ca.tc
IRC: DarkShock
Jabber: darkshock@myjabber.net, darkshock@linux-quebec.org
AIM: darkshock19
Gadu-Gadu: 1172438
ICQ: 29644783
Yahoo: darkshock_TT



["kopete_globalidentity_dcop.patch" (text/x-diff)]

Index: kopeteiface.h
===================================================================
--- kopeteiface.h	(revision 430923)
+++ kopeteiface.h	(working copy)
@@ -144,6 +144,17 @@
 	 */
 	void setAutoAway();
 
+	/**
+	 * set the global nickname if global identity is enabled.
+	 * @param nickname the new global nickname
+	 */
+	void setGlobalNickname( const QString &nickname );
+
+	/**
+	 * set the global photo if global identity is enabled.
+	 * @param photoUrl URL to the photo
+	 */
+	void setGlobalPhoto( const KURL &photoUrl );
 };
 
 #endif
Index: kopeteiface.cpp
===================================================================
--- kopeteiface.cpp	(revision 430923)
+++ kopeteiface.cpp	(working copy)
@@ -31,6 +31,7 @@
 #include "kopeteaway.h"
 #include "kopetegroup.h"
 #include "kopetecontact.h"
+#include "kopeteconfig.h"
 
 KopeteIface::KopeteIface() : DCOPObject( "KopeteIface" )
 {
@@ -286,5 +287,26 @@
 	Kopete::Away::getInstance()->setAutoAway();
 }
 
+void KopeteIface::setGlobalNickname( const QString &nickname )
+{
+	if( Kopete::Config::enableGlobalIdentity() )
+	{
+		Kopete::MetaContact *myselfMetaContact = Kopete::ContactList::self()->myself();
+		myselfMetaContact->setDisplayNameSource( Kopete::MetaContact::SourceCustom );
+		myselfMetaContact->setDisplayName( nickname );
+	}
+}
+
+void KopeteIface::setGlobalPhoto( const KURL &photoUrl )
+{
+	if( Kopete::Config::enableGlobalIdentity() )
+	{
+		Kopete::MetaContact *myselfMetaContact = Kopete::ContactList::self()->myself();
+		myselfMetaContact->setPhoto( photoUrl );
+		if( myselfMetaContact->photoSource() != Kopete::MetaContact::SourceCustom )
+			myselfMetaContact->setPhotoSource( Kopete::MetaContact::SourceCustom );
+	}
+}
+
 // vim: set noet ts=4 sts=4 sw=4:
 

[Attachment #8 (application/pgp-signature)]

_______________________________________________
kopete-devel mailing list
kopete-devel@kde.org
https://mail.kde.org/mailman/listinfo/kopete-devel


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

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