diff options
Diffstat (limited to 'src/ephy-history-window.c')
-rw-r--r-- | src/ephy-history-window.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/ephy-history-window.c b/src/ephy-history-window.c index ac56df46f..a3f53a064 100644 --- a/src/ephy-history-window.c +++ b/src/ephy-history-window.c @@ -832,7 +832,7 @@ add_by_date_filter (EphyHistoryWindow *editor, { time_t now, midnight, cmp_time = 0; struct tm btime; - int time_range; + int time_range, days = 0; time_range = gtk_combo_box_get_active (GTK_COMBO_BOX (editor->priv->time_combo)); @@ -855,22 +855,10 @@ add_by_date_filter (EphyHistoryWindow *editor, cmp_time = now - 30 * 60; break; case TIME_LAST_THREE_DAYS: - /* subtract 1 day */ - midnight -= 43200; - localtime_r (&midnight, &btime); - btime.tm_sec = 0; - btime.tm_min = 0; - btime.tm_hour = 0; - midnight = mktime (&btime); + days++; /* fall-through */ case TIME_LAST_TWO_DAYS: - /* subtract 1 day */ - midnight -= 43200; - localtime_r (&midnight, &btime); - btime.tm_sec = 0; - btime.tm_min = 0; - btime.tm_hour = 0; - midnight = mktime (&btime); + days++; /* fall-through */ case TIME_TODAY: cmp_time = midnight; @@ -880,6 +868,17 @@ add_by_date_filter (EphyHistoryWindow *editor, break; } + while (--days >= 0) + { + /* subtract 1 day */ + cmp_time -= 43200; + localtime_r (&cmp_time, &btime); + btime.tm_sec = 0; + btime.tm_min = 0; + btime.tm_hour = 0; + cmp_time = mktime (&btime); + } + ephy_node_filter_add_expression (filter, ephy_node_filter_expression_new (EPHY_NODE_FILTER_EXPRESSION_INT_PROP_BIGGER_THAN, |