Merge lp:~cairo-dock-team/ubuntu/oneiric/cairo-dock-plug-ins/2.3.0-3-1 into lp:ubuntu/oneiric/cairo-dock-plug-ins

Proposed by Matthieu Baerts on 2011-07-23
Status: Needs review
Proposed branch: lp:~cairo-dock-team/ubuntu/oneiric/cairo-dock-plug-ins/2.3.0-3-1
Merge into: lp:ubuntu/oneiric/cairo-dock-plug-ins
Diff against target: 342 lines (+185/-78)
11 files modified
.pc/.version (+1/-0)
.pc/applied-patches (+1/-0)
.pc/fix_uppix_dnd2share_backend.patch/dnd2share/src/applet-backend-uppix.c (+126/-0)
debian/changelog (+18/-0)
debian/patches/01-ubuntuone-fix_upstream-version-2.3.0~2.1.patch (+0/-36)
debian/patches/02-weather-fix_upstream-version-2.3.0~2.2.patch (+0/-41)
debian/patches/fix_uppix_dnd2share_backend.patch (+18/-0)
debian/patches/series (+1/-0)
dnd2share/src/applet-backend-uppix.c (+1/-1)
stack/src/applet-stack.c (+18/-0)
systray/src/systray-interface.c (+1/-0)
To merge this branch: bzr merge lp:~cairo-dock-team/ubuntu/oneiric/cairo-dock-plug-ins/2.3.0-3-1
Reviewer Review Type Date Requested Status
Matthieu Baerts (community) Resubmit on 2011-08-06
Michael Vogt 2011-07-23 Needs Fixing on 2011-07-29
Review via email: mp+68944@code.launchpad.net

Description of the change

Hello,

The Cairo-Dock team proposes a bugs fixed version for its 2.3.0 branch.

This is the ChangeLog:
 * From 2.3.0~3 to 2.3.0~3.1:
   - Stack: fixed a bug that prevented from having more than 1 stack.
   - Systray: fixed a crash when inside the dock.

Please note that this new version fixes also this bug #811579 (Cairo-Dock Plug-Ins needs to be recompiled to fix a dependency issues)

How to reproduce the bugs:
   * Stack will not work correctly if there is more than one instance.
   * Enable the Systray (aka Notification Area) applet and put it into the dock (not in a desklet mode)

Thank you for your help

To post a comment you must log in.
Matthieu Baerts (matttbe) wrote :

I've a question to the Ubuntu Sponsors Team:
 The older version was 2.3.0~3-0ubuntu1. Should I now use 2.3.0~3-1ubuntu1 or 2.3.0~3.1-0ubuntu1?

22. By Matthieu Baerts on 2011-07-27

* debian/patches
 - Fixed the Uppix backend of the Drop to Share applet

Matthieu Baerts (matttbe) wrote :

Hi,

I've added a patch to fix a bug with the Uppix backend (Drop to Share/DND2Share applet)

Michael Vogt (mvo) wrote :

Thanks for proposing this branch!

When I test merge this branch into the ubuntu branch I see that the following two patches are
deleted:
-D debian/patches/01-ubuntuone-fix_upstream-version-2.3.0~2.1.patch
-D debian/patches/02-weather-fix_upstream-version-2.3.0~2.2.patch

Is this intentional? It looks like they are just leftovers that were not applied anyway, but it would be nice to mention it here.

review: Needs Fixing
Matthieu Baerts (matttbe) wrote :

Hello,

Sorry for this delay and for this lack of precisions and thank you for your help!

These patches have been removed on the rev 20 with the version 2.3.0~3-0ubuntu1 (now in upstream) but I've forgotten to delete these two files...

http://bazaar.launchpad.net/~cairo-dock-team/ubuntu/oneiric/cairo-dock-plug-ins/2.3.0-3-1/revision/20

review: Resubmit
Matthieu Baerts (matttbe) wrote :

(arf, sorry for this new Resubmit status :( )

Unmerged revisions

22. By Matthieu Baerts on 2011-07-27

* debian/patches
 - Fixed the Uppix backend of the Drop to Share applet

21. By Matthieu Baerts on 2011-07-23

* New upstream release. (LP: #815026)
* Upstream ChangeLog:
 - Stack: fixed a bug that prevented from having more than 1 stack.
 - Systray: fixed a crash when inside the dock.
* This package needs to be recompiled in order to fix
   a dependency issues. (LP: #811579)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory '.pc'
2=== added file '.pc/.version'
3--- .pc/.version 1970-01-01 00:00:00 +0000
4+++ .pc/.version 2011-07-28 10:10:29 +0000
5@@ -0,0 +1,1 @@
6+2
7
8=== added file '.pc/applied-patches'
9--- .pc/applied-patches 1970-01-01 00:00:00 +0000
10+++ .pc/applied-patches 2011-07-28 10:10:29 +0000
11@@ -0,0 +1,1 @@
12+fix_uppix_dnd2share_backend.patch
13
14=== added directory '.pc/fix_uppix_dnd2share_backend.patch'
15=== added directory '.pc/fix_uppix_dnd2share_backend.patch/dnd2share'
16=== added directory '.pc/fix_uppix_dnd2share_backend.patch/dnd2share/src'
17=== added file '.pc/fix_uppix_dnd2share_backend.patch/dnd2share/src/applet-backend-uppix.c'
18--- .pc/fix_uppix_dnd2share_backend.patch/dnd2share/src/applet-backend-uppix.c 1970-01-01 00:00:00 +0000
19+++ .pc/fix_uppix_dnd2share_backend.patch/dnd2share/src/applet-backend-uppix.c 2011-07-28 10:10:29 +0000
20@@ -0,0 +1,126 @@
21+/**
22+* This file is a part of the Cairo-Dock project
23+*
24+* Copyright : (C) see the 'copyright' file.
25+* E-mail : see the 'copyright' file.
26+*
27+* This program is free software; you can redistribute it and/or
28+* modify it under the terms of the GNU General Public License
29+* as published by the Free Software Foundation; either version 3
30+* of the License, or (at your option) any later version.
31+*
32+* This program is distributed in the hope that it will be useful,
33+* but WITHOUT ANY WARRANTY; without even the implied warranty of
34+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35+* GNU General Public License for more details.
36+* You should have received a copy of the GNU General Public License
37+* along with this program. If not, see <http://www.gnu.org/licenses/>.
38+*/
39+
40+#define _BSD_SOURCE
41+#include <stdlib.h>
42+#include <math.h>
43+#include <unistd.h>
44+#include <glib/gstdio.h>
45+
46+#include "applet-struct.h"
47+#include "applet-dnd2share.h"
48+#include "applet-backend-uppix.h"
49+
50+#define NB_URLS 5
51+static const gchar *s_UrlLabels[NB_URLS] = {"DirectLink", "DisplayImage", "BBCode150px", "BBCode600px", "BBCodeFullPic"};
52+
53+
54+static void upload (const gchar *cFilePath, gchar *cDropboxDir, gboolean bAnonymous, gint iLimitRate, gchar **cResultUrls)
55+{
56+ // On cree un fichier de log temporaire.
57+ gchar *cLogFile = g_strdup ("/tmp/dnd2share-log.XXXXXX");
58+ int fds = mkstemp (cLogFile);
59+ if (fds == -1)
60+ {
61+ g_free (cLogFile);
62+ return ;
63+ }
64+ close(fds);
65+
66+ // On lance la commande d'upload.
67+ gchar *cCommand = g_strdup_printf ("curl --connect-timeout 5 --retry 2 --limit-rate %dk uppix.net -F myimage=@\"%s\" -F submit=Upload -F formup=1 -o \"%s\"", iLimitRate, cFilePath, cLogFile); /// peut-on ajouter le nom de l'auteur dans le formulaire ?...
68+ cd_debug ("%s", cCommand);
69+ int r = system (cCommand);
70+ g_free (cCommand);
71+
72+
73+ // On récupère toutes les infos dans le fichier de log :
74+ /// TODO : se passer des g_spawn_command_line_sync !
75+ //D'abord l'url de DisplayImage
76+ gchar *cDisplayImage = NULL;
77+ gchar *cCommandDisplayImage = g_strdup_printf ("grep -oEm 1 '\\[url\\=([^]]*)' \"%s\"", cLogFile);
78+ g_spawn_command_line_sync (cCommandDisplayImage, &cDisplayImage, NULL, NULL, NULL);
79+ g_free (cCommandDisplayImage);
80+
81+ if (cDisplayImage == NULL || *cDisplayImage == '\0')
82+ {
83+ g_remove (cLogFile);
84+ g_free (cLogFile);
85+ return ;
86+ }
87+
88+ gchar *str = g_strstr_len (cDisplayImage, -1, "http://"); // On retire tout ce qui se trouve avant http://
89+ if (str != NULL && str != cDisplayImage)
90+ {
91+ gchar *tmp = cDisplayImage;
92+ cDisplayImage = g_strdup (str);
93+ g_free (tmp);
94+ }
95+ cDisplayImage[strlen(cDisplayImage) - 1] = '\0'; // on retire le \n à la fin
96+ cd_debug ("dnd2share : Display Image = %s", cDisplayImage);
97+
98+ // Puis l'url de DirectLink
99+ gchar *cDirectLink = NULL;
100+ gchar *cCommandDirectLink = g_strdup_printf ("grep -oEm 1 '\\[img\\]([^[]*)' \"%s\"", cLogFile);
101+ g_spawn_command_line_sync (cCommandDirectLink, &cDirectLink, NULL, NULL, NULL);
102+ g_free (cCommandDirectLink);
103+
104+ str = g_strstr_len (cDirectLink, -1, "http://"); // On retire tout ce qui se trouve avant http://
105+ if (str != NULL && str != cDirectLink)
106+ {
107+ gchar *tmp = cDirectLink;
108+ cDirectLink = g_strdup (str);
109+ g_free (tmp);
110+ }
111+ cDirectLink[strlen(cDirectLink) - 1] = '\0'; // on retire le \n à la fin
112+ cd_debug ("dnd2share : Direct Link = %s", cDirectLink);
113+
114+ // Puis on créé les autres URLs à la mano ;-) :
115+ gchar *cBBCodeFullPic = g_strdup_printf ("[img]%s[/img]", cDirectLink);
116+ cd_debug ("dnd2share : BBCODE_Full = '%s'", cBBCodeFullPic);
117+
118+ gchar *cDirectLinkWithoutExt = g_strdup (cDisplayImage);
119+ cDirectLinkWithoutExt[strlen(cDirectLinkWithoutExt) - 5] = '\0'; // on retire le .html à la fin
120+ gchar *cBBCode150px = g_strdup_printf ("[url=%s][img]%st.jpg[/img][/url]", cDirectLink, cDirectLinkWithoutExt);
121+ gchar *cBBCode600px = g_strdup_printf ("[url=%s][img]%stt.jpg[/img][/url]", cDirectLink, cDirectLinkWithoutExt);
122+ g_free (cDirectLinkWithoutExt);
123+ cd_debug ("dnd2share : BBCODE_150px = '%s'", cBBCode150px);
124+ cd_debug ("dnd2share : BBCODE_600px = '%s'", cBBCode600px);
125+
126+ g_remove (cLogFile);
127+ g_free (cLogFile);
128+
129+ // Enfin on remplit la memoire partagee avec nos URLs.
130+ cResultUrls[0] = cDirectLink;
131+ cResultUrls[1] = cDisplayImage;
132+ cResultUrls[2] = cBBCode150px;
133+ cResultUrls[3] = cBBCode600px;
134+ cResultUrls[4] = cBBCodeFullPic;
135+}
136+
137+
138+void cd_dnd2share_register_uppix_backend (void)
139+{
140+ cd_dnd2share_register_new_backend (CD_TYPE_IMAGE,
141+ "Uppix.net",
142+ NB_URLS,
143+ s_UrlLabels,
144+ 0,
145+ upload);
146+}
147
148=== modified file 'debian/changelog'
149--- debian/changelog 2011-07-05 13:45:43 +0000
150+++ debian/changelog 2011-07-28 10:10:29 +0000
151@@ -1,3 +1,21 @@
152+cairo-dock-plug-ins (2.3.0~3-1ubuntu2) natty; urgency=low
153+
154+ * debian/patches
155+ - Fixed the Uppix backend of the Drop to Share applet
156+
157+ -- Matthieu Baerts (matttbe) <matttbe@gmail.com> Wed, 27 Jul 2011 23:58:24 +0200
158+
159+cairo-dock-plug-ins (2.3.0~3-1ubuntu1) UNRELEASED; urgency=low
160+
161+ * New upstream release. (LP: #815026)
162+ * Upstream ChangeLog:
163+ - Stack: fixed a bug that prevented from having more than 1 stack.
164+ - Systray: fixed a crash when inside the dock.
165+ * This package needs to be recompiled in order to fix
166+ a dependency issues. (LP: #811579)
167+
168+ -- Matthieu Baerts (matttbe) <matttbe@gmail.com> Sat, 23 Jul 2011 12:10:37 +0200
169+
170 cairo-dock-plug-ins (2.3.0~3-0ubuntu1) oneiric; urgency=low
171
172 * New upstream release. (LP: #799774)
173
174=== removed file 'debian/patches/01-ubuntuone-fix_upstream-version-2.3.0~2.1.patch'
175--- debian/patches/01-ubuntuone-fix_upstream-version-2.3.0~2.1.patch 2011-06-06 10:13:07 +0000
176+++ debian/patches/01-ubuntuone-fix_upstream-version-2.3.0~2.1.patch 1970-01-01 00:00:00 +0000
177@@ -1,36 +0,0 @@
178-From: Matthieu Baerts <matttbe@gmail.com>
179-Subject: dnd2share: UbuntuOne backend: wait for the end of the sync before publishing the link (to avoid a crash of u1sdtool)
180-Origin: upstream, http://bazaar.launchpad.net/~cairo-dock-team/cairo-dock-plug-ins/2.3.x/revision/1939
181-Bug: http://www.glx-dock.org/tt_task.php?p=2&t=187
182-Forwarded: yes
183-
184-Index: cairo-dock-plug-ins/CMakeLists.txt
185-===================================================================
186---- cairo-dock-plug-ins.orig/CMakeLists.txt 2011-05-21 01:52:06.786633847 +0200
187-+++ cairo-dock-plug-ins/CMakeLists.txt 2011-05-21 01:52:49.006695762 +0200
188-@@ -299,7 +299,7 @@
189-
190- ############# DND2SHARE #################
191- set (GETTEXT_DND2SHARE ${GETTEXT_PLUGINS})
192--set (VERSION_DND2SHARE "1.0.5")
193-+set (VERSION_DND2SHARE "1.0.6")
194- set (PACKAGE_DND2SHARE "cd-dnd2share")
195- set (dnd2sharedatadir "${pluginsdatadir}/dnd2share")
196- configure_file (${CMAKE_CURRENT_SOURCE_DIR}/dnd2share/data/dnd2share.conf.in ${CMAKE_CURRENT_BINARY_DIR}/dnd2share/data/dnd2share.conf)
197-Index: cairo-dock-plug-ins/dnd2share/src/applet-backend-ubuntuone.c
198-===================================================================
199---- cairo-dock-plug-ins.orig/dnd2share/src/applet-backend-ubuntuone.c 2011-05-21 01:52:06.806633864 +0200
200-+++ cairo-dock-plug-ins/dnd2share/src/applet-backend-ubuntuone.c 2011-05-21 01:52:49.006695762 +0200
201-@@ -54,8 +54,10 @@
202- return;
203- }
204-
205-- // On recupere l'URL (dispo tout de suite, sinon il faudra boucler en testant 'dropbox status' jusqu'a avoir 'Idle').
206-- cCommand= g_strdup_printf ("u1sdtool --publish-file \"%s\"", cLocalFilePath);
207-+ // We wait for the end of the sync
208-+ cairo_dock_launch_command_sync ("u1sdtool --wait");
209-+ // We publish the file and we read the output message
210-+ cCommand = g_strdup_printf ("u1sdtool --publish-file \"%s\"", cLocalFilePath);
211- cd_debug ("commande u2 : %s", cCommand);
212- gchar *cResult = cairo_dock_launch_command_sync (cCommand);
213- g_free (cCommand);
214
215=== removed file 'debian/patches/02-weather-fix_upstream-version-2.3.0~2.2.patch'
216--- debian/patches/02-weather-fix_upstream-version-2.3.0~2.2.patch 2011-06-06 10:13:07 +0000
217+++ debian/patches/02-weather-fix_upstream-version-2.3.0~2.2.patch 1970-01-01 00:00:00 +0000
218@@ -1,41 +0,0 @@
219-From: Matthieu Baerts <matttbe@gmail.com>
220-Subject: Weather: prevent a crash if there is an error (thanks to Tsu Jan)
221-Origin: upstream, http://bazaar.launchpad.net/~cairo-dock-team/cairo-dock-plug-ins/2.3.x/revision/1940
222-Bug: https://bugs.launchpad.net/ubuntu/+source/cairo-dock-plug-ins/+bug/788437
223-Forwarded: yes
224-
225-Index: cairo-dock-plug-ins/weather/src/applet-read-data.c
226-===================================================================
227---- cairo-dock-plug-ins.orig/weather/src/applet-read-data.c 2011-06-04 02:16:45.821196928 +0200
228-+++ cairo-dock-plug-ins/weather/src/applet-read-data.c 2011-06-04 02:17:05.891226364 +0200
229-@@ -304,13 +304,13 @@
230- {
231- gchar *cURL = g_strdup_printf (CD_WEATHER_BASE_URL"/weather/local/%s?cc=*%s", pSharedMemory->cLocationCode, (pSharedMemory->bISUnits ? "&unit=m" : ""));
232- cCCData = cairo_dock_get_url_data (cURL, &erreur);
233-- g_free (cURL);
234- if (erreur != NULL)
235- {
236- cd_warning ("while downloading current conditions data:\n%s -> %s", cURL, erreur->message);
237- g_error_free (erreur);
238- erreur = NULL;
239- }
240-+ g_free (cURL);
241- if (cCCData == NULL)
242- {
243- pSharedMemory->bErrorInThread = TRUE;
244-@@ -324,7 +324,6 @@
245- {
246- gchar *cURL = g_strdup_printf (CD_WEATHER_BASE_URL"/weather/local/%s?dayf=%d%s", pSharedMemory->cLocationCode, pSharedMemory->iNbDays, (pSharedMemory->bISUnits ? "&unit=m" : ""));
247- cForecastData = cairo_dock_get_url_data (cURL, &erreur);
248-- g_free (cURL);
249- if (erreur != NULL)
250- {
251- cd_warning ("while downloading forecast data:\n%s -> %s", cURL, erreur->message);
252-@@ -332,6 +331,7 @@
253- erreur = NULL;
254- pSharedMemory->bErrorInThread = TRUE;
255- }
256-+ g_free (cURL);
257- if (cForecastData == NULL)
258- {
259- pSharedMemory->bErrorInThread = TRUE;
260
261=== added file 'debian/patches/fix_uppix_dnd2share_backend.patch'
262--- debian/patches/fix_uppix_dnd2share_backend.patch 1970-01-01 00:00:00 +0000
263+++ debian/patches/fix_uppix_dnd2share_backend.patch 2011-07-28 10:10:29 +0000
264@@ -0,0 +1,18 @@
265+From: Matthieu Baerts (matttbe) <matttbe@gmail.com>
266+Subject: Fixed uppix DND2Share backend.
267+Origin: upstream, http://bazaar.launchpad.net/~cairo-dock-team/cairo-dock-plug-ins/plug-ins/revision/2041
268+Forwarded: yes
269+
270+Index: cairo-dock-plug-ins/dnd2share/src/applet-backend-uppix.c
271+===================================================================
272+--- cairo-dock-plug-ins.orig/dnd2share/src/applet-backend-uppix.c 2011-07-27 23:51:15.675945270 +0200
273++++ cairo-dock-plug-ins/dnd2share/src/applet-backend-uppix.c 2011-07-27 23:52:18.904258832 +0200
274+@@ -44,7 +44,7 @@
275+ close(fds);
276+
277+ // On lance la commande d'upload.
278+- gchar *cCommand = g_strdup_printf ("curl --connect-timeout 5 --retry 2 --limit-rate %dk uppix.net -F myimage=@\"%s\" -F submit=Upload -F formup=1 -o \"%s\"", iLimitRate, cFilePath, cLogFile); /// peut-on ajouter le nom de l'auteur dans le formulaire ?...
279++ gchar *cCommand = g_strdup_printf ("curl --connect-timeout 5 --retry 2 --limit-rate %dk uppix.net -H Expect: -F myimage=@\"%s\" -F submit=Upload -F formup=1 -o \"%s\"", iLimitRate, cFilePath, cLogFile);
280+ cd_debug ("%s", cCommand);
281+ int r = system (cCommand);
282+ g_free (cCommand);
283
284=== added file 'debian/patches/series'
285--- debian/patches/series 1970-01-01 00:00:00 +0000
286+++ debian/patches/series 2011-07-28 10:10:29 +0000
287@@ -0,0 +1,1 @@
288+fix_uppix_dnd2share_backend.patch
289
290=== modified file 'dnd2share/src/applet-backend-uppix.c'
291--- dnd2share/src/applet-backend-uppix.c 2011-04-20 20:46:51 +0000
292+++ dnd2share/src/applet-backend-uppix.c 2011-07-28 10:10:29 +0000
293@@ -44,7 +44,7 @@
294 close(fds);
295
296 // On lance la commande d'upload.
297- gchar *cCommand = g_strdup_printf ("curl --connect-timeout 5 --retry 2 --limit-rate %dk uppix.net -F myimage=@\"%s\" -F submit=Upload -F formup=1 -o \"%s\"", iLimitRate, cFilePath, cLogFile); /// peut-on ajouter le nom de l'auteur dans le formulaire ?...
298+ gchar *cCommand = g_strdup_printf ("curl --connect-timeout 5 --retry 2 --limit-rate %dk uppix.net -H Expect: -F myimage=@\"%s\" -F submit=Upload -F formup=1 -o \"%s\"", iLimitRate, cFilePath, cLogFile);
299 cd_debug ("%s", cCommand);
300 int r = system (cCommand);
301 g_free (cCommand);
302
303=== modified file 'stack/src/applet-stack.c'
304--- stack/src/applet-stack.c 2011-04-20 20:46:51 +0000
305+++ stack/src/applet-stack.c 2011-07-28 10:10:29 +0000
306@@ -26,6 +26,24 @@
307
308
309 void cd_stack_check_local (CairoDockModuleInstance *myApplet, GKeyFile *pKeyFile) {
310+
311+ // be sure to not use the stack dir of another instance (it can happen when the applet is multi-instanciated, since new instances are initialized with the conf file of the first instance when they are created).
312+ GList *mi;
313+ CairoDockModuleInstance *applet;
314+ AppletConfig *cfg;
315+ for (mi = myApplet->pModule->pInstancesList; mi!= NULL; mi = mi->next)
316+ {
317+ applet = mi->data;
318+ if (applet == myApplet)
319+ continue;
320+ cfg = (AppletConfig*)applet->pConfig;
321+ if (cfg->cStackDir && strcmp (cfg->cStackDir, myConfig.cStackDir) == 0)
322+ {
323+ g_free (myConfig.cStackDir);
324+ myConfig.cStackDir = NULL;
325+ }
326+ }
327+
328
329 if (! g_file_test (myConfig.cStackDir, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_EXECUTABLE))
330 {
331
332=== modified file 'systray/src/systray-interface.c'
333--- systray/src/systray-interface.c 2010-08-10 00:05:57 +0000
334+++ systray/src/systray-interface.c 2011-07-28 10:10:29 +0000
335@@ -36,6 +36,7 @@
336 CairoDialogAttribute attr;
337 memset (&attr, 0, sizeof (CairoDialogAttribute));
338 attr.pInteractiveWidget = GTK_WIDGET (myData.tray);
339+ attr.bHideOnClick = TRUE; // keep the dialog alive on click (hide it).
340 myData.dialog = cairo_dock_build_dialog (&attr, myIcon, myContainer);
341 gtk_window_set_resizable (GTK_WINDOW(myData.dialog->container.pWidget), FALSE); /// utile ?...
342 cairo_dock_hide_dialog (myData.dialog);

Subscribers

People subscribed via source and target branches