diff org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/program/Program.d @ 113:fb3aa8075988

D2 support for the linux port.
author Jacob Carlborg <doob@me.com>
date Wed, 06 Apr 2011 21:57:23 +0200
parents b397a43d66d1
children 536e43f63c81
line wrap: on
line diff
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/program/Program.d	Wed Mar 16 21:53:53 2011 +0900
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/program/Program.d	Wed Apr 06 21:57:23 2011 +0200
@@ -173,19 +173,22 @@
         GList* function() gnome_vfs_get_registered_mime_types;
         char* function(char*) gnome_vfs_mime_type_from_name;
     }
-    static Symbol symbols[] = [
-        { "gnome_vfs_mime_get_default_application", cast(void**)&gnome_vfs_mime_get_default_application },
-        { "gnome_vfs_make_uri_from_input_with_dirs", cast(void**)&gnome_vfs_make_uri_from_input_with_dirs },
-        { "gnome_vfs_mime_application_launch", cast(void**)&gnome_vfs_mime_application_launch },
-        { "gnome_vfs_mime_application_free", cast(void**)&gnome_vfs_mime_application_free },
-        { "gnome_vfs_url_show", cast(void**)&gnome_vfs_url_show },
-        { "gnome_vfs_make_uri_from_input", cast(void**)&gnome_vfs_make_uri_from_input },
-        { "gnome_vfs_get_registered_mime_types", cast(void**)&gnome_vfs_get_registered_mime_types },
-        { "gnome_vfs_mime_get_extensions_list", cast(void**)&gnome_vfs_mime_get_extensions_list },
-        { "gnome_vfs_mime_extensions_list_free", cast(void**)&gnome_vfs_mime_extensions_list_free },
-        { "gnome_vfs_mime_registered_mime_type_list_free", cast(void**)&gnome_vfs_mime_registered_mime_type_list_free },
-        { "gnome_vfs_mime_type_from_name", cast(void**)&gnome_vfs_mime_type_from_name }
-    ];
+    static Symbol[] symbols;
+    static this () {
+        symbols = [
+            Symbol("gnome_vfs_mime_get_default_application", cast(void**)&gnome_vfs_mime_get_default_application ),
+            Symbol("gnome_vfs_make_uri_from_input_with_dirs", cast(void**)&gnome_vfs_make_uri_from_input_with_dirs ),
+            Symbol("gnome_vfs_mime_application_launch", cast(void**)&gnome_vfs_mime_application_launch ),
+            Symbol("gnome_vfs_mime_application_free", cast(void**)&gnome_vfs_mime_application_free ),
+            Symbol("gnome_vfs_url_show", cast(void**)&gnome_vfs_url_show ),
+            Symbol("gnome_vfs_make_uri_from_input", cast(void**)&gnome_vfs_make_uri_from_input ),
+            Symbol("gnome_vfs_get_registered_mime_types", cast(void**)&gnome_vfs_get_registered_mime_types ),
+            Symbol("gnome_vfs_mime_get_extensions_list", cast(void**)&gnome_vfs_mime_get_extensions_list ),
+            Symbol("gnome_vfs_mime_extensions_list_free", cast(void**)&gnome_vfs_mime_extensions_list_free ),
+            Symbol("gnome_vfs_mime_registered_mime_type_list_free", cast(void**)&gnome_vfs_mime_registered_mime_type_list_free ),
+            Symbol("gnome_vfs_mime_type_from_name", cast(void**)&gnome_vfs_mime_type_from_name )
+        ];
+    }
 }
 
 /**
@@ -785,7 +788,7 @@
             version(Tango){
                 bool contains = cast(bool)tango.core.Array.contains(extensions, mimeExts[index]);
             } else { // Phobos
-                bool contains = std.algorithm.find(extensions, mimeExts[index]) != std.iterator.end(extensions);
+                bool contains = std.algorithm.canFind(extensions, mimeExts[index]);
             }
             if (!contains) {
                 extensions ~= mimeExts[index];