OSDN Git Service

kate: register as plugin
authorIvailo Monev <xakepa10@gmail.com>
Thu, 1 Dec 2022 00:25:09 +0000 (02:25 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Thu, 1 Dec 2022 00:25:20 +0000 (02:25 +0200)
KTextEditor::Factory does its own thing in terms of plugin lookup, view
creation and such. the plan is to remove the KTextEditor interface glue
code (because there is only one part providing the functionality for that
interface - katepart) and register KateDocument as part plugin via
K_PLUGIN_FACTORY() macro but until then that will work

fixes loading of the part in some cases (e.g. when Ark attempts to load it
from its previewer)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
kate/part/document/katedocument.cpp
kate/part/document/katedocument.h
kate/part/utils/katefactory.cpp

index 355bfdb..8827026 100644 (file)
@@ -105,6 +105,12 @@ inline bool isBracket     ( const QChar& c ) { return isStartBracket( c ) || isE
 //
 // KateDocument Constructor
 //
+KateDocument::KateDocument ( QWidget *parentWidget, QObject *parent, const QVariantList &args)
+: KateDocument (true, false, true, parentWidget, parent)
+{
+  Q_UNUSED(args);
+}
+
 KateDocument::KateDocument ( bool bSingleViewMode, bool bBrowserView,
                              bool bReadOnly, QWidget *parentWidget,
                              QObject *parent)
index d32ed91..72546ca 100644 (file)
@@ -103,6 +103,7 @@ class KATEPARTINTERFACES_EXPORT KateDocument : public KTextEditor::Document,
   friend class KateBuffer;
 
   public:
+    explicit KateDocument (QWidget *parentWidget, QObject *, const QVariantList &args);
     explicit KateDocument (bool bSingleViewMode=false, bool bBrowserView=false, bool bReadOnly=false,
                   QWidget *parentWidget = 0, QObject * = 0);
     ~KateDocument ();
index 6e5db19..089f391 100644 (file)
@@ -40,6 +40,7 @@ class KateFactory : public KTextEditor::Factory
       : KTextEditor::Factory (parent)
     {
       KateGlobal::incRef ();
+      registerPlugin<KateDocument>();
     }
 
     /**