forked from qt-creator/qt-creator
CppEditor: Make CppEditorOutline independent of CppEditor plugin
Change-Id: I1cafcd8daf93ffc2f672bf7e2ba5d1c8ea5e8652 Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
This commit is contained in:
@@ -52,6 +52,7 @@ const char CPP_HEADER_MIMETYPE[] = "text/x-c++hdr";
|
||||
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_MODEL_MANAGER_SUPPORTERS_KEY[] = "ModelManagerSupporters";
|
||||
const char CPPTOOLS_MODEL_MANAGER_PCH_USAGE[] = "PCHUsage";
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
|
||||
static const char idKey[] = "CppGlobal";
|
||||
|
||||
using namespace Core;
|
||||
using namespace CppTools;
|
||||
using namespace CppTools::Internal;
|
||||
using namespace TextEditor;
|
||||
@@ -262,3 +263,21 @@ void CppToolsSettings::setCommentsSettings(const CommentsSettings &commentsSetti
|
||||
d->m_commentsSettings.toSettings(QLatin1String(Constants::CPPTOOLS_SETTINGSGROUP),
|
||||
Core::ICore::settings());
|
||||
}
|
||||
|
||||
static QString sortEditorDocumentOutlineKey()
|
||||
{
|
||||
return QLatin1String(CppTools::Constants::CPPTOOLS_SETTINGSGROUP)
|
||||
+ QLatin1Char('/')
|
||||
+ QLatin1String(CppTools::Constants::CPPTOOLS_SORT_EDITOR_DOCUMENT_OUTLINE);
|
||||
}
|
||||
|
||||
bool CppToolsSettings::sortedEditorDocumentOutline() const
|
||||
{
|
||||
return ICore::settings()->value(sortEditorDocumentOutlineKey(), true).toBool();
|
||||
}
|
||||
|
||||
void CppToolsSettings::setSortedEditorDocumentOutline(bool sorted)
|
||||
{
|
||||
ICore::settings()->setValue(sortEditorDocumentOutlineKey(), sorted);
|
||||
emit editorDocumentOutlineSortingChanged(sorted);
|
||||
}
|
||||
|
||||
@@ -63,6 +63,12 @@ public:
|
||||
const CommentsSettings &commentsSettings() const;
|
||||
void setCommentsSettings(const CommentsSettings &commentsSettings);
|
||||
|
||||
bool sortedEditorDocumentOutline() const;
|
||||
void setSortedEditorDocumentOutline(bool sorted);
|
||||
|
||||
signals:
|
||||
void editorDocumentOutlineSortingChanged(bool isSorted);
|
||||
|
||||
private:
|
||||
Internal::CppToolsSettingsPrivate *d;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user