Update launcher/ui/themes/CatPack.cpp

Co-authored-by: TheKodeToad <TheKodeToad@proton.me>
Signed-off-by: Alexandru Ionut Tripon <alexandru.tripon97@gmail.com>
This commit is contained in:
Alexandru Ionut Tripon 2024-01-21 08:52:49 +02:00 committed by GitHub
parent bb9df1684b
commit e4306d5cb6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -132,7 +132,7 @@ QString JsonCatPack::path(QDate now)
auto files = QDir(m_default_path).entryInfoList(supportedImageFormats, QDir::Files, QDir::Name); auto files = QDir(m_default_path).entryInfoList(supportedImageFormats, QDir::Files, QDir::Name);
if (files.length() == 0) if (files.length() == 0)
return ""; return "";
auto idx = now.dayOfYear() % files.length(); auto idx = (now.dayOfYear() - 1) % files.length();
auto isRandom = dInfo.fileName().compare("random", Qt::CaseInsensitive) == 0; auto isRandom = dInfo.fileName().compare("random", Qt::CaseInsensitive) == 0;
if (isRandom) if (isRandom)
idx = QRandomGenerator::global()->bounded(0, files.length()); idx = QRandomGenerator::global()->bounded(0, files.length());