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()
s_instance = 0;
}
QObject *CervisiaFactory::create( QObject* parent, const char* name,
KParts::Part *CervisiaFactory::createPartObject( QWidget *parentWidget, const char *widgetName,
QObject* parent, const char* name,
const char * /*classname*/,
const QStringList & /*args*/ )
{
QObject *obj = new CervisiaPart( static_cast<QWidget *>(parent), name );
emit objectCreated( obj );
KParts::Part *obj = new CervisiaPart( parentWidget, widgetName, parent, name );
return obj;
}
......@@ -90,7 +90,8 @@ KAboutData *CervisiaFactory::aboutData()
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 )
{
hasRunningJob = false;
......@@ -102,7 +103,8 @@ CervisiaPart::CervisiaPart( QWidget *parent, const char *name )
conf->setGroup("LookAndFeel");
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->setFocusPolicy( QWidget::StrongFocus );
......
......@@ -5,7 +5,7 @@
#include <kparts/part.h>
#include <kparts/browserextension.h>
#include <klibloader.h>
#include <kparts/factory.h>
#include "commitdlg.h"
#include "checkoutdlg.h"
......@@ -22,7 +22,7 @@ class KAboutData;
/**
* Factory for instantiating CervisiaParts.
*/
class CervisiaFactory : public KLibFactory
class CervisiaFactory : public KParts::Factory
{
Q_OBJECT
......@@ -30,7 +30,8 @@ public:
CervisiaFactory();
virtual ~CervisiaFactory();
virtual QObject* create( QObject* parent = 0, const char* name = 0,
virtual KParts::Part *createPartObject( QWidget *parentWidget, const char *widgetName,
QObject* parent = 0, const char* name = 0,
const char* classname = "QObject",
const QStringList &args = QStringList() );
......@@ -50,7 +51,8 @@ class CervisiaPart : public KParts::ReadOnlyPart
Q_OBJECT
public:
CervisiaPart( QWidget *parent, const char *name=0 );
CervisiaPart( QWidget *parentWidget, const char *widgetName,
QObject *parent, const char *name=0 );
virtual ~CervisiaPart();
/**
......
......@@ -16,7 +16,7 @@ CervisiaShell::CervisiaShell( const char *name )
{
setXMLFile( "cervisiashellui.rc" );
part = new CervisiaPart( this, "cervisiapart" );
part = new CervisiaPart( this, "cervisiaview", this, "cervisiapart" );
setCentralWidget( part->widget() );
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