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

List:       kde-commits
Subject:    kdenonbeta/kopete/libkopete
From:       Duncan Mac-Vicar Prett <duncan () kde ! org>
Date:       2003-07-10 4:19:03
[Download RAW message or body]

CVS commit by dmacvicar: 

o KABC compatible metacontact id. ( QString) randomly generated.


  M +8 -15     kopetemetacontact.cpp   1.164
  M +1 -1      kopetemetacontact.h   1.80


--- kdenonbeta/kopete/libkopete/kopetemetacontact.cpp  #1.163:1.164
@@ -20,5 +20,5 @@
 #include "kopetemetacontact.h"
 
-#include <qapplication.h>
+#include <kapplication.h>
 
 #include <kdebug.h>
@@ -49,14 +49,9 @@ struct KopeteMetaContactPrivate
         bool temporary;
 //      bool dirty;
-        ulong contactId;
+        QString contactId;
         KopeteOnlineStatus::OnlineStatus onlineStatus;
         KopeteMetaContact::IdleState    idleState;
-
-        //Unique contact id per metacontact
-        static ulong uniqueContactId;
 };
 
-ulong KopeteMetaContactPrivate::uniqueContactId = 0;
-
 KopeteMetaContact::KopeteMetaContact()
 : KopetePluginDataObject( KopeteContactList::contactList() )
@@ -69,5 +64,5 @@ KopeteMetaContact::KopeteMetaContact()
         d->onlineStatus = KopeteOnlineStatus::Offline;
         d->idleState = Unspecified;
-        d->contactId = 0;
+        d->contactId = QString();
 }
 
@@ -592,5 +587,5 @@ const QDomElement KopeteMetaContact::toX
         QDomDocument metaContact;
         metaContact.appendChild( metaContact.createElement( \
                QString::fromLatin1("meta-contact") ) );
-        metaContact.documentElement().setAttribute( \
QString::fromLatin1("contactId"), QString::number(contactId()) ); +        \
metaContact.documentElement().setAttribute( QString::fromLatin1("contactId"), \
contactId() );  
         QDomElement displayName = metaContact.createElement( \
QString::fromLatin1("display-name") ); @@ -644,7 +639,5 @@ bool \
KopeteMetaContact::fromXML( const Q  if( !strContactId.isEmpty() )
         {
-                d->contactId = strContactId.toULong();
-                if( d->contactId > d->uniqueContactId )
-                        d->uniqueContactId = d->contactId;
+                d->contactId = strContactId;
         }
 
@@ -770,8 +763,8 @@ KopeteMetaContact::IdleState KopeteMetaC
 }
 
-ulong KopeteMetaContact::contactId() const
+QString KopeteMetaContact::contactId() const
 {
-        if( d->contactId == 0 )
-                d->contactId = ++d->uniqueContactId;
+        if( (d->contactId).isEmpty() )
+                d->contactId = KApplication::randomString(10);
 
         return d->contactId;

--- kdenonbeta/kopete/libkopete/kopetemetacontact.h  #1.79:1.80
@@ -249,5 +249,5 @@ public:
          * Every metacontact has a unique id, set by kopete when creating the \
                contact, or reading the contactlist
          */
-        ulong contactId() const;
+        QString contactId() const;
 
         /**


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

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