diff options
Diffstat (limited to 'src/plugins/cpptools')
-rw-r--r-- | src/plugins/cpptools/completionsettingspage.cpp | 4 | ||||
-rw-r--r-- | src/plugins/cpptools/cppcodestylesettingspage.cpp | 8 | ||||
-rw-r--r-- | src/plugins/cpptools/cppcompletionassist.cpp | 3 | ||||
-rw-r--r-- | src/plugins/cpptools/cpptoolssettings.cpp | 31 |
4 files changed, 20 insertions, 26 deletions
diff --git a/src/plugins/cpptools/completionsettingspage.cpp b/src/plugins/cpptools/completionsettingspage.cpp index 92b249fc45..37ca2ed172 100644 --- a/src/plugins/cpptools/completionsettingspage.cpp +++ b/src/plugins/cpptools/completionsettingspage.cpp @@ -63,7 +63,7 @@ QWidget *CompletionSettingsPage::createPage(QWidget *parent) m_page->setupUi(w); const TextEditor::CompletionSettings &settings = - TextEditor::TextEditorSettings::instance()->completionSettings(); + TextEditor::TextEditorSettings::completionSettings(); int caseSensitivityIndex = 0; switch (settings.m_caseSensitivity) { @@ -131,7 +131,7 @@ void CompletionSettingsPage::apply() settings.m_partiallyComplete = m_page->partiallyComplete->isChecked(); settings.m_spaceAfterFunctionName = m_page->spaceAfterFunctionName->isChecked(); - TextEditor::TextEditorSettings::instance()->setCompletionSettings(settings); + TextEditor::TextEditorSettings::setCompletionSettings(settings); if (!requireCommentsSettingsUpdate()) return; diff --git a/src/plugins/cpptools/cppcodestylesettingspage.cpp b/src/plugins/cpptools/cppcodestylesettingspage.cpp index 01a0589eb5..ca94a0ec57 100644 --- a/src/plugins/cpptools/cppcodestylesettingspage.cpp +++ b/src/plugins/cpptools/cppcodestylesettingspage.cpp @@ -275,9 +275,8 @@ CppCodeStylePreferencesWidget::CppCodeStylePreferencesWidget(QWidget *parent) for (int i = 0; i < m_previews.size(); ++i) m_previews[i]->setPlainText(QLatin1String(defaultCodeStyleSnippets[i])); - TextEditor::TextEditorSettings *textEditorSettings = TextEditorSettings::instance(); - decorateEditors(textEditorSettings->fontSettings()); - connect(textEditorSettings, SIGNAL(fontSettingsChanged(TextEditor::FontSettings)), + decorateEditors(TextEditorSettings::fontSettings()); + connect(TextEditorSettings::instance(), SIGNAL(fontSettingsChanged(TextEditor::FontSettings)), this, SLOT(decorateEditors(TextEditor::FontSettings))); setVisualizeWhitespace(true); @@ -575,8 +574,7 @@ QWidget *CppCodeStyleSettingsPage::createPage(QWidget *parent) m_pageCppCodeStylePreferences->setCurrentDelegate(originalCodeStylePreferences->currentDelegate()); // we set id so that it won't be possible to set delegate to the original prefs m_pageCppCodeStylePreferences->setId(originalCodeStylePreferences->id()); - TextEditorSettings *settings = TextEditorSettings::instance(); - m_widget = new CodeStyleEditor(settings->codeStyleFactory(CppTools::Constants::CPP_SETTINGS_ID), + m_widget = new CodeStyleEditor(TextEditorSettings::codeStyleFactory(CppTools::Constants::CPP_SETTINGS_ID), m_pageCppCodeStylePreferences, parent); return m_widget; diff --git a/src/plugins/cpptools/cppcompletionassist.cpp b/src/plugins/cpptools/cppcompletionassist.cpp index 3ad517e650..4a9ea06122 100644 --- a/src/plugins/cpptools/cppcompletionassist.cpp +++ b/src/plugins/cpptools/cppcompletionassist.cpp @@ -210,8 +210,7 @@ void CppAssistProposalItem::applyContextualContent(TextEditor::BaseTextEditor *e } else { toInsert = text(); - const CompletionSettings &completionSettings = - TextEditorSettings::instance()->completionSettings(); + const CompletionSettings &completionSettings = TextEditorSettings::completionSettings(); const bool autoInsertBrackets = completionSettings.m_autoInsertBrackets; if (autoInsertBrackets && symbol && symbol->type()) { diff --git a/src/plugins/cpptools/cpptoolssettings.cpp b/src/plugins/cpptools/cpptoolssettings.cpp index 2f034bac91..877b86da62 100644 --- a/src/plugins/cpptools/cpptoolssettings.cpp +++ b/src/plugins/cpptools/cpptoolssettings.cpp @@ -50,7 +50,7 @@ static const char idKey[] = "CppGlobal"; using namespace CppTools; using namespace CppTools::Internal; -using TextEditor::TabSettings; +using namespace TextEditor; namespace CppTools { namespace Internal { @@ -89,15 +89,13 @@ CppToolsSettings::CppToolsSettings(QObject *parent) this, SIGNAL(commentsSettingsChanged(CppTools::CommentsSettings))); - TextEditor::TextEditorSettings *textEditorSettings = TextEditor::TextEditorSettings::instance(); - // code style factory - TextEditor::ICodeStylePreferencesFactory *factory = new CppTools::CppCodeStylePreferencesFactory(); - textEditorSettings->registerCodeStyleFactory(factory); + ICodeStylePreferencesFactory *factory = new CppTools::CppCodeStylePreferencesFactory(); + TextEditorSettings::registerCodeStyleFactory(factory); // code style pool - TextEditor::CodeStylePool *pool = new TextEditor::CodeStylePool(factory, this); - textEditorSettings->registerCodeStylePool(Constants::CPP_SETTINGS_ID, pool); + CodeStylePool *pool = new CodeStylePool(factory, this); + TextEditorSettings::registerCodeStylePool(Constants::CPP_SETTINGS_ID, pool); // global code style settings d->m_globalCodeStyle = new CppCodeStylePreferences(this); @@ -105,7 +103,7 @@ CppToolsSettings::CppToolsSettings(QObject *parent) d->m_globalCodeStyle->setDisplayName(tr("Global", "Settings")); d->m_globalCodeStyle->setId(QLatin1String(idKey)); pool->addCodeStyle(d->m_globalCodeStyle); - textEditorSettings->registerCodeStyle(CppTools::Constants::CPP_SETTINGS_ID, d->m_globalCodeStyle); + TextEditorSettings::registerCodeStyle(CppTools::Constants::CPP_SETTINGS_ID, d->m_globalCodeStyle); /* For every language we have exactly 1 pool. The pool contains: @@ -203,7 +201,7 @@ CppToolsSettings::CppToolsSettings(QObject *parent) QString(), s, &legacyTabSettings); } else { // delegating to global - legacyTabSettings = textEditorSettings->codeStyle()->currentTabSettings(); + legacyTabSettings = TextEditorSettings::codeStyle()->currentTabSettings(); } // create custom code style out of old settings @@ -224,16 +222,16 @@ CppToolsSettings::CppToolsSettings(QObject *parent) // mimetypes to be handled - textEditorSettings->registerMimeTypeForLanguageId( + TextEditorSettings::registerMimeTypeForLanguageId( QLatin1String(Constants::C_SOURCE_MIMETYPE), Constants::CPP_SETTINGS_ID); - textEditorSettings->registerMimeTypeForLanguageId( + TextEditorSettings::registerMimeTypeForLanguageId( QLatin1String(Constants::C_HEADER_MIMETYPE), Constants::CPP_SETTINGS_ID); - textEditorSettings->registerMimeTypeForLanguageId( + TextEditorSettings::registerMimeTypeForLanguageId( QLatin1String(Constants::CPP_SOURCE_MIMETYPE), Constants::CPP_SETTINGS_ID); - textEditorSettings->registerMimeTypeForLanguageId( + TextEditorSettings::registerMimeTypeForLanguageId( QLatin1String(Constants::CPP_HEADER_MIMETYPE), Constants::CPP_SETTINGS_ID); } @@ -242,10 +240,9 @@ CppToolsSettings::~CppToolsSettings() { ExtensionSystem::PluginManager::removeObject(d->m_completionSettingsPage); - TextEditor::TextEditorSettings *textEditorSettings = TextEditor::TextEditorSettings::instance(); - textEditorSettings->unregisterCodeStyle(Constants::CPP_SETTINGS_ID); - textEditorSettings->unregisterCodeStylePool(Constants::CPP_SETTINGS_ID); - textEditorSettings->unregisterCodeStyleFactory(Constants::CPP_SETTINGS_ID); + TextEditorSettings::unregisterCodeStyle(Constants::CPP_SETTINGS_ID); + TextEditorSettings::unregisterCodeStylePool(Constants::CPP_SETTINGS_ID); + TextEditorSettings::unregisterCodeStyleFactory(Constants::CPP_SETTINGS_ID); delete d; |