Commit b5b7ad89 authored by Fabio Bas's avatar Fabio Bas
Browse files

Startup: fix resetting card database to default

The check was inverted. LoadStatus::Ok = 0, so only when
db->loadCardDatabase() returns 0 we know the card database path is
correct
parent 0e371172
......@@ -926,7 +926,7 @@ LoadStatus CardDatabase::loadCardDatabase(const QString &path, bool tokens)
if (!tokens) {
loadStatus = tempLoadStatus;
qDebug() << "loadCardDatabase(): Status = " << loadStatus;
qDebug() << "loadCardDatabase(): Path = " << path << " Status = " << loadStatus;
}
......
......@@ -146,7 +146,7 @@ int main(int argc, char *argv[])
const QString dataDir = QStandardPaths::standardLocations(QStandardPaths::DataLocation).first();
#endif
if (!db->getLoadSuccess())
if (db->loadCardDatabase(dataDir + "/cards.xml"))
if (!db->loadCardDatabase(dataDir + "/cards.xml"))
settingsCache->setCardDatabasePath(dataDir + "/cards.xml");
if (settingsCache->getTokenDatabasePath().isEmpty())
settingsCache->setTokenDatabasePath(dataDir + "/tokens.xml");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment