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 763129 - application: handle notifications internally
application: handle notifications internally
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-03-05 09:11 UTC by Razvan Chitu
Modified: 2016-03-07 20:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
application: handle notifications internally (5.12 KB, patch)
2016-03-05 09:11 UTC, Razvan Chitu
committed Details | Review
window, progress-persistence-handler: change notifications API (4.93 KB, patch)
2016-03-05 10:09 UTC, Razvan Chitu
committed Details | Review

Description Razvan Chitu 2016-03-05 09:11:27 UTC
See patch.
Comment 1 Razvan Chitu 2016-03-05 09:11:46 UTC
Created attachment 323142 [details] [review]
application: handle notifications internally

In Nautilus, operations such as unmounts create notifications that are not
withdrawn on application closing. This leads to issues such as notifications
that persist even after reboot. In order to fix this, the application should
keep track of the notifications sent in order to withdraw them when it is
closed.

Add helper functions for sending and withdrawing notifications. Add "shutdown"
signal handler for removing notifications on application closing.
Comment 2 Razvan Chitu 2016-03-05 10:09:43 UTC
Created attachment 323143 [details] [review]
window, progress-persistence-handler: change notifications API

In Nautilus, notifications are sent using GApplication functions and are not
tracked. This leads to notifications that are not being cleared when Nautilus is
closed. In order to fix this, sending and withdrawing notifications should be
done with the methods of NautilusApplication. These methods automatically track
and clear them when the application is shutdown.

Replace GApplication functions for sending and withdrawing notifications with
corresponding NautilusApplication functions.
Comment 3 Carlos Soriano 2016-03-07 16:32:28 UTC
Review of attachment 323142 [details] [review]:

right
Comment 4 Carlos Soriano 2016-03-07 16:42:53 UTC
Review of attachment 323143 [details] [review]:

I'm going to pus this patch with the issue below fixed, since I want to do a release with this in.

Thanks for these patches!

::: src/nautilus-progress-persistence-handler.c
@@ -204,3 @@
-	g_application_send_notification (g_application_get_default (),
-                                         "transfer-complete",
-                                         complete_notification);

these id are notunique. You can have multple notifications here. This needs something similar to what we do in the window.
Comment 5 Carlos Soriano 2016-03-07 16:59:02 UTC
Review of attachment 323143 [details] [review]:

we actually don't have multiple instances of this kind of notification, since we only use it when all the progress are done. So this patch is good!
Comment 6 Carlos Soriano 2016-03-07 20:11:26 UTC
Attachment 323142 [details] pushed as 1ba5e62 - application: handle notifications internally
Attachment 323143 [details] pushed as 075e9c1 - window, progress-persistence-handler: change notifications API