refactor: appconfig is no longer a iAppConfig subclass
This commit is contained in:
@ -20,6 +20,7 @@
|
||||
#include "gui/config/ConfigScopes.h"
|
||||
#include "gui/constants.h"
|
||||
#include "gui/core/CoreProcess.h"
|
||||
#include "gui/core/CoreTool.h"
|
||||
#include "gui/diagnostic.h"
|
||||
#include "gui/ipc/DaemonIpcClient.h"
|
||||
#include "gui/messages.h"
|
||||
|
||||
@ -36,7 +36,6 @@ add_library(${target} STATIC
|
||||
config/AppConfig.h
|
||||
config/ConfigScopes.cpp
|
||||
config/ConfigScopes.h
|
||||
config/IAppConfig.h
|
||||
config/IConfigScopes.h
|
||||
config/IServerConfig.h
|
||||
config/Screen.cpp
|
||||
|
||||
@ -12,13 +12,6 @@
|
||||
|
||||
#include "ConfigScopes.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
#include <QVariant>
|
||||
|
||||
#include <functional>
|
||||
|
||||
using namespace deskflow::gui;
|
||||
|
||||
AppConfig::AppConfig(deskflow::gui::IConfigScopes &scopes, std::shared_ptr<Deps> deps) : m_Scopes(scopes), m_pDeps(deps)
|
||||
|
||||
@ -8,18 +8,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "IAppConfig.h"
|
||||
#include "IConfigScopes.h"
|
||||
#include "common/constants.h"
|
||||
#include "gui/paths.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QObject>
|
||||
#include <QPoint>
|
||||
#include <QSize>
|
||||
#include <QString>
|
||||
#include <QVariant>
|
||||
#include <optional>
|
||||
|
||||
/**
|
||||
* @brief Simply reads and writes app settings.
|
||||
@ -29,7 +20,7 @@
|
||||
* instance is widely accessible, but that has previously led to this class
|
||||
* becoming a god object.
|
||||
*/
|
||||
class AppConfig : public QObject, public deskflow::gui::IAppConfig
|
||||
class AppConfig : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
using IConfigScopes = deskflow::gui::IConfigScopes;
|
||||
@ -44,16 +35,16 @@ public:
|
||||
|
||||
void determineScope();
|
||||
|
||||
IConfigScopes &scopes() const override;
|
||||
bool isActiveScopeWritable() const override;
|
||||
bool isActiveScopeSystem() const override;
|
||||
IConfigScopes &scopes() const;
|
||||
bool isActiveScopeWritable() const;
|
||||
bool isActiveScopeSystem() const;
|
||||
|
||||
/// @brief Sets the user preference to load from SystemScope.
|
||||
/// @param [in] value
|
||||
/// True - This will set the variable and load the global scope
|
||||
/// settings. False - This will set the variable and load the user
|
||||
/// scope settings.
|
||||
void setLoadFromSystemScope(bool value) override;
|
||||
void setLoadFromSystemScope(bool value);
|
||||
|
||||
private:
|
||||
/// @brief This method loads config from specified scope
|
||||
|
||||
@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* SPDX-FileCopyrightText: (C) 2024 Symless Ltd.
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "gui/config/IConfigScopes.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
namespace deskflow::gui {
|
||||
|
||||
class IAppConfig
|
||||
{
|
||||
using IConfigScopes = deskflow::gui::IConfigScopes;
|
||||
|
||||
public:
|
||||
virtual ~IAppConfig() = default;
|
||||
|
||||
//
|
||||
// Getters
|
||||
//
|
||||
|
||||
virtual IConfigScopes &scopes() const = 0;
|
||||
virtual bool isActiveScopeSystem() const = 0;
|
||||
virtual bool isActiveScopeWritable() const = 0;
|
||||
|
||||
//
|
||||
// Setters
|
||||
//
|
||||
|
||||
virtual void setLoadFromSystemScope(bool loadFromSystemScope) = 0;
|
||||
};
|
||||
|
||||
} // namespace deskflow::gui
|
||||
@ -5,7 +5,6 @@
|
||||
*/
|
||||
|
||||
#include "common/Settings.h"
|
||||
#include "gui/config/IAppConfig.h"
|
||||
#include "gui/core/CoreProcess.h"
|
||||
#include "gui/proxy/QProcessProxy.h"
|
||||
#include "shared/gui/mocks/ServerConfigMock.h"
|
||||
|
||||
Reference in New Issue
Block a user