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

List:       kde-commits
Subject:    KDE/kdenetwork/kopete/protocols/messenger/libpapillon
From:       Michaƫl Larouche <larouche () kde ! org>
Date:       2006-12-22 4:06:31
Message-ID: 1166760391.039047.25499.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 615569 by mlarouche:

ContactList use Client as parent and added Client::contactList()

 M  +10 -1     client.cpp  
 M  +13 -3     contactlist.cpp  
 M  +11 -0     include/Papillon/client.h  
 M  +9 -1      include/Papillon/contactlist.h  
 M  +2 -2      include/Papillon/papillon_enums.h  


--- trunk/KDE/kdenetwork/kopete/protocols/messenger/libpapillon/client.cpp \
#615568:615569 @@ -27,6 +27,7 @@
 #include "Papillon/ClientStream"
 #include "Papillon/Transfer"
 #include "Papillon/MimeHeader"
+#include "Papillon/ContactList"
 
 // Papillon tasks
 #include "Papillon/Tasks/LoginTask"
@@ -44,7 +45,7 @@
 public:
 	Private()
 	 : connector(0), notificationConnection(0),
-	   server( QLatin1String("messenger.hotmail.com") ), port(1863),
+	   server( QLatin1String("messenger.hotmail.com") ), port(1863), contactList(0),
 	   loginTask(0), notifyMessageTask(0), notifyPresenceTask(0), \
notifyStatusMessageTask(0)  {}
 
@@ -60,6 +61,8 @@
 	// Convience object that init QCA.
 	QCA::Initializer qcaInit;
 
+	ContactList *contactList;
+
 	// All the tasks
 	LoginTask *loginTask;
 	NotifyMessageTask *notifyMessageTask;
@@ -71,6 +74,7 @@
  : QObject(parent), d(new Private)
 {
 	d->connector = connector;
+	d->contactList = new ContactList(this);
 }
 
 Client::~Client()
@@ -96,6 +100,11 @@
 	return newConnection;
 }
 
+ContactList *Client::contactList()
+{
+	return d->contactList;
+}
+
 void Client::connectToServer(const QString &server, quint16 port)
 {
 	if( !server.isEmpty() )
--- trunk/KDE/kdenetwork/kopete/protocols/messenger/libpapillon/contactlist.cpp \
#615568:615569 @@ -15,8 +15,11 @@
 #include "Papillon/ContactList"
 
 // Qt includes
-#include <QtXml/QDomDocument>
+#include <QtCore/QPointer>
 
+// Papillon includes
+#include "Papillon/Client"
+
 namespace Papillon 
 {
 
@@ -25,11 +28,14 @@
 public:
 	Private()
 	{}
+	
+	QPointer<Client> client;
 };
 
-ContactList::ContactList(QObject *parent)
- : QObject(parent), d(new Private)
+ContactList::ContactList(Client *client)
+ : QObject(client), d(new Private)
 {
+	d->client = client;
 }
 
 
@@ -38,6 +44,10 @@
 	delete d;
 }
 
+Client *ContactList::client()
+{
+	return d->client;
+}
 
 }
 
--- trunk/KDE/kdenetwork/kopete/protocols/messenger/libpapillon/include/Papillon/client.h \
#615568:615569 @@ -29,6 +29,7 @@
 class Transfer;
 class MimeHeader;
 class StatusMessage;
+class ContactList;
 
 // TODO APIDOX, add a reference about connector model.
 /**
@@ -86,6 +87,16 @@
 	 */
 	QString passportAuthTicket() const;
 
+	/**
+	 * @brief Get the contact list instance.
+	 *
+	 * Initially, the contact list isn't loaded. Fetching of the 
+	 * contact list will be called when necessary.
+	 *
+	 * @return the ContactList instance.
+	 */
+	ContactList *contactList();
+
 signals:
 	/**
 	 * Emitted when Client is connected, but not logged, to Windows Live Messenger's \
                service.
--- trunk/KDE/kdenetwork/kopete/protocols/messenger/libpapillon/include/Papillon/contactlist.h \
#615568:615569 @@ -23,6 +23,7 @@
 namespace Papillon 
 {
 
+class Client;
 /**
  * @brief Manage contact list.
  *
@@ -35,13 +36,20 @@
 	/**
 	 * @brief Create a new ContactList.
 	 */
-	ContactList(QObject *parent = 0);
+	ContactList(Client *client);
 	/**
 	 * d-tor
 	 */
 	~ContactList();
 
 private:
+	/**
+	 * Get the current instance of Client.
+	 * @return the current Client pointer.
+	 */
+	Client *client();
+
+private:
 	class Private;
 	Private *d;
 };
--- trunk/KDE/kdenetwork/kopete/protocols/messenger/libpapillon/include/Papillon/papillon_enums.h \
#615568:615569 @@ -22,7 +22,7 @@
 	/**
 	 * @brief Enums related to Contact list
 	 */
-	struct ContactList
+	struct ContactListEnums
 	{
 		/**
 		 * @brief Flags for the different contact list type.
@@ -37,7 +37,7 @@
 		};
 		Q_DECLARE_FLAGS(ContactListFlags, Type)
 	};
-	Q_DECLARE_OPERATORS_FOR_FLAGS( ContactList::ContactListFlags )
+	Q_DECLARE_OPERATORS_FOR_FLAGS( ContactListEnums::ContactListFlags )
 
 	/**
 	 * @brief Enums related to ClientInfo


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

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