Move Preferences backend code into SettingsStorage class

Closes #4764
This commit is contained in:
Vladimir Golovnev (Glassez)
2016-02-09 11:55:02 +03:00
committed by sledgehammer999
parent 3c03ccc14a
commit 8e5c31ae82
7 changed files with 320 additions and 189 deletions

View File

@@ -60,6 +60,7 @@
#include "application.h"
#include "filelogger.h"
#include "base/logger.h"
#include "base/settingsstorage.h"
#include "base/preferences.h"
#include "base/utils/fs.h"
#include "base/utils/misc.h"
@@ -81,6 +82,7 @@ Application::Application(const QString &id, int &argc, char **argv)
#endif
{
Logger::initInstance();
SettingsStorage::initInstance();
Preferences::initInstance();
#if defined(Q_OS_MACX) && !defined(DISABLE_GUI)
@@ -159,7 +161,7 @@ void Application::torrentFinished(BitTorrent::TorrentHandle *const torrent)
QString program = pref->getAutoRunProgram();
program.replace("%N", torrent->name());
program.replace("%L", torrent->label());
program.replace("%L", torrent->category());
program.replace("%F", Utils::Fs::toNativePath(torrent->contentPath()));
program.replace("%R", Utils::Fs::toNativePath(torrent->rootPath()));
program.replace("%D", Utils::Fs::toNativePath(torrent->savePath()));
@@ -486,6 +488,7 @@ void Application::cleanup()
#endif
Net::DownloadManager::freeInstance();
Preferences::freeInstance();
SettingsStorage::freeInstance();
delete m_fileLogger;
Logger::freeInstance();
IconProvider::freeInstance();