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:
BruebachL
2025-01-22 12:58:19 +00:00
committed by GitHub
co-authored by Lukas Brübach
parent 66e2e7a473
commit 1d2ab8d3d3
@@ -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