From 010dd24e4be3116138197108349b75e90104666d Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Tue, 17 Dec 2013 18:16:09 +0100 Subject: [PATCH] SIngleton getter for systemfactory. --- src/core/systemfactory.cpp | 3 ++- src/core/systemfactory.h | 4 +++- src/gui/formsettings.cpp | 14 ++++++-------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/core/systemfactory.cpp b/src/core/systemfactory.cpp index 19464a7a0..b86166387 100644 --- a/src/core/systemfactory.cpp +++ b/src/core/systemfactory.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #if defined(Q_OS_WIN) #include @@ -86,6 +87,7 @@ QString SystemFactory::getAutostartDesktopFileLocation() { // No location found, return empty string. return desktop_file_location; } +#endif SystemFactory *SystemFactory::getInstance() { if (s_instance.isNull()) { @@ -94,7 +96,6 @@ SystemFactory *SystemFactory::getInstance() { return s_instance; } -#endif bool SystemFactory::setAutoStartStatus(const AutoStartStatus &new_status) { SystemFactory::AutoStartStatus current_status = SystemFactory::getAutoStartStatus(); diff --git a/src/core/systemfactory.h b/src/core/systemfactory.h index 6c08f74e1..fb303aec9 100644 --- a/src/core/systemfactory.h +++ b/src/core/systemfactory.h @@ -5,6 +5,8 @@ #include +class QReadWriteLock; + class SystemFactory : public QObject { Q_OBJECT @@ -32,7 +34,7 @@ class SystemFactory : public QObject { #if defined(Q_OS_LINUX) // Returns standard location where auto-start .desktop files // should be placed. - static QString getAutostartDesktopFileLocation(); + QString getAutostartDesktopFileLocation(); #endif // Singleton getter. diff --git a/src/gui/formsettings.cpp b/src/gui/formsettings.cpp index 39b3f6e59..24420389d 100755 --- a/src/gui/formsettings.cpp +++ b/src/gui/formsettings.cpp @@ -133,7 +133,7 @@ void FormSettings::selectBrowserExecutable() { tr("Executables (*.*)")); if (!executable_file.isEmpty()) { - m_ui->m_txtExternalBrowserExecutable->setText(executable_file); + m_ui->m_txtExternalBrowserExecutable->setText(executable_file); } } @@ -425,13 +425,11 @@ void FormSettings::loadGeneral() { void FormSettings::saveGeneral() { // If auto-start feature is available and user wants // to turn it on, then turn it on. - if (SystemFactory::getInstance()->getAutoStartStatus() != SystemFactory::Unavailable) { - if (m_ui->m_checkAutostart->isChecked()) { - SystemFactory::getInstance()->setAutoStartStatus(SystemFactory::Enabled); - } - else { - SystemFactory::getInstance()->setAutoStartStatus(SystemFactory::Disabled); - } + if (m_ui->m_checkAutostart->isChecked()) { + SystemFactory::getInstance()->setAutoStartStatus(SystemFactory::Enabled); + } + else { + SystemFactory::getInstance()->setAutoStartStatus(SystemFactory::Disabled); } }