[nautilus] mime-actions: check for name owner for PackageKit
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] mime-actions: check for name owner for PackageKit
- Date: Mon, 16 Nov 2015 22:00:38 +0000 (UTC)
commit 12dedcc4100ea01b2639be5d4f46a87fe171ad86
Author: Cosimo Cecchi <cosimo endlessm com>
Date: Mon Nov 16 13:49:50 2015 -0800
mime-actions: check for name owner for PackageKit
We might not have a PackageKit name owner. Check for that case, or the
system will think that it can install extra applications.
src/nautilus-mime-actions.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/nautilus-mime-actions.c b/src/nautilus-mime-actions.c
index 493aee4..a55469a 100644
--- a/src/nautilus-mime-actions.c
+++ b/src/nautilus-mime-actions.c
@@ -1157,18 +1157,19 @@ pk_proxy_appeared_cb (GObject *source,
gpointer user_data)
{
ActivateParametersInstall *parameters_install = user_data;
- char *mime_type;
+ char *mime_type, *name_owner;
char *error_message;
GtkWidget *dialog;
GDBusProxy *proxy;
GError *error = NULL;
proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
+ name_owner = g_dbus_proxy_get_name_owner (proxy);
- if (error != NULL) {
+ if (error != NULL || name_owner == NULL) {
g_warning ("Couldn't call Modify on the PackageKit interface: %s",
- error->message);
- g_error_free (error);
+ error != NULL ? error->message : "no owner for PackageKit");
+ g_clear_error (&error);
/* show an unhelpful dialog */
show_unhandled_type_error (parameters_install);
@@ -1178,6 +1179,8 @@ pk_proxy_appeared_cb (GObject *source,
return;
}
+ g_free (name_owner);
+
mime_type = nautilus_file_get_mime_type (parameters_install->file);
error_message = get_application_no_mime_type_handler_message (parameters_install->file,
parameters_install->uri);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]