mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-08-03 01:15:41 -07:00
Convert lastLoaded timestamp into proper QDateTime for correct comparison. (#5506)
* Convert lastLoaded timestamp into proper QDateTime for correct comparison. * Reintroduce null check. --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
co-authored by
Lukas Brübach
parent
66e2e7a473
commit
1d2ab8d3d3
+5
-2
@@ -81,8 +81,11 @@ QList<DeckPreviewWidget *> &VisualDeckStorageSortWidget::filterFiles(QList<DeckP
|
||||
return info1.fileName().toLower() < info2.fileName().toLower();
|
||||
case ByLastModified:
|
||||
return info1.lastModified() > info2.lastModified();
|
||||
case ByLastLoaded:
|
||||
return widget1->deckLoader->getLastLoadedTimestamp() > widget2->deckLoader->getLastLoadedTimestamp();
|
||||
case ByLastLoaded: {
|
||||
QDateTime time1 = QDateTime::fromString(widget1->deckLoader->getLastLoadedTimestamp());
|
||||
QDateTime time2 = QDateTime::fromString(widget2->deckLoader->getLastLoadedTimestamp());
|
||||
return time1 > time2;
|
||||
}
|
||||
}
|
||||
|
||||
return false; // Default case, no sorting applied
|
||||
|
||||
Reference in New Issue
Block a user