diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 8bda4211..65165d10 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -858,7 +858,7 @@ midori_browser_speed_dial_get_next_free_slot (void) if (!g_file_test (body_fname, G_FILE_TEST_EXISTS)) { - if (g_file_get_contents (DATADIR "/midori/res/speeddial.json", + if (g_file_get_contents (MDATADIR "/midori/res/speeddial.json", &speed_dial_body, NULL, NULL)) { g_file_set_contents (body_fname, speed_dial_body, -1, NULL); diff --git a/midori/midori-view.c b/midori/midori-view.c index 0e137e5c..84806ad8 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -729,7 +729,7 @@ webkit_web_view_load_error_cb (WebKitWebView* web_view, GError* error, MidoriView* view) { - const gchar* template_file = DATADIR "/midori/res/error.html"; + const gchar* template_file = MDATADIR "/midori/res/error.html"; gchar* template; if (g_file_get_contents (template_file, &template, NULL, NULL)) @@ -786,7 +786,7 @@ webkit_web_frame_load_done_cb (WebKitWebFrame* web_frame, data = g_strdup_printf ( "%s" "

%s

" - "" "

The page you were opening doesn't exist." "

Try to load the page again, " @@ -2059,7 +2059,7 @@ midori_view_set_uri (MidoriView* view, katze_assign (view->uri, g_strdup ("")); - g_file_get_contents (DATADIR "/midori/res/speeddial-head.html", + g_file_get_contents (MDATADIR "/midori/res/speeddial-head.html", &speed_dial_head, NULL, NULL); res_server = sokoke_get_res_server (); @@ -2071,7 +2071,7 @@ midori_view_set_uri (MidoriView* view, if (!g_file_test (body_fname, G_FILE_TEST_EXISTS)) { - if (g_file_get_contents (DATADIR "/midori/res/speeddial.json", + if (g_file_get_contents (MDATADIR "/midori/res/speeddial.json", &speed_dial_body, NULL, NULL)) g_file_set_contents (body_fname, speed_dial_body, -1, NULL); else @@ -2122,7 +2122,7 @@ midori_view_set_uri (MidoriView* view, data = g_strdup_printf ( "%s" "

%s

" - "" "

The document %s of type '%s' cannot be displayed." "", @@ -2139,7 +2139,7 @@ midori_view_set_uri (MidoriView* view, data = g_strdup_printf ( "%s" "

%s

" - "" "

There is no documentation installed at %s." "You may want to ask your distribution or " diff --git a/midori/sokoke.c b/midori/sokoke.c index 5bee98b4..fe8fc61d 100644 --- a/midori/sokoke.c +++ b/midori/sokoke.c @@ -958,7 +958,7 @@ res_server_handler_cb (SoupServer* res_server, { if (g_str_has_prefix (path, "/res")) { - gchar* filename = g_strconcat (DATADIR "/midori", path, NULL); + gchar* filename = g_strconcat (MDATADIR "/midori", path, NULL); gchar* contents; gsize length; diff --git a/wscript b/wscript index 6dcc2152..02cd7203 100644 --- a/wscript +++ b/wscript @@ -51,12 +51,14 @@ def configure (conf): Utils.pprint ('RED', desc + ' N/A') sys.exit (1) - def dirname_default (dirname, default): + def dirname_default (dirname, default, defname=None): if getattr (Options.options, dirname) == '': dirvalue = default else: dirvalue = getattr (Options.options, dirname) - conf.define (dirname, dirvalue) + if not defname: + defname = dirname + conf.define (defname, dirvalue) return dirvalue conf.check_tool ('compiler_cc') @@ -86,13 +88,16 @@ def configure (conf): nls = 'no ' conf.define ('ENABLE_NLS', [0,1][nls == 'yes']) - dirname_default ('DATADIR', os.path.join (conf.env['PREFIX'], 'share')) dirname_default ('DOCDIR', os.path.join (conf.env['DATADIR'], 'doc')) dirname_default ('LIBDIR', os.path.join (conf.env['PREFIX'], 'lib')) if conf.env['PREFIX'] == '/usr': dirname_default ('SYSCONFDIR', '/etc') else: dirname_default ('SYSCONFDIR', os.path.join (conf.env['PREFIX'], 'etc')) + dirname_default ('DATADIR', os.path.join (conf.env['PREFIX'], 'share'), + # Use MDATADIR because DATADIR is a constant in objidl.h on Windows + 'MDATADIR') + conf.undefine ('DATADIR') if option_enabled ('apidocs'): conf.find_program ('gtkdoc-scan', var='GTKDOC_SCAN')