mirror of
https://github.com/deskflow/deskflow.git
synced 2026-06-28 21:02:21 +08:00
#6583 Changed Server config to pull Settings directly from AppConfig instead of maintaining its own pointer
Signed-off-by: jnewbon <jamie@symless.com>
This commit is contained in:
parent
87692ad0a5
commit
0243ba9171
@ -42,21 +42,21 @@ static const struct
|
||||
|
||||
const int serverDefaultIndex = 7;
|
||||
|
||||
ServerConfig::ServerConfig(QSettings* settings, int numColumns, int numRows ,
|
||||
ServerConfig::ServerConfig(AppConfig* appConfig, int numColumns, int numRows ,
|
||||
QString serverName, MainWindow* mainWindow) :
|
||||
m_pSettings(settings),
|
||||
m_Screens(),
|
||||
m_NumColumns(numColumns),
|
||||
m_NumRows(numRows),
|
||||
m_ServerName(serverName),
|
||||
m_IgnoreAutoConfigClient(false),
|
||||
m_EnableDragAndDrop(false),
|
||||
m_DisableLockToScreen(false),
|
||||
m_ClipboardSharing(true),
|
||||
m_ClipboardSharingSize(defaultClipboardSharingSize()),
|
||||
m_pMainWindow(mainWindow)
|
||||
m_pAppConfig(appConfig),
|
||||
m_Screens(),
|
||||
m_NumColumns(numColumns),
|
||||
m_NumRows(numRows),
|
||||
m_ServerName(serverName),
|
||||
m_IgnoreAutoConfigClient(false),
|
||||
m_EnableDragAndDrop(false),
|
||||
m_DisableLockToScreen(false),
|
||||
m_ClipboardSharing(true),
|
||||
m_ClipboardSharingSize(defaultClipboardSharingSize()),
|
||||
m_pMainWindow(mainWindow)
|
||||
{
|
||||
Q_ASSERT(m_pSettings);
|
||||
Q_ASSERT(m_pAppConfig);
|
||||
|
||||
loadSettings();
|
||||
}
|
||||
@ -430,3 +430,7 @@ size_t ServerConfig::setClipboardSharingSize(size_t size) {
|
||||
swap (size, m_ClipboardSharingSize);
|
||||
return size;
|
||||
}
|
||||
|
||||
QSettings &ServerConfig::settings() {
|
||||
return m_pAppConfig->settings();
|
||||
}
|
||||
|
||||
@ -32,6 +32,7 @@ class QString;
|
||||
class QFile;
|
||||
class ServerConfigDialog;
|
||||
class MainWindow;
|
||||
class AppConfig;
|
||||
|
||||
class ServerConfig : public BaseConfig
|
||||
{
|
||||
@ -39,7 +40,7 @@ class ServerConfig : public BaseConfig
|
||||
friend QTextStream& operator<<(QTextStream& outStream, const ServerConfig& config);
|
||||
|
||||
public:
|
||||
ServerConfig(QSettings* settings, int numColumns, int numRows,
|
||||
ServerConfig(AppConfig* settings, int numColumns, int numRows,
|
||||
QString serverName, MainWindow* mainWindow);
|
||||
~ServerConfig();
|
||||
|
||||
@ -75,7 +76,7 @@ class ServerConfig : public BaseConfig
|
||||
int autoAddScreen(const QString name);
|
||||
|
||||
protected:
|
||||
QSettings& settings() { return *m_pSettings; }
|
||||
QSettings& settings();
|
||||
ScreenList& screens() { return m_Screens; }
|
||||
void setScreens(const ScreenList& screens) { m_Screens = screens; }
|
||||
void addScreen(const Screen& screen) { m_Screens.append(screen); }
|
||||
@ -110,7 +111,7 @@ class ServerConfig : public BaseConfig
|
||||
void addToFirstEmptyGrid(const QString& clientName);
|
||||
|
||||
private:
|
||||
QSettings* m_pSettings;
|
||||
AppConfig* m_pAppConfig;
|
||||
ScreenList m_Screens;
|
||||
int m_NumColumns;
|
||||
int m_NumRows;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user