[nautilus] window: simplify handling of enter-location action
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] window: simplify handling of enter-location action
- Date: Sun, 25 Jan 2015 15:23:11 +0000 (UTC)
commit c91b8857c25d16ca9c8ae4e2c72514d05e51fdc6
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Sun Jan 25 13:22:37 2015 +0000
window: simplify handling of enter-location action
We don't need it on both the application and the window.
src/nautilus-application-actions.c | 15 ---------------
src/nautilus-window.c | 8 +++++---
src/nautilus-window.h | 1 -
3 files changed, 5 insertions(+), 19 deletions(-)
---
diff --git a/src/nautilus-application-actions.c b/src/nautilus-application-actions.c
index b37c385..3caa09e 100644
--- a/src/nautilus-application-actions.c
+++ b/src/nautilus-application-actions.c
@@ -61,20 +61,6 @@ action_connect_to_server (GSimpleAction *action,
}
static void
-action_enter_location (GSimpleAction *action,
- GVariant *parameter,
- gpointer user_data)
-{
- GtkApplication *application = user_data;
- NautilusWindow *window;
- GtkWindow *cur_window;
-
- cur_window = gtk_application_get_active_window (application);
- window = NAUTILUS_WINDOW (cur_window);
- nautilus_window_ensure_location_entry (window);
-}
-
-static void
action_bookmarks (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
@@ -265,7 +251,6 @@ action_show_hide_sidebar (GSimpleAction *action,
static GActionEntry app_entries[] = {
{ "new-window", action_new_window, NULL, NULL, NULL },
{ "connect-to-server", action_connect_to_server, NULL, NULL, NULL },
- { "enter-location", action_enter_location, NULL, NULL, NULL },
{ "bookmarks", action_bookmarks, NULL, NULL, NULL },
{ "preferences", action_preferences, NULL, NULL, NULL },
{ "show-hide-sidebar", NULL, NULL, "true", action_show_hide_sidebar },
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index fc3e8b1..2e7f362 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -81,6 +81,7 @@ static void mouse_back_button_changed (gpointer callback_
static void mouse_forward_button_changed (gpointer callback_data);
static void use_extra_mouse_buttons_changed (gpointer callback_data);
static void nautilus_window_initialize_actions (NautilusWindow *window);
+static GtkWidget * nautilus_window_ensure_location_entry (NautilusWindow *window);
/* Sanity check: highest mouse button value I could find was 14. 5 is our
* lower threshold (well-documented to be the one of the button events for the
@@ -252,8 +253,9 @@ action_enter_location (GSimpleAction *action,
GVariant *state,
gpointer user_data)
{
- g_action_group_activate_action (G_ACTION_GROUP (g_application_get_default ()),
- "enter-location", NULL);
+ NautilusWindow *window = user_data;
+
+ nautilus_window_ensure_location_entry (window);
}
static void
@@ -1365,7 +1367,7 @@ nautilus_window_sync_location_widgets (NautilusWindow *window)
nautilus_window_sync_bookmarks (window);
}
-GtkWidget *
+static GtkWidget *
nautilus_window_ensure_location_entry (NautilusWindow *window)
{
GtkWidget *location_entry;
diff --git a/src/nautilus-window.h b/src/nautilus-window.h
index 75c6fc8..d201b2f 100644
--- a/src/nautilus-window.h
+++ b/src/nautilus-window.h
@@ -109,7 +109,6 @@ NautilusWindowSlot * nautilus_window_open_slot (NautilusWindow *wind
void nautilus_window_slot_close (NautilusWindow *window,
NautilusWindowSlot *slot);
-GtkWidget * nautilus_window_ensure_location_entry (NautilusWindow *window);
void nautilus_window_sync_location_widgets (NautilusWindow *window);
void nautilus_window_grab_focus (NautilusWindow *window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]