After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 683577 - strange error notification
strange error notification
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: printers
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Marek Kašík
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2012-09-07 14:14 UTC by William Jon McCann
Modified: 2012-12-05 15:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot (604.51 KB, image/png)
2012-09-07 14:14 UTC, William Jon McCann
  Details
blacklist some printer state reasons (1.85 KB, patch)
2012-12-05 14:14 UTC, Marek Kašík
needs-work Details | Review
Don't show strange notifications when printing (2.18 KB, patch)
2012-12-05 14:55 UTC, Marek Kašík
reviewed Details | Review

Description William Jon McCann 2012-09-07 14:14:29 UTC
Created attachment 223765 [details]
screenshot

Successfully printed something out yesterday and saw this notification.
Comment 1 Marek Kašík 2012-12-05 14:14:19 UTC
Created attachment 230762 [details] [review]
blacklist some printer state reasons

Hi,

this patch fixes the problem. It blacklists reasons which should not be shown to users. This bug is also related to https://bugzilla.redhat.com/show_bug.cgi?id=883401.

Regards

Marek
Comment 2 Bastien Nocera 2012-12-05 14:32:27 UTC
Review of attachment 230762 [details] [review]:

The commit subject should be the user-visible impact, eg. "Don't show strange notifications when printing"

::: plugins/print-notifications/gsd-print-notifications-manager.c
@@ +686,3 @@
+                                if (!known_reason &&
+                                    (!g_str_equal (data, "none") &&
+                                     /* These reasons should not be shown to users (rhbz#883401) */

Move all that to a separate function.
Comment 3 Marek Kašík 2012-12-05 14:55:50 UTC
Created attachment 230765 [details] [review]
Don't show strange notifications when  printing

(In reply to comment #2)
> Review of attachment 230762 [details] [review]:
> 
> The commit subject should be the user-visible impact, eg. "Don't show strange
> notifications when printing"

Done.

> Move all that to a separate function.

Done.
Comment 4 Bastien Nocera 2012-12-05 15:18:15 UTC
Review of attachment 230765 [details] [review]:

::: plugins/print-notifications/gsd-print-notifications-manager.c
@@ +265,3 @@
+static gboolean
+reason_is_blacklisted (const gchar *reason) {
+        if (g_str_equal (reason, "none") ||

You can split those up.

@@ +272,3 @@
+                return TRUE;
+        }
+        else {

No need for an else branch if you reverse the checks.
Comment 5 Bastien Nocera 2012-12-05 15:25:10 UTC
Fixed in gnome-3-6 and master

commit 66f5934a8f6185b172fc9db9ce743b4f78188296
Author: Marek Kasik <mkasik@redhat.com>
Date:   Wed Dec 5 15:54:07 2012 +0100

    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.