diff options
| author | Andre Hartmann <[email protected]> | 2019-08-15 20:41:31 +0200 |
|---|---|---|
| committer | André Hartmann <[email protected]> | 2019-09-12 06:45:06 +0000 |
| commit | b292c30a13bdfaaad847f4fe07a96d615a39e954 (patch) | |
| tree | 374aac30d67af631826cc766e60e7d89c6f5782e /src/plugins | |
| parent | 545552cc134886f12864f3f6acf2265f768b8ec0 (diff) | |
Core: Make InfoBar::GlobalSuppressionMode an enum class
Change-Id: I859a727196a887f7699a667fbe07e1bfead4cb2b
Reviewed-by: Eike Ziller <[email protected]>
Diffstat (limited to 'src/plugins')
| -rw-r--r-- | src/plugins/coreplugin/find/searchresultwidget.cpp | 2 | ||||
| -rw-r--r-- | src/plugins/coreplugin/infobar.cpp | 4 | ||||
| -rw-r--r-- | src/plugins/coreplugin/infobar.h | 8 | ||||
| -rw-r--r-- | src/plugins/coreplugin/vcsmanager.cpp | 2 | ||||
| -rw-r--r-- | src/plugins/cppeditor/cppeditordocument.cpp | 2 | ||||
| -rw-r--r-- | src/plugins/git/gitplugin.cpp | 2 | ||||
| -rw-r--r-- | src/plugins/projectexplorer/projecttree.cpp | 2 | ||||
| -rw-r--r-- | src/plugins/texteditor/texteditor.cpp | 2 | ||||
| -rw-r--r-- | src/plugins/welcome/introductionwidget.cpp | 2 |
9 files changed, 13 insertions, 13 deletions
diff --git a/src/plugins/coreplugin/find/searchresultwidget.cpp b/src/plugins/coreplugin/find/searchresultwidget.cpp index bbc9f24d2bf..23b894ef9ae 100644 --- a/src/plugins/coreplugin/find/searchresultwidget.cpp +++ b/src/plugins/coreplugin/find/searchresultwidget.cpp @@ -257,7 +257,7 @@ void SearchResultWidget::addResults(const QList<SearchResultItem> &items, Search Id undoWarningId = Id("warninglabel/").withSuffix(m_dontAskAgainGroup); if (m_infoBar.canInfoBeAdded(undoWarningId)) { InfoBarEntry info(undoWarningId, tr("This change cannot be undone."), - InfoBarEntry::GlobalSuppressionEnabled); + InfoBarEntry::GlobalSuppression::Enabled); m_infoBar.addInfo(info); } } diff --git a/src/plugins/coreplugin/infobar.cpp b/src/plugins/coreplugin/infobar.cpp index 2113e0b78e1..93f051e1581 100644 --- a/src/plugins/coreplugin/infobar.cpp +++ b/src/plugins/coreplugin/infobar.cpp @@ -47,7 +47,7 @@ QSet<Id> InfoBar::globallySuppressed; QSettings *InfoBar::m_settings = nullptr; Utils::Theme *InfoBar::m_theme = nullptr; -InfoBarEntry::InfoBarEntry(Id _id, const QString &_infoText, GlobalSuppressionMode _globalSuppression) +InfoBarEntry::InfoBarEntry(Id _id, const QString &_infoText, GlobalSuppression _globalSuppression) : m_id(_id) , m_infoText(_infoText) , m_globalSuppression(_globalSuppression) @@ -307,7 +307,7 @@ void InfoBarDisplay::update() const Id id = info.m_id; QToolButton *infoWidgetSuppressButton = nullptr; - if (info.m_globalSuppression == InfoBarEntry::GlobalSuppressionEnabled) { + if (info.m_globalSuppression == InfoBarEntry::GlobalSuppression::Enabled) { infoWidgetSuppressButton = new QToolButton; infoWidgetSuppressButton->setText(tr("Do Not Show Again")); connect(infoWidgetSuppressButton, &QAbstractButton::clicked, this, [this, id] { diff --git a/src/plugins/coreplugin/infobar.h b/src/plugins/coreplugin/infobar.h index fd8f476c1dc..a6cb0ee5905 100644 --- a/src/plugins/coreplugin/infobar.h +++ b/src/plugins/coreplugin/infobar.h @@ -49,13 +49,13 @@ class InfoBarDisplay; class CORE_EXPORT InfoBarEntry { public: - enum GlobalSuppressionMode + enum class GlobalSuppression { - GlobalSuppressionDisabled, - GlobalSuppressionEnabled + Disabled, + Enabled }; - InfoBarEntry(Id _id, const QString &_infoText, GlobalSuppressionMode _globalSuppression = GlobalSuppressionDisabled); + InfoBarEntry(Id _id, const QString &_infoText, GlobalSuppression _globalSuppression = GlobalSuppression::Disabled); using CallBack = std::function<void()>; void setCustomButtonInfo(const QString &_buttonText, CallBack callBack); diff --git a/src/plugins/coreplugin/vcsmanager.cpp b/src/plugins/coreplugin/vcsmanager.cpp index fc9388aa1e9..0de226c5cf0 100644 --- a/src/plugins/coreplugin/vcsmanager.cpp +++ b/src/plugins/coreplugin/vcsmanager.cpp @@ -301,7 +301,7 @@ IVersionControl* VcsManager::findVersionControlForDirectory(const QString &input InfoBarEntry info(vcsWarning, tr("%1 repository was detected but %1 is not configured.") .arg(versionControl->displayName()), - InfoBarEntry::GlobalSuppressionEnabled); + InfoBarEntry::GlobalSuppression::Enabled); d->m_unconfiguredVcs = versionControl; info.setCustomButtonInfo(ICore::msgShowOptionsDialog(), []() { QTC_ASSERT(d->m_unconfiguredVcs, return); diff --git a/src/plugins/cppeditor/cppeditordocument.cpp b/src/plugins/cppeditor/cppeditordocument.cpp index e2d85d0f410..5d85bd638c3 100644 --- a/src/plugins/cppeditor/cppeditordocument.cpp +++ b/src/plugins/cppeditor/cppeditordocument.cpp @@ -357,7 +357,7 @@ void CppEditorDocument::showHideInfoBarAboutMultipleParseContexts(bool show) Core::InfoBarEntry info(id, tr("Note: Multiple parse contexts are available for this file. " "Choose the preferred one from the editor toolbar."), - Core::InfoBarEntry::GlobalSuppressionEnabled); + Core::InfoBarEntry::GlobalSuppression::Enabled); info.removeCancelButton(); if (infoBar()->canInfoBeAdded(id)) infoBar()->addInfo(info); diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index db3154e4997..4c0a0e99980 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -988,7 +988,7 @@ void GitPlugin::updateVersionWarning() infoBar->addInfo(InfoBarEntry(gitVersionWarning, tr("Unsupported version of Git found. Git %1 or later required.") .arg(versionString(minimumRequiredVersion)), - InfoBarEntry::GlobalSuppressionEnabled)); + InfoBarEntry::GlobalSuppression::Enabled)); } IEditor *GitPlugin::openSubmitEditor(const QString &fileName, const CommitData &cd) diff --git a/src/plugins/projectexplorer/projecttree.cpp b/src/plugins/projectexplorer/projecttree.cpp index 5259a0d609d..5010b18b876 100644 --- a/src/plugins/projectexplorer/projecttree.cpp +++ b/src/plugins/projectexplorer/projecttree.cpp @@ -321,7 +321,7 @@ void ProjectTree::updateExternalFileWarning() } infoBar->addInfo(Core::InfoBarEntry(externalFileId, tr("<b>Warning:</b> This file is outside the project directory."), - Core::InfoBarEntry::GlobalSuppressionEnabled)); + Core::InfoBarEntry::GlobalSuppression::Enabled)); } bool ProjectTree::hasFocus(ProjectTreeWidget *widget) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index b022a5a7e35..1419b045c28 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -3101,7 +3101,7 @@ void TextEditorWidgetPrivate::updateSyntaxInfoBar(const Highlighter::Definitions InfoBarEntry info(missing, BaseTextEditor::tr("A highlight definition was not found for this file. " "Would you like to update highlight definition files?"), - InfoBarEntry::GlobalSuppressionEnabled); + InfoBarEntry::GlobalSuppression::Enabled); info.setCustomButtonInfo(BaseTextEditor::tr("Update Definitions"), [missing, this]() { m_document->infoBar()->removeInfo(missing); Highlighter::updateDefinitions([widget = QPointer<TextEditorWidget>(q)]() { diff --git a/src/plugins/welcome/introductionwidget.cpp b/src/plugins/welcome/introductionwidget.cpp index a719a4ae90a..a29b5e4f57a 100644 --- a/src/plugins/welcome/introductionwidget.cpp +++ b/src/plugins/welcome/introductionwidget.cpp @@ -59,7 +59,7 @@ void IntroductionWidget::askUserAboutIntroduction(QWidget *parent, QSettings *se tr("Would you like to take a quick UI tour? This tour highlights important user " "interface elements and shows how they are used. To take the tour later, " "select Help > UI Tour."), - Core::InfoBarEntry::GlobalSuppressionEnabled); + Core::InfoBarEntry::GlobalSuppression::Enabled); info.setCustomButtonInfo(tr("Take UI Tour"), [parent] { Core::ICore::infoBar()->removeInfo(kTakeTourSetting); Core::ICore::infoBar()->globallySuppressInfo(kTakeTourSetting); |
