[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/krita/sdk/templates
From:       Adrian Page <adrian () pagenet ! plus ! com>
Date:       2010-01-13 21:02:22
Message-ID: 1263416542.227060.30065.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1074313 by page:

Fix deprecated warnings by changing

typedef KGenericFactory<Plugin> PluginFactory;
K_EXPORT_COMPONENT_FACTORY(lib, PluginFactory("krita"))

to

K_PLUGIN_FACTORY(PluginFactory, registerPlugin<Plugin>();)
K_EXPORT_PLUGIN(PluginFactory("krita"))

Update tool and filter plugin templates to current form, i.e. QObjects instead of KParts::Plugins.

 M  +4 -4      docker/APPNAMELC.cc  
 M  +3 -1      docker/APPNAMELC.h  
 M  +4 -4      filefilter/APPNAMELC_export.cc  
 M  +2 -1      filefilter/APPNAMELC_export.h  
 M  +4 -4      filefilter/APPNAMELC_import.cc  
 M  +2 -1      filefilter/APPNAMELC_import.h  
 M  +1 -1      filefilter/krita_APPNAMELC_export.desktop  
 M  +1 -1      filefilter/krita_APPNAMELC_import.desktop  
 M  +5 -9      filter/APPNAMELC.cc  
 M  +4 -3      filter/APPNAMELC.h  
 M  +1 -1      tool/kis_tool_APPNAMELC.h  
 M  +6 -22     tool/tool_APPNAMELC.cc  
 M  +4 -3      tool/tool_APPNAMELC.h  
 M  +4 -5      view/APPNAMELC.cc  
 M  +3 -1      view/APPNAMELC.h  


--- trunk/koffice/krita/sdk/templates/docker/APPNAMELC.cc #1074312:1074313
@@ -7,7 +7,7 @@
 #include <kactioncollection.h>
 #include <kcomponentdata.h>
 #include <kis_debug.h>
-#include <kgenericfactory.h>
+#include <kpluginfactory.h>
 #include <klocale.h>
 #include <kstandarddirs.h>
 
@@ -21,8 +21,8 @@
 
 #include "%{APPNAMELC}_dock.h"
 
-typedef KGenericFactory<%{APPNAME}Plugin> %{APPNAME}PluginFactory;
-K_EXPORT_COMPONENT_FACTORY( krita%{APPNAMELC}, %{APPNAME}PluginFactory( "krita" ) )
+K_PLUGIN_FACTORY(%{APPNAME}PluginFactory, registerPlugin<%{APPNAME}Plugin>();)
+K_EXPORT_PLUGIN(%{APPNAME}PluginFactory("krita"))
 
 class %{APPNAME}DockFactory : public KoDockFactory {
 public:
@@ -60,7 +60,7 @@
 };
 
 
-%{APPNAME}Plugin::%{APPNAME}Plugin(QObject *parent, const QStringList &)
+%{APPNAME}Plugin::%{APPNAME}Plugin(QObject *parent, const QVariantList &)
     : KParts::Plugin(parent)
 {
     dbgPlugins << "%{APPNAME}Plugin";
--- trunk/koffice/krita/sdk/templates/docker/APPNAMELC.h #1074312:1074313
@@ -1,6 +1,8 @@
 #ifndef _%{APPNAMEUC}_H_
 #define _%{APPNAMEUC}_H_
 
+#include <QVariant>
+
 #include <kparts/plugin.h>
 
 class KisView2;
@@ -12,7 +14,7 @@
 {
     Q_OBJECT
     public:
-        %{APPNAME}Plugin(QObject *parent, const QStringList &);
+        %{APPNAME}Plugin(QObject *parent, const QVariantList &);
         virtual ~%{APPNAME}Plugin();
     private:
         KisView2* m_view;
--- trunk/koffice/krita/sdk/templates/filefilter/APPNAMELC_export.cc #1074312:1074313
@@ -5,7 +5,7 @@
 
 #include <kapplication.h>
 #include <kdialog.h>
-#include <kgenericfactory.h>
+#include <kpluginfactory.h>
 
 #include <KoFilterChain.h>
 #include <KoColorSpaceConstants.h>
@@ -20,10 +20,10 @@
 
 class KisExternalLayer;
 
-typedef KGenericFactory<%{APPNAME}Export> ExportFactory;
-K_EXPORT_COMPONENT_FACTORY(libkrita%{APPNAMELC}export, ExportFactory("kofficefilters"))
+K_PLUGIN_FACTORY(ExportFactory, registerPlugin<%{APPNAME}Export>();)
+K_EXPORT_PLUGIN(ExportFactory("kofficefilters"))
 
-%{APPNAME}Export::%{APPNAME}Export(QObject *parent, const QStringList&) : KoFilter(parent)
+%{APPNAME}Export::%{APPNAME}Export(QObject *parent, const QVariantList&) : KoFilter(parent)
 {
 }
 
--- trunk/koffice/krita/sdk/templates/filefilter/APPNAMELC_export.h #1074312:1074313
@@ -1,12 +1,13 @@
 #ifndef _%{APPNAMEUC}_EXPORT_H_
 #define _%{APPNAMEUC}_EXPORT_H_
 
+#include <QVariant>
 #include <KoFilter.h>
 
 class %{APPNAME}Export : public KoFilter {
     Q_OBJECT
     public:
-        %{APPNAME}Export(QObject* parent, const QStringList&);
+        %{APPNAME}Export(QObject *parent, const QVariantList &);
         virtual ~%{APPNAME}Export();
     public:
         virtual KoFilter::ConversionStatus convert(const QByteArray& from, const QByteArray& to);
--- trunk/koffice/krita/sdk/templates/filefilter/APPNAMELC_import.cc #1074312:1074313
@@ -1,6 +1,6 @@
 #include "%{APPNAMELC}_import.h"
 
-#include <kgenericfactory.h>
+#include <kpluginfactory.h>
 
 #include <KoFilterChain.h>
 
@@ -9,10 +9,10 @@
 
 #include "%{APPNAMELC}_converter.h"
 
-typedef KGenericFactory<%{APPNAME}Import> ImportFactory;
-K_EXPORT_COMPONENT_FACTORY(libkrita%{APPNAMELC}import, ImportFactory("kofficefilters"))
+K_PLUGIN_FACTORY(ImportFactory, registerPlugin<%{APPNAME}Import>();)
+K_EXPORT_PLUGIN(ImportFactory("kofficefilters"))
 
-%{APPNAME}Import::%{APPNAME}Import(QObject *parent, const QStringList&) : KoFilter(parent)
+%{APPNAME}Import::%{APPNAME}Import(QObject *parent, const QVariantList&) : KoFilter(parent)
 {
 }
 
--- trunk/koffice/krita/sdk/templates/filefilter/APPNAMELC_import.h #1074312:1074313
@@ -1,12 +1,13 @@
 #ifndef _IMPORT_H_
 #define _IMPORT_H_
 
+#include <QVariant>
 #include <KoFilter.h>
 
 class %{APPNAME}Import : public KoFilter {
     Q_OBJECT
     public:
-        %{APPNAME}Import(QObject* parent, const QStringList&);
+        %{APPNAME}Import(QObject *parent, const QVariantList &);
         virtual ~%{APPNAME}Import();
     public:
         virtual KoFilter::ConversionStatus convert(const QByteArray& from, const QByteArray& to);
--- trunk/koffice/krita/sdk/templates/filefilter/krita_APPNAMELC_export.desktop #1074312:1074313
@@ -35,5 +35,5 @@
 Type=Service
 X-KDE-Export=image/%{APPNAMELC}
 X-KDE-Import=application/x-krita
-X-KDE-Library=libkrita%{APPNAMELC}export
+X-KDE-Library=krita%{APPNAMELC}export
 X-KDE-Weight=1
--- trunk/koffice/krita/sdk/templates/filefilter/krita_APPNAMELC_import.desktop #1074312:1074313
@@ -35,5 +35,5 @@
 Type=Service
 X-KDE-Export=application/x-krita
 X-KDE-Import=image/%{APPNAMELC}
-X-KDE-Library=libkrita%{APPNAMELC}import
+X-KDE-Library=krita%{APPNAMELC}import
 X-KDE-Weight=1
--- trunk/koffice/krita/sdk/templates/filter/APPNAMELC.cc #1074312:1074313
@@ -8,11 +8,10 @@
 
 #include <klocale.h>
 #include <kiconloader.h>
-#include <kcomponentdata.h>
 #include <kmessagebox.h>
 #include <kstandarddirs.h>
 #include <kis_debug.h>
-#include <kgenericfactory.h>
+#include <kpluginfactory.h>
 
 #include <kis_image.h>
 #include <kis_iterators_pixel.h>
@@ -21,15 +20,12 @@
 #include <kis_global.h>
 #include <kis_types.h>
 
-typedef KGenericFactory<%{APPNAME}Plugin> %{APPNAME}PluginFactory;
-K_EXPORT_COMPONENT_FACTORY( krita%{APPNAMELC}, %{APPNAME}PluginFactory( "krita" ) )
+K_PLUGIN_FACTORY(%{APPNAME}PluginFactory, registerPlugin<%{APPNAME}Plugin>();)
+K_EXPORT_PLUGIN(%{APPNAME}PluginFactory("krita"))
 
-%{APPNAME}Plugin::%{APPNAME}Plugin(QObject *parent, const QStringList &)
-        : KParts::Plugin(parent)
+%{APPNAME}Plugin::%{APPNAME}Plugin(QObject *parent, const QVariantList &)
+        : QObject(parent)
 {
-    setComponentData(%{APPNAME}PluginFactory::componentData());
-
-
     if (parent->inherits("KisFilterRegistry")) {
         KisFilterRegistry * manager = dynamic_cast<KisFilterRegistry *>(parent);
         manager->add(KisFilterSP(new %{APPNAME}Filter()));
--- trunk/koffice/krita/sdk/templates/filter/APPNAMELC.h #1074312:1074313
@@ -1,13 +1,14 @@
 #ifndef _%{APPNAMEUC}_H_
 #define _%{APPNAMEUC}_H_
 
-#include <kparts/plugin.h>
+#include <QObject>
+#include <QVariant>
 #include "filter/kis_filter.h"
 
-class %{APPNAME}Plugin : public KParts::Plugin
+class %{APPNAME}Plugin : public QObject
 {
 public:
-    %{APPNAME}Plugin(QObject *parent, const QStringList &);
+    %{APPNAME}Plugin(QObject *parent, const QVariantList &);
     virtual ~%{APPNAME}Plugin();
 };
 
--- trunk/koffice/krita/sdk/templates/tool/kis_tool_APPNAMELC.h #1074312:1074313
@@ -41,7 +41,7 @@
 class KisTool%{APPNAME}Factory : public KoToolFactory {
 
 public:
-    KisTool%{APPNAME}Factory(QObject *parent, const QStringList&)
+    KisTool%{APPNAME}Factory(QObject *parent)
         : KoToolFactory(parent, "KisTool%{APPNAME}", i18n( "%{APPNAME}" ))
         {
             setToolTip( i18n( "%{APPNAME}" ) );
--- trunk/koffice/krita/sdk/templates/tool/tool_APPNAMELC.cc #1074312:1074313
@@ -1,35 +1,19 @@
-#include <stdlib.h>
-#include <vector>
 
-#include <qpoint.h>
+#include <kpluginfactory.h>
 
-#include <klocale.h>
-#include <kiconloader.h>
-#include <kcomponentdata.h>
-#include <kmessagebox.h>
-#include <kstandarddirs.h>
-#include <kis_debug.h>
-#include <kgenericfactory.h>
-
-#include <kis_global.h>
-#include <kis_types.h>
 #include <KoToolRegistry.h>
 
 #include "tool_%{APPNAMELC}.h"
 #include "kis_tool_%{APPNAMELC}.h"
 
+K_PLUGIN_FACTORY(%{APPNAME}PluginFactory, registerPlugin<%{APPNAME}Plugin>();)
+K_EXPORT_PLUGIN(%{APPNAME}PluginFactory("krita"))
 
-typedef KGenericFactory<%{APPNAME}Plugin> %{APPNAME}Factory;
-K_EXPORT_COMPONENT_FACTORY( kritatool%{APPNAMELC}, %{APPNAME}Factory( "krita" ) )
-
-
-%{APPNAME}Plugin::%{APPNAME}Plugin(QObject *parent, const QStringList &)
-    : KParts::Plugin(parent)
+%{APPNAME}Plugin::%{APPNAME}Plugin(QObject *parent, const QVariantList &)
+    : QObject(parent)
 {
-    setComponentData(%{APPNAME}Factory::componentData());
-
     KoToolRegistry * r = KoToolRegistry::instance();
-    r->add(new KisTool%{APPNAME}Factory(r, QStringList()));
+    r->add(new KisTool%{APPNAME}Factory(r));
 }
 
 %{APPNAME}Plugin::~%{APPNAME}Plugin()
--- trunk/koffice/krita/sdk/templates/tool/tool_APPNAMELC.h #1074312:1074313
@@ -1,15 +1,16 @@
 #ifndef _%{APPNAMEUC}_H_
 #define _%{APPNAMEUC}_H_
 
-#include <kparts/plugin.h>
+#include <QObject>
+#include <QVariant>
 
 class KisView;
 
-class %{APPNAME}Plugin : public KParts::Plugin
+class %{APPNAME}Plugin : public QObject
 {
     Q_OBJECT
 public:
-    %{APPNAME}Plugin(QObject *parent, const QStringList &);
+    %{APPNAME}Plugin(QObject *parent, const QVariantList &);
     virtual ~%{APPNAME}Plugin();
 
 private:
--- trunk/koffice/krita/sdk/templates/view/APPNAMELC.cc #1074312:1074313
@@ -5,7 +5,7 @@
 #include <kactioncollection.h>
 #include <kcomponentdata.h>
 #include <kis_debug.h>
-#include <kgenericfactory.h>
+#include <kpluginfactory.h>
 #include <klocale.h>
 #include <kstandarddirs.h>
 
@@ -15,11 +15,10 @@
 #include "kis_types.h"
 #include "kis_view2.h"
 
-typedef KGenericFactory<%{APPNAME}Plugin> %{APPNAME}PluginFactory;
-K_EXPORT_COMPONENT_FACTORY( krita%{APPNAMELC}, %{APPNAME}PluginFactory( "krita" ) )
+K_PLUGIN_FACTORY(%{APPNAME}PluginFactory, registerPlugin<%{APPNAME}Plugin>();)
+K_EXPORT_PLUGIN(%{APPNAME}PluginFactory("krita"))
 
-
-%{APPNAME}Plugin::%{APPNAME}Plugin(QObject *parent, const QStringList &)
+%{APPNAME}Plugin::%{APPNAME}Plugin(QObject *parent, const QVariantList &)
     : KParts::Plugin(parent)
 {
     if ( parent->inherits("KisView2") )
--- trunk/koffice/krita/sdk/templates/view/APPNAMELC.h #1074312:1074313
@@ -1,6 +1,8 @@
 #ifndef _%{APPNAMEUC}_H_
 #define _%{APPNAMEUC}_H_
 
+#include <QVariant>
+
 #include <kparts/plugin.h>
 
 class KisView2;
@@ -12,7 +14,7 @@
 {
     Q_OBJECT
 public:
-    %{APPNAME}Plugin(QObject *parent, const QStringList &);
+    %{APPNAME}Plugin(QObject *parent, const QVariantList &);
     virtual ~%{APPNAME}Plugin();
 
 private slots:
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic