Add get_command_line_str for debugging output

This commit is contained in:
Christian Dywan 2012-08-30 00:13:43 +02:00
parent 1ce2b96680
commit a0d9517053
2 changed files with 7 additions and 5 deletions

View file

@ -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);

View file

@ -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);