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 {
|
namespace Utils {
|
||||||
|
|
||||||
static QSettings *theSettings = nullptr;
|
static QtcSettings *theSettings = nullptr;
|
||||||
|
|
||||||
void BaseAspect::setQtcSettings(QSettings *settings)
|
void BaseAspect::setQtcSettings(QtcSettings *settings)
|
||||||
{
|
{
|
||||||
theSettings = settings;
|
theSettings = settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
QSettings *BaseAspect::qtcSettings()
|
QtcSettings *BaseAspect::qtcSettings()
|
||||||
{
|
{
|
||||||
return theSettings;
|
return theSettings;
|
||||||
}
|
}
|
||||||
|
@@ -9,6 +9,7 @@
|
|||||||
#include "macroexpander.h"
|
#include "macroexpander.h"
|
||||||
#include "pathchooser.h"
|
#include "pathchooser.h"
|
||||||
#include "store.h"
|
#include "store.h"
|
||||||
|
#include "qtcsettings.h"
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@@ -180,8 +181,8 @@ public:
|
|||||||
|
|
||||||
Data::Ptr extractData() const;
|
Data::Ptr extractData() const;
|
||||||
|
|
||||||
static void setQtcSettings(QSettings *settings);
|
static void setQtcSettings(QtcSettings *settings);
|
||||||
static QSettings *qtcSettings();
|
static QtcSettings *qtcSettings();
|
||||||
|
|
||||||
// This is expensive. Do not use without good reason
|
// This is expensive. Do not use without good reason
|
||||||
void writeToSettingsImmediatly() const;
|
void writeToSettingsImmediatly() const;
|
||||||
|
@@ -22,7 +22,7 @@ static const char C_SUPPRESSED_WARNINGS[] = "SuppressedWarnings";
|
|||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
QSet<Id> InfoBar::globallySuppressed;
|
QSet<Id> InfoBar::globallySuppressed;
|
||||||
QSettings *InfoBar::m_settings = nullptr;
|
QtcSettings *InfoBar::m_settings = nullptr;
|
||||||
|
|
||||||
class InfoBarWidget : public QWidget
|
class InfoBarWidget : public QWidget
|
||||||
{
|
{
|
||||||
@@ -184,17 +184,17 @@ void InfoBar::globallyUnsuppressInfo(Id id)
|
|||||||
writeGloballySuppressedToSettings();
|
writeGloballySuppressedToSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void InfoBar::initialize(QSettings *settings)
|
void InfoBar::initialize(QtcSettings *settings)
|
||||||
{
|
{
|
||||||
m_settings = settings;
|
m_settings = settings;
|
||||||
|
|
||||||
if (QTC_GUARD(m_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);
|
globallySuppressed = transform<QSet>(list, Id::fromString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QSettings *InfoBar::settings()
|
QtcSettings *InfoBar::settings()
|
||||||
{
|
{
|
||||||
return m_settings;
|
return m_settings;
|
||||||
}
|
}
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
#include "utils_global.h"
|
#include "utils_global.h"
|
||||||
|
|
||||||
#include "id.h"
|
#include "id.h"
|
||||||
|
#include "qtcsettings.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
@@ -102,8 +103,8 @@ public:
|
|||||||
static void clearGloballySuppressed();
|
static void clearGloballySuppressed();
|
||||||
static bool anyGloballySuppressed();
|
static bool anyGloballySuppressed();
|
||||||
|
|
||||||
static void initialize(QSettings *settings);
|
static void initialize(QtcSettings *settings);
|
||||||
static QSettings *settings();
|
static QtcSettings *settings();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void changed();
|
void changed();
|
||||||
@@ -116,7 +117,7 @@ private:
|
|||||||
QSet<Id> m_suppressed;
|
QSet<Id> m_suppressed;
|
||||||
|
|
||||||
static QSet<Id> globallySuppressed;
|
static QSet<Id> globallySuppressed;
|
||||||
static QSettings *m_settings;
|
static QtcSettings *m_settings;
|
||||||
|
|
||||||
friend class InfoBarDisplay;
|
friend class InfoBarDisplay;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user