Hello,

I have had free time and created two patches for kopete's gadugadu plugin. For 
bugs:
163541: Setting description in Gadu plugin makes it go offline
184696: Gadu-gadu has problems with contact list

The first one fixes setting of description (currently it goes offline for every 
status but for offline status it goes... online!) It's my old patch but hasn't 
been committed...
The second one is more important is at fixes bad handling of gadugadu import 
contact list, which after couple of reconnects make a lot of dead and empty 
contacts in kopete contact list. Whole trouble is because the of the one line 
in imported gadu contact list (it always starts with GG70ExportString; and is 
just a list of groups) so I wrote a patch to ignore it.

I'm using both patches and haven't notice any troubles.

BTW Does gadugadu plugin have any active development? I'm asking because new 
libgadu-1.9.0-rc1 was released today, which brings support for new protocol in 
gadugadu (UTF8 support, new statuses). Are there any plans to introduce it in 
kopete? If not I would like to do it and also deal with couple of most 
irritating bugs in gadugadu protocol (ex. not working public directory search 
since kopete3! - honestly I'm working on it right know). 

Jakub Grandys - Pennguin
Index: kopete/protocols/gadu/gaduaway.cpp
===================================================================
--- kopete/protocols/gadu/gaduaway.cpp	(wersja 1019689)
+++ kopete/protocols/gadu/gaduaway.cpp	(kopia robocza)
@@ -29,7 +29,6 @@
 #include <ktextedit.h>
 #include <klocale.h>
 
-#include <q3buttongroup.h>
 #include <qradiobutton.h>
 #include <qlineedit.h>
 
@@ -49,18 +48,24 @@
 	ui_->setupUi( w );
 	setMainWidget( w );
 
+	ui_->buttonGroup_->setId(ui_->onlineButton_, GG_STATUS_AVAIL_DESCR);
+	ui_->buttonGroup_->setId(ui_->awayButton_, GG_STATUS_BUSY_DESCR);
+	ui_->buttonGroup_->setId(ui_->invisibleButton_, GG_STATUS_INVISIBLE_DESCR);
+	ui_->buttonGroup_->setId(ui_->offlineButton_, GG_STATUS_NOT_AVAIL_DESCR);
+	
+	
 	ks = account->myself()->onlineStatus();
 	s  = GaduProtocol::protocol()->statusToWithDescription( ks );
 
 	if ( s == GG_STATUS_NOT_AVAIL_DESCR ) {
-		ui_->statusGroup_->find( GG_STATUS_NOT_AVAIL_DESCR )->setDisabled( true );
-		ui_->statusGroup_->setButton( GG_STATUS_AVAIL_DESCR );
+		ui_->buttonGroup_->button( GG_STATUS_NOT_AVAIL_DESCR )->setDisabled( true );
+		ui_->buttonGroup_->button( GG_STATUS_AVAIL_DESCR)->setChecked(true);
 	}
 	else {
-		ui_->statusGroup_->setButton( s );
+		ui_->buttonGroup_->button( s )->setChecked(true);
 	}
 
-	ui_->textEdit_->setText( account->myself()->property( "awayMessage" ).value().toString() );
+	ui_->textEdit_->setText( account->myself()->property( "statusMessage" ).value().toString() );
 	connect( this, SIGNAL( applyClicked() ), SLOT( slotApply() ) );
 }
 
@@ -72,7 +77,7 @@
 int
 GaduAway::status() const
 {
-	return ui_->statusGroup_->id( ui_->statusGroup_->selected() );
+	return ui_->buttonGroup_->checkedId();
 }
 
 QString
Index: kopete/protocols/gadu/ui/gaduawayui.ui
===================================================================
--- kopete/protocols/gadu/ui/gaduawayui.ui	(wersja 1019689)
+++ kopete/protocols/gadu/ui/gaduawayui.ui	(kopia robocza)
@@ -1,155 +1,123 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>GaduAwayUI</class>
- <widget class="QWidget" name="GaduAwayUI" >
-  <property name="geometry" >
+ <widget class="QWidget" name="GaduAwayUI">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>332</width>
-    <height>188</height>
+    <height>200</height>
    </rect>
   </property>
-  <property name="focusPolicy" >
+  <property name="focusPolicy">
    <enum>Qt::TabFocus</enum>
   </property>
-  <property name="windowTitle" >
+  <property name="windowTitle">
    <string>Away Dialog</string>
   </property>
-  <layout class="QGridLayout" >
-   <property name="leftMargin" >
+  <layout class="QGridLayout">
+   <property name="margin">
     <number>0</number>
    </property>
-   <property name="topMargin" >
-    <number>0</number>
-   </property>
-   <property name="rightMargin" >
-    <number>0</number>
-   </property>
-   <property name="bottomMargin" >
-    <number>0</number>
-   </property>
-   <property name="horizontalSpacing" >
+   <property name="spacing">
     <number>6</number>
    </property>
-   <property name="verticalSpacing" >
-    <number>6</number>
-   </property>
-   <item row="0" column="0" >
-    <layout class="QVBoxLayout" >
-     <property name="spacing" >
+   <item row="0" column="0">
+    <layout class="QVBoxLayout">
+     <property name="spacing">
       <number>6</number>
      </property>
-     <property name="leftMargin" >
+     <property name="margin">
       <number>0</number>
      </property>
-     <property name="topMargin" >
-      <number>0</number>
-     </property>
-     <property name="rightMargin" >
-      <number>0</number>
-     </property>
-     <property name="bottomMargin" >
-      <number>0</number>
-     </property>
      <item>
-      <widget class="Q3ButtonGroup" name="statusGroup_" >
-       <property name="whatsThis" >
+      <widget class="QGroupBox" name="statusGroup_">
+       <property name="whatsThis">
         <string>Choose a status; by default Online status is selected. 
 So all you need to do is just to type in your description. 
 Choosing Offline status will disconnect you, with given description.</string>
        </property>
-       <property name="title" >
+       <property name="title">
         <string>Status</string>
        </property>
-       <property name="orientation" >
-        <enum>Qt::Vertical</enum>
-       </property>
-       <layout class="QGridLayout" >
-        <property name="leftMargin" >
+       <layout class="QGridLayout">
+        <property name="margin">
          <number>11</number>
         </property>
-        <property name="topMargin" >
-         <number>11</number>
-        </property>
-        <property name="rightMargin" >
-         <number>11</number>
-        </property>
-        <property name="bottomMargin" >
-         <number>11</number>
-        </property>
-        <property name="horizontalSpacing" >
+        <property name="spacing">
          <number>6</number>
         </property>
-        <property name="verticalSpacing" >
-         <number>6</number>
-        </property>
-        <item row="0" column="0" >
-         <layout class="QVBoxLayout" >
-          <property name="spacing" >
+        <item row="0" column="0">
+         <layout class="QVBoxLayout">
+          <property name="spacing">
            <number>6</number>
           </property>
-          <property name="leftMargin" >
+          <property name="margin">
            <number>0</number>
           </property>
-          <property name="topMargin" >
-           <number>0</number>
-          </property>
-          <property name="rightMargin" >
-           <number>0</number>
-          </property>
-          <property name="bottomMargin" >
-           <number>0</number>
-          </property>
           <item>
-           <widget class="QRadioButton" name="onlineButton_" >
-            <property name="toolTip" >
+           <widget class="QRadioButton" name="onlineButton_">
+            <property name="toolTip">
              <string>Set your status to Online.</string>
             </property>
-            <property name="whatsThis" >
+            <property name="whatsThis">
              <string>Set your status to Online, indicating that you are available to chat with anyone who wishes.</string>
             </property>
-            <property name="text" >
+            <property name="text">
              <string>O&amp;nline</string>
             </property>
+            <attribute name="buttonGroup">
+             <string>buttonGroup_</string>
+            </attribute>
            </widget>
           </item>
           <item>
-           <widget class="QRadioButton" name="awayButton_" >
-            <property name="toolTip" >
+           <widget class="QRadioButton" name="awayButton_">
+            <property name="toolTip">
              <string>Set your status to busy.</string>
             </property>
-            <property name="whatsThis" >
+            <property name="whatsThis">
              <string>Set your status to busy, indicating that you should not be bothered with trivial chat, and may not be able to reply immediately.</string>
             </property>
-            <property name="text" >
+            <property name="text">
              <string>&amp;Busy</string>
             </property>
+            <attribute name="buttonGroup">
+             <string>buttonGroup_</string>
+            </attribute>
            </widget>
           </item>
           <item>
-           <widget class="QRadioButton" name="invisibleButton_" >
-            <property name="toolTip" >
+           <widget class="QRadioButton" name="invisibleButton_">
+            <property name="toolTip">
              <string>Set status to invisible, which will hide your presence from other users.</string>
             </property>
-            <property name="whatsThis" >
+            <property name="whatsThis">
              <string>Set status to invisible, which will hide your presence from other users (who will see you as offline).  However you may still chat, and see the online presence of others.</string>
             </property>
-            <property name="text" >
+            <property name="text">
              <string>&amp;Invisible</string>
             </property>
+            <attribute name="buttonGroup">
+             <string>buttonGroup_</string>
+            </attribute>
            </widget>
           </item>
           <item>
-           <widget class="QRadioButton" name="offlineButton_" >
-            <property name="toolTip" >
+           <widget class="QRadioButton" name="offlineButton_">
+            <property name="toolTip">
              <string>Choose this status to disconnect with the description entered below.</string>
             </property>
-            <property name="whatsThis" >
+            <property name="whatsThis">
              <string>Choose this status to disconnect with the description entered below.</string>
             </property>
-            <property name="text" >
+            <property name="text">
              <string>O&amp;ffline</string>
             </property>
+            <attribute name="buttonGroup">
+             <string>buttonGroup_</string>
+            </attribute>
            </widget>
           </item>
          </layout>
@@ -158,50 +126,41 @@
       </widget>
      </item>
      <item>
-      <layout class="QHBoxLayout" >
-       <property name="spacing" >
+      <layout class="QHBoxLayout">
+       <property name="spacing">
         <number>6</number>
        </property>
-       <property name="leftMargin" >
+       <property name="margin">
         <number>0</number>
        </property>
-       <property name="topMargin" >
-        <number>0</number>
-       </property>
-       <property name="rightMargin" >
-        <number>0</number>
-       </property>
-       <property name="bottomMargin" >
-        <number>0</number>
-       </property>
        <item>
-        <widget class="QLabel" name="textLabel3" >
-         <property name="toolTip" >
+        <widget class="QLabel" name="textLabel3">
+         <property name="toolTip">
           <string>Description of your status.</string>
          </property>
-         <property name="whatsThis" >
+         <property name="whatsThis">
           <string>Description of your status (up to 70 characters).</string>
          </property>
-         <property name="text" >
+         <property name="text">
           <string>&amp;Message:</string>
          </property>
-         <property name="buddy" >
+         <property name="buddy">
           <cstring>textEdit_</cstring>
          </property>
         </widget>
        </item>
        <item>
-        <widget class="QLineEdit" name="textEdit_" >
-         <property name="acceptDrops" >
+        <widget class="QLineEdit" name="textEdit_">
+         <property name="acceptDrops">
           <bool>false</bool>
          </property>
-         <property name="toolTip" >
+         <property name="toolTip">
           <string>Description of your status.</string>
          </property>
-         <property name="whatsThis" >
+         <property name="whatsThis">
           <string>Description of your status (up to 70 characters).</string>
          </property>
-         <property name="maxLength" >
+         <property name="maxLength">
           <number>70</number>
          </property>
         </widget>
@@ -212,14 +171,6 @@
    </item>
   </layout>
  </widget>
- <customwidgets>
-  <customwidget>
-   <class>Q3ButtonGroup</class>
-   <extends>Q3GroupBox</extends>
-   <header>Qt3Support/Q3ButtonGroup</header>
-   <container>1</container>
-  </customwidget>
- </customwidgets>
  <tabstops>
   <tabstop>onlineButton_</tabstop>
   <tabstop>awayButton_</tabstop>
@@ -229,4 +180,7 @@
  </tabstops>
  <resources/>
  <connections/>
+ <buttongroups>
+  <buttongroup name="buttonGroup_"/>
+ </buttongroups>
 </ui>
Index: kopete/protocols/gadu/gaducontactlist.cpp
===================================================================
--- kopete/protocols/gadu/gaducontactlist.cpp	(wersja 1019689)
+++ kopete/protocols/gadu/gaducontactlist.cpp	(kopia robocza)
@@ -61,12 +61,18 @@
 
 		strList  = cline.split( QChar( ';' ), QString::KeepEmptyParts );
 
-		if ( strList.size() < 7 ) {
+		stringIterator = strList.begin();
+
+		if ((*stringIterator) == "GG70ExportString,") {
+			// since it doesn't matter for neither kopete nor ggserver
+			// its just list of current groups but may spoil contact list
+			kDebug( 14100 ) << "Ignoring GG70ExportSting contact list member";
+			break;
+		} else if ( strList.size() < 7 ) {
 			kDebug( 14100 ) << "Malformed entry, too short! Ignoring entry: " << strList;
 			break;
-		}
+		} 
 
-		stringIterator = strList.begin();
 		
 		if ( strList.count() >= 12 ) {
 			email = true;
_______________________________________________
kopete-devel mailing list
kopete-devel@kde.org
https://mail.kde.org/mailman/listinfo/kopete-devel

Reply via email to