mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-02 05:38:06 -06:00
Fix prefjson::setPreferences() doesn't actually save.
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#include <QLocale>
|
||||
#include <QLibraryInfo>
|
||||
#include <QSysInfo>
|
||||
|
||||
#ifndef DISABLE_GUI
|
||||
#ifdef Q_OS_WIN
|
||||
#include <Windows.h>
|
||||
@@ -39,6 +40,7 @@
|
||||
#endif // Q_OS_WIN
|
||||
#ifdef Q_OS_MAC
|
||||
#include <QFileOpenEvent>
|
||||
#include <QFont>
|
||||
#include <QUrl>
|
||||
#endif // Q_OS_MAC
|
||||
#include "mainwindow.h"
|
||||
@@ -47,8 +49,8 @@
|
||||
#include <iostream>
|
||||
#endif // DISABLE_GUI
|
||||
|
||||
#if (!defined(DISABLE_GUI) && defined(Q_OS_MAC))
|
||||
#include <QFont>
|
||||
#ifndef DISABLE_WEBUI
|
||||
#include "webui.h"
|
||||
#endif
|
||||
|
||||
#include "application.h"
|
||||
@@ -92,17 +94,6 @@ void Application::processMessage(const QString &message)
|
||||
m_paramsQueue.append(params);
|
||||
}
|
||||
|
||||
void Application::cleanup()
|
||||
{
|
||||
#ifndef DISABLE_GUI
|
||||
delete m_window;
|
||||
#endif
|
||||
QBtSession::drop();
|
||||
TorrentPersistentData::drop();
|
||||
Preferences::drop();
|
||||
Logger::drop();
|
||||
}
|
||||
|
||||
bool Application::sendParams(const QStringList ¶ms)
|
||||
{
|
||||
return sendMessage(params.join(QLatin1String(PARAMS_SEPARATOR)));
|
||||
@@ -159,7 +150,12 @@ int Application::exec(const QStringList ¶ms)
|
||||
// Resume unfinished torrents
|
||||
QBtSession::instance()->startUpTorrents();
|
||||
|
||||
#ifndef DISABLE_WEBUI
|
||||
m_webui = new WebUI;
|
||||
#endif
|
||||
|
||||
#ifdef DISABLE_GUI
|
||||
#ifndef DISABLE_WEBUI
|
||||
Preferences* const pref = Preferences::instance();
|
||||
if (pref->isWebUiEnabled()) {
|
||||
// Display some information to the user
|
||||
@@ -172,9 +168,10 @@ int Application::exec(const QStringList ¶ms)
|
||||
std::cout << qPrintable(tr("This is a security risk, please consider changing your password from program preferences.")) << std::endl;
|
||||
}
|
||||
}
|
||||
#endif // DISABLE_WEBUI
|
||||
#else
|
||||
m_window = new MainWindow;
|
||||
#endif
|
||||
#endif // DISABLE_GUI
|
||||
|
||||
m_running = true;
|
||||
m_paramsQueue = params + m_paramsQueue;
|
||||
@@ -290,3 +287,17 @@ void Application::initializeTranslation()
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void Application::cleanup()
|
||||
{
|
||||
#ifndef DISABLE_GUI
|
||||
delete m_window;
|
||||
#endif
|
||||
#ifndef DISABLE_WEBUI
|
||||
delete m_webui;
|
||||
#endif
|
||||
QBtSession::drop();
|
||||
TorrentPersistentData::drop();
|
||||
Preferences::drop();
|
||||
Logger::drop();
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#ifndef APPLICATION_H
|
||||
#define APPLICATION_H
|
||||
|
||||
#include <QPointer>
|
||||
#include <QStringList>
|
||||
#include <QTranslator>
|
||||
|
||||
@@ -42,6 +43,10 @@ class MainWindow;
|
||||
typedef QtSingleCoreApplication BaseApplication;
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_WEBUI
|
||||
class WebUI;
|
||||
#endif
|
||||
|
||||
class Application : public BaseApplication
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -69,9 +74,15 @@ private slots:
|
||||
|
||||
private:
|
||||
bool m_running;
|
||||
|
||||
#ifndef DISABLE_GUI
|
||||
QPointer<MainWindow> m_window;
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_WEBUI
|
||||
QPointer<WebUI> m_webui;
|
||||
#endif
|
||||
|
||||
QTranslator m_qtTranslator;
|
||||
QTranslator m_translator;
|
||||
QStringList m_paramsQueue;
|
||||
|
||||
@@ -49,11 +49,8 @@ Q_IMPORT_PLUGIN(qico)
|
||||
#endif // QBT_STATIC_QT
|
||||
#else // DISABLE_GUI
|
||||
#include <cstdio>
|
||||
#include <iostream>
|
||||
#endif // DISABLE_GUI
|
||||
|
||||
#include "application.h"
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
#include <signal.h>
|
||||
#include <execinfo.h>
|
||||
@@ -67,6 +64,8 @@ Q_IMPORT_PLUGIN(qico)
|
||||
#endif //STACKTRACE_WIN
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include "application.h"
|
||||
#include "misc.h"
|
||||
#include "preferences.h"
|
||||
#include "logger.h"
|
||||
|
||||
Reference in New Issue
Block a user