Remove unneeded default .ini

This commit is contained in:
Nodir Temirkhodjaev 2017-09-09 05:08:11 +05:00
parent 9303aea5e4
commit 7167149565
5 changed files with 7 additions and 23 deletions

View File

@ -4,5 +4,6 @@
#define APP_NAME "Fort Firewall"
#define APP_VERSION_STR "0.1.0"
#define APP_VERSION 0x000100
#define APP_UPDATES_URL "https://github.com/tnodir/fort/releases"
#endif VERSION_H

View File

@ -58,8 +58,7 @@ QML_FILES += \
qml/pages/apps/*.qml
OTHER_FILES += \
$${QML_FILES} \
*.ini
$${QML_FILES}
TRANSLATIONS += \
i18n/i18n_ru.ts
@ -70,9 +69,6 @@ RESOURCES += fort_qml.qrc
# Compiled translation files
RESOURCES += fort_i18n.qrc
# Default FortFirewall.ini
RESOURCES += fort_ini.qrc
# Images
RESOURCES += fort_images.qrc

View File

@ -1,5 +0,0 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>FortFirewall.ini</file>
</qresource>
</RCC>

View File

@ -67,19 +67,10 @@ void FortSettings::processArguments(const QStringList &args)
void FortSettings::setupIni()
{
const QString qrcIniPath(":/FortFirewall.ini");
const QString iniPath(m_profilePath + "FortFirewall.ini");
FileUtil::makePath(m_profilePath);
// Copy default .ini into writable location
if (!FileUtil::fileExists(iniPath)) {
const QString text = FileUtil::readFile(qrcIniPath);
if (!FileUtil::writeFile(iniPath, text)) {
FileUtil::removeFile(iniPath);
}
}
m_ini = new QSettings(iniPath, QSettings::IniFormat, this);
}

View File

@ -4,6 +4,8 @@
#include <QObject>
#include <QSettings>
#include "../common/version.h"
class FirewallConf;
class FortSettings : public QObject
@ -11,7 +13,7 @@ class FortSettings : public QObject
Q_OBJECT
Q_PROPERTY(bool debug READ debug WRITE setDebug NOTIFY iniChanged)
Q_PROPERTY(QString language READ language WRITE setLanguage NOTIFY iniChanged)
Q_PROPERTY(QString updatesUrl READ updatesUrl WRITE setUpdatesUrl NOTIFY iniChanged)
Q_PROPERTY(QString updatesUrl READ updatesUrl CONSTANT)
Q_PROPERTY(bool startWithWindows READ startWithWindows WRITE setStartWithWindows NOTIFY startWithWindowsChanged)
Q_PROPERTY(QString errorMessage READ errorMessage NOTIFY errorMessageChanged)
@ -25,10 +27,9 @@ public:
void setDebug(bool on) { setIniValue("base/debug", on); }
QString language() const { return iniText("base/language", "en"); }
void setLanguage(const QString &v) { setIniValue("base/language", v, "en"); }
void setLanguage(const QString &v) { setIniValue("base/language", v); }
QString updatesUrl() const { return iniText("base/updatesUrl"); }
void setUpdatesUrl(const QString &v) { setIniValue("base/updatesUrl", v); }
QString updatesUrl() const { return APP_UPDATES_URL; }
bool startWithWindows() const;
void setStartWithWindows(bool start);