Remove leftover code for header diagnostic info bar

ClangCodeModel used to show an info bar about errors in headers in the
editor, but that was removed. Remove the remaining infrastructure that
was used to show them.

Amends b52fac7148

Change-Id: Id89f2bcb7778245f468923d29c577bf1ca68ee75
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Eike Ziller
2022-05-04 09:04:08 +02:00
parent 2b9ec0c3d9
commit eec77fa67a
8 changed files with 0 additions and 94 deletions

View File

@@ -45,8 +45,6 @@ MinimizableInfoBars::MinimizableInfoBars(InfoBar &infoBar, QObject *parent)
: QObject(parent)
, m_infoBar(infoBar)
{
connect(settings(), &CppToolsSettings::showHeaderErrorInfoBarChanged,
this, &MinimizableInfoBars::updateHeaderErrors);
connect(settings(), &CppToolsSettings::showNoProjectInfoBarChanged,
this, &MinimizableInfoBars::updateNoProjectConfiguration);
}
@@ -68,50 +66,15 @@ MinimizableInfoBars::Actions MinimizableInfoBars::createShowInfoBarActions(
action->setVisible(!settings()->showNoProjectInfoBar());
result.insert(Constants::NO_PROJECT_CONFIGURATION, action);
// Errors in included files
button = new QToolButton();
button->setToolTip(tr("File contains errors in included files."));
button->setIcon(Utils::Icons::WARNING_TOOLBAR.pixmap());
connect(button, &QAbstractButton::clicked, []() {
settings()->setShowHeaderErrorInfoBar(true);
});
action = actionCreator(button);
action->setVisible(!settings()->showHeaderErrorInfoBar());
result.insert(Constants::ERRORS_IN_HEADER_FILES, action);
return result;
}
void MinimizableInfoBars::processHeaderDiagnostics(
const DiagnosticWidgetCreator &diagnosticWidgetCreator)
{
m_diagnosticWidgetCreator = diagnosticWidgetCreator;
updateHeaderErrors();
}
void MinimizableInfoBars::processHasProjectPart(bool hasProjectPart)
{
m_hasProjectPart = hasProjectPart;
updateNoProjectConfiguration();
}
void MinimizableInfoBars::updateHeaderErrors()
{
const Id id(Constants::ERRORS_IN_HEADER_FILES);
m_infoBar.removeInfo(id);
bool show = false;
// Show the info entry only if there is a project configuration.
if (m_hasProjectPart && m_diagnosticWidgetCreator) {
if (settings()->showHeaderErrorInfoBar())
addHeaderErrorEntry(id, m_diagnosticWidgetCreator);
else
show = true;
}
emit showAction(id, show);
}
void MinimizableInfoBars::updateNoProjectConfiguration()
{
const Id id(Constants::NO_PROJECT_CONFIGURATION);
@@ -156,20 +119,5 @@ void MinimizableInfoBars::addNoProjectConfigurationEntry(const Id &id)
}));
}
void MinimizableInfoBars::addHeaderErrorEntry(const Id &id,
const DiagnosticWidgetCreator &diagnosticWidgetCreator)
{
const QString text = tr("<b>Warning</b>: The code model could not parse an included file, "
"which might lead to incorrect code completion and "
"highlighting, for example.");
InfoBarEntry info = createMinimizableInfo(id, text, []() {
settings()->setShowHeaderErrorInfoBar(false);
});
info.setDetailsWidgetCreator(diagnosticWidgetCreator);
m_infoBar.addInfo(info);
}
} // namespace Internal
} // namespace CppEditor