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:
Peter Hutterer 2019-08-08 13:33:07 +10:00
parent 89559364cf
commit 35ab7ad621
1 changed files with 1 additions and 1 deletions

View File

@ -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