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
|
class TextEditorPluginPrivate : public QObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TextEditorSettings settings;
|
|
||||||
|
|
||||||
FindInFiles findInFilesFilter;
|
FindInFiles findInFilesFilter;
|
||||||
FindInCurrentFile findInCurrentFileFilter;
|
FindInCurrentFile findInCurrentFileFilter;
|
||||||
FindInOpenFiles findInOpenFilesFilter;
|
FindInOpenFiles findInOpenFilesFilter;
|
||||||
@@ -113,6 +111,8 @@ void TextEditorPlugin::initialize()
|
|||||||
addTestCreator(createSnippetParserTest);
|
addTestCreator(createSnippetParserTest);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
setupTextEditorSettings();
|
||||||
|
|
||||||
setupTextMarkRegistry(this);
|
setupTextMarkRegistry(this);
|
||||||
setupOutlineFactory();
|
setupOutlineFactory();
|
||||||
setupLineNumberFilter(); // Goto line functionality for quick open
|
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);
|
this, &TextEditorPlugin::updateSearchResultsFont);
|
||||||
|
|
||||||
updateSearchResultsFont(TextEditorSettings::fontSettings());
|
updateSearchResultsFont(TextEditorSettings::fontSettings());
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#include "typingsettings.h"
|
#include "typingsettings.h"
|
||||||
#include "snippets/snippetssettingspage.h"
|
#include "snippets/snippetssettingspage.h"
|
||||||
|
|
||||||
|
#include <coreplugin/find/searchresultwindow.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/messagemanager.h>
|
#include <coreplugin/messagemanager.h>
|
||||||
|
|
||||||
@@ -613,4 +614,15 @@ void TextEditorSettings::resetFontZoom()
|
|||||||
setFontZoom(100);
|
setFontZoom(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TextEditorSettings &Internal::textEditorSettings()
|
||||||
|
{
|
||||||
|
static TextEditorSettings theTextEditorSettings;
|
||||||
|
return theTextEditorSettings;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Internal::setupTextEditorSettings()
|
||||||
|
{
|
||||||
|
(void) textEditorSettings(); // Trigger instantiation.
|
||||||
|
}
|
||||||
|
|
||||||
} // TextEditor
|
} // TextEditor
|
||||||
|
|||||||
@@ -95,4 +95,9 @@ signals:
|
|||||||
void commentsSettingsChanged();
|
void commentsSettingsChanged();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace TextEditor
|
namespace Internal {
|
||||||
|
TextEditorSettings &textEditorSettings();
|
||||||
|
void setupTextEditorSettings();
|
||||||
|
} // Internal
|
||||||
|
|
||||||
|
} // TextEditor
|
||||||
|
|||||||
Reference in New Issue
Block a user