linamh/dev-lang/mono/files/mono-2.0-mimeicon.patch
geos_one be5cae4b16 add new mono version
git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/linamh@1476 6952d904-891a-0410-993b-d76249ca496b
2009-08-22 00:44:22 +00:00

55 lines
2.1 KiB
Diff

--- mono-2.0/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MimeIcon.cs 2008-09-02 16:46:50.000000000 +0100
+++ mono-2.0/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MimeIcon-new.cs 2008-09-18 23:29:05.000000000 +0100
@@ -358,11 +358,12 @@
if (internal_mime_type == "harddisk/harddisk" || internal_mime_type == "cdrom/cdrom" || internal_mime_type == "removable/removable")
image = ResourceImageLoader.Get ("text-x-generic.png");
}
-
- index = MimeIconEngine.SmallIcons.Images.Add (image, Color.Transparent);
- MimeIconEngine.LargeIcons.Images.Add (image, Color.Transparent);
-
- MimeIconEngine.MimeIconIndex.Add (internal_mime_type, index);
+
+ if (image != null) {
+ index = MimeIconEngine.SmallIcons.Images.Add (image, Color.Transparent);
+ MimeIconEngine.LargeIcons.Images.Add (image, Color.Transparent);
+ MimeIconEngine.MimeIconIndex.Add (internal_mime_type, index);
+ }
}
public override object AddAndGetIconIndex (string filename, string mime_type)
@@ -370,11 +371,11 @@
int index = -1;
Image image = GnomeUtil.GetIcon (filename, mime_type, 48);
-
- index = MimeIconEngine.SmallIcons.Images.Add (image, Color.Transparent);
- MimeIconEngine.LargeIcons.Images.Add (image, Color.Transparent);
-
- MimeIconEngine.MimeIconIndex.Add (mime_type, index);
+ if (image != null) {
+ index = MimeIconEngine.SmallIcons.Images.Add (image, Color.Transparent);
+ MimeIconEngine.LargeIcons.Images.Add (image, Color.Transparent);
+ MimeIconEngine.MimeIconIndex.Add (mime_type, index);
+ }
return index;
}
@@ -384,11 +385,11 @@
int index = -1;
Image image = GnomeUtil.GetIcon (mime_type, 48);
-
- index = MimeIconEngine.SmallIcons.Images.Add (image, Color.Transparent);
- MimeIconEngine.LargeIcons.Images.Add (image, Color.Transparent);
-
- MimeIconEngine.MimeIconIndex.Add (mime_type, index);
+ if (image != null) {
+ index = MimeIconEngine.SmallIcons.Images.Add (image, Color.Transparent);
+ MimeIconEngine.LargeIcons.Images.Add (image, Color.Transparent);
+ MimeIconEngine.MimeIconIndex.Add (mime_type, index);
+ }
return index;
}