Core: Allow to globally unsuppress an info

Change-Id: Ie7af913e28a323e4ad391a35cfd65abd084cfd99
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Nikolai Kosjar
2016-10-11 13:08:24 +02:00
parent b5023bda5a
commit cb24872f43
2 changed files with 19 additions and 4 deletions

View File

@@ -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)