diff --git a/src/markdowneditorfactory.cpp b/src/markdowneditorfactory.cpp index 64307e2..6dd908d 100644 --- a/src/markdowneditorfactory.cpp +++ b/src/markdowneditorfactory.cpp @@ -3,34 +3,25 @@ #include "markdowntextedit.h" -#include #include namespace QtcMarkview { - namespace Internal { +namespace Internal { - MarkdownEditorFactory::MarkdownEditorFactory (QObject *parent) : - TextEditor::TextEditorFactory (parent) { - setId (Constants::MARKDOWN_EDITOR_ID); - setDisplayName (QCoreApplication::translate ("OpenWith::Editors", - Constants::MARKDOWN_EDITOR_NAME)); - addMimeType ("text/plain"); - addMimeType ("text/markdown"); +MarkdownEditorFactory::MarkdownEditorFactory() + : TextEditor::TextEditorFactory() { + setId(Constants::MARKDOWN_EDITOR_ID); + setDisplayName(QCoreApplication::translate("OpenWith::Editors", + Constants::MARKDOWN_EDITOR_NAME)); + addMimeType("text/plain"); + addMimeType("text/markdown"); - setDocumentCreator ([]() { - return new TextEditor::TextDocument (Constants::MARKDOWN_EDITOR_ID); - }); - setEditorCreator ([]() { - return new TextEditor::BaseTextEditor; - }); - setEditorWidgetCreator ([]() { - return new QMarkdownTextEdit; - }); - setIndenterCreator ([](QTextDocument *doc) { - return new TextEditor::NormalIndenter (doc); - }); - // setSyntaxHighlighterCreator() - } + setDocumentCreator([]() { + return new TextEditor::TextDocument(Constants::MARKDOWN_EDITOR_ID); + }); + setEditorCreator([]() { return new TextEditor::BaseTextEditor; }); + setEditorWidgetCreator([]() { return new QMarkdownTextEdit; }); +} - } // namespace Internal +} // namespace Internal } // namespace QtcMarkview diff --git a/src/markdowneditorfactory.h b/src/markdowneditorfactory.h index a421a56..1a114e3 100644 --- a/src/markdowneditorfactory.h +++ b/src/markdowneditorfactory.h @@ -10,7 +10,7 @@ namespace QtcMarkview { Q_OBJECT public: - explicit MarkdownEditorFactory (QObject *parent = nullptr); + explicit MarkdownEditorFactory (); }; } // namespace Internal diff --git a/src/markviewplugin.cpp b/src/markviewplugin.cpp index 28a7b49..1f14c73 100644 --- a/src/markviewplugin.cpp +++ b/src/markviewplugin.cpp @@ -11,17 +11,17 @@ using namespace QtcMarkview::Internal; -MarkviewPlugin::MarkviewPlugin () : - IPlugin () { +MarkviewPlugin::MarkviewPlugin() : IPlugin() { // Create your members } -MarkviewPlugin::~MarkviewPlugin () { +MarkviewPlugin::~MarkviewPlugin() { // Unregister objects from the plugin manager's object pool // Delete members } -bool MarkviewPlugin::initialize (const QStringList &arguments, QString *errorString) { +bool MarkviewPlugin::initialize(const QStringList &arguments, + QString *errorString) { // Register objects in the plugin manager's object pool // Load settings // Add actions to menus @@ -29,39 +29,39 @@ bool MarkviewPlugin::initialize (const QStringList &arguments, QString *errorStr // In the initialize function, a plugin can be sure that the plugins it // depends on have initialized their members. - Q_UNUSED (arguments) - Q_UNUSED (errorString) + Q_UNUSED(arguments) + Q_UNUSED(errorString) - initLanguage (); + initLanguage(); - new MarkdownEditorFactory (this); + new MarkdownEditorFactory(); return true; } -void MarkviewPlugin::initLanguage () { - const QString &language = Core::ICore::userInterfaceLanguage (); - if (!language.isEmpty ()) { +void MarkviewPlugin::initLanguage() { + const QString &language = Core::ICore::userInterfaceLanguage(); + if (!language.isEmpty()) { QStringList paths; - paths << Core::ICore::resourcePath () << Core::ICore::userResourcePath (); - const QString &trFile = QLatin1String ("QtcMarkview_") + language; - QTranslator *translator = new QTranslator (this); + paths << Core::ICore::resourcePath() << Core::ICore::userResourcePath(); + const QString &trFile = QLatin1String("QtcMarkview_") + language; + QTranslator *translator = new QTranslator(this); foreach (const QString &path, paths) { - if (translator->load (trFile, path + QLatin1String ("/translations"))) { - qApp->installTranslator (translator); + if (translator->load(trFile, path + QLatin1String("/translations"))) { + qApp->installTranslator(translator); break; } } } } -void MarkviewPlugin::extensionsInitialized () { +void MarkviewPlugin::extensionsInitialized() { // Retrieve objects from the plugin manager's object pool // In the extensionsInitialized function, a plugin can be sure that all // plugins that depend on it are completely initialized. } -ExtensionSystem::IPlugin::ShutdownFlag MarkviewPlugin::aboutToShutdown () { +ExtensionSystem::IPlugin::ShutdownFlag MarkviewPlugin::aboutToShutdown() { // Save settings // Disconnect from signals that are not needed during shutdown // Hide UI (if you add UI that is not in the main window directly) diff --git a/util/ci/config.py b/util/ci/config.py index b4e7a8f..c543341 100644 --- a/util/ci/config.py +++ b/util/ci/config.py @@ -1,7 +1,7 @@ from os import getenv, path -qt_version = "5.14.0" -qtc_version = "4.11.0" +qt_version = "5.14.2" +qtc_version = "4.12.0" os_name = getenv('OS', 'linux') qt_modules = ['qtbase', 'qttools', 'icu'] plugin_name = 'QtcMarkview'