summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Neumair <cneumair@gnome.org>2008-06-29 11:28:11 +0000
committerChristian Neumair <cneumair@src.gnome.org>2008-06-29 11:28:11 +0000
commit5ce76b65a6cfdaeb81ff93bde732bab02ab31d01 (patch)
tree89a5b39a594046133577de0a93e16c77eddf351d
parentcccb8521025ddcec91604817eec7886c5bf31b2c (diff)
downloadnautilus-5ce76b65a6cfdaeb81ff93bde732bab02ab31d01.tar.gz
Return pending location, fall back to current location. This API is used
2008-06-29 Christian Neumair <cneumair@gnome.org> * src/nautilus-window-slot.c (real_slot_info_get_current_location), (nautilus_window_slot_info_iface_init): Return pending location, fall back to current location. This API is used by the side panes, we have to guarantee that a valid URI is returned even if the view has not yet been set up. svn path=/branches/multiview/; revision=14300
-rw-r--r--ChangeLog8
-rw-r--r--src/nautilus-window-slot.c22
2 files changed, 29 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ab5c55f24..5bef1938b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-06-29 Christian Neumair <cneumair@gnome.org>
+
+ * src/nautilus-window-slot.c (real_slot_info_get_current_location),
+ (nautilus_window_slot_info_iface_init):
+ Return pending location, fall back to current location. This API is
+ used by the side panes, we have to guarantee that a valid URI is
+ returned even if the view has not yet been set up.
+
2008-06-28 Christian Neumair <cneumair@gnome.org>
* src/nautilus-window-slot.c
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index 632393f51..d1e989c8a 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -415,6 +415,26 @@ nautilus_window_slot_add_current_location_to_history_list (NautilusWindowSlot *s
}
}
+/* returns either the pending or the actual current location - used by side panes. */
+static char *
+real_slot_info_get_current_location (NautilusWindowSlotInfo *info)
+{
+ NautilusWindowSlot *slot;
+
+ slot = NAUTILUS_WINDOW_SLOT (info);
+
+ if (slot->pending_location != NULL) {
+ return g_file_get_uri (slot->pending_location);
+ }
+
+ if (slot->location != NULL) {
+ return g_file_get_uri (slot->location);
+ }
+
+ g_assert_not_reached ();
+ return NULL;
+}
+
static void
nautilus_window_slot_dispose (GObject *object)
{
@@ -480,7 +500,7 @@ nautilus_window_slot_info_iface_init (NautilusWindowSlotInfoIface *iface)
iface->inactive = nautilus_window_slot_inactive;
iface->get_window = nautilus_window_slot_get_window;
iface->get_selection_count = nautilus_window_slot_get_selection_count;
- iface->get_current_location = nautilus_window_slot_get_location_uri;
+ iface->get_current_location = real_slot_info_get_current_location;
iface->set_status = nautilus_window_slot_set_status;
iface->get_title = nautilus_window_slot_get_title;
iface->open_location = nautilus_window_slot_open_location_full;