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

List:       kde-commits
Subject:    koffice/kword/part
From:       David Faure <faure () kde ! org>
Date:       2010-11-15 13:41:51
Message-ID: 20101115134151.1E4F7AC8A0 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1197348 by dfaure:

Port away from KoFactory/KParts::Factory - just reimplement KPluginFactory::create \
directly - so that kword works with kdelibs-in-mobile-profile.


 M  +7 -5      KWFactory.cpp  
 M  +3 -4      KWFactory.h  


--- trunk/koffice/kword/part/KWFactory.cpp #1197347:1197348
@@ -18,6 +18,7 @@
 */
 
 #include "KWFactory.h"
+#include <kdebug.h>
 #include "KWAboutData.h"
 #include "KWDocument.h"
 #include <kcomponentdata.h>
@@ -28,8 +29,8 @@
 KComponentData *KWFactory::s_instance = 0;
 KAboutData *KWFactory::s_aboutData = 0;
 
-KWFactory::KWFactory(QObject *parent, const char *name)
-        : KoFactory(parent, name)
+KWFactory::KWFactory(QObject *parent)
+        : KPluginFactory(*aboutData(), parent)
 {
     // Create our instance, so that it becomes KGlobal::instance if the
     // main app is KWord.
@@ -44,9 +45,11 @@
     s_instance = 0;
 }
 
-KParts::Part *KWFactory::createPartObject(QWidget *parentWidget, QObject *parent, \
const char *classname, const QStringList &) +QObject* KWFactory::create(const char* \
iface, QWidget* parentWidget, QObject *parent, const QVariantList& args, const \
QString& keyword)  {
-    bool bWantKoDocument = (strcmp(classname, "KoDocument") == 0);
+    Q_UNUSED(args);
+    Q_UNUSED(keyword);
+    bool bWantKoDocument = (strcmp(iface, "KoDocument") == 0);
 
     KWDocument *doc = new KWDocument(parentWidget, parent, !bWantKoDocument);
 
@@ -77,4 +80,3 @@
     }
     return *s_instance;
 }
-
--- trunk/koffice/kword/part/KWFactory.h #1197347:1197348
@@ -29,20 +29,19 @@
  * Factory for the KWord application.
  * Will use the KWord library to create a new instance of the KWord doc.
  */
-class KWORD_EXPORT KWFactory : public KoFactory
+class KWORD_EXPORT KWFactory : public KPluginFactory
 {
     Q_OBJECT
 public:
     /**
      * Constructor
      * @param parent the parent QObject
-     * @param name the name of the object
      */
-    explicit KWFactory(QObject *parent = 0, const char *name = 0);
+    explicit KWFactory(QObject *parent = 0);
     ~KWFactory();
 
     /// overwritten method from superclass
-    virtual KParts::Part* createPartObject(QWidget * = 0, QObject *parent = 0, const \
char *classname = "KoDocument", const QStringList &args = QStringList()); +    \
virtual QObject* create(const char* iface, QWidget* parentWidget, QObject *parent, \
const QVariantList& args, const QString& keyword);  
     /// Return an instance
     static const KComponentData &componentData();


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

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