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

List:       kde-commits
Subject:    kdenonbeta/kopete/protocols/oscar
From:       Tom Linsky <twl6 () po ! cwru ! edu>
Date:       2002-12-31 20:51:03
[Download RAW message or body]

CVS commit by linsky: 



Fixed bug 51213 (Metacontacts only remember one Oscar contact)


  M +3 -1      oscarcontact.cpp   1.36
  M +21 -10    oscarprotocol.cpp   1.39


--- kdenonbeta/kopete/protocols/oscar/oscarcontact.cpp  #1.35:1.36
@@ -562,6 +562,8 @@ QStringList OscarContact::removeTag ( QS
 }
 */
-void OscarContact::slotMoved(KopeteMetaContact * /*old */)
+void OscarContact::slotMoved(KopeteMetaContact * old )
 {
+        disconnect(old, SIGNAL(aboutToSave(KopeteMetaContact*)), 0, 0);
+
         connect (metaContact() , SIGNAL( aboutToSave(KopeteMetaContact*) ),
                 protocol(), SLOT (serialize(KopeteMetaContact*) ));

--- kdenonbeta/kopete/protocols/oscar/oscarprotocol.cpp  #1.38:1.39
@@ -524,13 +524,19 @@ void OscarProtocol::serialize( KopeteMet
 {
         QStringList strList;
-        KopeteContact *c;
-        for( c = metaContact->contacts().first(); c ; c = metaContact->contacts().next() )
+        QStringList stream;
+        QPtrList<KopeteContact> contacts = metaContact->contacts();
+        for( KopeteContact *c = contacts.first(); c ; c = contacts.next() )
         {
-                if( c->protocol()->pluginId() == this->pluginId() ){
-                        OscarContact *g = static_cast<OscarContact*>(c);
-                        strList << g->contactId() << g->data();
+                if ( c->protocol()->pluginId() != this->pluginId() ) // not our contact, next one please
+                                continue;
+
+                OscarContact *m = dynamic_cast<OscarContact*>(c);
+
+                if( m )
+                {
+                        stream << m->contactId() << m->displayName();
                 }
         }
-        metaContact->setPluginData(this , strList);
+        metaContact->setPluginData(this , stream);
 }
 
@@ -544,8 +550,13 @@ void OscarProtocol::deserialize( KopeteM
         kdDebug() << "[OscarProtocol] in deserialize, strList[0]: " << strList[0] << endl;
 
+        for ( QStringList::ConstIterator it = strList.begin(); it != strList.end(); ++it )
+        {
         QString group= "Unknow";
         if(!metaContact->groups().isEmpty())
                 group=metaContact->groups().first()->displayName();
-        addNewContact(strList[0], strList[1], strList[1].isEmpty() ? false : true, group, metaContact);
+                QString tmpstr = *it;
+                it++;
+                addNewContact(tmpstr, *it, ( *it ).isEmpty() ? false : true, group, metaContact);
+        }
 }
 


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

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