Commit 218b6304 authored by Pino Toscano's avatar Pino Toscano

port to the new library loading stuff

svn path=/trunk/KDE/kdegraphics/okular/; revision=706132
parent eec1e883
......@@ -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)
......
......@@ -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();
......
......@@ -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
......
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