[gnome-software/wip/rancell/ubuntu-3-20-3: 49/56] Make filename passed with --local-filename absolute.
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/rancell/ubuntu-3-20-3: 49/56] Make filename passed with --local-filename absolute.
- Date: Sat, 17 Jun 2017 12:13:15 +0000 (UTC)
commit ed1312353d57491046ec456f2a26851461208f72
Author: Robert Ancell <robert ancell canonical com>
Date: Fri Apr 21 14:15:54 2017 +1200
Make filename passed with --local-filename absolute.
If you already have gnome-software running this filename is passed to the
existing process which is likely to be running in a different working directory.
src/gs-application.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/gs-application.c b/src/gs-application.c
index faea12d..2f08f5f 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -852,9 +852,14 @@ gs_application_handle_local_options (GApplication *app, GVariantDict *options)
g_variant_new_string (pkgname));
return 0;
} else if (g_variant_dict_lookup (options, "local-filename", "^&ay", &local_filename)) {
+ g_autoptr(GFile) file = NULL;
+ g_autofree gchar *absolute_filename = NULL;
+
+ file = g_file_new_for_path (local_filename);
+ absolute_filename = g_file_get_path (file);
g_action_group_activate_action (G_ACTION_GROUP (app),
"filename",
- g_variant_new ("(s)", local_filename));
+ g_variant_new ("(s)", absolute_filename));
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]