CppEditor: Clean up header error indicator

* Show/hide the error indicator button instead of enabling/disabling it.
* Use "Minimize" instead of "Do Not Show Again" in the info bar button
  and use a custom setting to save this. The current info bar API does
  not signal addition/removal of global suppression ids which would be
  needed to update all editor widgets properly. We are the only client
  and it feels wrong to add this API there at the moment.
* Remove not needed code anymore.

Change-Id: I2bb872522b7410434f060cc359a3b62dfed0af4d
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Nikolai Kosjar
2016-10-13 13:11:07 +02:00
parent 3016c6c96f
commit dd647b4236
9 changed files with 58 additions and 50 deletions

View File

@@ -49,6 +49,7 @@ const char CPPTOOLS_SETTINGSGROUP[] = "CppTools";
const char LOWERCASE_CPPFILES_KEY[] = "LowerCaseFiles";
enum { lowerCaseFilesDefault = 1 };
const char CPPTOOLS_SORT_EDITOR_DOCUMENT_OUTLINE[] = "SortedMethodOverview";
const char CPPTOOLS_SHOW_INFO_BAR_FOR_HEADER_ERRORS[] = "ShowInfoBarForHeaderErrors";
const char CPPTOOLS_MODEL_MANAGER_PCH_USAGE[] = "PCHUsage";
const char CPPTOOLS_SKIP_INDEXING_BIG_FILES[] = "SkipIndexingBigFiles";
const char CPPTOOLS_INDEXER_FILE_SIZE_LIMIT[] = "IndexerFileSizeLimit";

View File

@@ -267,3 +267,21 @@ void CppToolsSettings::setSortedEditorDocumentOutline(bool sorted)
ICore::settings()->setValue(sortEditorDocumentOutlineKey(), sorted);
emit editorDocumentOutlineSortingChanged(sorted);
}
static QString showHeaderErrorInfoBarKey()
{
return QLatin1String(CppTools::Constants::CPPTOOLS_SETTINGSGROUP)
+ QLatin1Char('/')
+ QLatin1String(CppTools::Constants::CPPTOOLS_SHOW_INFO_BAR_FOR_HEADER_ERRORS);
}
bool CppToolsSettings::showHeaderErrorInfoBar() const
{
return ICore::settings()->value(showHeaderErrorInfoBarKey(), true).toBool();
}
void CppToolsSettings::setShowHeaderErrorInfoBar(bool show)
{
ICore::settings()->setValue(showHeaderErrorInfoBarKey(), show);
emit showHeaderErrorInfoBarChanged(show);
}

View File

@@ -63,8 +63,12 @@ public:
bool sortedEditorDocumentOutline() const;
void setSortedEditorDocumentOutline(bool sorted);
bool showHeaderErrorInfoBar() const;
void setShowHeaderErrorInfoBar(bool show);
signals:
void editorDocumentOutlineSortingChanged(bool isSorted);
void showHeaderErrorInfoBarChanged(bool isShown);
private:
Internal::CppToolsSettingsPrivate *d;