[Goodies-commits] r1910 - in verve-plugin/trunk: . panel-plugin

Jannis Pohlmann jannis at xfce.org
Wed Aug 16 21:44:22 CEST 2006


Author: jannis
Date: 2006-08-16 19:44:20 +0000 (Wed, 16 Aug 2006)
New Revision: 1910

Modified:
   verve-plugin/trunk/ChangeLog
   verve-plugin/trunk/panel-plugin/verve-env.c
   verve-plugin/trunk/panel-plugin/verve-history.c
   verve-plugin/trunk/panel-plugin/verve-plugin.c
   verve-plugin/trunk/panel-plugin/verve.c
Log:
	* panel-plugin/verve-plugin.c, panel-plugin/verve-history.c,
	  panel-plugin/verve.c, panel-plugin/verve-env.c: Apply patch
	  from Jasper, which removes several unused variables, evil
	  C99-style and avoids a double-free'd GList. Bug #2175.

Modified: verve-plugin/trunk/ChangeLog
===================================================================
--- verve-plugin/trunk/ChangeLog	2006-08-16 16:24:26 UTC (rev 1909)
+++ verve-plugin/trunk/ChangeLog	2006-08-16 19:44:20 UTC (rev 1910)
@@ -1,3 +1,10 @@
+2006-08-16	Jannis Pohlmann <jannis at xfce.org>
+
+	* panel-plugin/verve-plugin.c, panel-plugin/verve-history.c,
+	  panel-plugin/verve.c, panel-plugin/verve-env.c: Apply patch
+	  from Jasper, which removes several unused variables, evil
+	  C99-style and avoids a double-free'd GList. Bug #2175.
+
 2006-08-09	Jannis Pohlmann <jannis at xfce.org>
 
 	* panel-plugin/verve-plugin.c, panel-plugin/verve-history.c:

Modified: verve-plugin/trunk/panel-plugin/verve-env.c
===================================================================
--- verve-plugin/trunk/panel-plugin/verve-env.c	2006-08-16 16:24:26 UTC (rev 1909)
+++ verve-plugin/trunk/panel-plugin/verve-env.c	2006-08-16 19:44:20 UTC (rev 1910)
@@ -183,13 +183,17 @@
   /* Free binaries list */
   if (G_LIKELY (env->binaries != NULL))
     {
+      g_list_foreach (env->binaries, (GFunc) g_free, NULL);
+#if 0
       GList *iter = g_list_first (env->binaries);
       while (iter != NULL)
         {
           g_free ((gchar *)iter->data);
           iter = g_list_next (iter);
         }
+#endif
       g_list_free (env->binaries);
+      env->binaries = NULL;
     }
 }
 
@@ -233,6 +237,9 @@
   /* Iterate over paths list */
   for (i=0; !env->load_thread_cancelled && i<g_strv_length (paths); i++)
   {
+    const gchar *current;
+    gchar       *filename;
+    GList       *lp;
     /* Try opening the directory */
     GDir *dir = g_dir_open (paths[i], 0, NULL);
 
@@ -240,11 +247,6 @@
     if (G_UNLIKELY (dir == NULL)) 
       continue;
 
-    /* Skip directory when errors have occured */
-    const gchar *current;
-    gchar       *filename;
-    GList       *lp;
-
     /* Iterate over files in this directory */
     while (!env->load_thread_cancelled && (current = g_dir_read_name (dir)) != NULL)
       {
@@ -263,10 +265,11 @@
             gchar *path = g_build_filename (paths[i], current, NULL);
 
             /* Check if the path refers to an executable */
-            if (g_file_test (path, G_FILE_TEST_IS_EXECUTABLE))
+            if (g_file_test (path, G_FILE_TEST_IS_EXECUTABLE) &&
+                !g_file_test (path, G_FILE_TEST_IS_DIR))
               {
                 /* Add file filename to the list */
-                env->binaries = g_list_prepend (env->binaries, g_strdup (filename));
+                env->binaries = g_list_prepend (env->binaries, filename);
 
                 /* No need to free the filename later in this function */
                 filename = NULL;

Modified: verve-plugin/trunk/panel-plugin/verve-history.c
===================================================================
--- verve-plugin/trunk/panel-plugin/verve-history.c	2006-08-16 16:24:26 UTC (rev 1909)
+++ verve-plugin/trunk/panel-plugin/verve-history.c	2006-08-16 19:44:20 UTC (rev 1910)
@@ -281,7 +281,6 @@
       if (G_LIKELY (handle != NULL))
       {
         GList    *current;
-        GIOStatus status;
         gsize     bytes;
         int       i;
 

Modified: verve-plugin/trunk/panel-plugin/verve-plugin.c
===================================================================
--- verve-plugin/trunk/panel-plugin/verve-plugin.c	2006-08-16 16:24:26 UTC (rev 1909)
+++ verve-plugin/trunk/panel-plugin/verve-plugin.c	2006-08-16 19:44:20 UTC (rev 1910)
@@ -102,7 +102,7 @@
   G_LOCK (plugin_completion_mutex);
 
   /* Build merged list */
-  items = g_list_concat (NULL, binaries);
+  items = g_list_copy (binaries);
   for (iter = g_list_first (history); iter != NULL; iter = g_list_next (iter))
     items = g_list_insert_sorted (items, iter->data, (GCompareFunc) g_utf8_collate);
 
@@ -761,7 +761,6 @@
                          VervePlugin *verve)
 {
   GtkWidget *dialog;
-  GtkWidget *header;
   GtkWidget *frame;
   GtkWidget *bin1;
   GtkWidget *bin2;

Modified: verve-plugin/trunk/panel-plugin/verve.c
===================================================================
--- verve-plugin/trunk/panel-plugin/verve.c	2006-08-16 16:24:26 UTC (rev 1909)
+++ verve-plugin/trunk/panel-plugin/verve.c	2006-08-16 19:44:20 UTC (rev 1910)
@@ -197,7 +197,6 @@
   pcre        *pattern;
   const gchar *error;
   int          error_offset;
-  int          count;
   int          ovector[30];
   gboolean     success = FALSE;
 
@@ -244,7 +243,6 @@
   const gchar *error;
   pcre        *pattern;
   int          error_offset;
-  int          count;
   int          ovector[30];
   gboolean     success = FALSE;
 




More information about the Goodies-commits mailing list