#6538 Removed appconfig saveSettings calls from external classes, update serverconfig to derived class
This commit is contained in:
parent
73b9f40a44
commit
ad1429e9aa
6 changed files with 12 additions and 18 deletions
|
|
@ -54,7 +54,6 @@ void ActivationDialog::reject()
|
|||
if (QDialog::Accepted == cancelActivationDialog.exec()) {
|
||||
m_LicenseManager->skipActivation();
|
||||
m_appConfig->activationHasRun(true);
|
||||
m_appConfig->saveSettings();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
|
@ -66,7 +65,6 @@ void ActivationDialog::accept()
|
|||
{
|
||||
QMessageBox message;
|
||||
m_appConfig->activationHasRun(true);
|
||||
m_appConfig->saveSettings();
|
||||
|
||||
std::pair<bool, QString> result;
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -62,8 +62,6 @@ LicenseManager::setSerialKey(SerialKey serialKey, bool acceptExpired)
|
|||
emit beginTrial(m_serialKey.isExpiring(currentTime));
|
||||
}
|
||||
}
|
||||
|
||||
m_AppConfig->saveSettings();
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
@ -118,7 +116,6 @@ void LicenseManager::refresh()
|
|||
setSerialKey(serialKey, true);
|
||||
} catch (...) {
|
||||
m_AppConfig->clearSerialKey();
|
||||
m_AppConfig->saveSettings();
|
||||
}
|
||||
}
|
||||
if (m_serialKey.isExpired(::time(0))) {
|
||||
|
|
|
|||
|
|
@ -42,9 +42,9 @@ static const struct
|
|||
|
||||
const int serverDefaultIndex = 7;
|
||||
|
||||
ServerConfig::ServerConfig(AppConfig* appConfig, int numColumns, int numRows ,
|
||||
ServerConfig::ServerConfig(int numColumns, int numRows ,
|
||||
QString serverName, MainWindow* mainWindow) :
|
||||
m_pAppConfig(appConfig),
|
||||
|
||||
m_Screens(),
|
||||
m_NumColumns(numColumns),
|
||||
m_NumRows(numRows),
|
||||
|
|
@ -56,8 +56,7 @@ ServerConfig::ServerConfig(AppConfig* appConfig, int numColumns, int numRows ,
|
|||
m_ClipboardSharingSize(defaultClipboardSharingSize()),
|
||||
m_pMainWindow(mainWindow)
|
||||
{
|
||||
Q_ASSERT(m_pAppConfig);
|
||||
|
||||
GUI::Config::ConfigWriter::make()->registerClass(this);
|
||||
loadSettings();
|
||||
}
|
||||
|
||||
|
|
@ -142,6 +141,9 @@ void ServerConfig::saveSettings()
|
|||
settings().endArray();
|
||||
|
||||
settings().endGroup();
|
||||
|
||||
//Tell the config writer there are changes
|
||||
GUI::Config::ConfigWriter::make()->markUnsaved();
|
||||
}
|
||||
|
||||
void ServerConfig::loadSettings()
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
#include "Screen.h"
|
||||
#include "BaseConfig.h"
|
||||
#include "Hotkey.h"
|
||||
#include "ConfigBase.h"
|
||||
|
||||
class QTextStream;
|
||||
class QSettings;
|
||||
|
|
@ -34,13 +35,13 @@ class ServerConfigDialog;
|
|||
class MainWindow;
|
||||
class AppConfig;
|
||||
|
||||
class ServerConfig : public BaseConfig
|
||||
class ServerConfig : public BaseConfig, public GUI::Config::ConfigBase
|
||||
{
|
||||
friend class ServerConfigDialog;
|
||||
friend QTextStream& operator<<(QTextStream& outStream, const ServerConfig& config);
|
||||
|
||||
public:
|
||||
ServerConfig(AppConfig* settings, int numColumns, int numRows,
|
||||
ServerConfig(int numColumns, int numRows,
|
||||
QString serverName, MainWindow* mainWindow);
|
||||
~ServerConfig();
|
||||
|
||||
|
|
@ -68,8 +69,8 @@ class ServerConfig : public BaseConfig
|
|||
size_t clipboardSharingSize() const { return m_ClipboardSharingSize; }
|
||||
static size_t defaultClipboardSharingSize();
|
||||
|
||||
void saveSettings();
|
||||
void loadSettings();
|
||||
void saveSettings() override;
|
||||
void loadSettings() override;
|
||||
bool save(const QString& fileName) const;
|
||||
void save(QFile& file) const;
|
||||
int numScreens() const;
|
||||
|
|
@ -111,7 +112,6 @@ class ServerConfig : public BaseConfig
|
|||
void addToFirstEmptyGrid(const QString& clientName);
|
||||
|
||||
private:
|
||||
AppConfig* m_pAppConfig;
|
||||
ScreenList m_Screens;
|
||||
int m_NumColumns;
|
||||
int m_NumRows;
|
||||
|
|
|
|||
|
|
@ -68,7 +68,6 @@ void SettingsDialog::accept()
|
|||
|
||||
//We only need to test the System scoped Radio as they are connected
|
||||
appConfig().setLoadFromSystemScope(m_pRadioSystemScope->isChecked());
|
||||
appConfig().saveSettings();
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
|
|
@ -201,7 +200,6 @@ void SettingsDialog::on_m_pComboLanguage_currentIndexChanged(int index)
|
|||
void SettingsDialog::on_m_pCheckBoxEnableCrypto_toggled(bool checked)
|
||||
{
|
||||
m_appConfig.setCryptoEnabled(checked);
|
||||
m_appConfig.saveSettings();
|
||||
if (checked) {
|
||||
SslCertificate sslCertificate;
|
||||
sslCertificate.generateCertificate();
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#define TRAY_RETRY_COUNT 1
|
||||
#define TRAY_RETRY_COUNT 10
|
||||
#define TRAY_RETRY_WAIT 2000
|
||||
|
||||
#include "QSynergyApplication.h"
|
||||
|
|
@ -27,7 +27,6 @@
|
|||
|
||||
#include <QtCore>
|
||||
#include <QtGui>
|
||||
#include <QSettings>
|
||||
#include <QMessageBox>
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
|
|
|
|||
Loading…
Reference in a new issue