summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntónio Fernandes <antoniojpfernandes@gmail.com>2018-03-05 21:30:14 +0000
committerErnestas Kulik <ernestask@gnome.org>2018-03-24 20:33:28 +0200
commit5500c7b1cd3817d69503f0b9c43b80cdea56933a (patch)
tree6462bd9d80a968d7ded9bad345e17cb99e9b6809
parentf535a59e65f72e9591aad19a2dc9c37f37fc6248 (diff)
downloadnautilus-5500c7b1cd3817d69503f0b9c43b80cdea56933a.tar.gz
list-view: Fix build warning
We are using a variable which may be uninitialized (even though it is initialized in the case where it is used) GCC8 fails to build due to this. As that variable is only ever compared with a constant, compare the return value directly without storing it on a variable. Fixes https://gitlab.gnome.org/GNOME/nautilus/issues/284
-rw-r--r--src/nautilus-list-view.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index 3a9e720e4..9c168f97e 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -1556,7 +1556,6 @@ filename_cell_data_func (GtkTreeViewColumn *column,
GString *display_text;
NautilusDirectory *directory;
NautilusQuery *query = NULL;
- NautilusQuerySearchContent content;
NautilusFile *file;
const gchar *snippet;
@@ -1574,11 +1573,6 @@ filename_cell_data_func (GtkTreeViewColumn *column,
query = nautilus_search_directory_get_query (NAUTILUS_SEARCH_DIRECTORY (directory));
}
- if (query)
- {
- content = nautilus_query_get_search_content (query);
- }
-
if (get_click_policy () == NAUTILUS_CLICK_POLICY_SINGLE)
{
path = gtk_tree_model_get_path (model, iter);
@@ -1600,7 +1594,8 @@ filename_cell_data_func (GtkTreeViewColumn *column,
underline = PANGO_UNDERLINE_NONE;
}
- if (query && content == NAUTILUS_QUERY_SEARCH_CONTENT_FULL_TEXT)
+ if (query &&
+ nautilus_query_get_search_content (query) == NAUTILUS_QUERY_SEARCH_CONTENT_FULL_TEXT)
{
gtk_tree_model_get (model, iter,
NAUTILUS_LIST_MODEL_FILE_COLUMN, &file,