summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2009-04-13 18:11:52 +0000
committerAlexander Larsson <alexl@src.gnome.org>2009-04-13 18:11:52 +0000
commit99e702d497e41d42be4b7b3078ca3764f6aef359 (patch)
tree7e453509a90cfffbdbceddd5f49cc5ef20a81732
parentcb087ce4d1de7ca414b9fbceaa19c9da3a783fc5 (diff)
downloadnautilus-99e702d497e41d42be4b7b3078ca3764f6aef359.tar.gz
Don't show eject if not mounted.NAUTILUS_2_26_2
2009-04-13 Alexander Larsson <alexl@redhat.com> * src/nautilus-places-sidebar.c: (add_place): Don't show eject if not mounted. svn path=/trunk/; revision=15181
-rw-r--r--ChangeLog6
-rw-r--r--src/nautilus-places-sidebar.c13
2 files changed, 16 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 693dfa835..e8224529a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2009-04-13 Alexander Larsson <alexl@redhat.com>
+ * src/nautilus-places-sidebar.c:
+ (add_place):
+ Don't show eject if not mounted.
+
+2009-04-13 Alexander Larsson <alexl@redhat.com>
+
* NEWS:
Update for release
diff --git a/src/nautilus-places-sidebar.c b/src/nautilus-places-sidebar.c
index b7d3564a4..2212bc395 100644
--- a/src/nautilus-places-sidebar.c
+++ b/src/nautilus-places-sidebar.c
@@ -218,6 +218,7 @@ add_place (NautilusPlacesSidebar *sidebar,
NautilusIconInfo *icon_info;
int icon_size;
gboolean show_eject, show_unmount;
+ gboolean show_eject_button;
icon_size = nautilus_get_icon_size_for_stock_size (GTK_ICON_SIZE_MENU);
icon_info = nautilus_icon_info_lookup (icon, icon_size);
@@ -230,7 +231,13 @@ add_place (NautilusPlacesSidebar *sidebar,
if (show_unmount || show_eject) {
g_assert (place_type != PLACES_BOOKMARK);
}
-
+
+ if (mount == NULL) {
+ show_eject_button = FALSE;
+ } else {
+ show_eject_button = (show_unmount || show_eject);
+ }
+
gtk_list_store_append (sidebar->store, &iter);
gtk_list_store_set (sidebar->store, &iter,
PLACES_SIDEBAR_COLUMN_ICON, pixbuf,
@@ -241,8 +248,8 @@ add_place (NautilusPlacesSidebar *sidebar,
PLACES_SIDEBAR_COLUMN_MOUNT, mount,
PLACES_SIDEBAR_COLUMN_ROW_TYPE, place_type,
PLACES_SIDEBAR_COLUMN_INDEX, index,
- PLACES_SIDEBAR_COLUMN_EJECT, (show_unmount || show_eject),
- PLACES_SIDEBAR_COLUMN_NO_EJECT, !(show_unmount || show_eject),
+ PLACES_SIDEBAR_COLUMN_EJECT, show_eject_button,
+ PLACES_SIDEBAR_COLUMN_NO_EJECT, !show_eject_button,
PLACES_SIDEBAR_COLUMN_BOOKMARK, place_type != PLACES_BOOKMARK,
PLACES_SIDEBAR_COLUMN_NO_BOOKMARK, place_type == PLACES_BOOKMARK,
-1);