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

List:       kopete-devel
Subject:    Re: [kopete-devel] GaduGadu Patches
From:       pennguin <pennguin () gmail ! com>
Date:       2009-09-06 10:50:52
Message-ID: 200909061250.52585.pennguin () gmail ! com
[Download RAW message or body]

Dnia niedziela 06 wrzesieĊ„ 2009 o 03:52:18 Matt Rogers napisaĊ‚(a):
> Reply at the bottom
> 
> On Fri, 2009-09-04 at 12:16 +0200, pennguin wrote:
> > 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
> 
> I tried to apply the patch for bug 163541 and it wouldn't apply. Could
> you regenerate and resend the patch?

Sory, I've must messed something, attached are working patches. I've tested 
them and are working for me ;) should apply now clean and easy against trunk 
and also stable branch.

> Nobody actively works on Gadu Gadu support at the moment, and it would be 
> great to have some additional help in that area of Kopete.

So as long as I will have time I will try to at least bug-hunt gadu plugin. 

> We use an external libgadu now, so provided that Kopete still compiles when 
> using it (and it may not), then hopefully we'll have an easier time taking 
> advantage of that new functionality. 

AFAIK kopete should compile and work with new version, simply using old 
protocol version. Will try it in couple of days.

> Please feel free to continue to submit patches for review (either on the 
> mailing list or via reviewboard) and I'll get them committed for you. After 
> you've got a few more patches under your belt, then I'll support your
> request for an SVN account. 
Thanks, as soon as I finish some patches will send it here or on reviewboard.


Jakub Grandys
Pennguin

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

Index: kopete/protocols/gadu/gaduaway.cpp
===================================================================
--- kopete/protocols/gadu/gaduaway.cpp	(revision 1020430)
+++ kopete/protocols/gadu/gaduaway.cpp	(working copy)
@@ -29,7 +29,6 @@
 #include <ktextedit.h>
 #include <klocale.h>
 
-#include <q3buttongroup.h>
 #include <qradiobutton.h>
 #include <qlineedit.h>
 
@@ -49,18 +48,25 @@ GaduAway::GaduAway( GaduAccount* account
 	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 +78,7 @@ GaduAway::~GaduAway()
 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	(revision 1020430)
+++ kopete/protocols/gadu/ui/gaduawayui.ui	(working copy)
@@ -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" >
-    <number>6</number>
-   </property>
-   <property name="verticalSpacing" >
+   <property name="spacing">
     <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" >
-      <number>0</number>
-     </property>
-     <property name="topMargin" >
-      <number>0</number>
-     </property>
-     <property name="rightMargin" >
-      <number>0</number>
-     </property>
-     <property name="bottomMargin" >
+     <property name="margin">
       <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" >
-         <number>11</number>
-        </property>
-        <property name="topMargin" >
+       <layout class="QGridLayout">
+        <property name="margin">
          <number>11</number>
         </property>
-        <property name="rightMargin" >
-         <number>11</number>
-        </property>
-        <property name="bottomMargin" >
-         <number>11</number>
-        </property>
-        <property name="horizontalSpacing" >
-         <number>6</number>
-        </property>
-        <property name="verticalSpacing" >
+        <property name="spacing">
          <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" >
-           <number>0</number>
-          </property>
-          <property name="topMargin" >
-           <number>0</number>
-          </property>
-          <property name="rightMargin" >
-           <number>0</number>
-          </property>
-          <property name="bottomMargin" >
+          <property name="margin">
            <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 @@ Choosing Offline status will disconnect 
       </widget>
      </item>
      <item>
-      <layout class="QHBoxLayout" >
-       <property name="spacing" >
+      <layout class="QHBoxLayout">
+       <property name="spacing">
         <number>6</number>
        </property>
-       <property name="leftMargin" >
-        <number>0</number>
-       </property>
-       <property name="topMargin" >
-        <number>0</number>
-       </property>
-       <property name="rightMargin" >
-        <number>0</number>
-       </property>
-       <property name="bottomMargin" >
+       <property name="margin">
         <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 @@ Choosing Offline status will disconnect 
    </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 @@ Choosing Offline status will disconnect 
  </tabstops>
  <resources/>
  <connections/>
+ <buttongroups>
+  <buttongroup name="buttonGroup_"/>
+ </buttongroups>
 </ui>


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

Index: kopete/protocols/gadu/gaducontactlist.cpp
===================================================================
--- kopete/protocols/gadu/gaducontactlist.cpp	(revision 1020430)
+++ kopete/protocols/gadu/gaducontactlist.cpp	(working copy)
@@ -61,12 +61,18 @@ GaduContactsList::GaduContactsList( QStr
 
 		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


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

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