forked from qt-creator/qt-creator
Core: Remove SettingsDatabase QObject base
Was not really needed except for the ownership. Change-Id: I88e32123cbb85a8217ade9450b5b578845736311 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -124,8 +124,7 @@ MainWindow::MainWindow()
|
||||
, m_lowPrioAdditionalContexts(Constants::C_GLOBAL)
|
||||
, m_settingsDatabase(
|
||||
new SettingsDatabase(QFileInfo(PluginManager::settings()->fileName()).path(),
|
||||
QCoreApplication::applicationName(),
|
||||
this))
|
||||
QCoreApplication::applicationName()))
|
||||
, m_progressManager(new ProgressManagerPrivate)
|
||||
, m_jsExpander(JsExpander::createGlobalJsExpander())
|
||||
, m_vcsManager(new VcsManager)
|
||||
@@ -307,6 +306,9 @@ MainWindow::~MainWindow()
|
||||
|
||||
delete m_jsExpander;
|
||||
m_jsExpander = nullptr;
|
||||
|
||||
delete m_settingsDatabase;
|
||||
m_settingsDatabase = nullptr;
|
||||
}
|
||||
|
||||
void MainWindow::init()
|
||||
|
||||
@@ -68,11 +68,8 @@ public:
|
||||
} // namespace Internal
|
||||
} // namespace Core
|
||||
|
||||
SettingsDatabase::SettingsDatabase(const QString &path,
|
||||
const QString &application,
|
||||
QObject *parent)
|
||||
: QObject(parent)
|
||||
, d(new SettingsDatabasePrivate)
|
||||
SettingsDatabase::SettingsDatabase(const QString &path, const QString &application)
|
||||
: d(new SettingsDatabasePrivate)
|
||||
{
|
||||
const QLatin1Char slash('/');
|
||||
|
||||
|
||||
@@ -14,11 +14,11 @@ namespace Core {
|
||||
|
||||
namespace Internal { class SettingsDatabasePrivate; }
|
||||
|
||||
class CORE_EXPORT SettingsDatabase : public QObject
|
||||
class CORE_EXPORT SettingsDatabase final
|
||||
{
|
||||
public:
|
||||
SettingsDatabase(const QString &path, const QString &application, QObject *parent = nullptr);
|
||||
~SettingsDatabase() override;
|
||||
SettingsDatabase(const QString &path, const QString &application);
|
||||
~SettingsDatabase();
|
||||
|
||||
void setValue(const QString &key, const QVariant &value);
|
||||
QVariant value(const QString &key, const QVariant &defaultValue = QVariant()) const;
|
||||
|
||||
Reference in New Issue
Block a user