Commit 9398df0a authored by Frederik Gladhorn's avatar Frederik Gladhorn
Browse files

Welcome back Okular::Part

parent ac15a707
...@@ -156,6 +156,8 @@ class FileKeeper ...@@ -156,6 +156,8 @@ class FileKeeper
std::FILE * m_handle; std::FILE * m_handle;
}; };
K_PLUGIN_FACTORY(OkularPartFactory, registerPlugin<Okular::Part>();)
Okular::PartFactory::PartFactory() Okular::PartFactory::PartFactory()
{ {
} }
...@@ -173,8 +175,6 @@ QObject *Okular::PartFactory::create(const char *iface, QWidget *parentWidget, Q ...@@ -173,8 +175,6 @@ QObject *Okular::PartFactory::create(const char *iface, QWidget *parentWidget, Q
return object; return object;
} }
K_EXPORT_PLUGIN( Okular::PartFactory() )
static QAction* actionForExportFormat( const Okular::ExportFormat& format, QObject *parent = 0 ) static QAction* actionForExportFormat( const Okular::ExportFormat& format, QObject *parent = 0 )
{ {
QAction *act = new QAction( format.description(), parent ); QAction *act = new QAction( format.description(), parent );
...@@ -2967,6 +2967,6 @@ void Part::setReadWrite(bool readwrite) ...@@ -2967,6 +2967,6 @@ void Part::setReadWrite(bool readwrite)
} // namespace Okular } // namespace Okular
#include "moc_part.cpp" #include "part.moc"
/* kate: replace-tabs on; indent-width 4; */ /* kate: replace-tabs on; indent-width 4; */
...@@ -89,12 +89,13 @@ void Shell::init() ...@@ -89,12 +89,13 @@ void Shell::init()
// this routine will find and load our Part. it finds the Part by // 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 // name which is a bad idea usually.. but it's alright in this
// case since our Part is made for this Shell // case since our Part is made for this Shell
m_partFactory = KPluginLoader("okularpart").factory(); KPluginLoader loader("okularpart");
m_partFactory = loader.factory();
if (!m_partFactory) if (!m_partFactory)
{ {
// if we couldn't find our Part, we exit since the Shell by // if we couldn't find our Part, we exit since the Shell by
// itself can't do anything useful // itself can't do anything useful
KMessageBox::error(this, i18n("Unable to find the Okular component.")); KMessageBox::error(this, i18n("Unable to find the Okular component: %1", loader.errorString()));
return; return;
} }
......
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