forked from qt-creator/qt-creator
CppEditor: Show info bar for project-less file
While at it, centralize the code for handling the info bars and actions. Change-Id: Ied62e3db268aaff3ef87e246bfe2b50399341be3 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -285,3 +285,21 @@ void CppToolsSettings::setShowHeaderErrorInfoBar(bool show)
|
||||
ICore::settings()->setValue(showHeaderErrorInfoBarKey(), show);
|
||||
emit showHeaderErrorInfoBarChanged(show);
|
||||
}
|
||||
|
||||
static QString showNoProjectInfoBarKey()
|
||||
{
|
||||
return QLatin1String(CppTools::Constants::CPPTOOLS_SETTINGSGROUP)
|
||||
+ QLatin1Char('/')
|
||||
+ QLatin1String(CppTools::Constants::CPPTOOLS_SHOW_INFO_BAR_FOR_FOR_NO_PROJECT);
|
||||
}
|
||||
|
||||
bool CppToolsSettings::showNoProjectInfoBar() const
|
||||
{
|
||||
return ICore::settings()->value(showNoProjectInfoBarKey(), true).toBool();
|
||||
}
|
||||
|
||||
void CppToolsSettings::setShowNoProjectInfoBar(bool show)
|
||||
{
|
||||
ICore::settings()->setValue(showNoProjectInfoBarKey(), show);
|
||||
emit showNoProjectInfoBarChanged(show);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user