Commit 702106fe authored by Pino Toscano's avatar Pino Toscano
Browse files

port to the kde4 plugin factory

svn path=/trunk/KDE/kdegraphics/svgpart/; revision=814888
parent f1a9af1e
......@@ -24,19 +24,29 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <QGraphicsView>
// KDE
#include <kaboutdata.h>
#include <kactioncollection.h>
#include <kgenericfactory.h>
#include <kstandardaction.h>
#include <ksvgrenderer.h>
#include <kparts/genericfactory.h>
// Local
static KAboutData createAboutData()
{
KAboutData aboutData( "svgpart", 0, ki18n("SVG Part"),
"1.0", ki18n("A KPart to display SVG images"),
KAboutData::License_GPL,
ki18n("Copyright 2007, Aurélien Gâteau <aurelien.gateau@free.fr>"));
return aboutData;
}
//Factory Code
typedef KParts::GenericFactory<SvgPart> SvgPartFactory;
K_EXPORT_COMPONENT_FACTORY( svgpart /*library name*/, SvgPartFactory )
K_PLUGIN_FACTORY( SvgPartFactory, registerPlugin< SvgPart >(); )
K_EXPORT_PLUGIN( SvgPartFactory( createAboutData() ) )
SvgPart::SvgPart(QWidget* parentWidget, QObject* parent, const QStringList&)
SvgPart::SvgPart(QWidget* parentWidget, QObject* parent, const QVariantList&)
: KParts::ReadOnlyPart(parent)
{
mRenderer = new KSvgRenderer(this);
......@@ -65,15 +75,6 @@ bool SvgPart::openFile() {
}
KAboutData* SvgPart::createAboutData() {
KAboutData* aboutData = new KAboutData( "svgpart", 0, ki18n("SVG Part"),
"1.0", ki18n("A KPart to display SVG images"),
KAboutData::License_GPL,
ki18n("Copyright 2007, Aurélien Gâteau <aurelien.gateau@free.fr>"));
return aboutData;
}
void SvgPart::zoomIn() {
setZoom(zoom() * 2);
}
......
......@@ -22,7 +22,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// KDE
#include <kparts/part.h>
class KAboutData;
class KSvgRenderer;
class QGraphicsScene;
......@@ -32,9 +31,7 @@ class QGraphicsView;
class SvgPart : public KParts::ReadOnlyPart {
Q_OBJECT
public:
SvgPart(QWidget* parentWidget, QObject* parent, const QStringList&);
static KAboutData* createAboutData();
SvgPart(QWidget* parentWidget, QObject* parent, const QVariantList&);
protected:
virtual bool openFile();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment