summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Kasik <mkasik@redhat.com>2012-12-05 15:54:07 +0100
committerBastien Nocera <hadess@hadess.net>2012-12-05 16:23:52 +0100
commite2621fe77c295850aff3b26dad422e7ed05e3d43 (patch)
tree9626b34230e22818b02107092317f04cf235d21c
parent650ad58acab0d87f2a13bc49965454603be68431 (diff)
downloadgnome-settings-daemon-e2621fe77c295850aff3b26dad422e7ed05e3d43.tar.gz
print-notifications: Don't show strange notifications when printing
Don't show notifications for: - cups-remote-* - other - com.apple.print.recoverable printer state reasons. "cups-remote-*" are not real errors: https://bugzilla.redhat.com/show_bug.cgi?id=883401 https://bugzilla.gnome.org/show_bug.cgi?id=683577 "other" can be emitted for no reason: https://bugzilla.redhat.com/show_bug.cgi?id=520815 "com.apple.print.recoverable" is for internal use only.
-rw-r--r--plugins/print-notifications/gsd-print-notifications-manager.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/plugins/print-notifications/gsd-print-notifications-manager.c b/plugins/print-notifications/gsd-print-notifications-manager.c
index 482a5286..c191e5c4 100644
--- a/plugins/print-notifications/gsd-print-notifications-manager.c
+++ b/plugins/print-notifications/gsd-print-notifications-manager.c
@@ -262,6 +262,20 @@ show_notification (gpointer user_data)
return FALSE;
}
+static gboolean
+reason_is_blacklisted (const gchar *reason) {
+ if (g_str_equal (reason, "none"))
+ return TRUE;
+ if (g_str_equal (reason, "other"))
+ return TRUE;
+ if (g_str_equal (reason, "com.apple.print.recoverable"))
+ return TRUE;
+ /* https://bugzilla.redhat.com/show_bug.cgi?id=883401 */
+ if (g_str_has_prefix (reason, "cups-remote-"))
+ return TRUE;
+ return FALSE;
+}
+
static void
on_cups_notification (GDBusConnection *connection,
const char *sender_name,
@@ -683,7 +697,8 @@ on_cups_notification (GDBusConnection *connection,
}
}
- if (!known_reason && !g_str_equal (data, "none")) {
+ if (!known_reason &&
+ !reason_is_blacklisted (data)) {
NotifyNotification *notification;
ReasonData *reason_data;
gchar *first_row;