[Xfce4-commits] <midori:master> Only query the current time once when populating the history
Christian Dywan
noreply at xfce.org
Wed Feb 3 18:44:04 CET 2010
Updating branch refs/heads/master
to ae1ea1214bb056dbc294c32e84e769dae84c907f (commit)
from 297d38e7d0496ad1b42f7e93e0bcaae73de25c02 (commit)
commit ae1ea1214bb056dbc294c32e84e769dae84c907f
Author: Christian Dywan <christian at twotoasts.de>
Date: Wed Feb 3 18:42:58 2010 +0100
Only query the current time once when populating the history
panels/midori-history.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/panels/midori-history.c b/panels/midori-history.c
index 87d2153..3f56ddb 100644
--- a/panels/midori-history.c
+++ b/panels/midori-history.c
@@ -180,6 +180,7 @@ midori_history_read_from_db (MidoriHistory* history,
sqlite3_stmt* statement;
gint result;
gchar* sqlcmd;
+ time_t current_time;
GtkTreeIter iter;
GtkTreeIter root_iter;
@@ -201,6 +202,8 @@ midori_history_read_from_db (MidoriHistory* history,
}
g_free (sqlcmd);
+ current_time = time (NULL);
+
while ((result = sqlite3_step (statement)) == SQLITE_ROW)
{
KatzeItem* item;
@@ -211,7 +214,6 @@ midori_history_read_from_db (MidoriHistory* history,
if (req_day == 0)
{
- time_t current_time;
gint age;
gchar token[50];
gchar* sdate;
@@ -221,7 +223,6 @@ midori_history_read_from_db (MidoriHistory* history,
item = katze_item_new ();
katze_item_set_added (item, day);
- current_time = time (NULL);
age = sokoke_days_between ((time_t*)&date, ¤t_time);
/* A negative age is a date in the future, the clock is probably off */
More information about the Xfce4-commits
mailing list