Commit 357517c5 authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

factoring

parent 86fb5746
......@@ -98,15 +98,7 @@ void Plugin_viewer::setup(QWidget* widget)
void Plugin_viewer::slotActivate()
{
Interface* iface = dynamic_cast<Interface*>(parent());
if ( !iface )
{
kError() << "Kipi interface is null!";
return;
}
d->widget = new ViewerWidget(iface);
d->widget = new ViewerWidget();
if ( d->widget->listOfFilesIsEmpty() )
{
......
......@@ -39,6 +39,8 @@
// Libkipi includes
#include <libkipi/imagecollection.h>
#include <libkipi/interface.h>
#include <libkipi/pluginloader.h>
// Local includes
......@@ -99,6 +101,14 @@ public:
// be the optimal way for a PentiumM 1.4G, Nvidia FX5200. For a faster setup, this might
// not be necessary anymore
zoomsize = QSize(1024, 768);
iface = 0;
PluginLoader* pl = PluginLoader::instance();
if (pl)
{
iface = pl->interface();
}
}
GLuint tex[3];
......@@ -117,13 +127,14 @@ public:
float zoomfactor_scrollwheel, zoomfactor_mousemove, zoomfactor_keyboard;
QString nullImage;
int screen_width;
Interface* iface;
};
ViewerWidget::ViewerWidget(Interface* const iface)
ViewerWidget::ViewerWidget()
: d(new ViewerWidgetPriv)
{
ImageCollection selection = iface->currentSelection();
ImageCollection album = iface->currentAlbum();
ImageCollection selection = d->iface->currentSelection();
ImageCollection album = d->iface->currentAlbum();
KUrl::List myfiles; //pics which are displayed in imageviewer
QString selectedImage; //selected pic in hostapp
......
......@@ -38,10 +38,6 @@
#include <kurl.h>
#include <kmimetype.h>
// LibKIPI includes
#include <libkipi/interface.h>
// Local includes
#include "texture.h"
......@@ -58,7 +54,7 @@ class ViewerWidget : public QGLWidget
public:
ViewerWidget(Interface* const iface);
ViewerWidget();
~ViewerWidget();
void prevImage();
......
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