gui: reverse-sort the drawings by timestamp before adding them
We want the most-recent drawings up the top. And since we always add to the flowbox, we need to reverse-sort everything. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
89559364cf
commit
35ab7ad621
|
@ -88,7 +88,7 @@ class DrawingPerspective(Gtk.Stack):
|
|||
def _hash(drawing):
|
||||
return time.strftime('%Y%m', time.gmtime(drawing.timestamp))
|
||||
|
||||
for js in config.drawings:
|
||||
for js in sorted(config.drawings, reverse=True, key=lambda j: j['timestamp']):
|
||||
ts = js['timestamp']
|
||||
if ts in self.known_drawings:
|
||||
continue
|
||||
|
|
Loading…
Reference in New Issue