1
Fork 0
mirror of https://github.com/redstrate/Novus.git synced 2025-04-25 05:17:44 +00:00
novus/common/src/settings.cpp

26 lines
No EOL
746 B
C++

// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#include "settings.h"
#include <KConfig>
#include <KConfigGroup>
#include <KLocalizedString>
#include <QCoreApplication>
#include <QMessageBox>
QString getGameDirectory()
{
KConfig config(QStringLiteral("novusrc"));
KConfigGroup game = config.group(QStringLiteral("Game"));
if (game.hasKey(QStringLiteral("GameDir"))) {
return game.readEntry(QStringLiteral("GameDir"));
} else {
QMessageBox msgBox;
msgBox.setText(i18n("The game directory has not been set. Please open the Novus SDK launcher and set it."));
msgBox.exec();
QCoreApplication::quit();
return {};
}
}