diff options
author | Wu Xiaotian <[email protected]> | 2019-01-29 22:07:16 +0800 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-01-29 16:46:48 +0100 |
commit | 328d820311cacf644014efda12400172179c0c4d (patch) | |
tree | 17fa1507433f88ebc8850d8bf1f9113f70b2ae76 | |
parent | dbfd51ed7989ac2b8e70b603ca3ce30bd0ba87f4 (diff) | |
download | caja-328d820311cacf644014efda12400172179c0c4d.tar.bz2 caja-328d820311cacf644014efda12400172179c0c4d.tar.xz |
Fix compile warning
Remove unused variables, avoid uninitialized variable warnings, and indent code.
-rw-r--r-- | libcaja-private/caja-query.c | 2 | ||||
-rw-r--r-- | libcaja-private/caja-search-engine-simple.c | 2 | ||||
-rw-r--r-- | src/caja-query-editor.c | 39 |
3 files changed, 22 insertions, 21 deletions
diff --git a/libcaja-private/caja-query.c b/libcaja-private/caja-query.c index dd0384f0..54c23d4e 100644 --- a/libcaja-private/caja-query.c +++ b/libcaja-private/caja-query.c @@ -383,8 +383,6 @@ caja_query_to_xml (CajaQuery *query) char *mimetype; char *tag; GList *l; - gint64 timestamp; - gint64 size; xml = g_string_new (""); g_string_append (xml, diff --git a/libcaja-private/caja-search-engine-simple.c b/libcaja-private/caja-search-engine-simple.c index 9e6084a7..519ea51a 100644 --- a/libcaja-private/caja-search-engine-simple.c +++ b/libcaja-private/caja-search-engine-simple.c @@ -347,7 +347,7 @@ visit_directory (GFile *dir, SearchThreadData *data) GFileEnumerator *enumerator; GFileInfo *info; GFile *child; - const char *tag, *mime_type, *display_name; + const char *mime_type, *display_name; char *lower_name, *normalized; gboolean hit; int i; diff --git a/src/caja-query-editor.c b/src/caja-query-editor.c index b93c072a..ce4120c2 100644 --- a/src/caja-query-editor.c +++ b/src/caja-query-editor.c @@ -1136,26 +1136,29 @@ static void modtime_row_add_to_query(CajaQueryEditorRow *row, CajaQuery *query) gtk_tree_model_get(duration_model, &duration_iter, 0, &duration, -1); now = g_date_time_new_now_local (); + datetime = now; switch (duration) { - case DURATION_ONE_HOUR: - datetime = g_date_time_add_hours (now, -1); - break; - case DURATION_ONE_DAY: - datetime = g_date_time_add_days (now, -1); - break; - case DURATION_ONE_WEEK: - datetime = g_date_time_add_weeks (now, -1); - break; - case DURATION_ONE_MONTH: - datetime = g_date_time_add_months (now, -1); - break; - case DURATION_SIX_MONTHS: - datetime = g_date_time_add_months (now, -6); - break; - case DURATION_ONE_YEAR: - datetime = g_date_time_add_years (now, -1); - break; + case DURATION_ONE_HOUR: + datetime = g_date_time_add_hours (now, -1); + break; + case DURATION_ONE_DAY: + datetime = g_date_time_add_days (now, -1); + break; + case DURATION_ONE_WEEK: + datetime = g_date_time_add_weeks (now, -1); + break; + case DURATION_ONE_MONTH: + datetime = g_date_time_add_months (now, -1); + break; + case DURATION_SIX_MONTHS: + datetime = g_date_time_add_months (now, -6); + break; + case DURATION_ONE_YEAR: + datetime = g_date_time_add_years (now, -1); + break; + default: + g_assert_not_reached (); } g_date_time_unref (now); |