Author: nick
Date: 2008-11-22 11:11:40 +0000 (Sat, 22 Nov 2008)
New Revision: 28884

Modified:
   xfce4-panel/trunk/panel/main.c
   xfce4-panel/trunk/plugins/launcher/launcher-exec.c
   xfce4-panel/trunk/plugins/launcher/launcher.c
Log:
* use -V for --version.
* Fix bug 4640.


Modified: xfce4-panel/trunk/panel/main.c
===================================================================
--- xfce4-panel/trunk/panel/main.c      2008-11-22 10:53:25 UTC (rev 28883)
+++ xfce4-panel/trunk/panel/main.c      2008-11-22 11:11:40 UTC (rev 28884)
@@ -57,7 +57,7 @@
 /* command line options */
 static GOptionEntry option_entries[] =
 {
-    { "version",   'v', 0, G_OPTION_ARG_NONE, &opt_version,   N_ ("Show this 
message and exit"), NULL },
+    { "version",   'V', 0, G_OPTION_ARG_NONE, &opt_version,   N_ ("Show this 
message and exit"), NULL },
     { "customize", 'c', 0, G_OPTION_ARG_NONE, &opt_customize, N_ ("Show 
configuration dialog"), NULL },
     { "save",      's', 0, G_OPTION_ARG_NONE, &opt_save,      N_ ("Save 
configuration"), NULL },
     { "restart",   'r', 0, G_OPTION_ARG_NONE, &opt_restart,   N_ ("Restart 
panels"), NULL },

Modified: xfce4-panel/trunk/plugins/launcher/launcher-exec.c
===================================================================
--- xfce4-panel/trunk/plugins/launcher/launcher-exec.c  2008-11-22 10:53:25 UTC 
(rev 28883)
+++ xfce4-panel/trunk/plugins/launcher/launcher-exec.c  2008-11-22 11:11:40 UTC 
(rev 28884)
@@ -612,7 +612,7 @@
         text = gtk_clipboard_wait_for_text (clipboard);
 
     /* try other clipboard if this one was empty */
-    if (text == NULL)
+    if (text == NULL || *text == '\0')
     {
         /* get the clipboard */
         clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
@@ -622,11 +622,12 @@
             text = gtk_clipboard_wait_for_text (clipboard);
     }
 
-    if (G_LIKELY (text))
+    if (G_LIKELY (text != NULL && *text != '\0'))
     {
         /* create some fake selection data */
         selection_data.data = (guchar *) text;
         selection_data.length = strlen (text);
+        selection_data.target = NULL;
 
         /* parse the filelist, this way we can handle 'copied' file from 
thunar */
         filenames = launcher_utility_filenames_from_selection_data 
(&selection_data);

Modified: xfce4-panel/trunk/plugins/launcher/launcher.c
===================================================================
--- xfce4-panel/trunk/plugins/launcher/launcher.c       2008-11-22 10:53:25 UTC 
(rev 28883)
+++ xfce4-panel/trunk/plugins/launcher/launcher.c       2008-11-22 11:11:40 UTC 
(rev 28884)
@@ -128,17 +128,17 @@
     /* check whether the retrieval worked */
     if (G_LIKELY (selection_data->length > 0))
     {
-        if (g_str_equal(gdk_atom_name(selection_data->target), 
"text/uri-list"))
+        if (selection_data->target == gdk_atom_intern_static_string 
("text/uri-list"))
         {
-                       /* split the received uri list */
-                       uri_list = g_uri_list_extract_uris ((gchar *) 
selection_data->data);
+                /* split the received uri list */
+                uri_list = g_uri_list_extract_uris ((gchar *) 
selection_data->data);
         }
         else
         {
-               /* split input by \n, \r or \r\n, this might result in empty 
elements, we sort
-                * them out below */
-               uri_list = g_strsplit_set ((gchar *) selection_data->data, 
"\n\r", 0);
-               is_uri = FALSE;
+                /* split input by \n, \r or \r\n, this might result in empty 
elements, we sort
+                 * them out below */
+                uri_list = g_strsplit_set ((gchar *) selection_data->data, 
"\n\r", 0);
+                is_uri = FALSE;
         }
 
         if (G_LIKELY (uri_list))
@@ -153,7 +153,7 @@
                 if (is_uri)
                     filename = g_filename_from_uri (uri_list[i], NULL, NULL);
                 else
-                                       filename = g_strdup (uri_list[i]);
+                                        filename = g_strdup (uri_list[i]);
 
                 /* prepend the filename */
                 if (G_LIKELY (filename))
@@ -244,7 +244,7 @@
         {
             /* load the cached pixbuf */
             if (entry->tooltip_cache == NULL)
-                entry->tooltip_cache = launcher_utility_load_pixbuf 
(gtk_widget_get_screen (widget), 
+                entry->tooltip_cache = launcher_utility_load_pixbuf 
(gtk_widget_get_screen (widget),
                                                                      
entry->icon,
                                                                      
LAUNCHER_TOOLTIP_SIZE);
 
@@ -620,7 +620,7 @@
     /* popup menu */
     gtk_menu_popup (GTK_MENU (launcher->menu), NULL, NULL,
                     xfce_panel_plugin_position_menu,
-                    launcher->panel_plugin, 
+                    launcher->panel_plugin,
                     1, gtk_get_current_event_time ());
 
     GDK_THREADS_LEAVE ();
@@ -689,7 +689,7 @@
 
     /* set the menu screen */
     gtk_menu_set_screen (GTK_MENU (launcher->menu), screen);
-    
+
     /* get the arrow direction of the button */
     arrow_type = xfce_arrow_button_get_arrow_type (XFCE_ARROW_BUTTON 
(launcher->arrow_button));
 
@@ -705,7 +705,7 @@
         /* create menu item */
         mi = gtk_image_menu_item_new_with_label (entry->name ? entry->name : 
_("New Item"));
         gtk_widget_show (mi);
-        
+
         /* fix menu order when it's on the top or bottom of the screen */
         if (arrow_type == GTK_ARROW_DOWN)
             gtk_menu_shell_append (GTK_MENU_SHELL (launcher->menu), mi);
@@ -861,7 +861,7 @@
     /* hook for icon themes changes */
     screen = gtk_widget_get_screen (launcher->image);
     icon_theme = gtk_icon_theme_get_for_screen (screen);
-    g_signal_connect (G_OBJECT (icon_theme), "changed", 
+    g_signal_connect (G_OBJECT (icon_theme), "changed",
                       G_CALLBACK (launcher_utility_icon_theme_changed), 
launcher);
 
     /* icon button signals */
@@ -1172,7 +1172,7 @@
 
     /* set the arrow direction */
     xfce_arrow_button_set_arrow_type (XFCE_ARROW_BUTTON 
(launcher->arrow_button), arrow_type);
-    
+
     /* destroy the menu, so menu items appear in the correct direction */
     launcher_menu_destroy (launcher);
 }

_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to