]> spindle.queued.net Git - midori/commitdiff
Implement default configuration files on Windows
authorPeter de Ridder <peter@xfce.org>
Sat, 26 Jun 2010 13:38:37 +0000 (15:38 +0200)
committerChristian Dywan <christian@twotoasts.de>
Sat, 26 Jun 2010 14:02:49 +0000 (16:02 +0200)
midori/sokoke.c
wscript

index c3f3d82613cd9fcfe5daeeab592e1c10538e83ae..4f7e92d7d2b1df6cb6a2d635d1e0b96e7c1013a4 100644 (file)
@@ -1455,17 +1455,27 @@ sokoke_find_config_filename (const gchar* folder,
     const gchar* const* config_dirs = g_get_system_config_dirs ();
     guint i = 0;
     const gchar* config_dir;
+    gchar* path;
 
     if (!folder)
         folder = "";
 
     while ((config_dir = config_dirs[i++]))
     {
-        gchar* path = g_build_filename (config_dir, PACKAGE_NAME, folder, filename, NULL);
+        path = g_build_filename (config_dir, PACKAGE_NAME, folder, filename, NULL);
         if (g_access (path, F_OK) == 0)
             return path;
         g_free (path);
     }
+
+    #ifdef G_OS_WIN32
+    config_dir = g_win32_get_package_installation_directory_of_module (NULL);
+    path = g_build_filename (config_dir, "etc", "xdg", PACKAGE_NAME, folder, filename, NULL);
+    if (g_access (path, F_OK) == 0)
+        return path;
+    g_free (path);
+    #endif
+
     return g_build_filename (SYSCONFDIR, "xdg", PACKAGE_NAME, folder, filename, NULL);
 }
 
diff --git a/wscript b/wscript
index 59595b4837e86dcf23f04cf9417bd98c4aea93a5..76de481aca00bcd4abb1f69eda4a669a3bac2e9a 100644 (file)
--- a/wscript
+++ b/wscript
@@ -503,7 +503,15 @@ def build (bld):
         bld.install_files ('${MDATADIR}/' + APPNAME + '/res', 'data/autosuggestcontrol.css')
 
         # FIXME: Determine the library naming for other platforms
-        if Options.platform == 'linux':
+        if bld.env['platform'] == 'win32':
+            extensions = os.listdir ('data/extensions')
+            for extension in extensions:
+                folder = 'lib' + extension + '.dll'
+                source = 'data/extensions/' + extension +  '/config'
+                if os.path.exists (source):
+                    bld.install_files ('${SYSCONFDIR}/xdg/' + APPNAME + \
+                                       '/extensions/' + folder, source)
+        elif Options.platform == 'linux':
             extensions = os.listdir ('data/extensions')
             for extension in extensions:
                 folder = 'lib' + extension + '.so'