[nautilus] Clean up dead assigments



commit 2c7620a73234e8ef48ade4be1d950d4ca7b4997a
Author: Ernestas Kulik <ernestask src gnome org>
Date:   Thu Aug 4 20:17:11 2016 +0300

    Clean up dead assigments
    
    A static analyzer revealed a number of dead assignments, which
    have a negative effect on readability. This commit removes them.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=769526

 src/nautilus-file.c           |    1 -
 src/nautilus-files-view.c     |   13 ++++---------
 src/nautilus-query-editor.c   |    1 -
 src/nautilus-search-popover.c |    1 -
 4 files changed, 4 insertions(+), 12 deletions(-)
---
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index e85ffa3..b380d39 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -2159,7 +2159,6 @@ update_info_internal (NautilusFile *file,
                                                  g_file_info_get_edit_name (info),
                                                  FALSE);
 
-       mime_type = g_file_info_get_content_type (info);
        file_type = g_file_info_get_file_type (info);
        if (file->details->type != file_type) {
                changed = TRUE;
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index cbe8d2f..097f1f2 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -2602,7 +2602,7 @@ set_up_scripts_directory_global (void)
                                 if (res == -1) {
                                         fd = g_creat (updated, 0600);
                                         if (fd != -1) {
-                                                res = write (fd, message, strlen (message));
+                                                write (fd, message, strlen (message));
                                                 close (fd);
                                         }
                                 }
@@ -5597,8 +5597,7 @@ invoke_external_bulk_rename_utility (NautilusFilesView *view,
 }
 
 static void
-real_action_rename (NautilusFilesView *view,
-                    gboolean           select_all)
+real_action_rename (NautilusFilesView *view)
 {
         NautilusFile *file;
         GList *selection;
@@ -5615,11 +5614,7 @@ real_action_rename (NautilusFilesView *view,
                         }
                 } else {
                         file = NAUTILUS_FILE (selection->data);
-                        if (!select_all) {
-                                /* directories don't have a file extension, so
-                                 * they are always pre-selected as a whole */
-                                select_all = nautilus_file_is_directory (file);
-                        }
+
                         nautilus_files_view_rename_file_popover_new (view, file);
                 }
         }
@@ -5632,7 +5627,7 @@ action_rename (GSimpleAction *action,
                GVariant      *state,
                gpointer       user_data)
 {
-        real_action_rename (NAUTILUS_FILES_VIEW (user_data), FALSE);
+        real_action_rename (NAUTILUS_FILES_VIEW (user_data));
 }
 
 #define BG_KEY_PRIMARY_COLOR      "primary-color"
diff --git a/src/nautilus-query-editor.c b/src/nautilus-query-editor.c
index db836db..9461138 100644
--- a/src/nautilus-query-editor.c
+++ b/src/nautilus-query-editor.c
@@ -658,7 +658,6 @@ nautilus_query_editor_set_location (NautilusQueryEditor *editor,
         gboolean should_notify;
 
         priv = nautilus_query_editor_get_instance_private (editor);
-        should_notify = FALSE;
 
         /* The client could set us a location that is actually a search directory,
          * like what happens with the slot when updating the query editor location.
diff --git a/src/nautilus-search-popover.c b/src/nautilus-search-popover.c
index 15e3a23..9693305 100644
--- a/src/nautilus-search-popover.c
+++ b/src/nautilus-search-popover.c
@@ -381,7 +381,6 @@ fill_fuzzy_dates_listbox (NautilusSearchPopover *popover)
   maximum_dt = g_date_time_new_from_unix_local (0);
   now = g_date_time_new_now_local ();
   max_days = SEARCH_FILTER_MAX_YEARS * 365;
-  current_date = g_date_time_new_now_local ();
 
   /* Add the no date filter element first */
   row = create_row_for_label (_("Any time"), TRUE);


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