Comment 1 for bug 600207

Revision history for this message
Loïc Minier (lool) wrote :

A new warning is triggered by the use of a variable named "read".

liblauncher-0.1 is a fork of liblauncher 0.1.x series, the latest liblauncher doesn't have this var.

The fix was merged in r37 of lp:liblauncher and was developed in r28.3.7:
------------------------------------------------------------
revno: 28.3.7
committer: Gordon Allott <email address hidden>
branch nick: liblauncher-session
timestamp: Mon 2009-10-19 11:10:55 +0100
message:
  added dependancy on libwncksync
=== modified file 'launcher/launcher-session.c'
--- launcher/launcher-session.c 2009-10-19 09:59:05 +0000
+++ launcher/launcher-session.c 2009-10-19 10:10:55 +0000
@@ -35,6 +35,7 @@
 #include <X11/Xutil.h>

 #include "launcher-application.h"
+#include "launcher-appman.h"
 #include "launcher-menu.h"

 #include "launcher-session.h"
@@ -151,55 +152,6 @@
 /*
  * Private methods
  */
-/*
- * Taken from libwnck, LGPL 2.0
- */
-static gchar *
-latin1_to_utf8 (const gchar *latin1)
-{
- GError *error = NULL;
- gsize read, written;
- gchar *utf8, *ret;
-
- utf8 = g_convert (latin1, -1, "UTF-8", "ISO-8859-1", &read, &written, &error);
- if (error)
- {
- g_debug ("errors converting latin1 to utf8: latin1=\"%s\", utf8=\"%s\", "
- "read=%zu, written=%zu, error=\"%s\".\n",
- latin1, utf8, read, written, error->message);
- g_error_free (error);
- }
-
- ret = g_utf8_strdown (utf8, -1);
- g_free (utf8);
- return ret;
-}
-
-static void
-window_wmclass_get (gulong xid, gchar **res_name, gchar **class_name)
-{
- XClassHint ch = {NULL, NULL};
-
- gdk_error_trap_push ();
- XGetClassHint (gdk_display, xid, &ch);
- gdk_error_trap_pop ();
-
- if (ch.res_name)
- {
- *res_name = latin1_to_utf8 (ch.res_name);
- XFree (ch.res_name);
- }
- else
- *res_name = NULL;
-
- if (ch.res_class)
- {
- *class_name = latin1_to_utf8 (ch.res_class);
- XFree (ch.res_class);
- }
- else
- *class_name = NULL;
-}

 static void
 on_application_opened (WnckScreen *screen,
@@ -207,14 +159,12 @@
                        LauncherSession *session)
 {
   LauncherSessionPrivate *priv;
- GSList *apps, *a;
   gchar *app_name = NULL;
   gchar *res_name = NULL;
   gchar *class_name = NULL;
- LauncherApplication *nearmatch = NULL;
   LauncherApplication *bestmatch = NULL;
   LauncherAppman *appman = NULL;
- GList *windows, w = NULL;
+ GList *windows, *w;

   g_return_if_fail (LAUNCHER_IS_SESSION (session));
@@ -231,7 +181,7 @@
       WnckWindow *window = w->data;
       gchar *desktop_file;

- desktop_file = wncksync_desktop_item_for_window_xid (wnck_window_get_xid (window))
+ desktop_file = wncksync_desktop_item_for_xid (wnck_window_get_xid (window));
       //try the next item
       if (!desktop_file)
         continue;

One of this include changes isn't present in liblauncher-0.1 though