[nautilus/284-nautilus-3-27-92-fails-to-build-with-gcc-8] list-view: Fix build warning



commit 61054d5f528c1cb492d15687cf073d898257c897
Author: António Fernandes <antoniojpfernandes gmail com>
Date:   Mon Mar 5 21:30:14 2018 +0000

    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

 src/nautilus-list-view.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
---
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index 9292086d7..d2ba388e8 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -1645,7 +1645,6 @@ filename_cell_data_func (GtkTreeViewColumn *column,
     GString *display_text;
     NautilusDirectory *directory;
     NautilusQuery *query = NULL;
-    NautilusQuerySearchContent content;
     NautilusFile *file;
     const gchar *snippet;
 
@@ -1663,11 +1662,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);
@@ -1689,7 +1683,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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]