[kupfer] notes: yield Notes in date order
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer] notes: yield Notes in date order
- Date: Fri, 28 Aug 2009 09:31:59 +0000 (UTC)
commit bbd2810052088aac60883ed99203d792824a4663
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Fri Aug 28 00:08:04 2009 +0200
notes: yield Notes in date order
Gnote returns the list of notes so that most recently changed is
first; we simply use this ordering.
kupfer/plugin/notes.py | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/kupfer/plugin/notes.py b/kupfer/plugin/notes.py
index 6c54b26..ab6ed7b 100644
--- a/kupfer/plugin/notes.py
+++ b/kupfer/plugin/notes.py
@@ -95,7 +95,7 @@ class NotesSource (AppLeafContentMixin, Source):
appleaf_content_id = PROGRAM_IDS
def __init__(self):
Source.__init__(self, _("Notes"))
- self._notes = {}
+ self._notes = []
def _update_cache(self, notes):
try:
@@ -106,23 +106,20 @@ class NotesSource (AppLeafContentMixin, Source):
templates = notes.GetAllNotesWithTag("system:template")
- self._notes = {}
+ self._notes = []
for noteuri in noteuris:
if noteuri in templates:
continue
title = notes.GetNoteTitle(noteuri)
- self._notes[noteuri] = title
+ self._notes.append((noteuri, title))
def get_items(self):
notes = _get_notes_interface()
if notes:
self._update_cache(notes)
- for noteuri, title in self._notes.iteritems():
+ for noteuri, title in self._notes:
yield Note(noteuri, title)
- def should_sort_lexically(self):
- return True
-
def get_gicon(self):
return icons.get_gicon_with_fallbacks(None, PROGRAM_IDS)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]