Commit 3b4c0867 authored by Julian Sparber's avatar Julian Sparber

[minor] imporved file opening code

parent 5ece7f33
......@@ -78,13 +78,16 @@ static void
open_file_callback (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data) {
const gchar *path;
g_print("Open file\n %s%s",
g_variant_get_string (g_variant_get_child_value (parameter, 3), NULL),
g_variant_get_string (g_variant_get_child_value (parameter, 2), NULL));
g_spawn_command_line_async(g_strdup_printf("xdg-open %s/%s",
g_variant_get_string (g_variant_get_child_value (parameter, 3), NULL),
g_variant_get_string (g_variant_get_child_value (parameter, 2), NULL)), NULL);
path = g_strdup_printf("%s/%s",
g_variant_get_string (g_variant_get_child_value (parameter, 3), NULL),
g_variant_get_string (g_variant_get_child_value (parameter, 2), NULL));
gtk_show_uri_on_window (NULL, g_filename_to_uri(path, NULL, NULL), GDK_CURRENT_TIME, NULL);
}
void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment