refactor: mv lib/gui/proxy/QSettingsProxy => lib/common
This commit is contained in:
parent
5a7284fd6a
commit
3cd3d7b1ff
14 changed files with 9 additions and 30 deletions
|
|
@ -17,7 +17,6 @@
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
using namespace deskflow::gui::proxy;
|
|
||||||
using enum ScreenConfig::Modifier;
|
using enum ScreenConfig::Modifier;
|
||||||
using enum ScreenConfig::SwitchCorner;
|
using enum ScreenConfig::SwitchCorner;
|
||||||
using enum ScreenConfig::Fix;
|
using enum ScreenConfig::Fix;
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,6 @@ const auto kDefaultProtocol = ServerProtocol::kBarrier;
|
||||||
|
|
||||||
class ServerConfig : public ScreenConfig, public deskflow::gui::IServerConfig
|
class ServerConfig : public ScreenConfig, public deskflow::gui::IServerConfig
|
||||||
{
|
{
|
||||||
using QSettingsProxy = deskflow::gui::proxy::QSettingsProxy;
|
|
||||||
using ServerProtocol = synergy::gui::ServerProtocol;
|
using ServerProtocol = synergy::gui::ServerProtocol;
|
||||||
|
|
||||||
friend class ServerConfigDialog;
|
friend class ServerConfigDialog;
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@ add_library(common STATIC
|
||||||
stdvector.h
|
stdvector.h
|
||||||
Settings.h
|
Settings.h
|
||||||
Settings.cpp
|
Settings.cpp
|
||||||
|
QSettingsProxy.cpp
|
||||||
|
QSettingsProxy.h
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/constants.h
|
${CMAKE_CURRENT_BINARY_DIR}/constants.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
#include "QSettingsProxy.h"
|
#include "QSettingsProxy.h"
|
||||||
|
|
||||||
#include "common/constants.h"
|
#include "common/constants.h"
|
||||||
#include "gui/Logger.h"
|
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
@ -15,8 +14,6 @@
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
namespace deskflow::gui::proxy {
|
|
||||||
|
|
||||||
const auto kLegacyOrgDomain = "http-symless-com";
|
const auto kLegacyOrgDomain = "http-symless-com";
|
||||||
const auto kLegacySystemConfigFilename = "SystemConfig.ini";
|
const auto kLegacySystemConfigFilename = "SystemConfig.ini";
|
||||||
|
|
||||||
|
|
@ -105,7 +102,7 @@ void migrateLegacyUserSettings(QSettings &newSettings)
|
||||||
for (const QString &key : std::as_const(keys)) {
|
for (const QString &key : std::as_const(keys)) {
|
||||||
QVariant oldValue = oldSettings.value(key);
|
QVariant oldValue = oldSettings.value(key);
|
||||||
newSettings.setValue(key, oldValue);
|
newSettings.setValue(key, oldValue);
|
||||||
logVerbose(QString("migrating setting '%1' = '%2'").arg(key, oldValue.toString()));
|
qInfo().noquote() << QStringLiteral("migrating setting '%1' = '%2'").arg(key, oldValue.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
newSettings.sync();
|
newSettings.sync();
|
||||||
|
|
@ -214,5 +211,3 @@ bool QSettingsProxy::contains(const QString &key) const
|
||||||
{
|
{
|
||||||
return m_pSettings->contains(key);
|
return m_pSettings->contains(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace deskflow::gui::proxy
|
|
||||||
|
|
@ -8,8 +8,6 @@
|
||||||
|
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
|
||||||
namespace deskflow::gui::proxy {
|
|
||||||
|
|
||||||
QString getSystemSettingBaseDir();
|
QString getSystemSettingBaseDir();
|
||||||
|
|
||||||
class QSettingsProxy
|
class QSettingsProxy
|
||||||
|
|
@ -52,5 +50,3 @@ public:
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<QSettings> m_pSettings;
|
std::unique_ptr<QSettings> m_pSettings;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace deskflow::gui::proxy
|
|
||||||
|
|
@ -64,8 +64,6 @@ add_library(${target} STATIC
|
||||||
proxy/QNetworkAccessManagerProxy.h
|
proxy/QNetworkAccessManagerProxy.h
|
||||||
proxy/QProcessProxy.cpp
|
proxy/QProcessProxy.cpp
|
||||||
proxy/QProcessProxy.h
|
proxy/QProcessProxy.h
|
||||||
proxy/QSettingsProxy.cpp
|
|
||||||
proxy/QSettingsProxy.h
|
|
||||||
tls/TlsCertificate.cpp
|
tls/TlsCertificate.cpp
|
||||||
tls/TlsCertificate.h
|
tls/TlsCertificate.h
|
||||||
tls/TlsUtility.cpp
|
tls/TlsUtility.cpp
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#include "ConfigScopes.h"
|
#include "ConfigScopes.h"
|
||||||
|
|
||||||
#include "proxy/QSettingsProxy.h"
|
#include "common/QSettingsProxy.h"
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
@ -17,8 +17,6 @@
|
||||||
|
|
||||||
namespace deskflow::gui {
|
namespace deskflow::gui {
|
||||||
|
|
||||||
using namespace proxy;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// ConfigScopes::Deps
|
// ConfigScopes::Deps
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "IConfigScopes.h"
|
#include "IConfigScopes.h"
|
||||||
|
#include "common/QSettingsProxy.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
|
@ -18,8 +19,6 @@ namespace deskflow::gui {
|
||||||
/// @brief Encapsulates Qt config for both user and global scopes.
|
/// @brief Encapsulates Qt config for both user and global scopes.
|
||||||
class ConfigScopes : public QObject, public IConfigScopes
|
class ConfigScopes : public QObject, public IConfigScopes
|
||||||
{
|
{
|
||||||
using QSettingsProxy = deskflow::gui::proxy::QSettingsProxy;
|
|
||||||
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "gui/proxy/QSettingsProxy.h"
|
#include "common/QSettingsProxy.h"
|
||||||
|
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
@ -16,7 +16,6 @@ namespace deskflow::gui {
|
||||||
|
|
||||||
class IConfigScopes
|
class IConfigScopes
|
||||||
{
|
{
|
||||||
using QSettingsProxy = deskflow::gui::proxy::QSettingsProxy;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum class Scope
|
enum class Scope
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@
|
||||||
#include "Screen.h"
|
#include "Screen.h"
|
||||||
#include "config/ScreenConfig.h"
|
#include "config/ScreenConfig.h"
|
||||||
|
|
||||||
using namespace deskflow::gui::proxy;
|
|
||||||
using enum ScreenConfig::Modifier;
|
using enum ScreenConfig::Modifier;
|
||||||
using enum ScreenConfig::SwitchCorner;
|
using enum ScreenConfig::SwitchCorner;
|
||||||
using enum ScreenConfig::Fix;
|
using enum ScreenConfig::Fix;
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
#include "ScreenConfig.h"
|
#include "ScreenConfig.h"
|
||||||
|
|
||||||
#include "gui/proxy/QSettingsProxy.h"
|
#include "common/QSettingsProxy.h"
|
||||||
|
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
|
@ -24,8 +24,6 @@ class ScreenSettingsDialog;
|
||||||
|
|
||||||
class Screen : public ScreenConfig
|
class Screen : public ScreenConfig
|
||||||
{
|
{
|
||||||
using QSettingsProxy = deskflow::gui::proxy::QSettingsProxy;
|
|
||||||
|
|
||||||
friend class ScreenSettingsDialog;
|
friend class ScreenSettingsDialog;
|
||||||
friend class ScreenSetupModel;
|
friend class ScreenSetupModel;
|
||||||
friend class ScreenSetupView;
|
friend class ScreenSetupView;
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,11 @@
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
|
||||||
#include "gui/proxy/QSettingsProxy.h"
|
#include "common/QSettingsProxy.h"
|
||||||
|
|
||||||
/// @brief Screen configuration base class
|
/// @brief Screen configuration base class
|
||||||
class ScreenConfig
|
class ScreenConfig
|
||||||
{
|
{
|
||||||
using QSettingsProxy = deskflow::gui::proxy::QSettingsProxy;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum class Modifier
|
enum class Modifier
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@
|
||||||
|
|
||||||
using namespace testing;
|
using namespace testing;
|
||||||
using namespace deskflow::gui;
|
using namespace deskflow::gui;
|
||||||
using namespace deskflow::gui::proxy;
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,13 +6,12 @@
|
||||||
|
|
||||||
#include "gui/config/Screen.h"
|
#include "gui/config/Screen.h"
|
||||||
|
|
||||||
#include "gui/proxy/QSettingsProxy.h"
|
#include "common/QSettingsProxy.h"
|
||||||
#include "shared/gui/TestQtCoreApp.h"
|
#include "shared/gui/TestQtCoreApp.h"
|
||||||
|
|
||||||
#include <gmock/gmock.h>
|
#include <gmock/gmock.h>
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
using namespace deskflow::gui::proxy;
|
|
||||||
using namespace testing;
|
using namespace testing;
|
||||||
|
|
||||||
class QSettingsProxyMock : public QSettingsProxy
|
class QSettingsProxyMock : public QSettingsProxy
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue