Merge lp:~uriboni/unity-2d/launcher-eject-with-ui-if-blocked into lp:unity-2d/3.0

Proposed by Ugo Riboni
Status: Merged
Approved by: Florian Boucault
Approved revision: 433
Merged at revision: 437
Proposed branch: lp:~uriboni/unity-2d/launcher-eject-with-ui-if-blocked
Merge into: lp:unity-2d/3.0
Diff against target: 46 lines (+13/-2)
1 file modified
launcher/UnityApplications/launcherdevice.cpp (+13/-2)
To merge this branch: bzr merge lp:~uriboni/unity-2d/launcher-eject-with-ui-if-blocked
Reviewer Review Type Date Requested Status
Florian Boucault (community) code Needs Fixing
Review via email: mp+52666@code.launchpad.net

Commit message

[launcher] Make sure that when unmounting/ejecting a device Gnome pops up the dialog informing the user about which applications are holding the device busy preventing the eject.

Description of the change

Make sure that when unmounting/ejecting a device Gnome pops up the dialog informing the user about which applications are holding the device busy preventing the eject.

Note for the reviewer: there are two code paths inside LauncherDevice::eject(), but it always seems to use the first one (true), so I couldn't test with the second one, but given the docs it should work exactly in the same way.

To post a comment you must log in.
432. By Ugo Riboni

Merge changes from trunk

Revision history for this message
Florian Boucault (fboucault) wrote :

Looks good!

Do not use the 'mount_op' abbreviation, prefer 'mount_operation' instead. Thanks.

review: Needs Fixing (code)
433. By Ugo Riboni

Rename variable to not be an abbreviation.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/UnityApplications/launcherdevice.cpp'
2--- launcher/UnityApplications/launcherdevice.cpp 2011-03-09 13:23:04 +0000
3+++ launcher/UnityApplications/launcherdevice.cpp 2011-03-10 12:35:43 +0000
4@@ -25,6 +25,12 @@
5 #include <QDebug>
6 #include <QAction>
7
8+#undef signals
9+extern "C" {
10+ #include <gtk/gtk.h>
11+}
12+
13+
14 LauncherDevice::LauncherDevice() :
15 m_volume(NULL)
16 {
17@@ -175,8 +181,11 @@
18 return;
19 }
20
21+ GMountOperation *mountOperation;
22+ mountOperation = gtk_mount_operation_new(NULL);
23+
24 if (g_volume_can_eject(m_volume)) {
25- g_volume_eject_with_operation(m_volume, G_MOUNT_UNMOUNT_NONE, NULL,
26+ g_volume_eject_with_operation(m_volume, G_MOUNT_UNMOUNT_NONE, mountOperation,
27 NULL, (GAsyncReadyCallback) LauncherDevice::onVolumeEjected, NULL);
28 } else {
29 GMount* mount = g_volume_get_mount(m_volume);
30@@ -186,13 +195,15 @@
31 }
32
33 if (g_mount_can_unmount(mount)) {
34- g_mount_unmount_with_operation(mount, G_MOUNT_UNMOUNT_NONE, NULL,
35+ g_mount_unmount_with_operation(mount, G_MOUNT_UNMOUNT_NONE, mountOperation,
36 NULL, (GAsyncReadyCallback) LauncherDevice::onMountUnmounted,
37 NULL);
38 } else {
39 g_object_unref(mount);
40 }
41 }
42+
43+ g_object_unref(mountOperation);
44 }
45
46 void

Subscribers

People subscribed via source and target branches

to all changes: