From 496baa0f0c928fb8036743e0e9cea712b142bb13 Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Thu, 2 Feb 2006 23:42:57 +0000 Subject: [PATCH] we sort by time in db query. no need to dup --- src/history_window.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/history_window.py b/src/history_window.py index 7d632de69..5b4b24a04 100644 --- a/src/history_window.py +++ b/src/history_window.py @@ -50,7 +50,7 @@ GTKGUI_GLADE = 'gtkgui.glade' # contact_name, date, message, time ( C_CONTACT_NAME, -C_DATE, +C_UNIXTIME, C_MESSAGE, C_TIME ) = range(4) @@ -94,8 +94,7 @@ class HistoryWindow: self.results_treeview.append_column(col) renderer = gtk.CellRendererText() col.pack_start(renderer) - col.set_attributes(renderer, text = C_DATE) - col.set_sort_column_id(C_DATE) + col.set_attributes(renderer, text = C_UNIXTIME) col.set_resizable(True) col = gtk.TreeViewColumn(_('Message')) @@ -355,7 +354,7 @@ class HistoryWindow: model = widget.get_model() iter = model.get_iter(path) # make it a tupple (Y, M, D, 0, 0, 0...) - tim = time.strptime(model[iter][C_DATE], '%x') + tim = time.strptime(model[iter][C_UNIXTIME], '%x') year = tim[0] gtk_month = tim[1] month = gtkgui_helpers.make_python_month_gtk_month(gtk_month)