quick-lounge-applet r250 - in trunk: . src



Author: paobac
Date: Tue Feb  3 15:14:07 2009
New Revision: 250
URL: http://svn.gnome.org/viewvc/quick-lounge-applet?rev=250&view=rev

Log:
2009-02-03  Paolo Bacchilega  <paobac svn gnome org>

	* src/qck-desktop-entry-dialog.c (icon_button_clicked_cb): 
	(browse_button_clicked_cb): use the home directory if the command
	or icon do not specify a path.


Modified:
   trunk/ChangeLog
   trunk/src/qck-desktop-entry-dialog.c

Modified: trunk/src/qck-desktop-entry-dialog.c
==============================================================================
--- trunk/src/qck-desktop-entry-dialog.c	(original)
+++ trunk/src/qck-desktop-entry-dialog.c	Tue Feb  3 15:14:07 2009
@@ -263,11 +263,12 @@
         
         icon = g_key_file_get_string (self->priv->current, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_ICON, NULL);        
         icon_path = panel_find_icon (gtk_icon_theme_get_default (), icon, _gtk_icon_get_pixel_size (GTK_WIDGET (self), GTK_ICON_SIZE_DIALOG));
-        if (icon_path == NULL) {
+        if ((icon_path == NULL) || (icon_path[0] != '/')) {
+        	g_free (icon_path);
         	icon_path = g_strdup ("/usr/share/pixmaps/");
         	set_current = TRUE;
         }
-	file = g_file_new_for_path (icon_path);
+        file = g_file_new_for_path (icon_path);
 	uri = g_file_get_uri (file);	
 	if (set_current)
 		gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (icon_chooser), uri);
@@ -341,7 +342,8 @@
         gtk_dialog_set_default_response (GTK_DIALOG (command_chooser), GTK_RESPONSE_OK);
         
         path = g_key_file_get_string (self->priv->current, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_EXEC, NULL);        
-        if (path == NULL) {
+        if ((path == NULL) || (path[0] != '/')) {
+        	g_free (path);
         	path = g_strdup (g_get_home_dir ());
         	set_current = TRUE;
         }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]