forked from qt-creator/qt-creator
TextEditor: Use new setup pattern for TextEditorSettings class
Change-Id: I8980f21a3ea156d45ab68bad66b94fbc5bbad641 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -67,8 +67,6 @@ const char kCurrentDocumentWordUnderCursor[] = "CurrentDocument:WordUnderCursor"
|
||||
class TextEditorPluginPrivate : public QObject
|
||||
{
|
||||
public:
|
||||
TextEditorSettings settings;
|
||||
|
||||
FindInFiles findInFilesFilter;
|
||||
FindInCurrentFile findInCurrentFileFilter;
|
||||
FindInOpenFiles findInOpenFilesFilter;
|
||||
@@ -113,6 +111,8 @@ void TextEditorPlugin::initialize()
|
||||
addTestCreator(createSnippetParserTest);
|
||||
#endif
|
||||
|
||||
setupTextEditorSettings();
|
||||
|
||||
setupTextMarkRegistry(this);
|
||||
setupOutlineFactory();
|
||||
setupLineNumberFilter(); // Goto line functionality for quick open
|
||||
@@ -189,7 +189,7 @@ void TextEditorPlugin::extensionsInitialized()
|
||||
}
|
||||
});
|
||||
|
||||
connect(&d->settings, &TextEditorSettings::fontSettingsChanged,
|
||||
connect(&textEditorSettings(), &TextEditorSettings::fontSettingsChanged,
|
||||
this, &TextEditorPlugin::updateSearchResultsFont);
|
||||
|
||||
updateSearchResultsFont(TextEditorSettings::fontSettings());
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "typingsettings.h"
|
||||
#include "snippets/snippetssettingspage.h"
|
||||
|
||||
#include <coreplugin/find/searchresultwindow.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/messagemanager.h>
|
||||
|
||||
@@ -613,4 +614,15 @@ void TextEditorSettings::resetFontZoom()
|
||||
setFontZoom(100);
|
||||
}
|
||||
|
||||
TextEditorSettings &Internal::textEditorSettings()
|
||||
{
|
||||
static TextEditorSettings theTextEditorSettings;
|
||||
return theTextEditorSettings;
|
||||
}
|
||||
|
||||
void Internal::setupTextEditorSettings()
|
||||
{
|
||||
(void) textEditorSettings(); // Trigger instantiation.
|
||||
}
|
||||
|
||||
} // TextEditor
|
||||
|
||||
@@ -95,4 +95,9 @@ signals:
|
||||
void commentsSettingsChanged();
|
||||
};
|
||||
|
||||
} // namespace TextEditor
|
||||
namespace Internal {
|
||||
TextEditorSettings &textEditorSettings();
|
||||
void setupTextEditorSettings();
|
||||
} // Internal
|
||||
|
||||
} // TextEditor
|
||||
|
||||
Reference in New Issue
Block a user