Commit 62db1c9b authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

using KIPI plugin loader singleton instance, we don't need to pass KIPI...

using KIPI plugin loader singleton instance, we don't need to pass KIPI interface instance to KPImageList constructor.
parent 05d84bad
......@@ -77,9 +77,7 @@ MainDialog::MainDialog(QWidget* const parent, SharedContainer* const sharedData)
// --------------------------------------------------------
QVBoxLayout* listBoxContainerLayout = new QVBoxLayout;
m_ImagesFilesListBox = new KPImagesList(m_sharedData->iface(),
m_ImagesFilesListBoxContainer,
KIconLoader::SizeMedium);
m_ImagesFilesListBox = new KPImagesList(m_ImagesFilesListBoxContainer, KIconLoader::SizeMedium);
m_ImagesFilesListBox->listView()->header()->hide();
listBoxContainerLayout->addWidget(m_ImagesFilesListBox);
......
......@@ -58,6 +58,7 @@
#include <libkipi/imagecollection.h>
#include <libkipi/interface.h>
#include <libkipi/pluginloader.h>
// LibKDcraw includes
......@@ -499,6 +500,12 @@ public:
progressTimer = 0;
loadRawThumb = 0;
progressPix = KPixmapSequence("process-working", KIconLoader::SizeSmallMedium);
PluginLoader* pl = PluginLoader::instance();
if (pl)
{
iface = pl->interface();
}
}
bool allowRAW;
......@@ -524,11 +531,9 @@ public:
KPRawThumbThread* loadRawThumb;
};
KPImagesList::KPImagesList(Interface* const iface, QWidget* const parent, int iconSize)
KPImagesList::KPImagesList(QWidget* const parent, int iconSize)
: QWidget(parent), d(new KPImagesListPriv)
{
d->iface = iface;
if (iconSize != -1) // default = ICONSIZE
{
setIconSize(iconSize);
......
......@@ -222,7 +222,7 @@ public:
public:
explicit KPImagesList(Interface* const iface, QWidget* const parent = 0, int iconSize = -1);
explicit KPImagesList(QWidget* const parent = 0, int iconSize = -1);
virtual ~KPImagesList();
void setAllowRAW(bool allow);
......@@ -265,7 +265,7 @@ Q_SIGNALS:
void signalXMLLoadImageElement(QXmlStreamReader&);
void signalXMLCustomElements(QXmlStreamWriter&);
void signalXMLCustomElements(QXmlStreamReader&);
public Q_SLOTS:
virtual void slotAddImages(const KUrl::List& list);
......
......@@ -54,7 +54,6 @@
// LibKIPI includes
#include <libkipi/interface.h>
#include <libkipi/uploadwidget.h>
#include <libkipi/imagecollection.h>
......@@ -72,7 +71,7 @@
namespace KIPIDebianScreenshotsPlugin
{
DsWidget::DsWidget(QWidget* const parent, KIPI::Interface* const iface)
DsWidget::DsWidget(QWidget* const parent)
: QWidget(parent),
m_lastTip( QString() ),
m_lastQueryUrl( QUrl() ),
......@@ -85,7 +84,7 @@ DsWidget::DsWidget(QWidget* const parent, KIPI::Interface* const iface)
// -------------------------------------------------------------------
m_imgList = new KIPIPlugins::KPImagesList(iface, this);
m_imgList = new KIPIPlugins::KPImagesList(this);
m_imgList->setControlButtonsPlacement(KIPIPlugins::KPImagesList::ControlButtonsBelow);
m_imgList->setAllowRAW(true);
m_imgList->loadImagesFromCurrentSelection();
......
......@@ -41,7 +41,6 @@ namespace KIO
namespace KIPI
{
class Interface;
class UploadWidget;
}
......@@ -61,12 +60,12 @@ class DsWidget : public QWidget
public:
DsWidget(QWidget* const parent, KIPI::Interface* const iface);
DsWidget(QWidget* const parent);
~DsWidget();
QString getDestinationPath() const;
QString getDestinationPath() const;
KIPIPlugins::KPImagesList* imagesList() const;
KIPIPlugins::KPImagesList* imagesList() const;
QProgressBar* progressBar() const;
......
......@@ -75,7 +75,7 @@ DsWindow::DsWindow(KIPI::Interface* const interface, const QString& tmpFolder, Q
// m_imagesCount = 0;
// m_imagesTotal = 0;
m_talker = new DsTalker(this);
m_widget = new DsWidget(this, interface);
m_widget = new DsWidget(this);
setMainWidget(m_widget);
setWindowIcon(KIcon("debianscreenshots"));
......
......@@ -129,7 +129,7 @@ BatchDialog::BatchDialog(Interface* const iface, DNGConverterAboutData* const ab
//---------------------------------------------
d->listView = new MyImageList(d->iface, d->page);
d->listView = new MyImageList(d->page);
// ---------------------------------------------------------------
......
......@@ -29,15 +29,11 @@
#include <klocale.h>
#include <kiconloader.h>
// KIPI includes
#include <libkipi/interface.h>
namespace KIPIDNGConverterPlugin
{
MyImageList::MyImageList(KIPI::Interface* const iface, QWidget* const parent)
: KPImagesList(iface, parent)
MyImageList::MyImageList(QWidget* const parent)
: KPImagesList(parent)
{
setControlButtonsPlacement(KPImagesList::ControlButtonsBelow);
listView()->setColumnLabel(KPImagesListView::Filename, i18n("Raw File"));
......
......@@ -47,7 +47,7 @@ public:
public:
explicit MyImageList(KIPI::Interface* const iface, QWidget* const parent = 0);
explicit MyImageList(QWidget* const parent = 0);
virtual ~MyImageList();
public Q_SLOTS:
......
......@@ -81,7 +81,7 @@ ItemsPage::ItemsPage(Manager* const mngr, KAssistantDialog* const dlg)
"<li>All images must have the same dimensions.</li></ul>"
"</qt>"));
d->list = new KPImagesList(d->mngr->iface(), vbox);
d->list = new KPImagesList(vbox);
d->list->listView()->setColumn(KPImagesListView::User1, i18n("Exposure (EV)"), true);
d->list->slotAddImages(d->mngr->itemsList());
......
......@@ -64,7 +64,7 @@ FbWidget::FbWidget(QWidget* const parent, KIPI::Interface* const iface, bool imp
// -------------------------------------------------------------------
m_imgList = new KIPIPlugins::KPImagesList(iface, this);
m_imgList = new KIPIPlugins::KPImagesList(this);
m_imgList->setControlButtonsPlacement(KIPIPlugins::KPImagesList::ControlButtonsBelow);
m_imgList->setAllowRAW(true);
m_imgList->loadImagesFromCurrentSelection();
......
......@@ -81,12 +81,12 @@ void SelectionPage::setPageContent(int choice)
if(choice == 0) // Collection Selector
{
Interface* interface = d->manager->iface();
Interface* interface = d->manager->iface();
d->imageCollectionSelector = interface->imageCollectionSelector(d->vbox);
}
else //Image Dialog
{
d->imageList = new KPImagesList(0, d->vbox);
d->imageList = new KPImagesList(d->vbox);
d->imageList->setControlButtonsPlacement(KPImagesList::ControlButtonsBelow);
}
......
......@@ -34,10 +34,6 @@
#include <klocale.h>
#include <kiconloader.h>
// KIPI includes
#include <libkipi/interface.h>
// Local includes
#include "comboboxdelegate.h"
......@@ -45,8 +41,8 @@
namespace KIPIFlickrExportPlugin
{
FlickrList::FlickrList(Interface* const iface, QWidget* const parent, bool is_23)
: KPImagesList(iface, parent),
FlickrList::FlickrList(QWidget* const parent, bool is_23)
: KPImagesList(parent),
m_public(Qt::Unchecked),
m_family(Qt::Unchecked),
m_friends(Qt::Unchecked),
......
......@@ -73,7 +73,7 @@ public:
public:
explicit FlickrList(Interface* const iface, QWidget* const parent = 0, bool = false);
explicit FlickrList(QWidget* const parent = 0, bool = false);
void setPublic(Qt::CheckState);
void setFamily(Qt::CheckState);
......
......@@ -63,7 +63,7 @@
namespace KIPIFlickrExportPlugin
{
FlickrWidget::FlickrWidget(QWidget* parent, Interface* iface, const QString& serviceName)
FlickrWidget::FlickrWidget(QWidget* parent, const QString& serviceName)
: QWidget(parent)
{
setObjectName("FlickrWidget");
......@@ -95,7 +95,7 @@ FlickrWidget::FlickrWidget(QWidget* parent, Interface* iface, const QString& ser
// -- The image list tab --------------------------------------------------
m_imglst = new KIPIFlickrExportPlugin::FlickrList(iface, m_tab, (serviceName == "23"));
m_imglst = new FlickrList(m_tab, (serviceName == "23"));
// For figuring out the width of the permission columns.
QHeaderView* hdr = m_imglst->listView()->header();
......
......@@ -45,11 +45,6 @@ class KTabWidget;
class KLineEdit;
class KHTMLPart;
namespace KIPI
{
class Interface;
}
namespace KIPIFlickrExportPlugin
{
......@@ -69,9 +64,11 @@ public:
public:
FlickrWidget(QWidget* parent, KIPI::Interface* iface, const QString& serviceName);
FlickrWidget(QWidget* parent, const QString& serviceName);
~FlickrWidget();
protected:
virtual void showEvent(QShowEvent* event);
private Q_SLOTS:
......
......@@ -104,7 +104,7 @@ FlickrWindow::FlickrWindow(Interface* const interface, const QString& tmpFolder,
m_uploadCount = 0;
m_uploadTotal = 0;
// m_wallet = 0;
m_widget = new FlickrWidget(this, interface, serviceName);
m_widget = new FlickrWidget(this, serviceName);
m_photoView = m_widget->m_photoView;
m_albumsListComboBox = m_widget->m_albumsListComboBox;
m_newAlbumBtn = m_widget->m_newAlbumBtn;
......
......@@ -46,7 +46,6 @@
// LibKIPI includes
#include <libkipi/interface.h>
#include <libkipi/uploadwidget.h>
#include <libkipi/imagecollection.h>
......@@ -58,7 +57,7 @@
namespace KIPIImageshackExportPlugin
{
ImageshackWidget::ImageshackWidget(QWidget* const parent, Interface* const interface, Imageshack* const imageshack)
ImageshackWidget::ImageshackWidget(QWidget* const parent, Imageshack* const imageshack)
: QWidget(parent)
{
setObjectName("ImageshackWidget");
......@@ -69,7 +68,7 @@ ImageshackWidget::ImageshackWidget(QWidget* const parent, Interface* const inter
// --------------------------------------------
m_imgList = new KIPIPlugins::KPImagesList(interface, this);
m_imgList = new KIPIPlugins::KPImagesList(this);
m_imgList->setControlButtonsPlacement(KIPIPlugins::KPImagesList::ControlButtonsBelow);
m_imgList->setAllowRAW(false);
m_imgList->loadImagesFromCurrentSelection();
......
......@@ -36,11 +36,6 @@ class QProgressBar;
class KComboBox;
class KPushButton;
namespace KIPI
{
class Interface;
}
namespace KIPIPlugins
{
class KPImagesList;
......@@ -56,7 +51,7 @@ class ImageshackWidget : public QWidget
Q_OBJECT
public:
ImageshackWidget(QWidget* const parent, KIPI::Interface* const interface, Imageshack* const imageshack);
ImageshackWidget(QWidget* const parent, Imageshack* const imageshack);
~ImageshackWidget();
KIPIPlugins::KPImagesList* imagesList() const;
......
......@@ -80,7 +80,7 @@ ImageshackWindow::ImageshackWindow(KIPI::Interface* const interface, QWidget* co
m_interface = interface;
m_imageshack = imghack;
m_widget = new ImageshackWidget(this, interface, imghack);
m_widget = new ImageshackWidget(this, imghack);
m_widget->setMinimumSize(700, 500);
setMainWidget(m_widget);
setWindowTitle(i18n("Imageshack Export"));
......
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