mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 08:34:52 -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:
parent
66e2e7a473
commit
1d2ab8d3d3
1 changed files with 5 additions and 2 deletions
|
|
@ -81,8 +81,11 @@ QList<DeckPreviewWidget *> &VisualDeckStorageSortWidget::filterFiles(QList<DeckP
|
||||||
return info1.fileName().toLower() < info2.fileName().toLower();
|
return info1.fileName().toLower() < info2.fileName().toLower();
|
||||||
case ByLastModified:
|
case ByLastModified:
|
||||||
return info1.lastModified() > info2.lastModified();
|
return info1.lastModified() > info2.lastModified();
|
||||||
case ByLastLoaded:
|
case ByLastLoaded: {
|
||||||
return widget1->deckLoader->getLastLoadedTimestamp() > widget2->deckLoader->getLastLoadedTimestamp();
|
QDateTime time1 = QDateTime::fromString(widget1->deckLoader->getLastLoadedTimestamp());
|
||||||
|
QDateTime time2 = QDateTime::fromString(widget2->deckLoader->getLastLoadedTimestamp());
|
||||||
|
return time1 > time2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false; // Default case, no sorting applied
|
return false; // Default case, no sorting applied
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue