SIngleton getter for systemfactory.
This commit is contained in:
parent
738dbbe5c6
commit
010dd24e4b
@ -1,6 +1,7 @@
|
||||
#include <QString>
|
||||
#include <QFile>
|
||||
#include <QApplication>
|
||||
#include <QReadWriteLock>
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
#include <QSettings>
|
||||
@ -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();
|
||||
|
@ -5,6 +5,8 @@
|
||||
#include <QPointer>
|
||||
|
||||
|
||||
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.
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user