summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErnestas Kulik <ekulik@redhat.com>2019-06-15 07:57:29 +0200
committerErnestas Kulik <ekulik@redhat.com>2019-06-15 07:57:29 +0200
commit005f638a2f7362ef0c3bd07ccac05f4e7b2826c6 (patch)
tree2333f2d080db61d1c16a094e40dd8e1ee775ef24
parent5a45368776b3ecf58da39571ff27598773c6d493 (diff)
downloadnautilus-005f638a2f7362ef0c3bd07ccac05f4e7b2826c6.tar.gz
window: Don’t mix and match enum types
Using NautilusNewTabPosition as NautilusWindowOpenFlags can result in a failed assertion when the value is equal to 1 (NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW/NAUTILUS_NEW_TAB_POSITION_END). Additionally, nautilus_window_open_location_full() checks the new tab position, so it is simply pointless to do that beforehand. Fixes https://gitlab.gnome.org/GNOME/nautilus/issues/953
-rw-r--r--src/nautilus-window.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index b039940fa..89d492a76 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -742,7 +742,6 @@ void
nautilus_window_new_tab (NautilusWindow *window)
{
NautilusWindowSlot *current_slot;
- NautilusWindowOpenFlags flags;
GFile *location;
g_autofree gchar *uri = NULL;
@@ -751,8 +750,6 @@ nautilus_window_new_tab (NautilusWindow *window)
if (location != NULL)
{
- flags = g_settings_get_enum (nautilus_preferences, NAUTILUS_PREFERENCES_NEW_TAB_POSITION);
-
uri = g_file_get_uri (location);
if (eel_uri_is_search (uri))
{
@@ -763,8 +760,9 @@ nautilus_window_new_tab (NautilusWindow *window)
g_object_ref (location);
}
- flags |= NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB;
- nautilus_window_open_location_full (window, location, flags, NULL, NULL);
+ nautilus_window_open_location_full (window, location,
+ NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB,
+ NULL, NULL);
g_object_unref (location);
}
}
@@ -1202,10 +1200,7 @@ action_restore_tab (GSimpleAction *action,
return;
}
- flags = g_settings_get_enum (nautilus_preferences, NAUTILUS_PREFERENCES_NEW_TAB_POSITION);
-
- flags |= NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB;
- flags |= NAUTILUS_WINDOW_OPEN_FLAG_DONT_MAKE_ACTIVE;
+ flags = NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB | NAUTILUS_WINDOW_OPEN_FLAG_DONT_MAKE_ACTIVE;
data = g_queue_pop_head (window->tab_data_queue);