summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2012-10-23 15:29:23 -0400
committerCosimo Cecchi <cosimoc@gnome.org>2012-10-23 16:10:04 -0400
commitd5492dc611473afaaaffd0679f4aed01c427f27d (patch)
treefdd807314e27204b5ec5ad43e99508092048d26c
parent24e0a2a47fb15573478e1a17710385323dbb7026 (diff)
downloadnautilus-d5492dc611473afaaaffd0679f4aed01c427f27d.tar.gz
slot: rename a function for clarity
Rename set_displayed_file() to nautilus_window_slot_update_bookmark(), as that's what it does.
-rw-r--r--src/nautilus-window-slot.c40
1 files changed, 16 insertions, 24 deletions
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index 7486ae93f..5ab01fa00 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -1736,43 +1736,35 @@ nautilus_window_slot_clear_back_list (NautilusWindowSlot *slot)
}
static void
-set_displayed_file (NautilusWindowSlot *slot, NautilusFile *file)
+nautilus_window_slot_update_bookmark (NautilusWindowSlot *slot, NautilusFile *file)
{
gboolean recreate;
- GFile *new_location = NULL;
+ GFile *new_location;
- if (file != NULL) {
- new_location = nautilus_file_get_location (file);
- }
+ new_location = nautilus_file_get_location (file);
- if (slot->details->current_location_bookmark == NULL || file == NULL) {
- recreate = TRUE;
- } else {
+ if (slot->details->current_location_bookmark == NULL) {
+ recreate = TRUE;
+ } else {
GFile *bookmark_location;
- bookmark_location = nautilus_bookmark_get_location (slot->details->current_location_bookmark);
- recreate = !g_file_equal (bookmark_location, new_location);
- g_object_unref (bookmark_location);
+ bookmark_location = nautilus_bookmark_get_location (slot->details->current_location_bookmark);
+ recreate = !g_file_equal (bookmark_location, new_location);
+ g_object_unref (bookmark_location);
}
- if (recreate) {
+ if (recreate) {
char *display_name = NULL;
- /* We've changed locations, must recreate bookmark for current location. */
+ /* We've changed locations, must recreate bookmark for current location. */
g_clear_object (&slot->details->last_location_bookmark);
-
- if (file != NULL) {
- display_name = nautilus_file_get_display_name (file);
- }
slot->details->last_location_bookmark = slot->details->current_location_bookmark;
- if (new_location == NULL) {
- slot->details->current_location_bookmark = NULL;
- } else {
- slot->details->current_location_bookmark = nautilus_bookmark_new (new_location, display_name);
- }
+
+ display_name = nautilus_file_get_display_name (file);
+ slot->details->current_location_bookmark = nautilus_bookmark_new (new_location, display_name);
g_free (display_name);
}
- g_clear_object (&new_location);
+ g_object_unref (new_location);
}
static void
@@ -2053,7 +2045,7 @@ nautilus_window_slot_update_for_new_location (NautilusWindowSlot *slot)
slot->details->pending_location = NULL;
file = nautilus_file_get (new_location);
- set_displayed_file (slot, file);
+ nautilus_window_slot_update_bookmark (slot, file);
update_history (slot, slot->details->location_change_type, new_location);
old_location = nautilus_window_slot_get_location (slot);