Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Files
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
443
Issues
443
List
Boards
Labels
Service Desk
Milestones
Merge Requests
30
Merge Requests
30
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
Files
Commits
9af483db
Commit
9af483db
authored
Feb 17, 2011
by
Cosimo Cecchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
all: merge NautilusNavigationWindowSlot into NautilusWindowSlot
parent
238bc145
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
172 additions
and
387 deletions
+172
-387
src/Makefile.am
src/Makefile.am
+0
-2
src/nautilus-application.c
src/nautilus-application.c
+2
-6
src/nautilus-navigation-action.c
src/nautilus-navigation-action.c
+2
-3
src/nautilus-navigation-window-slot.c
src/nautilus-navigation-window-slot.c
+0
-216
src/nautilus-navigation-window-slot.h
src/nautilus-navigation-window-slot.h
+0
-68
src/nautilus-navigation-window.c
src/nautilus-navigation-window.c
+3
-4
src/nautilus-window-manage-views.c
src/nautilus-window-manage-views.c
+44
-59
src/nautilus-window-pane.c
src/nautilus-window-pane.c
+6
-8
src/nautilus-window-slot.c
src/nautilus-window-slot.c
+100
-14
src/nautilus-window-slot.h
src/nautilus-window-slot.h
+11
-2
src/nautilus-window.c
src/nautilus-window.c
+4
-5
No files found.
src/Makefile.am
View file @
9af483db
...
...
@@ -105,8 +105,6 @@ nautilus_SOURCES = \
nautilus-navigation-window-menus.c
\
nautilus-navigation-window.c
\
nautilus-navigation-window.h
\
nautilus-navigation-window-slot.c
\
nautilus-navigation-window-slot.h
\
nautilus-notebook.c
\
nautilus-notebook.h
\
nautilus-pathbar.c
\
...
...
src/nautilus-application.c
View file @
9af483db
...
...
@@ -40,7 +40,6 @@
#include "nautilus-image-properties-page.h"
#include "nautilus-list-view.h"
#include "nautilus-navigation-window.h"
#include "nautilus-navigation-window-slot.h"
#include "nautilus-progress-ui-handler.h"
#include "nautilus-self-check-functions.h"
#include "nautilus-window-bookmarks.h"
...
...
@@ -893,9 +892,7 @@ get_first_navigation_slot (GList *slot_list)
GList
*
l
;
for
(
l
=
slot_list
;
l
!=
NULL
;
l
=
l
->
next
)
{
if
(
NAUTILUS_IS_NAVIGATION_WINDOW_SLOT
(
l
->
data
))
{
return
l
->
data
;
}
return
l
->
data
;
}
return
NULL
;
...
...
@@ -907,8 +904,7 @@ should_close_slot_with_mount (NautilusWindow *window,
NautilusWindowSlot
*
slot
,
GMount
*
mount
)
{
return
nautilus_navigation_window_slot_should_close_with_mount
(
NAUTILUS_NAVIGATION_WINDOW_SLOT
(
slot
),
mount
);
return
nautilus_window_slot_should_close_with_mount
(
slot
,
mount
);
}
/* Called whenever a mount is unmounted. Check and see if there are
...
...
src/nautilus-navigation-action.c
View file @
9af483db
...
...
@@ -33,7 +33,6 @@
#include "nautilus-navigation-action.h"
#include "nautilus-navigation-window.h"
#include "nautilus-navigation-window-slot.h"
#include <gtk/gtk.h>
#include <eel/eel-gtk-extensions.h>
...
...
@@ -106,14 +105,14 @@ fill_menu (NautilusNavigationWindow *window,
GtkWidget
*
menu
,
gboolean
back
)
{
Nautilus
Navigation
WindowSlot
*
slot
;
NautilusWindowSlot
*
slot
;
GtkWidget
*
menu_item
;
int
index
;
GList
*
list
;
g_assert
(
NAUTILUS_IS_NAVIGATION_WINDOW
(
window
));
slot
=
NAUTILUS_NAVIGATION_WINDOW_SLOT
(
nautilus_window_get_active_slot
(
NAUTILUS_WINDOW
(
window
)
));
slot
=
nautilus_window_get_active_slot
(
NAUTILUS_WINDOW
(
window
));
list
=
back
?
slot
->
back_list
:
slot
->
forward_list
;
index
=
0
;
...
...
src/nautilus-navigation-window-slot.c
deleted
100644 → 0
View file @
238bc145
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-navigation-window-slot.c: Nautilus navigation window slot
Copyright (C) 2008 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Christian Neumair <cneumair@gnome.org>
*/
#include "nautilus-window-slot.h"
#include "nautilus-navigation-window-slot.h"
#include "nautilus-window-private.h"
#include "nautilus-search-bar.h"
#include "nautilus-window-pane.h"
#include <libnautilus-private/nautilus-file.h>
#include <eel/eel-gtk-macros.h>
static
void
nautilus_navigation_window_slot_init
(
NautilusNavigationWindowSlot
*
slot
);
static
void
nautilus_navigation_window_slot_class_init
(
NautilusNavigationWindowSlotClass
*
class
);
G_DEFINE_TYPE
(
NautilusNavigationWindowSlot
,
nautilus_navigation_window_slot
,
NAUTILUS_TYPE_WINDOW_SLOT
)
#define parent_class nautilus_navigation_window_slot_parent_class
gboolean
nautilus_navigation_window_slot_should_close_with_mount
(
NautilusNavigationWindowSlot
*
slot
,
GMount
*
mount
)
{
NautilusBookmark
*
bookmark
;
GFile
*
mount_location
,
*
bookmark_location
;
GList
*
l
;
gboolean
close_with_mount
;
if
(
slot
->
parent
.
pane
->
window
->
details
->
initiated_unmount
)
{
return
FALSE
;
}
mount_location
=
g_mount_get_root
(
mount
);
close_with_mount
=
TRUE
;
for
(
l
=
slot
->
back_list
;
l
!=
NULL
;
l
=
l
->
next
)
{
bookmark
=
NAUTILUS_BOOKMARK
(
l
->
data
);
bookmark_location
=
nautilus_bookmark_get_location
(
bookmark
);
close_with_mount
&=
g_file_has_prefix
(
bookmark_location
,
mount_location
)
||
g_file_equal
(
bookmark_location
,
mount_location
);
g_object_unref
(
bookmark_location
);
if
(
!
close_with_mount
)
{
break
;
}
}
close_with_mount
&=
g_file_has_prefix
(
NAUTILUS_WINDOW_SLOT
(
slot
)
->
location
,
mount_location
)
||
g_file_equal
(
NAUTILUS_WINDOW_SLOT
(
slot
)
->
location
,
mount_location
);
/* we could also consider the forward list here, but since the “go home” request
* in nautilus-window-manager-views.c:mount_removed_callback() would discard those
* anyway, we don't consider them.
*/
g_object_unref
(
mount_location
);
return
close_with_mount
;
}
void
nautilus_navigation_window_slot_clear_forward_list
(
NautilusNavigationWindowSlot
*
slot
)
{
g_assert
(
NAUTILUS_IS_NAVIGATION_WINDOW_SLOT
(
slot
));
g_list_free_full
(
slot
->
forward_list
,
g_object_unref
);
slot
->
forward_list
=
NULL
;
}
void
nautilus_navigation_window_slot_clear_back_list
(
NautilusNavigationWindowSlot
*
slot
)
{
g_assert
(
NAUTILUS_IS_NAVIGATION_WINDOW_SLOT
(
slot
));
g_list_free_full
(
slot
->
back_list
,
g_object_unref
);
slot
->
back_list
=
NULL
;
}
static
void
query_editor_changed_callback
(
NautilusSearchBar
*
bar
,
NautilusQuery
*
query
,
gboolean
reload
,
NautilusWindowSlot
*
slot
)
{
NautilusDirectory
*
directory
;
g_assert
(
NAUTILUS_IS_FILE
(
slot
->
viewed_file
));
directory
=
nautilus_directory_get_for_file
(
slot
->
viewed_file
);
g_assert
(
NAUTILUS_IS_SEARCH_DIRECTORY
(
directory
));
nautilus_search_directory_set_query
(
NAUTILUS_SEARCH_DIRECTORY
(
directory
),
query
);
if
(
reload
)
{
nautilus_window_slot_reload
(
slot
);
}
nautilus_directory_unref
(
directory
);
}
static
void
nautilus_navigation_window_slot_update_query_editor
(
NautilusWindowSlot
*
slot
)
{
NautilusDirectory
*
directory
;
NautilusSearchDirectory
*
search_directory
;
NautilusQuery
*
query
;
GtkWidget
*
query_editor
;
g_assert
(
slot
->
pane
->
window
!=
NULL
);
query_editor
=
NULL
;
directory
=
nautilus_directory_get
(
slot
->
location
);
if
(
NAUTILUS_IS_SEARCH_DIRECTORY
(
directory
))
{
search_directory
=
NAUTILUS_SEARCH_DIRECTORY
(
directory
);
if
(
nautilus_search_directory_is_saved_search
(
search_directory
))
{
query_editor
=
nautilus_query_editor_new
(
TRUE
,
nautilus_search_directory_is_indexed
(
search_directory
));
}
else
{
query_editor
=
nautilus_query_editor_new_with_bar
(
FALSE
,
nautilus_search_directory_is_indexed
(
search_directory
),
slot
->
pane
->
window
->
details
->
active_pane
->
active_slot
==
slot
,
NAUTILUS_SEARCH_BAR
(
slot
->
pane
->
search_bar
),
slot
);
}
}
slot
->
query_editor
=
NAUTILUS_QUERY_EDITOR
(
query_editor
);
if
(
query_editor
!=
NULL
)
{
g_signal_connect_object
(
query_editor
,
"changed"
,
G_CALLBACK
(
query_editor_changed_callback
),
slot
,
0
);
query
=
nautilus_search_directory_get_query
(
search_directory
);
if
(
query
!=
NULL
)
{
nautilus_query_editor_set_query
(
NAUTILUS_QUERY_EDITOR
(
query_editor
),
query
);
g_object_unref
(
query
);
}
else
{
nautilus_query_editor_set_default_query
(
NAUTILUS_QUERY_EDITOR
(
query_editor
));
}
nautilus_window_slot_add_extra_location_widget
(
slot
,
query_editor
);
gtk_widget_show
(
query_editor
);
nautilus_query_editor_grab_focus
(
NAUTILUS_QUERY_EDITOR
(
query_editor
));
}
nautilus_directory_unref
(
directory
);
}
static
void
nautilus_navigation_window_slot_active
(
NautilusWindowSlot
*
slot
)
{
NautilusWindowPane
*
pane
;
int
page_num
;
pane
=
slot
->
pane
;
page_num
=
gtk_notebook_page_num
(
GTK_NOTEBOOK
(
pane
->
notebook
),
slot
->
content_box
);
g_assert
(
page_num
>=
0
);
gtk_notebook_set_current_page
(
GTK_NOTEBOOK
(
pane
->
notebook
),
page_num
);
EEL_CALL_PARENT
(
NAUTILUS_WINDOW_SLOT_CLASS
,
active
,
(
slot
));
}
static
void
nautilus_navigation_window_slot_dispose
(
GObject
*
object
)
{
NautilusNavigationWindowSlot
*
slot
;
slot
=
NAUTILUS_NAVIGATION_WINDOW_SLOT
(
object
);
nautilus_navigation_window_slot_clear_forward_list
(
slot
);
nautilus_navigation_window_slot_clear_back_list
(
slot
);
G_OBJECT_CLASS
(
parent_class
)
->
dispose
(
object
);
}
static
void
nautilus_navigation_window_slot_init
(
NautilusNavigationWindowSlot
*
slot
)
{
}
static
void
nautilus_navigation_window_slot_class_init
(
NautilusNavigationWindowSlotClass
*
class
)
{
NAUTILUS_WINDOW_SLOT_CLASS
(
class
)
->
active
=
nautilus_navigation_window_slot_active
;
NAUTILUS_WINDOW_SLOT_CLASS
(
class
)
->
update_query_editor
=
nautilus_navigation_window_slot_update_query_editor
;
G_OBJECT_CLASS
(
class
)
->
dispose
=
nautilus_navigation_window_slot_dispose
;
}
src/nautilus-navigation-window-slot.h
deleted
100644 → 0
View file @
238bc145
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-navigation-window-slot.h: Nautilus navigation window slot
Copyright (C) 2008 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Christian Neumair <cneumair@gnome.org>
*/
#ifndef NAUTILUS_NAVIGATION_WINDOW_SLOT_H
#define NAUTILUS_NAVIGATION_WINDOW_SLOT_H
#include "nautilus-window-slot.h"
typedef
struct
NautilusNavigationWindowSlot
NautilusNavigationWindowSlot
;
typedef
struct
NautilusNavigationWindowSlotClass
NautilusNavigationWindowSlotClass
;
#define NAUTILUS_TYPE_NAVIGATION_WINDOW_SLOT (nautilus_navigation_window_slot_get_type())
#define NAUTILUS_NAVIGATION_WINDOW_SLOT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), NAUTILUS_NAVIGATION_WINDOW_SLOT_CLASS, NautilusNavigationWindowSlotClass))
#define NAUTILUS_NAVIGATION_WINDOW_SLOT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NAUTILUS_TYPE_NAVIGATION_WINDOW_SLOT, NautilusNavigationWindowSlot))
#define NAUTILUS_IS_NAVIGATION_WINDOW_SLOT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NAUTILUS_TYPE_NAVIGATION_WINDOW_SLOT))
#define NAUTILUS_IS_NAVIGATION_WINDOW_SLOT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), NAUTILUS_TYPE_NAVIGATION_WINDOW_SLOT))
#define NAUTILUS_NAVIGATION_WINDOW_SLOT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), NAUTILUS_TYPE_NAVIGATION_WINDOW_SLOT, NautilusNavigationWindowSlotClass))
struct
NautilusNavigationWindowSlot
{
NautilusWindowSlot
parent
;
GtkTreeModel
*
viewer_model
;
int
num_viewers
;
/* Back/Forward chain, and history list.
* The data in these lists are NautilusBookmark pointers.
*/
GList
*
back_list
,
*
forward_list
;
/* Current views stuff */
GList
*
sidebar_panels
;
};
struct
NautilusNavigationWindowSlotClass
{
NautilusWindowSlotClass
parent
;
};
GType
nautilus_navigation_window_slot_get_type
(
void
);
gboolean
nautilus_navigation_window_slot_should_close_with_mount
(
NautilusNavigationWindowSlot
*
slot
,
GMount
*
mount
);
void
nautilus_navigation_window_slot_clear_forward_list
(
NautilusNavigationWindowSlot
*
slot
);
void
nautilus_navigation_window_slot_clear_back_list
(
NautilusNavigationWindowSlot
*
slot
);
#endif
/* NAUTILUS_NAVIGATION_WINDOW_SLOT_H */
src/nautilus-navigation-window.c
View file @
9af483db
...
...
@@ -37,7 +37,6 @@
#include "nautilus-location-bar.h"
#include "nautilus-query-editor.h"
#include "nautilus-search-bar.h"
#include "nautilus-navigation-window-slot.h"
#include "nautilus-notebook.h"
#include "nautilus-places-sidebar.h"
#include "nautilus-tree-sidebar.h"
...
...
@@ -456,10 +455,10 @@ nautilus_navigation_window_set_search_button (NautilusNavigationWindow *window,
gint
nautilus_navigation_window_get_base_page_index
(
NautilusNavigationWindow
*
window
)
{
Nautilus
Navigation
WindowSlot
*
slot
;
NautilusWindowSlot
*
slot
;
gint
forward_count
;
slot
=
NAUTILUS_
NAVIGATION_WINDOW_SLOT
(
NAUTILUS_WINDOW
(
window
)
->
details
->
active_pane
->
active_slot
)
;
slot
=
NAUTILUS_
WINDOW
(
window
)
->
details
->
active_pane
->
active_slot
;
forward_count
=
g_list_length
(
slot
->
forward_list
);
...
...
@@ -560,7 +559,7 @@ real_open_slot (NautilusWindowPane *pane,
{
NautilusWindowSlot
*
slot
;
slot
=
(
NautilusWindowSlot
*
)
g_object_new
(
NAUTILUS_TYPE_
NAVIGATION_
WINDOW_SLOT
,
NULL
);
slot
=
(
NautilusWindowSlot
*
)
g_object_new
(
NAUTILUS_TYPE_WINDOW_SLOT
,
NULL
);
slot
->
pane
=
pane
;
nautilus_window_pane_add_slot_in_tab
(
pane
,
slot
,
flags
);
...
...
src/nautilus-window-manage-views.c
View file @
9af483db
...
...
@@ -35,7 +35,6 @@
#include "nautilus-pathbar.h"
#include "nautilus-window-private.h"
#include "nautilus-window-slot.h"
#include "nautilus-navigation-window-slot.h"
#include "nautilus-trash-bar.h"
#include "nautilus-view-factory.h"
#include "nautilus-x-content-bar.h"
...
...
@@ -159,19 +158,16 @@ check_last_bookmark_location_matches_slot (NautilusWindowSlot *slot)
}
static
void
handle_go_back
(
Nautilus
NavigationWindowSlot
*
navigation_
slot
,
handle_go_back
(
Nautilus
WindowSlot
*
slot
,
GFile
*
location
)
{
NautilusWindowSlot
*
slot
;
guint
i
;
GList
*
link
;
NautilusBookmark
*
bookmark
;
slot
=
NAUTILUS_WINDOW_SLOT
(
navigation_slot
);
/* Going back. Move items from the back list to the forward list. */
g_assert
(
g_list_length
(
navigation_
slot
->
back_list
)
>
slot
->
location_change_distance
);
check_bookmark_location_matches
(
NAUTILUS_BOOKMARK
(
g_list_nth_data
(
navigation_
slot
->
back_list
,
g_assert
(
g_list_length
(
slot
->
back_list
)
>
slot
->
location_change_distance
);
check_bookmark_location_matches
(
NAUTILUS_BOOKMARK
(
g_list_nth_data
(
slot
->
back_list
,
slot
->
location_change_distance
)),
location
);
g_assert
(
slot
->
location
!=
NULL
);
...
...
@@ -181,40 +177,37 @@ handle_go_back (NautilusNavigationWindowSlot *navigation_slot,
check_last_bookmark_location_matches_slot
(
slot
);
/* Use the first bookmark in the history list rather than creating a new one. */
navigation_slot
->
forward_list
=
g_list_prepend
(
navigation_
slot
->
forward_list
,
slot
->
last_location_bookmark
);
g_object_ref
(
navigation_
slot
->
forward_list
->
data
);
slot
->
forward_list
=
g_list_prepend
(
slot
->
forward_list
,
slot
->
last_location_bookmark
);
g_object_ref
(
slot
->
forward_list
->
data
);
/* Move extra links from Back to Forward list */
for
(
i
=
0
;
i
<
slot
->
location_change_distance
;
++
i
)
{
bookmark
=
NAUTILUS_BOOKMARK
(
navigation_
slot
->
back_list
->
data
);
navigation_
slot
->
back_list
=
g_list_remove
(
navigation_
slot
->
back_list
,
bookmark
);
navigation_
slot
->
forward_list
=
g_list_prepend
(
navigation_
slot
->
forward_list
,
bookmark
);
bookmark
=
NAUTILUS_BOOKMARK
(
slot
->
back_list
->
data
);
slot
->
back_list
=
g_list_remove
(
slot
->
back_list
,
bookmark
);
slot
->
forward_list
=
g_list_prepend
(
slot
->
forward_list
,
bookmark
);
}
/* One bookmark falls out of back/forward lists and becomes viewed location */
link
=
navigation_
slot
->
back_list
;
navigation_slot
->
back_list
=
g_list_remove_link
(
navigation_
slot
->
back_list
,
link
);
link
=
slot
->
back_list
;
slot
->
back_list
=
g_list_remove_link
(
slot
->
back_list
,
link
);
g_object_unref
(
link
->
data
);
g_list_free_1
(
link
);
}
static
void
handle_go_forward
(
Nautilus
NavigationWindowSlot
*
navigation_
slot
,
handle_go_forward
(
Nautilus
WindowSlot
*
slot
,
GFile
*
location
)
{
NautilusWindowSlot
*
slot
;
guint
i
;
GList
*
link
;
NautilusBookmark
*
bookmark
;
slot
=
NAUTILUS_WINDOW_SLOT
(
navigation_slot
);
/* Going forward. Move items from the forward list to the back list. */
g_assert
(
g_list_length
(
navigation_
slot
->
forward_list
)
>
slot
->
location_change_distance
);
check_bookmark_location_matches
(
NAUTILUS_BOOKMARK
(
g_list_nth_data
(
navigation_
slot
->
forward_list
,
g_assert
(
g_list_length
(
slot
->
forward_list
)
>
slot
->
location_change_distance
);
check_bookmark_location_matches
(
NAUTILUS_BOOKMARK
(
g_list_nth_data
(
slot
->
forward_list
,
slot
->
location_change_distance
)),
location
);
g_assert
(
slot
->
location
!=
NULL
);
...
...
@@ -223,22 +216,22 @@ handle_go_forward (NautilusNavigationWindowSlot *navigation_slot,
check_last_bookmark_location_matches_slot
(
slot
);
/* Use the first bookmark in the history list rather than creating a new one. */
navigation_slot
->
back_list
=
g_list_prepend
(
navigation_
slot
->
back_list
,
slot
->
last_location_bookmark
);
g_object_ref
(
navigation_
slot
->
back_list
->
data
);
slot
->
back_list
=
g_list_prepend
(
slot
->
back_list
,
slot
->
last_location_bookmark
);
g_object_ref
(
slot
->
back_list
->
data
);
/* Move extra links from Forward to Back list */
for
(
i
=
0
;
i
<
slot
->
location_change_distance
;
++
i
)
{
bookmark
=
NAUTILUS_BOOKMARK
(
navigation_
slot
->
forward_list
->
data
);
navigation_
slot
->
forward_list
=
g_list_remove
(
navigation_
slot
->
back_list
,
bookmark
);
navigation_
slot
->
back_list
=
g_list_prepend
(
navigation_
slot
->
forward_list
,
bookmark
);
for
(
i
=
0
;
i
<
slot
->
location_change_distance
;
++
i
)
{
bookmark
=
NAUTILUS_BOOKMARK
(
slot
->
forward_list
->
data
);
slot
->
forward_list
=
g_list_remove
(
slot
->
back_list
,
bookmark
);
slot
->
back_list
=
g_list_prepend
(
slot
->
forward_list
,
bookmark
);
}
/* One bookmark falls out of back/forward lists and becomes viewed location */
link
=
navigation_
slot
->
forward_list
;
navigation_slot
->
forward_list
=
g_list_remove_link
(
navigation_
slot
->
forward_list
,
link
);
link
=
slot
->
forward_list
;
slot
->
forward_list
=
g_list_remove_link
(
slot
->
forward_list
,
link
);
g_object_unref
(
link
->
data
);
g_list_free_1
(
link
);
}
...
...
@@ -247,27 +240,21 @@ static void
handle_go_elsewhere
(
NautilusWindowSlot
*
slot
,
GFile
*
location
)
{
NautilusNavigationWindowSlot
*
navigation_slot
;
if
(
NAUTILUS_IS_NAVIGATION_WINDOW_SLOT
(
slot
))
{
navigation_slot
=
NAUTILUS_NAVIGATION_WINDOW_SLOT
(
slot
);
/* Clobber the entire forward list, and move displayed location to back list */
nautilus_navigation_window_slot_clear_forward_list
(
navigation_slot
);
/* Clobber the entire forward list, and move displayed location to back list */
nautilus_window_slot_clear_forward_list
(
slot
);
if
(
slot
->
location
!=
NULL
)
{
/* If we're returning to the same uri somehow, don't put this uri on back list.
* This also avoids a problem where set_displayed_location
* didn't update last_location_bookmark since the uri didn't change.
*/
if
(
!
g_file_equal
(
slot
->
location
,
location
))
{
/* Store bookmark for current location in back list, unless there is no current location */
check_last_bookmark_location_matches_slot
(
slot
);
/* Use the first bookmark in the history list rather than creating a new one. */
navigation_slot
->
back_list
=
g_list_prepend
(
navigation_slot
->
back_list
,
slot
->
last_location_bookmark
);
g_object_ref
(
navigation_slot
->
back_list
->
data
);
}
if
(
slot
->
location
!=
NULL
)
{
/* If we're returning to the same uri somehow, don't put this uri on back list.
* This also avoids a problem where set_displayed_location
* didn't update last_location_bookmark since the uri didn't change.
*/
if
(
!
g_file_equal
(
slot
->
location
,
location
))
{
/* Store bookmark for current location in back list, unless there is no current location */
check_last_bookmark_location_matches_slot
(
slot
);
/* Use the first bookmark in the history list rather than creating a new one. */
slot
->
back_list
=
g_list_prepend
(
slot
->
back_list
,
slot
->
last_location_bookmark
);
g_object_ref
(
slot
->
back_list
->
data
);
}
}
}
...
...
@@ -404,10 +391,10 @@ update_history (NautilusWindowSlot *slot,
/* for reload there is no work to do */
return
;
case
NAUTILUS_LOCATION_CHANGE_BACK
:
handle_go_back
(
NAUTILUS_NAVIGATION_WINDOW_SLOT
(
slot
)
,
new_location
);
handle_go_back
(
slot
,
new_location
);
return
;
case
NAUTILUS_LOCATION_CHANGE_FORWARD
:
handle_go_forward
(
NAUTILUS_NAVIGATION_WINDOW_SLOT
(
slot
)
,
new_location
);
handle_go_forward
(
slot
,
new_location
);
return
;
case
NAUTILUS_LOCATION_CHANGE_REDIRECT
:
/* for the redirect case, the caller can do the updating */
...
...
@@ -1778,15 +1765,13 @@ nautilus_navigation_window_back_or_forward (NautilusNavigationWindow *window,
gboolean
back
,
guint
distance
,
gboolean
new_tab
)
{
NautilusWindowSlot
*
slot
;
NautilusNavigationWindowSlot
*
navigation_slot
;
GList
*
list
;
GFile
*
location
;
guint
len
;
NautilusBookmark
*
bookmark
;
slot
=
NAUTILUS_WINDOW
(
window
)
->
details
->
active_pane
->
active_slot
;
navigation_slot
=
(
NautilusNavigationWindowSlot
*
)
slot
;
list
=
back
?
navigation_slot
->
back_list
:
navigation_slot
->
forward_list
;
list
=
back
?
slot
->
back_list
:
slot
->
forward_list
;
len
=
(
guint
)
g_list_length
(
list
);
...
...
src/nautilus-window-pane.c
View file @
9af483db
...
...
@@ -28,7 +28,6 @@
#include "nautilus-clipboard.h"
#include "nautilus-location-bar.h"
#include "nautilus-navigation-window-slot.h"
#include "nautilus-notebook.h"
#include "nautilus-pathbar.h"
#include "nautilus-toolbar.h"
...
...
@@ -190,10 +189,10 @@ path_bar_location_changed_callback (GtkWidget *widget,
GFile
*
location
,
NautilusWindowPane
*
pane
)
{
Nautilus
Navigation
WindowSlot
*
slot
;
NautilusWindowSlot
*
slot
;
int
i
;
slot
=
NAUTILUS_NAVIGATION_WINDOW_SLOT
(
pane
->
active_slot
)
;
slot
=
pane
->
active_slot
;
/* check whether we already visited the target location */
i
=
bookmark_list_get_uri_index
(
slot
->
back_list
,
location
);
...
...
@@ -694,8 +693,7 @@ nautilus_window_pane_show (NautilusWindowPane *pane)
void
nautilus_window_pane_sync_location_widgets
(
NautilusWindowPane
*
pane
)
{
NautilusNavigationWindowSlot
*
navigation_slot
;
NautilusWindowSlot
*
slot
;
NautilusWindowSlot
*
slot
,
*
active_slot
;
slot
=
pane
->
active_slot
;
...
...
@@ -717,11 +715,11 @@ nautilus_window_pane_sync_location_widgets (NautilusWindowPane *pane)
nautilus_window_update_up_button
(
pane
->
window
);
/* Check if the back and forward buttons need enabling or disabling. */
navigation_slot
=
NAUTILUS_NAVIGATION_WINDOW_SLOT
(
pane
->
window
->
details
->
active_pane
->
active_slot
)
;
active_slot
=
pane
->
window
->
details
->
active_pane
->
active_slot
;
nautilus_navigation_window_allow_back
(
NAUTILUS_NAVIGATION_WINDOW
(
pane
->
window
),
navigation
_slot
->
back_list
!=
NULL
);
active
_slot
->
back_list
!=
NULL
);
nautilus_navigation_window_allow_forward
(
NAUTILUS_NAVIGATION_WINDOW
(
pane
->
window
),
navigation
_slot
->
forward_list
!=
NULL
);
active
_slot
->
forward_list
!=
NULL
);
}
}
...
...
src/nautilus-window-slot.c
View file @
9af483db
...
...
@@ -22,7 +22,6 @@
Author: Christian Neumair <cneumair@gnome.org>
*/
#include "nautilus-window-slot.h"
#include "nautilus-navigation-window-slot.h"
#include "nautilus-desktop-window.h"
#include "nautilus-window-private.h"
...
...
@@ -51,6 +50,8 @@ query_editor_changed_callback (NautilusSearchBar *bar,
{
NautilusDirectory
*
directory
;
g_assert
(
NAUTILUS_IS_FILE
(
slot
->
viewed_file
));
directory
=
nautilus_directory_get_for_file
(
slot
->
viewed_file
);
g_assert
(
NAUTILUS_IS_SEARCH_DIRECTORY
(
directory
));
...
...
@@ -66,23 +67,34 @@ query_editor_changed_callback (NautilusSearchBar *bar,
static
void
real_update_query_editor
(
NautilusWindowSlot
*
slot
)
{
GtkWidget
*
query_editor
;
NautilusQuery
*
query
;
NautilusDirectory
*
directory
;
NautilusSearchDirectory
*
search_directory
;
NautilusQuery
*
query
;
GtkWidget
*
query_editor
;