[Xfce4-commits] <xfdesktop:danielm/port-to-gio> Minor sintax tweaking.

Jannis Pohlmann noreply at xfce.org
Sun Aug 29 21:14:14 CEST 2010


Updating branch refs/heads/danielm/port-to-gio
         to 799c8d32b6052846234c32524b49f13da97e4297 (commit)
       from 1f96f9b5979e11071e61c0ae01dc4f44efde68db (commit)

commit 799c8d32b6052846234c32524b49f13da97e4297
Author: Daniel Morales <daniel at daniel.com.uy>
Date:   Wed Feb 24 10:33:02 2010 -0200

    Minor sintax tweaking.

 src/xfdesktop-file-utils.c |   56 ++++++++++++++++++++++----------------------
 1 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/src/xfdesktop-file-utils.c b/src/xfdesktop-file-utils.c
index 47c41f0..4d8ebfe 100644
--- a/src/xfdesktop-file-utils.c
+++ b/src/xfdesktop-file-utils.c
@@ -517,9 +517,12 @@ gboolean
 xfdesktop_file_utils_launch_icon(const XfdesktopFileIcon *file_icon)
 {
     DBusGProxy *thunar_proxy;
-    GtkWidget *icon_view, *toplevel;
-    GdkScreen *gscreen;
-    gboolean success = FALSE;
+    GtkWidget  *icon_view, *toplevel;
+    GdkScreen  *gscreen;
+    GError     *error = NULL;
+    gboolean    success = FALSE;
+    gchar      *display_name;
+    gchar      *uri;
 
     g_return_val_if_fail(XFDESKTOP_IS_FILE_ICON(file_icon), FALSE);
     g_return_val_if_fail(G_IS_FILE(file_icon->gfile), FALSE);
@@ -531,34 +534,31 @@ xfdesktop_file_utils_launch_icon(const XfdesktopFileIcon *file_icon)
 
     /* use thunar D-BUS API */
     thunar_proxy = xfdesktop_file_utils_peek_filemanager_proxy();
-    if(thunar_proxy) {
-		GError *error = NULL;
-        gchar *display_name;
-        gchar *uri;
-
-        uri = g_file_get_uri(file_icon->gfile);
-        display_name = gdk_screen_make_display_name(gscreen);
-
-        success = org_xfce_FileManager_launch(thunar_proxy,
-                                              uri,
-                                              display_name,
-                                              &error);
-
-        if(!success) {
-            gchar *primary = g_markup_printf_escaped(_("Unable to launch \"%s\":"),
-                                                     g_file_info_get_display_name(file_icon->info));
-            xfce_message_dialog(GTK_WINDOW(toplevel), _("Launch Error"),
-                                GTK_STOCK_DIALOG_ERROR, primary,
-                                error->message,
-                                GTK_STOCK_CLOSE, GTK_RESPONSE_ACCEPT, NULL);
-            g_error_free(error);
-            g_free(primary);
-        }
+    if(!thunar_proxy)
+        return FALSE;
+
+    uri = g_file_get_uri(file_icon->gfile);
+    display_name = gdk_screen_make_display_name(gscreen);
+
+    success = org_xfce_FileManager_launch(thunar_proxy,
+                                          uri,
+                                          display_name,
+                                          &error);
 
-        g_free(uri);
-        g_free(display_name);
+    if(!success) {
+        gchar *primary = g_markup_printf_escaped(_("Unable to launch \"%s\":"),
+                                                 g_file_info_get_display_name(file_icon->info));
+        xfce_message_dialog(GTK_WINDOW(toplevel), _("Launch Error"),
+                            GTK_STOCK_DIALOG_ERROR, primary,
+                            error->message,
+                            GTK_STOCK_CLOSE, GTK_RESPONSE_ACCEPT, NULL);
+        g_error_free(error);
+        g_free(primary);
     }
 
+    g_free(uri);
+    g_free(display_name);
+
     return success;
 }
 



More information about the Xfce4-commits mailing list