port to the new library loading stuff

svn path=/trunk/KDE/kdegraphics/okular/; revision=706132
This commit is contained in:
Pino Toscano 2007-08-29 14:16:06 +00:00
parent eec1e88373
commit 218b630460
3 changed files with 7 additions and 8 deletions

View file

@ -76,8 +76,8 @@
#include "core/generator.h"
#include "core/page.h"
typedef KParts::GenericFactory<Part> okularPartFactory;
K_EXPORT_COMPONENT_FACTORY(libokularpart, okularPartFactory)
K_PLUGIN_FACTORY( okularPartFactory, registerPlugin< Part >(); )
K_EXPORT_PLUGIN( okularPartFactory( "okularpart" ) )
static QAction* actionForExportFormat( const Okular::ExportFormat& format, QObject *parent = 0 )
{
@ -114,7 +114,7 @@ static QString compressedMimeFor( const QString& mime_to_check )
Part::Part(QWidget *parentWidget,
QObject *parent,
const QStringList &args )
const QVariantList &args )
: KParts::ReadOnlyPart(parent),
m_tempfile( 0 ), m_showMenuBarAction( 0 ), m_showFullScreenAction( 0 ), m_actionsSearched( false ),
m_searchStarted(false), m_cliPresentation(false), m_generatorGuiClient(0)

2
part.h
View file

@ -76,7 +76,7 @@ class Part : public KParts::ReadOnlyPart, public Okular::DocumentObserver, publi
public:
// Default constructor
Part(QWidget* parentWidget, QObject* parent, const QStringList& args);
Part(QWidget* parentWidget, QObject* parent, const QVariantList& args);
// Destructor
~Part();

View file

@ -26,7 +26,7 @@
#include <kcmdlineargs.h>
#include <kedittoolbar.h>
#include <kfiledialog.h>
#include <klibloader.h>
#include <kpluginloader.h>
#include <kmessagebox.h>
#include <kmimetype.h>
#include <kstandardaction.h>
@ -35,7 +35,6 @@
#include <kdebug.h>
#include <klocale.h>
#include <kmenubar.h>
#include <kparts/componentfactory.h>
#include <kio/netaccess.h>
#include <krecentfilesaction.h>
#include <kservicetypetrader.h>
@ -64,12 +63,12 @@ void Shell::init()
// this routine will find and load our Part. it finds the Part by
// name which is a bad idea usually.. but it's alright in this
// case since our Part is made for this Shell
KParts::Factory *factory = (KParts::Factory *) KLibLoader::self()->factory("libokularpart");
KPluginFactory *factory = KPluginLoader("libokularpart").factory();
if (factory)
{
// now that the Part is loaded, we cast it to a Part to get
// our hands on it
m_part = (KParts::ReadOnlyPart*) factory->createPart(this, this);
m_part = factory->create< KParts::ReadOnlyPart >( this );
if (m_part)
{
// then, setup our actions