[Tutorial] Fix review blockers: null VDS guard, overlay QPointer, bounded fill, upgrade seeding

This commit is contained in:
Lukas Brübach 2026-10-11 15:10:43 +02:00
parent 5c024c6338
commit 86f6098d43
6 changed files with 32 additions and 5 deletions

View file

@ -5,6 +5,8 @@
#include "libcockatrice/utility/playmat_params.h"
#include <QChar>
#include <QDir>
#include <QFileInfo>
#include <QList>
#include <QVariant>
#include <QtGlobal>
@ -248,6 +250,14 @@ QStringList InterfaceSettings::getUserListExpandedSections() const
bool InterfaceSettings::getTutorialCompleted() const
{
// Upgrading users have settings files but no tutorial key yet: treat the tutorial as seen so they are
// not overlaid on upgrade. Genuinely new installs have no settings files at all, so they still get it.
if (!getSettings().contains("interface/tutorialCompleted")) {
QDir settingsDir = QFileInfo(settingPath).dir();
if (!settingsDir.entryList({"*.ini"}, QDir::Files).isEmpty()) {
return true;
}
}
return getValue("tutorialCompleted", QString(), QString(), false).toBool();
}