diff --git a/src/plugins/coreplugin/infobar.cpp b/src/plugins/coreplugin/infobar.cpp index acbccd47d39..9fcc7ce18ae 100644 --- a/src/plugins/coreplugin/infobar.cpp +++ b/src/plugins/coreplugin/infobar.cpp @@ -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) diff --git a/src/plugins/coreplugin/infobar.h b/src/plugins/coreplugin/infobar.h index 906f74ca78b..e832e570055 100644 --- a/src/plugins/coreplugin/infobar.h +++ b/src/plugins/coreplugin/infobar.h @@ -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 m_infoBarEntries; QSet m_suppressed;