[Goodies-commits] r2904 - in xfce4-places-plugin/branches/umount: . panel-plugin

Diego Ongaro ongardie at xfce.org
Fri Jul 13 04:25:12 CEST 2007


Author: ongardie
Date: 2007-07-13 02:25:12 +0000 (Fri, 13 Jul 2007)
New Revision: 2904

Modified:
   xfce4-places-plugin/branches/umount/ChangeLog
   xfce4-places-plugin/branches/umount/panel-plugin/places.c
Log:
2007-07-12	Diego Ongaro <ongardie at gmail.com>

* unmount branch: Cleaned up places.c



Modified: xfce4-places-plugin/branches/umount/ChangeLog
===================================================================
--- xfce4-places-plugin/branches/umount/ChangeLog	2007-07-12 23:11:09 UTC (rev 2903)
+++ xfce4-places-plugin/branches/umount/ChangeLog	2007-07-13 02:25:12 UTC (rev 2904)
@@ -1,3 +1,7 @@
+2007-07-12	Diego Ongaro <ongardie at gmail.com>
+
+	* unmount branch: Cleaned up places.c
+
 2007-06-04	Diego Ongaro <ongardie at gmail.com>
 
 	* unmount branch: added Open Terminal Here

Modified: xfce4-places-plugin/branches/umount/panel-plugin/places.c
===================================================================
--- xfce4-places-plugin/branches/umount/panel-plugin/places.c	2007-07-12 23:11:09 UTC (rev 2903)
+++ xfce4-places-plugin/branches/umount/panel-plugin/places.c	2007-07-13 02:25:12 UTC (rev 2904)
@@ -116,25 +116,31 @@
 }
 
 void
-places_load_terminal(const gchar *path)
+places_load_terminal(const gchar *const_path)
 {
-    gboolean free_path = FALSE;
+    gchar *path = NULL;
+    gboolean path_owner = FALSE; /* whether this function "owns" path */
 
     if(path != NULL){
-        if(strstr(path, "trash://") != NULL){
+        if(strncmp(const_path, "trash://", 8) == 0){
             DBG("Can't load terminal at trash:// URI's");
             return;
 
-        }else if(strstr(path, "file://") != NULL){
-            path = g_filename_from_uri(path, NULL, NULL);
-            free_path = TRUE;
+        }else if(strncmp(const_path, "file://", 7) == 0){
+            path = g_filename_from_uri(const_path, NULL, NULL);
+            path_owner = TRUE;
+
+        }else{
+            path = (gchar*) const_path;
+            /* (path_owner is FALSE) */
+            
         }
     }
 
     exo_execute_preferred_application("TerminalEmulator", NULL, path, NULL, NULL);
 
-    if(path != NULL && free_path)
-        g_free((gchar*) path);
+    if(path_owner && path != NULL)
+        g_free(path);
 }
 
 void




More information about the Goodies-commits mailing list