Commit f7ada9b9 authored by Michael Reeves's avatar Michael Reeves

*convert plugin loading to fully correct form

*add missing Q_OBJECT
parent 5c7ccc1e
......@@ -21,6 +21,9 @@
#include "kdiff3.h"
#include "kdiff3_part.h"
#include <KPluginMetaData>
#include <KPluginLoader>
#include <kshortcutsdialog.h>
#include <kfiledialog.h>
#include <kconfig.h>
......@@ -51,8 +54,15 @@ KDiff3Shell::KDiff3Shell( bool bCompleteInit )
// and a status bar
statusBar()->show();
// m_part = static_cast<KParts::ReadWritePart*>(factory->create(this, "KDiff3Part", QStringList("KParts::ReadWritePart")));
m_part = new KDiff3Part( this, this, QVariantList() << QVariant(QLatin1String("KDiff3Part")) );
const QVector<KPluginMetaData> plugin_offers = KPluginLoader::findPlugins("kf5/kdiff3part");
foreach (const KPluginMetaData &service, plugin_offers) {
KPluginFactory *factory = KPluginLoader(service.fileName()).factory();
m_part = factory->create<KDiff3Part>(this, QVariantList() << QVariant(QLatin1String("KDiff3Part")));
if (m_part)
break;
}
//m_part = new KDiff3Part( this, this, QVariantList() << QVariant(QLatin1String("KDiff3Part")) );
if (m_part)
{
......
......@@ -378,6 +378,7 @@ private:
class OptionEncodingComboBox : public QComboBox, public OptionItem
{
Q_OBJECT
QVector<QTextCodec*> m_codecVec;
QTextCodec** m_ppVarCodec;
public:
......
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