mirror of
				https://gitlab.gnome.org/GNOME/glib.git
				synced 2025-11-04 01:58:54 +01:00 
			
		
		
		
	Bug 559633 – gtk_image_new_from_gicon does not always work for .desktop
2008-11-28 Matthias Clasen <mclasen@redhat.com> Bug 559633 – gtk_image_new_from_gicon does not always work for .desktop files * gdesktopappinfo.c (g_desktop_app_info_new_from_keyfile): Ignore extensions on icon names. Proposed by Axel von Bertoldi. svn path=/branches/glib-2-18/; revision=7699
This commit is contained in:
		
				
					committed by
					
						
						Matthias Clasen
					
				
			
			
				
	
			
			
			
						parent
						
							4f6096cdc3
						
					
				
				
					commit
					cfbff7b707
				
			@@ -1,3 +1,13 @@
 | 
			
		||||
2008-11-28  Matthias Clasen  <mclasen@redhat.com>
 | 
			
		||||
 | 
			
		||||
	Merged from trunk:
 | 
			
		||||
 | 
			
		||||
	Bug 559633 – gtk_image_new_from_gicon does not always work for
 | 
			
		||||
	.desktop files
 | 
			
		||||
 | 
			
		||||
	* gdesktopappinfo.c (g_desktop_app_info_new_from_keyfile): Ignore
 | 
			
		||||
	extensions on icon names.  Proposed by Axel von Bertoldi.
 | 
			
		||||
 | 
			
		||||
2008-11-28  Matthias Clasen  <mclasen@redhat.com>
 | 
			
		||||
 | 
			
		||||
	Merged from trunk:
 | 
			
		||||
 
 | 
			
		||||
@@ -267,7 +267,18 @@ g_desktop_app_info_new_from_keyfile (GKeyFile *key_file)
 | 
			
		||||
	  g_object_unref (file);
 | 
			
		||||
	}
 | 
			
		||||
      else
 | 
			
		||||
	info->icon = g_themed_icon_new (info->icon_name);
 | 
			
		||||
        {
 | 
			
		||||
          char *p;
 | 
			
		||||
 | 
			
		||||
          /* Work around a common mistake in desktop files */
 | 
			
		||||
          if ((p = strrchr (info->icon_name, '.')) != NULL &&
 | 
			
		||||
              (strcmp (p, ".png") == 0 ||
 | 
			
		||||
               strcmp (p, ".xpm") == 0 ||
 | 
			
		||||
               strcmp (p, ".svg") == 0))
 | 
			
		||||
            *p = 0;
 | 
			
		||||
 | 
			
		||||
          info->icon = g_themed_icon_new (info->icon_name);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
  
 | 
			
		||||
  if (info->exec)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user