Skip to content
Permalink
Browse files

Fix compile warning

Remove unused variables, avoid uninitialized variable warnings, and indent code.
  • Loading branch information...
yetist authored and raveit65 committed Jan 29, 2019
1 parent dbfd51e commit 328d820311cacf644014efda12400172179c0c4d
Showing with 22 additions and 21 deletions.
  1. +0 −2 libcaja-private/caja-query.c
  2. +1 −1 libcaja-private/caja-search-engine-simple.c
  3. +21 −18 src/caja-query-editor.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,
@@ -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;
@@ -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);

0 comments on commit 328d820

Please sign in to comment.
You can’t perform that action at this time.