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

List:       kde-commits
Subject:    KDE/kdelibs/khtml
From:       David Faure <faure () kde ! org>
Date:       2010-10-25 13:06:54
Message-ID: 20101025130654.08DD8AC897 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1189635 by dfaure:

Port khtmlimagepart from deprecated K_EXPORT_COMPONENT_FACTORY to KPluginFactory/K_EXPORT_PLUGIN.


 M  +6 -7      khtmlimage.cpp  
 M  +6 -3      khtmlimage.h  
 M  +2 -9      khtmlimage_init.cpp  


--- trunk/KDE/kdelibs/khtml/khtmlimage.cpp #1189634:1189635
@@ -37,10 +37,6 @@
 #include <kvbox.h>
 #include <kactioncollection.h>
 
-// Export init_khtmlimagefactory. This way we don't have to export the whole class
-// just for khtmlimagepart. See khtmlimage_init.cpp
-K_EXPORT_COMPONENT_FACTORY( khtmlimagefactory, KHTMLImageFactory )
-
 KComponentData *KHTMLImageFactory::s_componentData = 0;
 
 KHTMLImageFactory::KHTMLImageFactory()
@@ -53,12 +49,15 @@
     delete s_componentData;
 }
 
-KParts::Part *KHTMLImageFactory::createPartObject( QWidget *parentWidget,
+QObject * KHTMLImageFactory::create(const char* iface,
+                                    QWidget *parentWidget,
                                                    QObject *parent,
-                                                   const char *className, const QStringList &args )
+                                    const QVariantList& args,
+                                    const QString &keyword)
 {
+    Q_UNUSED(keyword);
   KHTMLPart::GUIProfile prof = KHTMLPart::DefaultGUI;
-    if ( strcmp( className, "Browser/View" ) == 0 ) // old hack
+    if (strcmp( iface, "Browser/View" ) == 0) // old hack, now unused - KDE5: remove
         prof = KHTMLPart::BrowserViewGUI;
     if (args.contains("Browser/View"))
         prof = KHTMLPart::BrowserViewGUI;
--- trunk/KDE/kdelibs/khtml/khtmlimage.h #1189634:1189635
@@ -37,17 +37,20 @@
 
 /**
  * @internal
+ * (Only exported for khtmlimage_init.cpp, i.e. the part)
  */
-class KHTMLImageFactory : public KParts::Factory
+class KHTML_EXPORT KHTMLImageFactory : public KPluginFactory
 {
     Q_OBJECT
 public:
     KHTMLImageFactory();
     virtual ~KHTMLImageFactory();
 
-    virtual KParts::Part *createPartObject( QWidget *parentWidget,
+    virtual QObject *create(const char* iface,
+                            QWidget *parentWidget,
                                             QObject *parent,
-                                            const char *className, const QStringList &args );
+                            const QVariantList& args,
+                            const QString &keyword);
 
     static const KComponentData &componentData() { return *s_componentData; }
 
--- trunk/KDE/kdelibs/khtml/khtmlimage_init.cpp #1189634:1189635
@@ -17,13 +17,6 @@
    Boston, MA 02110-1301, USA.
 */
 
-#include <khtml_export.h>
+#include "khtmlimage.h"
 
-// Defined in libkhtml
-extern "C"  KDE_EXPORT void* init_khtmlimagefactory();
-
-// The real entry point for khtmlimagepart
-extern "C"  KDE_EXPORT void* init_khtmlimagepart() {
-    return init_khtmlimagefactory();
-}
-
+K_EXPORT_PLUGIN( KHTMLImageFactory )
[prev in list] [next in list] [prev in thread] [next in thread] 

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