[gnome-software/wip/ubuntu-changes] Replace custom function with gs_utils_is_current_desktop
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/ubuntu-changes] Replace custom function with gs_utils_is_current_desktop
- Date: Fri, 13 May 2016 03:41:49 +0000 (UTC)
commit f2f9682dfc20190f9890d358a79fdef9c49dc704
Author: Robert Ancell <robert ancell canonical com>
Date: Fri May 13 15:41:33 2016 +1200
Replace custom function with gs_utils_is_current_desktop
src/gs-dbus-helper.c | 9 ++-------
1 files changed, 2 insertions(+), 7 deletions(-)
---
diff --git a/src/gs-dbus-helper.c b/src/gs-dbus-helper.c
index b75e950..f1c1ced 100644
--- a/src/gs-dbus-helper.c
+++ b/src/gs-dbus-helper.c
@@ -32,6 +32,7 @@
#include "gs-packagekit-modify2-generated.h"
#include "gs-resources.h"
#include "gs-shell-extras.h"
+#include "gs-utils.h"
struct _GsDbusHelper {
GObject parent;
@@ -284,12 +285,6 @@ is_show_confirm_search_set (const gchar *interaction)
return ret;
}
-static gboolean
-is_unity (void)
-{
- return g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") == 0;
-}
-
static void
notify_search_resources (GsShellExtrasMode mode,
const gchar *desktop_id,
@@ -350,7 +345,7 @@ notify_search_resources (GsShellExtrasMode mode,
n = g_notification_new (title);
g_notification_set_body (n, body);
- if (!is_unity ()) {
+ if (!gs_utils_is_current_desktop ("Unity")) {
/* TRANSLATORS: this is a button that launches gnome-software */
g_notification_add_button_with_target (n, _("Find in Software"), "app.install-resources",
"(s^ass)", mode_string, resources, "");
g_notification_set_default_action_and_target (n, "app.install-resources", "(s^ass)",
mode_string, resources, "");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]