From a37589d431844a64031d3044787c15f8dddace45 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 30 Aug 2013 16:38:57 +0200 Subject: Apply 'static' pattern to MimeDatabase Also adjust and streamline using and surrounding code. Change-Id: I6a8b05126bdcbb74ff611b21c7cb3c5902a2d5ca Reviewed-by: Tobias Hunger Reviewed-by: Orgad Shaneh --- src/plugins/texteditor/plaintexteditor.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/plugins/texteditor/plaintexteditor.cpp') diff --git a/src/plugins/texteditor/plaintexteditor.cpp b/src/plugins/texteditor/plaintexteditor.cpp index 649b5f3bf6..410032a6ac 100644 --- a/src/plugins/texteditor/plaintexteditor.cpp +++ b/src/plugins/texteditor/plaintexteditor.cpp @@ -74,7 +74,7 @@ PlainTextEditorWidget::PlainTextEditorWidget(QWidget *parent) connect(Manager::instance(), SIGNAL(mimeTypesRegistered()), this, SLOT(configure())); } -Core::IEditor *PlainTextEditor::duplicate(QWidget *parent) +IEditor *PlainTextEditor::duplicate(QWidget *parent) { PlainTextEditorWidget *newWidget = new PlainTextEditorWidget(parent); newWidget->duplicateFrom(editorWidget()); @@ -82,9 +82,9 @@ Core::IEditor *PlainTextEditor::duplicate(QWidget *parent) return newWidget->editor(); } -Core::Id PlainTextEditor::id() const +Id PlainTextEditor::id() const { - return Core::Id(Core::Constants::K_DEFAULT_TEXT_EDITOR_ID); + return Core::Constants::K_DEFAULT_TEXT_EDITOR_ID; } void PlainTextEditorWidget::unCommentSelection() @@ -105,18 +105,18 @@ void PlainTextEditorWidget::setTabSettings(const TextEditor::TabSettings &ts) void PlainTextEditorWidget::configure() { - Core::MimeType mimeType; + MimeType mimeType; if (editorDocument()) - mimeType = Core::ICore::mimeDatabase()->findByFile(editorDocument()->filePath()); + mimeType = MimeDatabase::findByFile(editorDocument()->filePath()); configure(mimeType); } void PlainTextEditorWidget::configure(const QString &mimeType) { - configure(Core::ICore::mimeDatabase()->findByType(mimeType)); + configure(MimeDatabase::findByType(mimeType)); } -void PlainTextEditorWidget::configure(const Core::MimeType &mimeType) +void PlainTextEditorWidget::configure(const MimeType &mimeType) { Highlighter *highlighter = new Highlighter(); baseTextDocument()->setSyntaxHighlighter(highlighter); -- cgit v1.2.1