Commit a0aec903 authored by Rex Dieter's avatar Rex Dieter
Browse files

initial port to libkipi-2.x

Initial libkipi-2.x support courtesy of Sando Mani

BUG: 307147
parent a89b0042
......@@ -45,6 +45,7 @@
#include <solid/control/powermanager.h>
#endif
#include <QItemSelection>
#include <QLayout>
#include <QPushButton>
#include <QToolButton>
......@@ -189,7 +190,9 @@ Kamoso::Kamoso(QWidget* parent)
connect(mTracker, SIGNAL(urlsChanged(KUrl::List)), SLOT(updateThumbnails(KUrl::List)));
QMetaObject::invokeMethod(this, "initialize");
mPluginLoader = new KIPI::PluginLoader(QStringList(), new KIPIInterface(this), "");
mPluginLoader = new KIPI::PluginLoader();
mPluginLoader->setInterface(new KIPIInterface(this));
mPluginLoader->init();
}
KUrl::List Kamoso::selectedItems()
......
......@@ -36,6 +36,7 @@ class WebcamWidget;
class WebcamRetriever;
class CountdownWidget;
class KDirOperator;
class QItemSelection;
class QStackedLayout;
class QSplitter;
class QPushButton;
......
......@@ -19,7 +19,7 @@
#include "kipiaction.h"
#include <libkipi/plugin.h>
#include <libkipi/exportinterface.h>
#include "plugins/exportinterface.h"
#include <QDebug>
#include "kamoso.h"
#include "kamosojobtracker.h"
......@@ -33,7 +33,7 @@ KipiAction::KipiAction(KIPI::PluginLoader::Info* pluginInfo, Kamoso* ui, QObject
void KipiAction::runJob()
{
KIPI::Plugin* p=pluginInfo->plugin();
KIPI::ExportInterface* ep=dynamic_cast<KIPI::ExportInterface*>(p);
ExportInterface* ep=dynamic_cast<ExportInterface*>(p);
KJob* job=ep->exportFiles(i18n("Kamoso"));
mKamoso->tracker()->registerJob(job, mKamoso->selectedItems(), icon());
......
......@@ -20,10 +20,10 @@
#include "fakekipiaction.h"
#include <libkipi/plugin.h>
#include <libkipi/exportinterface.h>
#include <KIO/JobUiDelegate>
#include <kjobtrackerinterface.h>
#include <KDebug>
#include "../plugins/exportinterface.h"
FakeKipiAction::FakeKipiAction(KIPI::PluginLoader::Info* pluginInfo, QObject* parent)
: QAction(pluginInfo->icon(), pluginInfo->name(), parent), pluginInfo(pluginInfo)
......@@ -39,7 +39,7 @@ FakeKipiAction::~FakeKipiAction()
void FakeKipiAction::runJob()
{
KIPI::Plugin* p=pluginInfo->plugin();
KIPI::ExportInterface* ep = dynamic_cast<KIPI::ExportInterface*>(p);
ExportInterface* ep = dynamic_cast<ExportInterface*>(p);
m_job = ep->exportFiles(i18n("Kamoso"));
KIO::getJobTracker()->registerJob(m_job);
......
......@@ -41,7 +41,9 @@ PluginTester::PluginTester(QObject *parent) : QObject(parent)
kurlList.append(KUrl(args->arg(i)));
}
m_pluginLoader = new KIPI::PluginLoader(QStringList(), new FakeKIPIInterface(kurlList), "");
m_pluginLoader = new KIPI::PluginLoader();
m_pluginLoader->setInterface(new FakeKIPIInterface(kurlList));
m_pluginLoader->init();
bool found = false;
Q_FOREACH(KIPI::PluginLoader::Info *pluginInfo, m_pluginLoader->pluginList()) {
......
......@@ -30,5 +30,5 @@ FIND_PACKAGE(Kipi REQUIRED)
# MACRO_OPTIONAL_FIND_PACKAGE(KdepimLibs) # For Calendar (libkcal).
# MACRO_OPTIONAL_FIND_PACKAGE(QCA2) # For Shwup.
include_directories(${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/plugins/youtube)
include_directories(${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/plugins ${CMAKE_SOURCE_DIR}/src/plugins/youtube)
add_subdirectory(youtube)
#ifndef EXPORTINTERFACE_H
#define EXPORTINTERFACE_H
class KJob;
class ExportInterface
{
public:
virtual ~ExportInterface() {}
virtual KJob* exportFiles(const QString& albumname)=0;
};
#endif // EXPORTINTERFACE_H
......@@ -22,12 +22,11 @@
#include <kwallet.h>
#include <KIO/Job>
#include <libkipi/plugin.h>
#include <libkipi/exportinterface.h>
#include <exportinterface.h>
class YoutubePlugin : public KIPI::Plugin, public KIPI::ExportInterface
class YoutubePlugin : public KIPI::Plugin, public ExportInterface
{
Q_OBJECT
Q_INTERFACES(KIPI::ExportInterface)
public:
YoutubePlugin(QObject* parent, const QVariantList& args);
// virtual QAction* thumbnailsAction(const QList<KUrl>& url);
......
Supports Markdown
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