Author: aolk
Date: 2006-10-24 10:41:02 -0400 (Tue, 24 Oct 2006)
New Revision: 66917
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Mime.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MimeIcon.cs
Log:
2006-10-24 Alexander Olk <[EMAIL PROTECTED]>
* MimeIcon.cs, Mime.cs:
Fallback to the default platform handler if no shared mime info
stuff exists (fixes #79693).
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-10-24 12:42:23 UTC (rev 66916)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-10-24 14:41:02 UTC (rev 66917)
@@ -1,3 +1,9 @@
+2006-10-24 Alexander Olk <[EMAIL PROTECTED]>
+
+ * MimeIcon.cs, Mime.cs:
+ Fallback to the default platform handler if no shared mime info
+ stuff exists (fixes #79693).
+
2006-10-20 Andreia Gaita <[EMAIL PROTECTED]>
* ContainerControl.cs: Incorrect contains check in ActiveControl
from previous fix (duh).
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Mime.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Mime.cs
2006-10-24 12:42:23 UTC (rev 66916)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Mime.cs
2006-10-24 14:41:02 UTC (rev 66917)
@@ -88,6 +88,8 @@
private int bytes_read = 0;
+ private bool mime_available = false;
+
public static NameValueCollection Aliases;
public static NameValueCollection SubClasses;
@@ -125,9 +127,17 @@
if (buffer_length != -1) {
buffer = new byte[ buffer_length ];
+ mime_available = true;
}
}
+ public static bool MimeAvailable
+ {
+ get {
+ return Instance.mime_available;
+ }
+ }
+
public static string GetMimeTypeForFile( string filename )
{
lock ( lock_object )
@@ -517,7 +527,7 @@
if ( key[0] == '*' )
{
- if (FastEndsWidth(filename,
key.Replace( "*", "" )))
+ if (FastEndsWidth(filename,
key.Replace( "*", String.Empty )))
{
global_result = GlobalSufPref[
i ];
CheckGlobalResult( );
@@ -526,7 +536,7 @@
}
else
{
- if ( FastStartsWith(filename,
key.Replace( "*", "" ) ) )
+ if ( FastStartsWith(filename,
key.Replace( "*", String.Empty ) ) )
{
global_result = GlobalSufPref[
i ];
CheckGlobalResult( );
@@ -732,7 +742,7 @@
{
index += 13; // Length of string "Content-type:"
- global_result = "";
+ global_result = String.Empty;
while ( search_string[ index ] != ';' )
{
@@ -852,7 +862,7 @@
// indent
char c;
if (br.PeekChar () != '>') {
- string indent_string =
"";
+ string indent_string =
String.Empty;
while (true) {
if (br.PeekChar
() == '>')
break;
@@ -1088,7 +1098,7 @@
private int ReadValue ()
{
- string result_string = "";
+ string result_string = String.Empty;
int result = 0;
char c;
@@ -1108,7 +1118,7 @@
private string ReadPriorityAndMimeType (ref int priority)
{
if (br.ReadChar () == '[') {
- string priority_string = "";
+ string priority_string = String.Empty;
while (true) {
char c = br.ReadChar ();
if (c == ':')
@@ -1118,7 +1128,7 @@
priority = System.Convert.ToInt32
(priority_string);
- string mime_type_result = "";
+ string mime_type_result = String.Empty;
while (true) {
char c = br.ReadChar ();
if (c == ']')
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MimeIcon.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MimeIcon.cs
2006-10-24 12:42:23 UTC (rev 66916)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MimeIcon.cs
2006-10-24 14:41:02 UTC (rev 66917)
@@ -74,6 +74,7 @@
{
public static ImageList SmallIcons = new ImageList();
public static ImageList LargeIcons = new ImageList();
+ public static ImageList ThumbnailIL = new ImageList ();
private static EPlatformHandler platform =
EPlatformHandler.Default;
@@ -102,9 +103,9 @@
session = "GNOME";
}
} else
- session = "";
+ session = String.Empty;
- if (session == "GNOME") {
+ if (Mime.MimeAvailable && session == "GNOME") {
SmallIcons.ImageSize = new Size (24, 24);
LargeIcons.ImageSize = new Size (48, 48);
@@ -504,5 +505,10 @@
return gtk_icon_theme_has_icon (default_icon_theme,
name);
}
}
+
+ internal class ThumbNailer
+ {
+ public static ThumbNailer TN = new ThumbNailer ();
+ }
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches