forked from qt-creator/qt-creator
Utils: Switch to QtcSettings
Changes a few remaining QSettings members that popped up when trying to build with "apt-get" Qt 6.2.4. Change-Id: I3caa8545cf02d6453b802559c2f65279e1fb63fd Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -36,14 +36,14 @@ using namespace Layouting;
|
||||
|
||||
namespace Utils {
|
||||
|
||||
static QSettings *theSettings = nullptr;
|
||||
static QtcSettings *theSettings = nullptr;
|
||||
|
||||
void BaseAspect::setQtcSettings(QSettings *settings)
|
||||
void BaseAspect::setQtcSettings(QtcSettings *settings)
|
||||
{
|
||||
theSettings = settings;
|
||||
}
|
||||
|
||||
QSettings *BaseAspect::qtcSettings()
|
||||
QtcSettings *BaseAspect::qtcSettings()
|
||||
{
|
||||
return theSettings;
|
||||
}
|
||||
|
@@ -9,6 +9,7 @@
|
||||
#include "macroexpander.h"
|
||||
#include "pathchooser.h"
|
||||
#include "store.h"
|
||||
#include "qtcsettings.h"
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
@@ -180,8 +181,8 @@ public:
|
||||
|
||||
Data::Ptr extractData() const;
|
||||
|
||||
static void setQtcSettings(QSettings *settings);
|
||||
static QSettings *qtcSettings();
|
||||
static void setQtcSettings(QtcSettings *settings);
|
||||
static QtcSettings *qtcSettings();
|
||||
|
||||
// This is expensive. Do not use without good reason
|
||||
void writeToSettingsImmediatly() const;
|
||||
|
@@ -22,7 +22,7 @@ static const char C_SUPPRESSED_WARNINGS[] = "SuppressedWarnings";
|
||||
namespace Utils {
|
||||
|
||||
QSet<Id> InfoBar::globallySuppressed;
|
||||
QSettings *InfoBar::m_settings = nullptr;
|
||||
QtcSettings *InfoBar::m_settings = nullptr;
|
||||
|
||||
class InfoBarWidget : public QWidget
|
||||
{
|
||||
@@ -184,17 +184,17 @@ void InfoBar::globallyUnsuppressInfo(Id id)
|
||||
writeGloballySuppressedToSettings();
|
||||
}
|
||||
|
||||
void InfoBar::initialize(QSettings *settings)
|
||||
void InfoBar::initialize(QtcSettings *settings)
|
||||
{
|
||||
m_settings = settings;
|
||||
|
||||
if (QTC_GUARD(m_settings)) {
|
||||
const QStringList list = m_settings->value(QLatin1String(C_SUPPRESSED_WARNINGS)).toStringList();
|
||||
const QStringList list = m_settings->value(C_SUPPRESSED_WARNINGS).toStringList();
|
||||
globallySuppressed = transform<QSet>(list, Id::fromString);
|
||||
}
|
||||
}
|
||||
|
||||
QSettings *InfoBar::settings()
|
||||
QtcSettings *InfoBar::settings()
|
||||
{
|
||||
return m_settings;
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@
|
||||
#include "utils_global.h"
|
||||
|
||||
#include "id.h"
|
||||
#include "qtcsettings.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QSet>
|
||||
@@ -102,8 +103,8 @@ public:
|
||||
static void clearGloballySuppressed();
|
||||
static bool anyGloballySuppressed();
|
||||
|
||||
static void initialize(QSettings *settings);
|
||||
static QSettings *settings();
|
||||
static void initialize(QtcSettings *settings);
|
||||
static QtcSettings *settings();
|
||||
|
||||
signals:
|
||||
void changed();
|
||||
@@ -116,7 +117,7 @@ private:
|
||||
QSet<Id> m_suppressed;
|
||||
|
||||
static QSet<Id> globallySuppressed;
|
||||
static QSettings *m_settings;
|
||||
static QtcSettings *m_settings;
|
||||
|
||||
friend class InfoBarDisplay;
|
||||
};
|
||||
|
Reference in New Issue
Block a user