forked from qt-creator/qt-creator
Core: Allow to globally unsuppress an info
Change-Id: Ie7af913e28a323e4ad391a35cfd65abd084cfd99 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -139,10 +139,13 @@ void InfoBar::clear()
|
||||
void InfoBar::globallySuppressInfo(Id id)
|
||||
{
|
||||
globallySuppressed.insert(id);
|
||||
QStringList list;
|
||||
foreach (Id i, globallySuppressed)
|
||||
list << QLatin1String(i.name());
|
||||
ICore::settings()->setValue(QLatin1String(C_SUPPRESSED_WARNINGS), list);
|
||||
writeGloballySuppressedToSettings();
|
||||
}
|
||||
|
||||
void InfoBar::globallyUnsuppressInfo(Id id)
|
||||
{
|
||||
globallySuppressed.remove(id);
|
||||
writeGloballySuppressedToSettings();
|
||||
}
|
||||
|
||||
void InfoBar::initializeGloballySuppressed()
|
||||
@@ -163,6 +166,14 @@ bool InfoBar::anyGloballySuppressed()
|
||||
return !globallySuppressed.isEmpty();
|
||||
}
|
||||
|
||||
void InfoBar::writeGloballySuppressedToSettings()
|
||||
{
|
||||
QStringList list;
|
||||
foreach (Id i, globallySuppressed)
|
||||
list << QLatin1String(i.name());
|
||||
ICore::settings()->setValue(QLatin1String(C_SUPPRESSED_WARNINGS), list);
|
||||
}
|
||||
|
||||
|
||||
InfoBarDisplay::InfoBarDisplay(QObject *parent)
|
||||
: QObject(parent)
|
||||
|
@@ -92,6 +92,7 @@ public:
|
||||
void enableInfo(Id id);
|
||||
void clear();
|
||||
static void globallySuppressInfo(Id id);
|
||||
static void globallyUnsuppressInfo(Id id);
|
||||
static void initializeGloballySuppressed();
|
||||
static void clearGloballySuppressed();
|
||||
static bool anyGloballySuppressed();
|
||||
@@ -99,6 +100,9 @@ public:
|
||||
signals:
|
||||
void changed();
|
||||
|
||||
private:
|
||||
static void writeGloballySuppressedToSettings();
|
||||
|
||||
private:
|
||||
QList<InfoBarEntry> m_infoBarEntries;
|
||||
QSet<Id> m_suppressed;
|
||||
|
Reference in New Issue
Block a user