[Xfce4-commits] <thunar:jannis/new-shortcuts-pane> Improve flashing frequency/amount, fix disconnecting unmountable mounts.
Jannis Pohlmann
noreply at xfce.org
Thu Jun 16 00:36:01 CEST 2011
Updating branch refs/heads/jannis/new-shortcuts-pane
to bff5a583ae363322fc548e6c5347e044e0d44510 (commit)
from 4cab079f37a42a12ca44532c59f6bfd97009f08d (commit)
commit bff5a583ae363322fc548e6c5347e044e0d44510
Author: Jannis Pohlmann <jannis at xfce.org>
Date: Thu Jun 16 00:34:44 2011 +0200
Improve flashing frequency/amount, fix disconnecting unmountable mounts.
thunar/thunar-shortcut-row.c | 39 +++++++++++++++++++++++++++++++++++++--
thunar/thunar-shortcuts-view.c | 4 ++--
2 files changed, 39 insertions(+), 4 deletions(-)
diff --git a/thunar/thunar-shortcut-row.c b/thunar/thunar-shortcut-row.c
index 012ca37..1fbee4f 100644
--- a/thunar/thunar-shortcut-row.c
+++ b/thunar/thunar-shortcut-row.c
@@ -1617,6 +1617,8 @@ thunar_shortcut_row_unmount (ThunarShortcutRow *row)
_thunar_return_if_fail (THUNAR_IS_SHORTCUT_ROW (row));
+ g_debug ("row unmount");
+
/* check if we are currently mounting/ejecting something */
if (row->state != THUNAR_SHORTCUT_ROW_NORMAL)
{
@@ -1633,12 +1635,18 @@ thunar_shortcut_row_unmount (ThunarShortcutRow *row)
if (row->mount != NULL)
{
+ g_debug (" have mount");
+
/* only handle mounts that can be unmounted here */
if (g_mount_can_unmount (row->mount))
{
+ g_debug (" mount can unmount");
+
/* start spinning */
thunar_shortcut_row_set_spinning (row, TRUE, THUNAR_SHORTCUT_ROW_EJECTING);
+ g_debug (" unmount now");
+
/* try unmounting the mount */
g_mount_unmount_with_operation (row->mount,
G_MOUNT_UNMOUNT_NONE,
@@ -1650,18 +1658,23 @@ thunar_shortcut_row_unmount (ThunarShortcutRow *row)
}
else if (row->volume != NULL)
{
+ g_debug (" have volume");
mount = g_volume_get_mount (row->volume);
if (mount != NULL)
{
- g_debug ("have mount");
+ g_debug (" have mount");
+
/* only handle mounts that can be unmounted here */
if (g_mount_can_unmount(mount))
{
- g_debug ("can unmount");
+ g_debug (" can unmount");
+
/* start spinning */
thunar_shortcut_row_set_spinning (row, TRUE,
THUNAR_SHORTCUT_ROW_EJECTING);
+ g_debug (" unmount now");
+
/* try unmounting the mount */
g_mount_unmount_with_operation (mount,
G_MOUNT_UNMOUNT_NONE,
@@ -1697,6 +1710,8 @@ thunar_shortcut_row_disconnect (ThunarShortcutRow *row)
_thunar_return_if_fail (THUNAR_IS_SHORTCUT_ROW (row));
+ g_debug ("disconnect row");
+
/* check if we are currently mounting/ejecting something */
if (row->state != THUNAR_SHORTCUT_ROW_NORMAL)
{
@@ -1713,12 +1728,18 @@ thunar_shortcut_row_disconnect (ThunarShortcutRow *row)
if (row->mount != NULL)
{
+ g_debug (" have mount");
+
/* distinguish between ejectable and unmountable mounts */
if (g_mount_can_eject (row->mount))
{
+ g_debug (" can eject");
+
/* start spinning */
thunar_shortcut_row_set_spinning (row, TRUE, THUNAR_SHORTCUT_ROW_EJECTING);
+ g_debug (" eject now");
+
/* try ejecting the mount */
g_mount_eject_with_operation (row->mount,
G_MOUNT_UNMOUNT_NONE,
@@ -1727,6 +1748,20 @@ thunar_shortcut_row_disconnect (ThunarShortcutRow *row)
thunar_shortcut_row_mount_eject_finish,
row);
}
+ else if (g_mount_can_unmount (row->mount))
+ {
+ /* start spinning */
+ thunar_shortcut_row_set_spinning (row, TRUE,
+ THUNAR_SHORTCUT_ROW_EJECTING);
+
+ /* try unmounting the mount */
+ g_mount_unmount_with_operation (row->mount,
+ G_MOUNT_UNMOUNT_NONE,
+ mount_operation,
+ row->cancellable,
+ thunar_shortcut_row_mount_unmount_finish,
+ row);
+ }
}
else if (row->volume != NULL)
{
diff --git a/thunar/thunar-shortcuts-view.c b/thunar/thunar-shortcuts-view.c
index b6b7ceb..c1ff630 100644
--- a/thunar/thunar-shortcuts-view.c
+++ b/thunar/thunar-shortcuts-view.c
@@ -48,8 +48,8 @@
-#define THUNAR_SHORTCUTS_VIEW_FLASH_TIMEOUT 150
-#define THUNAR_SHORTCUTS_VIEW_FLASH_TIMES 4
+#define THUNAR_SHORTCUTS_VIEW_FLASH_TIMEOUT 300
+#define THUNAR_SHORTCUTS_VIEW_FLASH_TIMES 3
More information about the Xfce4-commits
mailing list