From 9fbe90e1f97d7ade423b324ea2a2ecc9a9ce2a47 Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Wed, 10 Jan 2018 06:21:54 +0500 Subject: [PATCH] UI: --boot unregisters booted provider only. --- src/ui/fortcommon.cpp | 5 ----- src/ui/fortcommon.h | 1 - src/ui/fortsettings.cpp | 8 ++------ src/ui/fortsettings.h | 2 -- src/ui/main.cpp | 5 ++--- 5 files changed, 4 insertions(+), 17 deletions(-) diff --git a/src/ui/fortcommon.cpp b/src/ui/fortcommon.cpp index 8f2265f0..d1a48f52 100644 --- a/src/ui/fortcommon.cpp +++ b/src/ui/fortcommon.cpp @@ -165,11 +165,6 @@ bool FortCommon::confAppBlocked(const void *drvConf, int appIndex) return fort_conf_app_blocked(conf, appIndex); } -uint FortCommon::provRegister(bool isBoot) -{ - return fort_prov_register(isBoot); -} - void FortCommon::provUnregister() { fort_prov_unregister(); diff --git a/src/ui/fortcommon.h b/src/ui/fortcommon.h index b5aecdfa..55fca1af 100644 --- a/src/ui/fortcommon.h +++ b/src/ui/fortcommon.h @@ -55,7 +55,6 @@ public: static quint8 confAppGroupIndex(const void *drvConf, int appIndex); static bool confAppBlocked(const void *drvConf, int appIndex); - static uint provRegister(bool isBoot); static void provUnregister(); }; diff --git a/src/ui/fortsettings.cpp b/src/ui/fortsettings.cpp index bf02eff0..945f1db8 100644 --- a/src/ui/fortsettings.cpp +++ b/src/ui/fortsettings.cpp @@ -12,8 +12,7 @@ FortSettings::FortSettings(const QStringList &args, QObject *parent) : QObject(parent), - m_hasProvBoot(false), - m_provBoot(false) + m_hasProvBoot(false) { processArguments(args); setupIni(); @@ -44,7 +43,7 @@ void FortSettings::processArguments(const QStringList &args) const QCommandLineOption provBootOption( QStringList() << "b" << "boot", - "Block access to network when Fort Firewall is not running.", "boot"); + "Unblock access to network when Fort Firewall is not running.", "boot"); parser.addOption(provBootOption); const QCommandLineOption profileOption( @@ -58,9 +57,6 @@ void FortSettings::processArguments(const QStringList &args) parser.process(args); m_hasProvBoot = parser.isSet(provBootOption); - if (m_hasProvBoot) { - m_provBoot = QVariant(parser.value(provBootOption)).toBool(); - } m_profilePath = parser.value(profileOption); if (m_profilePath.isEmpty()) { diff --git a/src/ui/fortsettings.h b/src/ui/fortsettings.h index d0630e65..074e5960 100644 --- a/src/ui/fortsettings.h +++ b/src/ui/fortsettings.h @@ -28,7 +28,6 @@ public: QObject *parent = nullptr); bool hasProvBoot() const { return m_hasProvBoot; } - bool provBoot() const { return m_provBoot; } bool debug() const { return iniBool("base/debug"); } void setDebug(bool on) { setIniValue("base/debug", on); } @@ -104,7 +103,6 @@ private: private: uint m_hasProvBoot : 1; - uint m_provBoot : 1; QString m_profilePath; diff --git a/src/ui/main.cpp b/src/ui/main.cpp index b9b063f2..4d438092 100644 --- a/src/ui/main.cpp +++ b/src/ui/main.cpp @@ -19,11 +19,10 @@ int main(int argc, char *argv[]) FortSettings fortSettings(qApp->arguments()); - // Register booted provider and exit + // Unregister booted provider and exit if (fortSettings.hasProvBoot()) { FortCommon::provUnregister(); - return fortSettings.provBoot() - ? FortCommon::provRegister(true) : 0; + return 0; } // To check running instance