GNOME Bugzilla – Bug 722629
optical-media: Implement proper content-changed support
Last modified: 2014-02-06 13:59:08 UTC
Quite tedious, but each patch should be reviewable and commitable separately.
Created attachment 266771 [details] [review] optical-media: Handle cancelled retvals like errors
Created attachment 266772 [details] [review] optical-media: Track added media
Created attachment 266773 [details] [review] optical-media: Split up drive detection function
Created attachment 266774 [details] [review] optical-media: Simplify device addition
Created attachment 266776 [details] [review] optical-media: Split out whether to ignore volumes
Created attachment 266777 [details] [review] optical-media: Add ignore_mount() helper
Created attachment 266778 [details] [review] optical-media: Monitor only volumes, with separate callbacks
Created attachment 266779 [details] [review] optical-media: Split out creating the media id
Created attachment 266780 [details] [review] optical-media: Split out setting metadata
Created attachment 266781 [details] [review] optical-media: Add a cancellable for other ops
Created attachment 266782 [details] [review] optical-media: Simplify add_volume()
Created attachment 266783 [details] [review] optical-media: Don't pass browse data to entry_parsed_cb()
Created attachment 266784 [details] [review] optical-media: Implement proper content-changed support
Created attachment 266788 [details] [review] optical-media: Don't pass browse data to entry_parsed_cb()
Created attachment 266789 [details] [review] optical-media: Implement proper content-changed support
Created attachment 266791 [details] [review] optical-media: Implement proper content-changed support
Created attachment 266851 [details] [review] optical-media: Implement proper content-changed support
Created attachment 266884 [details] [review] optical-media: Handle cancelled retvals like errors
Created attachment 266885 [details] [review] optical-media: Track added media
Created attachment 266886 [details] [review] optical-media: Add a cancellable for other ops
Created attachment 266887 [details] [review] optical-media: Don't pass browse data to entry_parsed_cb()
Created attachment 266888 [details] [review] optical-media: Add support for content-changed And rework the plugin to handle and monitor mounts rather than volumes. Even though we'd like to support volumes, it's rather unnecessary and causes problems: - physical discs will get mounted anyway, so create a mount - ISO images, when added, generate volume events that aren't easy to process when we're interested in mounts ("added" without a mount, "changed" when the mount is added) - When removing ISO images, the backing loop device might not get disconnected, not generating volume events, and when we get mount events, it's too late to find the backing volume All this together means that the the code is barely readable after all those changes, so here's a chunk of it.
Created attachment 268291 [details] [review] optical-media: Add start/stop notification changes
commit 95d8544d11b92cd1faa22a35347967bb9c0341c0 Author: Juan A. Suarez Romero <jasuarez@igalia.com> Date: Thu Feb 6 14:40:48 2014 +0100 optical-media: Add start/stop notification changes https://bugzilla.gnome.org/show_bug.cgi?id=722629 src/optical-media/grl-optical-media.c | 47 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 4 deletions(-) commit e01be7ecef9fde1f565b17b10f0223bb4d5709c7 Author: Bastien Nocera <hadess@hadess.net> Date: Mon Jan 20 17:21:08 2014 +0100 optical-media: Add support for content-changed And rework the plugin to handle and monitor mounts rather than volumes. Even though we'd like to support volumes, it's rather unnecessary and causes problems: - physical discs will get mounted anyway, so create a mount - ISO images, when added, generate volume events that aren't easy to process when we're interested in mounts ("added" without a mount, "changed" when the mount is added) - When removing ISO images, the backing loop device might not get disconnected, not generating volume events, and when we get mount events, it's too late to find the backing volume All this together means that the the code is barely readable after all those changes, so here's a chunk of it. https://bugzilla.gnome.org/show_bug.cgi?id=722629 src/optical-media/grl-optical-media.c | 418 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------ 1 file changed, 269 insertions(+), 149 deletions(-) commit 762fd61271a982e792e5de718bb2de39cda07923 Author: Bastien Nocera <hadess@hadess.net> Date: Mon Jan 20 19:09:54 2014 +0100 optical-media: Don't pass browse data to entry_parsed_cb() https://bugzilla.gnome.org/show_bug.cgi?id=722629 src/optical-media/grl-optical-media.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) commit c8fdaedb69e733a6fece70e1954bc10714ea48a3 Author: Bastien Nocera <hadess@hadess.net> Date: Mon Jan 20 19:07:37 2014 +0100 optical-media: Add a cancellable for other ops https://bugzilla.gnome.org/show_bug.cgi?id=722629 src/optical-media/grl-optical-media.c | 5 +++++ 1 file changed, 5 insertions(+) commit c4077cf4421ec5e162f717d86d6acc81eee5679e Author: Bastien Nocera <hadess@hadess.net> Date: Mon Jan 20 17:05:51 2014 +0100 optical-media: Track added media https://bugzilla.gnome.org/show_bug.cgi?id=722629 src/optical-media/grl-optical-media.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) commit 2756ec1f136b23b92b7c3a70d0989c1226314f58 Author: Bastien Nocera <hadess@hadess.net> Date: Mon Jan 20 17:05:08 2014 +0100 optical-media: Handle cancelled retvals like errors https://bugzilla.gnome.org/show_bug.cgi?id=722629 src/optical-media/grl-optical-media.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)