DolphinQt2: replace Settings with SConfig where possible

Changes:
- `ShowDevelopmentWarning` is now under the '[Interface]' group in
  Dolphin.ini, with other interface-related settings. So, whoever uses
  DolphinQt will have to edit that manually again. Sorry!
- Game search paths and the last file are now shared properly with
  DolphinWX
- Qt-only preferences like "Preferred View: list/table" are now
  stored using the platform's native settings storage, rather than in
  UI.ini
This commit is contained in:
Michael Maltese
2017-06-22 15:11:53 -07:00
parent 898bbffaa7
commit d0fdb9f149
16 changed files with 132 additions and 448 deletions

View File

@ -10,6 +10,7 @@
#include "Common/CommonPaths.h"
#include "Common/FileUtil.h"
#include "Core/ConfigManager.h"
#include "DolphinQt2/Resources.h"
#include "DolphinQt2/Settings.h"
@ -20,7 +21,7 @@ QList<QPixmap> Resources::m_misc;
QIcon Resources::GetIcon(const QString& name, const QString& dir)
{
QString base_path = dir + name;
QString base_path = dir + QStringLiteral("/") + name;
const auto dpr = QGuiApplication::primaryScreen()->devicePixelRatio();
@ -45,24 +46,34 @@ QPixmap Resources::GetPixmap(const QString& name, const QString& dir)
return icon.pixmap(icon.availableSizes()[0]);
}
static QString GetCurrentThemeDir()
{
return QString::fromStdString(File::GetThemeDir(SConfig::GetInstance().theme_name));
}
static QString GetResourcesDir()
{
return QString::fromStdString(File::GetSysDirectory() + "Resources");
}
QIcon Resources::GetScaledIcon(const std::string& name)
{
return GetIcon(QString::fromStdString(name), Settings::Instance().GetResourcesDir());
return GetIcon(QString::fromStdString(name), GetResourcesDir());
}
QIcon Resources::GetScaledThemeIcon(const std::string& name)
{
return GetIcon(QString::fromStdString(name), Settings::Instance().GetThemeDir());
return GetIcon(QString::fromStdString(name), GetCurrentThemeDir());
}
QPixmap Resources::GetScaledPixmap(const std::string& name)
{
return GetPixmap(QString::fromStdString(name), Settings::Instance().GetResourcesDir());
return GetPixmap(QString::fromStdString(name), GetResourcesDir());
}
QPixmap Resources::GetScaledThemePixmap(const std::string& name)
{
return GetPixmap(QString::fromStdString(name), Settings::Instance().GetThemeDir());
return GetPixmap(QString::fromStdString(name), GetCurrentThemeDir());
}
void Resources::Init()