From a0d95170539955aeffbbcf3918f04d5047fcac50 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Thu, 30 Aug 2012 00:13:43 +0200 Subject: [PATCH] Add get_command_line_str for debugging output --- katze/midori-paths.vala | 7 ++++++- midori/midori-view.c | 5 +---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/katze/midori-paths.vala b/katze/midori-paths.vala index c60b3fed..37811f5e 100644 --- a/katze/midori-paths.vala +++ b/katze/midori-paths.vala @@ -138,7 +138,7 @@ namespace Midori { #endif if (strcmp (Environment.get_variable ("MIDORI_DEBUG"), "paths") == 0) { stdout.printf ("command_line: %s\nexec_path: %s\nres: %s\nlib: %s\n", - "".joinv (" ", command_line), exec_path, + get_command_line_str (), exec_path, get_res_filename (""), get_lib_path (PACKAGE_NAME)); } } @@ -148,6 +148,11 @@ namespace Midori { return command_line; } + public static string get_command_line_str () { + assert (command_line != null); + return "".joinv (" ", command_line).replace (Environment.get_home_dir (), "~"); + } + public static string get_lib_path (string package) { assert (command_line != null); string path = Path.build_filename (exec_path, "lib", package); diff --git a/midori/midori-view.c b/midori/midori-view.c index 05212317..f6c1c09f 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -4540,9 +4540,7 @@ midori_view_set_uri (MidoriView* view, } else if (!strcmp (uri, "about:") || !strcmp (uri, "about:version")) { - gchar* arguments = g_strjoinv (" ", midori_paths_get_command_line (NULL)); - gchar* command_line = sokoke_replace_variables ( - arguments, g_get_home_dir (), "~", NULL); + gchar* command_line = midori_paths_get_command_line_str (); gchar* architecture, *platform; const gchar* sys_name = midori_web_settings_get_system_name ( &architecture, &platform); @@ -4621,7 +4619,6 @@ midori_view_set_uri (MidoriView* view, data = g_string_free (tmp, FALSE); g_free (command_line); - g_free (arguments); g_free (ident); g_free (video_formats); g_string_free (more, TRUE); -- 2.39.5