From kde-commits Mon Oct 25 13:06:54 2010 From: David Faure Date: Mon, 25 Oct 2010 13:06:54 +0000 To: kde-commits Subject: KDE/kdelibs/khtml Message-Id: <20101025130654.08DD8AC897 () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=128801208514375 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 #include -// 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 +#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 )