Commit d17c942b authored by Simon Hausmann's avatar Simon Hausmann

- make it compile (use kparts factory instead of klibfactory and

  reimplement the right methods)

svn path=/trunk/kdesdk/cervisia/; revision=114463
parent 358e80ed
...@@ -65,12 +65,12 @@ CervisiaFactory::~CervisiaFactory() ...@@ -65,12 +65,12 @@ CervisiaFactory::~CervisiaFactory()
s_instance = 0; s_instance = 0;
} }
QObject *CervisiaFactory::create( QObject* parent, const char* name, KParts::Part *CervisiaFactory::createPartObject( QWidget *parentWidget, const char *widgetName,
const char * /*classname*/, QObject* parent, const char* name,
const QStringList & /*args*/ ) const char * /*classname*/,
const QStringList & /*args*/ )
{ {
QObject *obj = new CervisiaPart( static_cast<QWidget *>(parent), name ); KParts::Part *obj = new CervisiaPart( parentWidget, widgetName, parent, name );
emit objectCreated( obj );
return obj; return obj;
} }
...@@ -90,7 +90,8 @@ KAboutData *CervisiaFactory::aboutData() ...@@ -90,7 +90,8 @@ KAboutData *CervisiaFactory::aboutData()
I18N_NOOP("(c) 1999-2001 Bernd Gehrmann")); I18N_NOOP("(c) 1999-2001 Bernd Gehrmann"));
} }
CervisiaPart::CervisiaPart( QWidget *parent, const char *name ) CervisiaPart::CervisiaPart( QWidget *parentWidget, const char *widgetName,
QObject *parent, const char *name )
: KParts::ReadOnlyPart( parent, name ) : KParts::ReadOnlyPart( parent, name )
{ {
hasRunningJob = false; hasRunningJob = false;
...@@ -102,7 +103,8 @@ CervisiaPart::CervisiaPart( QWidget *parent, const char *name ) ...@@ -102,7 +103,8 @@ CervisiaPart::CervisiaPart( QWidget *parent, const char *name )
conf->setGroup("LookAndFeel"); conf->setGroup("LookAndFeel");
bool splitHorz = conf->readBoolEntry("SplitHorizontally",true); bool splitHorz = conf->readBoolEntry("SplitHorizontally",true);
splitter = new QSplitter(splitHorz? QSplitter::Vertical : QSplitter::Horizontal, parent); splitter = new QSplitter(splitHorz? QSplitter::Vertical : QSplitter::Horizontal,
parentWidget, widgetName);
update = new UpdateView(splitter); update = new UpdateView(splitter);
update->setFocusPolicy( QWidget::StrongFocus ); update->setFocusPolicy( QWidget::StrongFocus );
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <kparts/part.h> #include <kparts/part.h>
#include <kparts/browserextension.h> #include <kparts/browserextension.h>
#include <klibloader.h> #include <kparts/factory.h>
#include "commitdlg.h" #include "commitdlg.h"
#include "checkoutdlg.h" #include "checkoutdlg.h"
...@@ -22,7 +22,7 @@ class KAboutData; ...@@ -22,7 +22,7 @@ class KAboutData;
/** /**
* Factory for instantiating CervisiaParts. * Factory for instantiating CervisiaParts.
*/ */
class CervisiaFactory : public KLibFactory class CervisiaFactory : public KParts::Factory
{ {
Q_OBJECT Q_OBJECT
...@@ -30,9 +30,10 @@ public: ...@@ -30,9 +30,10 @@ public:
CervisiaFactory(); CervisiaFactory();
virtual ~CervisiaFactory(); virtual ~CervisiaFactory();
virtual QObject* create( QObject* parent = 0, const char* name = 0, virtual KParts::Part *createPartObject( QWidget *parentWidget, const char *widgetName,
const char* classname = "QObject", QObject* parent = 0, const char* name = 0,
const QStringList &args = QStringList() ); const char* classname = "QObject",
const QStringList &args = QStringList() );
static KInstance *instance(); static KInstance *instance();
static KAboutData *aboutData(); static KAboutData *aboutData();
...@@ -50,7 +51,8 @@ class CervisiaPart : public KParts::ReadOnlyPart ...@@ -50,7 +51,8 @@ class CervisiaPart : public KParts::ReadOnlyPart
Q_OBJECT Q_OBJECT
public: public:
CervisiaPart( QWidget *parent, const char *name=0 ); CervisiaPart( QWidget *parentWidget, const char *widgetName,
QObject *parent, const char *name=0 );
virtual ~CervisiaPart(); virtual ~CervisiaPart();
/** /**
......
...@@ -16,7 +16,7 @@ CervisiaShell::CervisiaShell( const char *name ) ...@@ -16,7 +16,7 @@ CervisiaShell::CervisiaShell( const char *name )
{ {
setXMLFile( "cervisiashellui.rc" ); setXMLFile( "cervisiashellui.rc" );
part = new CervisiaPart( this, "cervisiapart" ); part = new CervisiaPart( this, "cervisiaview", this, "cervisiapart" );
setCentralWidget( part->widget() ); setCentralWidget( part->widget() );
setupActions(); setupActions();
......
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