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

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