diff options
author | Christian Neumair <cneumair@gnome.org> | 2008-06-29 11:28:11 +0000 |
---|---|---|
committer | Christian Neumair <cneumair@src.gnome.org> | 2008-06-29 11:28:11 +0000 |
commit | 5ce76b65a6cfdaeb81ff93bde732bab02ab31d01 (patch) | |
tree | 89a5b39a594046133577de0a93e16c77eddf351d | |
parent | cccb8521025ddcec91604817eec7886c5bf31b2c (diff) | |
download | nautilus-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-- | ChangeLog | 8 | ||||
-rw-r--r-- | src/nautilus-window-slot.c | 22 |
2 files changed, 29 insertions, 1 deletions
@@ -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; |