CppEditor: Make CppEditorOutline independent of CppEditor plugin

Change-Id: I1cafcd8daf93ffc2f672bf7e2ba5d1c8ea5e8652
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
This commit is contained in:
Nikolai Kosjar
2015-01-23 15:09:45 +01:00
parent db57fa8948
commit 21e50b2fde
6 changed files with 31 additions and 34 deletions

View File

@@ -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";

View File

@@ -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);
}

View File

@@ -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;