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