[krita] plugins/dockers: Remove the Reference Images Docker

Boudewijn Rempt null at kde.org
Mon Mar 5 13:52:42 UTC 2018


Git commit 2a6c5569c5f32d88ed82b053d308f4acae3c9308 by Boudewijn Rempt.
Committed on 05/03/2018 at 13:50.
Pushed by rempt into branch 'master'.

Remove the Reference Images Docker

This will be replaced in 4.1 with the Reference Images Tool. We're
already removing it because it figures as the top reason for crashes
in our statistics, caused by Qt's qimageio plugins crashing too
easily on broken files in the default Pictures folders.

CCMAIL:kimageshop at kde.org

M  +0    -1    plugins/dockers/CMakeLists.txt
D  +0    -11   plugins/dockers/imagedocker/CMakeLists.txt
D  +0    -114  plugins/dockers/imagedocker/forms/wdgImageViewPopup.ui
D  +0    -270  plugins/dockers/imagedocker/forms/wdgimagedocker.ui
D  +0    -199  plugins/dockers/imagedocker/image_strip_scene.cpp
D  +0    -125  plugins/dockers/imagedocker/image_strip_scene.h
D  +0    -264  plugins/dockers/imagedocker/image_view.cpp
D  +0    -94   plugins/dockers/imagedocker/image_view.h
D  +0    -61   plugins/dockers/imagedocker/imagedocker.cpp
D  +0    -31   plugins/dockers/imagedocker/imagedocker.h
D  +0    -593  plugins/dockers/imagedocker/imagedocker_dock.cpp
D  +0    -116  plugins/dockers/imagedocker/imagedocker_dock.h
D  +0    -9    plugins/dockers/imagedocker/kritaimagedocker.json

https://commits.kde.org/krita/2a6c5569c5f32d88ed82b053d308f4acae3c9308

diff --git a/plugins/dockers/CMakeLists.txt b/plugins/dockers/CMakeLists.txt
index 0840f5c6be0..d9cd652821e 100644
--- a/plugins/dockers/CMakeLists.txt
+++ b/plugins/dockers/CMakeLists.txt
@@ -6,7 +6,6 @@ add_subdirectory(advancedcolorselector)
 add_subdirectory(presetdocker)
 add_subdirectory(historydocker)
 add_subdirectory(channeldocker)
-add_subdirectory(imagedocker)
 add_subdirectory(artisticcolorselector)
 add_subdirectory(tasksetdocker)
 add_subdirectory(compositiondocker)
diff --git a/plugins/dockers/imagedocker/CMakeLists.txt b/plugins/dockers/imagedocker/CMakeLists.txt
deleted file mode 100644
index 128c936f4be..00000000000
--- a/plugins/dockers/imagedocker/CMakeLists.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-set(kritaimagedocker_SOURCES
-    imagedocker.cpp
-    imagedocker_dock.cpp
-    image_strip_scene.cpp
-    image_view.cpp
-)
-
-ki18n_wrap_ui(kritaimagedocker_SOURCES forms/wdgimagedocker.ui forms/wdgImageViewPopup.ui)
-add_library(kritaimagedocker MODULE ${kritaimagedocker_SOURCES})
-target_link_libraries(kritaimagedocker kritaui)
-install(TARGETS kritaimagedocker DESTINATION ${KRITA_PLUGIN_INSTALL_DIR})
diff --git a/plugins/dockers/imagedocker/forms/wdgImageViewPopup.ui b/plugins/dockers/imagedocker/forms/wdgImageViewPopup.ui
deleted file mode 100644
index 96de1b19701..00000000000
--- a/plugins/dockers/imagedocker/forms/wdgImageViewPopup.ui
+++ /dev/null
@@ -1,114 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>wdgImageViewPopup</class>
- <widget class="QWidget" name="wdgImageViewPopup">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>340</width>
-    <height>59</height>
-   </rect>
-  </property>
-  <layout class="QVBoxLayout" name="verticalLayout">
-   <item>
-    <layout class="QHBoxLayout" name="horizontalLayout_2">
-     <item>
-      <widget class="QPushButton" name="bnZoomFit">
-       <property name="text">
-        <string>Fit</string>
-       </property>
-       <property name="checkable">
-        <bool>false</bool>
-       </property>
-       <property name="autoDefault">
-        <bool>false</bool>
-       </property>
-       <property name="flat">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="bnZoomAdjust">
-       <property name="text">
-        <string comment="Zoom mode to fit by only one dimension - width or height">Adjust</string>
-       </property>
-       <property name="checkable">
-        <bool>false</bool>
-       </property>
-       <property name="flat">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="bnZoom100">
-       <property name="text">
-        <string>100%</string>
-       </property>
-       <property name="checkable">
-        <bool>false</bool>
-       </property>
-       <property name="flat">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="bnZoom75">
-       <property name="text">
-        <string>75%</string>
-       </property>
-       <property name="checkable">
-        <bool>false</bool>
-       </property>
-       <property name="flat">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="bnZoom50">
-       <property name="text">
-        <string>50%</string>
-       </property>
-       <property name="checkable">
-        <bool>false</bool>
-       </property>
-       <property name="flat">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="bnZoom25">
-       <property name="text">
-        <string>25%</string>
-       </property>
-       <property name="checkable">
-        <bool>false</bool>
-       </property>
-       <property name="flat">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <widget class="KisSliderSpinBox" name="zoomSlider"/>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>KisSliderSpinBox</class>
-   <extends>QWidget</extends>
-   <header location="global">kis_slider_spin_box.h</header>
-   <container>1</container>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
diff --git a/plugins/dockers/imagedocker/forms/wdgimagedocker.ui b/plugins/dockers/imagedocker/forms/wdgimagedocker.ui
deleted file mode 100644
index 81a7e4d57fb..00000000000
--- a/plugins/dockers/imagedocker/forms/wdgimagedocker.ui
+++ /dev/null
@@ -1,270 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>wdgImageDocker</class>
- <widget class="QWidget" name="wdgImageDocker">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>399</width>
-    <height>300</height>
-   </rect>
-  </property>
-  <layout class="QVBoxLayout" name="verticalLayout_2">
-   <property name="margin">
-    <number>0</number>
-   </property>
-   <item>
-    <widget class="QTabWidget" name="tabWidget">
-     <property name="tabPosition">
-      <enum>QTabWidget::North</enum>
-     </property>
-     <property name="tabShape">
-      <enum>QTabWidget::Rounded</enum>
-     </property>
-     <property name="currentIndex">
-      <number>0</number>
-     </property>
-     <property name="elideMode">
-      <enum>Qt::ElideNone</enum>
-     </property>
-     <property name="usesScrollButtons">
-      <bool>true</bool>
-     </property>
-     <property name="documentMode">
-      <bool>true</bool>
-     </property>
-     <property name="tabsClosable">
-      <bool>false</bool>
-     </property>
-     <widget class="QWidget" name="imgBrowserTab">
-      <attribute name="title">
-       <string>Browse</string>
-      </attribute>
-      <layout class="QVBoxLayout" name="verticalLayout_3">
-       <property name="spacing">
-        <number>0</number>
-       </property>
-       <property name="margin">
-        <number>0</number>
-       </property>
-       <item>
-        <widget class="QSplitter" name="splitter">
-         <property name="orientation">
-          <enum>Qt::Vertical</enum>
-         </property>
-         <widget class="QWidget" name="verticalLayoutWidget">
-          <layout class="QVBoxLayout" name="verticalLayout">
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout">
-             <item>
-              <widget class="QComboBox" name="cmbPath">
-               <property name="editable">
-                <bool>false</bool>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QToolButton" name="bnBack">
-               <property name="text">
-                <string>Back</string>
-               </property>
-               <property name="autoRaise">
-                <bool>true</bool>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QToolButton" name="bnUp">
-               <property name="text">
-                <string>Up</string>
-               </property>
-               <property name="autoRaise">
-                <bool>true</bool>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QToolButton" name="bnHome">
-               <property name="text">
-                <string>Home</string>
-               </property>
-               <property name="autoRaise">
-                <bool>true</bool>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <widget class="QTreeView" name="treeView">
-             <property name="verticalScrollBarPolicy">
-              <enum>Qt::ScrollBarAsNeeded</enum>
-             </property>
-             <property name="horizontalScrollBarPolicy">
-              <enum>Qt::ScrollBarAlwaysOff</enum>
-             </property>
-             <property name="alternatingRowColors">
-              <bool>true</bool>
-             </property>
-             <property name="rootIsDecorated">
-              <bool>true</bool>
-             </property>
-             <property name="uniformRowHeights">
-              <bool>true</bool>
-             </property>
-             <property name="itemsExpandable">
-              <bool>true</bool>
-             </property>
-             <property name="expandsOnDoubleClick">
-              <bool>false</bool>
-             </property>
-             <attribute name="headerVisible">
-              <bool>true</bool>
-             </attribute>
-             <attribute name="headerCascadingSectionResizes">
-              <bool>false</bool>
-             </attribute>
-             <attribute name="headerDefaultSectionSize">
-              <number>200</number>
-             </attribute>
-             <attribute name="headerHighlightSections">
-              <bool>false</bool>
-             </attribute>
-             <attribute name="headerStretchLastSection">
-              <bool>false</bool>
-             </attribute>
-            </widget>
-           </item>
-          </layout>
-         </widget>
-         <widget class="QGraphicsView" name="thumbView">
-          <property name="minimumSize">
-           <size>
-            <width>50</width>
-            <height>110</height>
-           </size>
-          </property>
-          <property name="maximumSize">
-           <size>
-            <width>16777215</width>
-            <height>110</height>
-           </size>
-          </property>
-          <property name="verticalScrollBarPolicy">
-           <enum>Qt::ScrollBarAlwaysOff</enum>
-          </property>
-         </widget>
-        </widget>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="imgViewTab">
-      <attribute name="title">
-       <string>Images</string>
-      </attribute>
-      <layout class="QVBoxLayout" name="verticalLayout_4" stretch="0,1">
-       <property name="spacing">
-        <number>0</number>
-       </property>
-       <property name="margin">
-        <number>0</number>
-       </property>
-       <item>
-        <layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,1,0,0,0">
-         <item>
-          <widget class="KisPopupButton" name="bnPopup">
-           <property name="enabled">
-            <bool>false</bool>
-           </property>
-           <property name="text">
-            <string/>
-           </property>
-           <property name="flat">
-            <bool>false</bool>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QComboBox" name="cmbImg">
-           <property name="frame">
-            <bool>true</bool>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QToolButton" name="bnImgPrev">
-           <property name="enabled">
-            <bool>false</bool>
-           </property>
-           <property name="text">
-            <string>Prev</string>
-           </property>
-           <property name="autoRaise">
-            <bool>true</bool>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QToolButton" name="bnImgNext">
-           <property name="enabled">
-            <bool>false</bool>
-           </property>
-           <property name="text">
-            <string>Next</string>
-           </property>
-           <property name="autoRaise">
-            <bool>true</bool>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QToolButton" name="bnImgClose">
-           <property name="enabled">
-            <bool>false</bool>
-           </property>
-           <property name="text">
-            <string>Close</string>
-           </property>
-           <property name="autoRaise">
-            <bool>true</bool>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="ImageView" name="imgView">
-         <property name="frameShape">
-          <enum>QFrame::StyledPanel</enum>
-         </property>
-         <property name="frameShadow">
-          <enum>QFrame::Plain</enum>
-         </property>
-         <property name="lineWidth">
-          <number>0</number>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </widget>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>ImageView</class>
-   <extends>QFrame</extends>
-   <header>image_view.h</header>
-   <container>1</container>
-  </customwidget>
-  <customwidget>
-   <class>KisPopupButton</class>
-   <extends>QPushButton</extends>
-   <header location="global">kis_popup_button.h</header>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
diff --git a/plugins/dockers/imagedocker/image_strip_scene.cpp b/plugins/dockers/imagedocker/image_strip_scene.cpp
deleted file mode 100644
index 534db68aeda..00000000000
--- a/plugins/dockers/imagedocker/image_strip_scene.cpp
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- *  Copyright (c) 2011 Silvio Heinrich <plassy at web.de>
- *
- *  This library is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; version 2.1 of the License.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "image_strip_scene.h"
-
-#include <kis_icon.h>
-
-#include <QApplication>
-#include <QDir>
-#include <QPainter>
-#include <QHash>
-#include <QGraphicsSceneMouseEvent>
-#include <QGraphicsLinearLayout>
-#include <QGraphicsWidget>
-#include <QMutexLocker>
-#include <kis_debug.h>
-
-/////////////////////////////////////////////////////////////////////////////////////////////
-// ------------- ImageLoader ---------------------------------------------------------- //
-
-ImageLoader::ImageLoader(float size)
-    : m_size(size)
-    , m_run(true)
-{
-    connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(stopExecution()));
-}
-
-void ImageLoader::run()
-{
-    typedef QHash<ImageItem*,Data>::iterator Iterator;
-
-    for (Iterator data = m_data.begin(); data != m_data.end() && m_run; ++data) {
-        QImage img = QImage(data->path);
-        if (!img.isNull()) {
-            data->image = img.scaled(m_size, m_size, Qt::KeepAspectRatio, Qt::SmoothTransformation);
-        }
-        //dbgKrita << "Loaded" << data->path;
-        data->isLoaded = true;
-        emit sigItemContentChanged(data.key());
-    }
-}
-
-void ImageLoader::stopExecution()
-{
-    m_run = false;
-}
-
-
-/////////////////////////////////////////////////////////////////////////////////////////////
-// ------------- ImageItem ------------------------------------------------------------ //
-
-void ImageItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
-{
-    Q_UNUSED(option);
-    Q_UNUSED(widget);
-
-    if (m_loader->isImageLoaded(this)) {
-        QImage  image = m_loader->getImage(this);
-
-        if (!image.isNull()) {
-            QPointF offset((m_size-image.width()) / 2.0, (m_size-image.height()) / 2.0);
-            painter->drawImage(offset, image);
-        }
-        else {
-            QIcon   icon = KisIconUtils::loadIcon("edit-delete");
-            QRect   rect = boundingRect().toRect();
-            QPixmap img  = icon.pixmap(rect.size());
-            painter->drawPixmap(rect, img, img.rect());
-        }
-    }
-    else {
-        QIcon   icon = KisIconUtils::loadIcon("folder-pictures");
-        QRect   rect = boundingRect().toRect();
-        QPixmap img  = icon.pixmap(rect.size());
-        painter->drawPixmap(rect, img, img.rect());
-    }
-
-    if (isSelected()) {
-        painter->setCompositionMode(QPainter::CompositionMode_HardLight);
-        painter->setOpacity(0.50);
-        painter->fillRect(boundingRect().toRect(), palette().color(QPalette::Active, QPalette::Highlight));
-        painter->setCompositionMode(QPainter::CompositionMode_SourceOver);
-        QPen pen(palette().color(QPalette::Active, QPalette::Highlight), 3);
-        painter->setPen(pen);
-    }
-
-    painter->drawRect(boundingRect());
-}
-
-QSizeF ImageItem::sizeHint(Qt::SizeHint /*which*/, const QSizeF& /*constraint*/) const
-{
-    return QSizeF(m_size, m_size);
-}
-
-
-/////////////////////////////////////////////////////////////////////////////////////////////
-// ------------- ImageStripScene ------------------------------------------------------ //
-
-ImageStripScene::ImageStripScene():
-    m_imgSize(80)
-  , m_loader(0)
-{
-}
-
-ImageStripScene::~ImageStripScene()
-{
-    delete m_loader;
-}
-
-bool ImageStripScene::setCurrentDirectory(const QString& path)
-{
-    m_path = path;
-    QMutexLocker locker(&m_mutex);
-    QDir         directory(path);
-    QImageReader reader;
-
-    if (directory.exists()) {
-        clear();
-
-        if (m_loader) {
-            m_loader->disconnect(this);
-            m_loader->stopExecution();
-
-            if (!m_loader->wait(500)) {
-                m_loader->terminate();
-                m_loader->wait();
-            }
-        }
-
-        delete m_loader;
-
-        m_numItems = 0;
-        m_loader   = new ImageLoader(m_imgSize);
-        connect(m_loader, SIGNAL(sigItemContentChanged(ImageItem*)), SLOT(slotItemContentChanged(ImageItem*)));
-
-        QStringList            files  = directory.entryList(QDir::Files);
-        QGraphicsLinearLayout* layout = new QGraphicsLinearLayout();
-
-        for (QStringList::iterator name=files.begin(); name!=files.end(); ++name) {
-            QString path = directory.absoluteFilePath(*name);
-            QString fileExtension = QFileInfo(path).suffix();
-
-            if (!fileExtension.compare("DNG", Qt::CaseInsensitive)) {
-                warnKrita << "WARNING: Qt is known to crash when trying to open a DNG file. Skip it";
-                continue;
-            }
-
-            reader.setFileName(path);
-
-            if(reader.canRead()) {
-                ImageItem* item = new ImageItem(m_imgSize, path, m_loader);
-                m_loader->addPath(item, path);
-                layout->addItem(item);
-                ++m_numItems;
-            }
-        }
-
-        QGraphicsWidget* widget = new QGraphicsWidget();
-        widget->setLayout(layout);
-        widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
-
-        addItem(widget);
-        setSceneRect(widget->boundingRect());
-
-        QTimer::singleShot(0, m_loader, SLOT(start()));
-        return true;
-    }
-
-    return false;
-}
-
-void ImageStripScene::slotItemContentChanged(ImageItem* item)
-{
-    QMutexLocker locker(&m_mutex);
-    item->update();
-}
-
-void ImageStripScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event)
-{
-    ImageItem* item = static_cast<ImageItem*>(itemAt(event->scenePos().x(), event->scenePos().y(), QTransform()));
-
-    if (item)
-        emit sigImageActivated(item->path());
-}
-
diff --git a/plugins/dockers/imagedocker/image_strip_scene.h b/plugins/dockers/imagedocker/image_strip_scene.h
deleted file mode 100644
index 399f248e2ef..00000000000
--- a/plugins/dockers/imagedocker/image_strip_scene.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- *  Copyright (c) 2011 Silvio Heinrich <plassy at web.de>
- *
- *  This library is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; version 2.1 of the License.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef H_IMAGE_STRIP_SCENE_H_
-#define H_IMAGE_STRIP_SCENE_H_
-
-#include <QGraphicsScene>
-#include <QGraphicsWidget>
-#include <QImageReader>
-#include <QThread>
-#include <QAtomicInt>
-#include <QMutex>
-#include <QTimer>
-
-class ImageItem;
-
-class ImageLoader: public QThread
-{
-    Q_OBJECT
-
-    struct Data
-    {
-        Data() { }
-        Data(const QString& p):
-            path(p), isLoaded(false) { };
-        Data(const Data& d):
-            image(d.image), path(d.path), isLoaded(d.isLoaded) { };
-
-        QImage     image;
-        QString    path;
-        QAtomicInt isLoaded;
-    };
-
-Q_SIGNALS:
-    void sigItemContentChanged(ImageItem* item);
-
-public:
-    ImageLoader(float size);
-
-    void addPath(ImageItem* item, const QString& path) {
-        m_data[item] = Data(path);
-    }
-
-    bool isImageLoaded(ImageItem* item) const {
-        return m_data[item].isLoaded != 0;
-    }
-
-    QImage getImage(ImageItem* item) const {
-        return m_data[item].image;
-    }
-
-    void run() override;
-
-public Q_SLOTS:
-
-    void stopExecution();
-
-private:
-    float                     m_size;
-    QHash<ImageItem*,Data> m_data;
-    QAtomicInt                m_run;
-};
-
-class ImageItem: public QGraphicsWidget
-{
-public:
-    ImageItem(float size, const QString& path, ImageLoader* loader):
-        m_size(size), m_loader(loader), m_path(path)
-    {
-        setFlag(QGraphicsItem::ItemIsSelectable, true);
-    }
-
-    const QString& path() const { return m_path; }
-
-    QSizeF sizeHint(Qt::SizeHint which, const QSizeF& constraint=QSizeF()) const override;
-    void   paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget=0) override;
-
-private:
-    float m_size;
-    ImageLoader* m_loader;
-    QString m_path;
-};
-
-class ImageStripScene: public QGraphicsScene
-{
-    Q_OBJECT
-
-public:
-    ImageStripScene();
-    ~ImageStripScene() override;
-    bool setCurrentDirectory(const QString& path);
-    QString currentPath() { return m_path; }
-Q_SIGNALS:
-    void sigImageActivated(const QString& path);
-
-private:
-    void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event) override;
-
-private Q_SLOTS:
-    void slotItemContentChanged(ImageItem* item);
-
-private:
-    float  m_imgSize;
-    quint32 m_numItems;
-    ImageLoader* m_loader;
-    QMutex m_mutex;
-    QString m_path;
-    QTimer m_singleShot;
-};
-
-#endif // H_IMAGE_STRIP_SCENE_H_
diff --git a/plugins/dockers/imagedocker/image_view.cpp b/plugins/dockers/imagedocker/image_view.cpp
deleted file mode 100644
index 889896532e6..00000000000
--- a/plugins/dockers/imagedocker/image_view.cpp
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- *  Copyright (c) 2011 Silvio Heinrich <plassy at web.de>
- *
- *  This library is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; version 2.1 of the License.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "image_view.h"
-#include <kis_cursor.h>
-
-#include <QPaintEvent>
-#include <QMouseEvent>
-#include <QResizeEvent>
-#include <QPainter>
-#include <QScrollBar>
-
-//////////////////////////////////////////////////////////////////////////////
-// -------- ImageViewport ---------------------------------------------- //
-
-ImageViewport::ImageViewport():
-    m_scale(1.0f),
-    m_mousePressed(false),
-    m_rubberBand(QRubberBand::Rectangle, this)
-{
-    setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
-    setCursor(KisCursor::pickerCursor());
-}
-
-void ImageViewport::paintEvent(QPaintEvent* event)
-{
-    Q_UNUSED(event);
-    QPainter painter(this);
-    painter.drawPixmap(imageRect().topLeft(), m_cachedPixmap);
-}
-
-void ImageViewport::setImage(const QPixmap& pixmap, qreal scale)
-{
-    m_scale        = scale;
-    m_pixmap       = pixmap;
-    m_cachedPixmap = pixmap.scaled(imageRect().size(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
-}
-
-void ImageViewport::setScale(qreal scale)
-{
-    if (!m_pixmap.isNull() && !qFuzzyCompare(scale, m_scale)) {
-        m_scale        = scale;
-        m_cachedPixmap = m_pixmap.scaled(imageRect().size(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
-    }
-}
-
-QColor ImageViewport::imageColor(const QPoint& pos) const
-{
-    return m_cachedPixmap.copy(pos.x(), pos.y(), 1, 1).toImage().pixel(0,0);
-}
-
-QSize ImageViewport::sizeHint() const
-{
-    return imageRect().size();
-}
-
-QRect ImageViewport::imageRect() const
-{
-    int w = int(m_scale * m_pixmap.width());
-    int h = int(m_scale * m_pixmap.height());
-    int x = (width()  - w) / 2;
-    int y = (height() - h) / 2;
-    return QRect(x, y, w, h);
-}
-
-QSize ImageViewport::imageSize() const
-{
-    return m_pixmap.size();
-}
-
-void ImageViewport::mousePressEvent(QMouseEvent* event)
-{
-    m_mousePressed = true;
-    m_selection    = QRect(event->pos(), QSize(0,0));
-    m_rubberBand.setGeometry(m_selection);
-    m_rubberBand.show();
-}
-
-void ImageViewport::mouseMoveEvent(QMouseEvent* event)
-{
-    if(m_mousePressed) {
-        setCursor(KisCursor::arrowCursor());
-        QPoint size = event->pos() - m_selection.topLeft();
-        m_selection.setSize(QSize(size.x(), size.y()));
-        m_rubberBand.setGeometry(m_selection.normalized());
-    }
-}
-
-void ImageViewport::mouseReleaseEvent(QMouseEvent* event)
-{
-    m_selection = m_selection.normalized();
-    setCursor(KisCursor::pickerCursor());
-
-    if(m_selection.width() > 5 && m_selection.height() > 5) {
-        QRect imgRect = imageRect();
-        QRect rect    = imgRect.intersected(m_selection).translated(-imgRect.topLeft());
-        emit sigRegionSelected(rect);
-    }
-    else if(imageRect().contains(event->pos(), true)) {
-        emit sigImageClicked(event->pos() - imageRect().topLeft());
-    }
-
-    m_mousePressed = false;
-    m_rubberBand.hide();
-}
-
-
-//////////////////////////////////////////////////////////////////////////////
-// -------- ImageView -------------------------------------------------- //
-
-ImageView::ImageView(QWidget* parent):
-    QScrollArea(parent),
-    m_viewMode(VIEW_MODE_FIT),
-    m_minScale(0.05),
-    m_maxScale(5.00)
-{
-    m_imgViewport = new ImageViewport();
-    QScrollArea::setWidgetResizable(true);
-    QScrollArea::setWidget(m_imgViewport);
-
-    connect(m_imgViewport, SIGNAL(sigImageClicked(const QPoint&)) , SLOT(slotImageClicked(const QPoint&)));
-    connect(m_imgViewport, SIGNAL(sigRegionSelected(const QRect&)), SLOT(slotRegionSelected(const QRect&)));
-}
-
-void ImageView::setPixmap(const QPixmap& pixmap, int viewMode, qreal scale)
-{
-    m_viewMode = viewMode;
-    m_scale    = calcScale(scale, viewMode, pixmap.size());
-    m_imgViewport->setImage(pixmap, m_scale);
-    m_imgViewport->setMinimumSize(m_imgViewport->sizeHint());
-    m_imgViewport->adjustSize();
-
-    emit sigViewModeChanged(m_viewMode, m_scale);
-}
-
-void ImageView::setViewMode(int viewMode, qreal scale)
-{
-    m_viewMode = viewMode;
-    m_scale    = calcScale(scale, viewMode, m_imgViewport->imageSize());
-    m_imgViewport->setScale(m_scale);
-    m_imgViewport->setMinimumSize(m_imgViewport->sizeHint());
-    m_imgViewport->adjustSize();
-
-    emit sigViewModeChanged(m_viewMode, m_scale);
-}
-
-void ImageView::setScrollPos(const QPoint& pos)
-{
-    horizontalScrollBar()->setValue(pos.x());
-    verticalScrollBar()->setValue(pos.y());
-}
-
-QPoint ImageView::getScrollPos() const
-{
-    return QPoint(horizontalScrollBar()->value(), verticalScrollBar()->value());
-}
-
-qreal ImageView::getScale() const
-{
-    return m_scale;
-}
-
-qreal ImageView::calcScale(qreal scale, int viewMode, const QSizeF& imgSize) const
-{
-    QSizeF viewSize  = viewportSize(viewMode == VIEW_MODE_ADJUST);
-    qreal  wdgAspect = viewSize.width() / viewSize.height();
-    qreal  imgAspect = imgSize.width() / imgSize.height();
-
-    switch(viewMode)
-    {
-    case VIEW_MODE_FIT:
-        if(wdgAspect > imgAspect) { scale = viewSize.height() / imgSize.height(); }
-        else                      { scale = viewSize.width()  / imgSize.width();  }
-        break;
-
-    case VIEW_MODE_ADJUST:
-        if(wdgAspect > imgAspect) { scale = viewSize.width()  / imgSize.width();  }
-        else                      { scale = viewSize.height() / imgSize.height(); }
-        break;
-    }
-
-    return qBound(m_minScale, scale, m_maxScale);
-}
-
-QSize ImageView::viewportSize(bool withScrollbars) const
-{
-    int width  = viewport()->width();
-    int height = viewport()->height();
-    int xAdd   = verticalScrollBar()->width();
-    int yAdd   = horizontalScrollBar()->height();
-
-    if(withScrollbars) {
-        width  -= verticalScrollBar()->isVisible()   ? 0 : xAdd;
-        height -= horizontalScrollBar()->isVisible() ? 0 : yAdd;
-    }
-    else {
-        width  += verticalScrollBar()->isVisible()   ? xAdd : 0;
-        height += horizontalScrollBar()->isVisible() ? yAdd : 0;
-    }
-
-    return QSize(width, height);
-}
-
-void ImageView::slotImageClicked(const QPoint& pos)
-{
-    emit sigColorSelected(m_imgViewport->imageColor(pos));
-}
-
-void ImageView::slotRegionSelected(const QRect& rect)
-{
-    QSizeF viewSize = viewportSize(true);
-    QRectF selRect  = rect;
-
-    selRect = QRectF(selRect.topLeft() / m_scale, selRect.size() / m_scale);
-
-    qreal wdgAspect = viewSize.width() / viewSize.height();
-    qreal selAspect = selRect.width() / selRect.height();
-
-    if(wdgAspect > selAspect)
-        m_scale = viewSize.height() / selRect.height();
-    else
-        m_scale = viewSize.width() / selRect.width();
-
-    m_scale    = qBound(m_minScale, m_scale, m_maxScale);
-    m_viewMode = VIEW_MODE_FREE;
-    m_imgViewport->setScale(m_scale);
-    m_imgViewport->setMinimumSize(m_imgViewport->sizeHint());
-    m_imgViewport->adjustSize();
-
-    selRect = QRectF(selRect.topLeft() * m_scale, selRect.size() * m_scale);
-
-    QSize  offset    = ((viewSize - selRect.size()) / 2.0).toSize();
-    QPoint scrollPos = selRect.topLeft().toPoint() - QPoint(offset.width(), offset.height());
-    setScrollPos(scrollPos);
-
-    emit sigViewModeChanged(m_viewMode, m_scale);
-}
-
-void ImageView::resizeEvent(QResizeEvent* event)
-{
-    QScrollArea::resizeEvent(event);
-
-    m_scale = calcScale(m_scale, m_viewMode, m_imgViewport->imageSize());
-    m_imgViewport->setScale(m_scale);
-    m_imgViewport->setMinimumSize(m_imgViewport->sizeHint());
-    m_imgViewport->adjustSize();
-
-    emit sigViewModeChanged(m_viewMode, m_scale);
-}
-
diff --git a/plugins/dockers/imagedocker/image_view.h b/plugins/dockers/imagedocker/image_view.h
deleted file mode 100644
index 820edcd8ce0..00000000000
--- a/plugins/dockers/imagedocker/image_view.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- *  Copyright (c) 2011 Silvio Heinrich <plassy at web.de>
- *
- *  This library is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; version 2.1 of the License.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef H_KIS_IMAGE_VIEW_H
-#define H_KIS_IMAGE_VIEW_H
-
-#include <QScrollArea>
-#include <QPixmap>
-#include <QRubberBand>
-
-class ImageViewport: public QWidget
-{
-    Q_OBJECT
-    
-public:
-    ImageViewport();
-    
-    QRect  imageRect() const;
-    QColor imageColor(const QPoint& pos) const;
-    QSize  imageSize() const;
-    
-    void setImage(const QPixmap& pixmap, qreal scale);
-    void setScale(qreal scale);
-    
-    QSize sizeHint() const override;
-    void paintEvent(QPaintEvent* event) override;
-    void mousePressEvent(QMouseEvent* event) override;
-    void mouseMoveEvent(QMouseEvent* event) override;
-    void mouseReleaseEvent(QMouseEvent* event) override;
-    
-private:
-    qreal       m_scale;
-    QPixmap     m_pixmap;
-    QPixmap     m_cachedPixmap;
-    bool        m_mousePressed;
-    QRubberBand m_rubberBand;
-    QRect       m_selection;
-    
-Q_SIGNALS:
-    void sigImageClicked(const QPoint& pos);
-    void sigRegionSelected(const QRect& rect);
-};
-
-class ImageView: public QScrollArea
-{
-    Q_OBJECT
-    
-public:
-    enum { VIEW_MODE_FREE=0, VIEW_MODE_ADJUST=1, VIEW_MODE_FIT=2 };
-    
-    ImageView(QWidget* parent=0);
-    
-    void setPixmap(const QPixmap& pixmap, int viewMode=VIEW_MODE_FIT, qreal scale=1.0);
-    void setViewMode(int viewMode, qreal scale=1.0);
-    void setScrollPos(const QPoint& pos);
-    QPoint getScrollPos() const;
-    qreal getScale() const;
-    
-Q_SIGNALS:
-    void sigColorSelected(const QColor& color);
-    void sigViewModeChanged(int viewMode, qreal scale);
-    
-private Q_SLOTS:
-    void slotImageClicked(const QPoint& pos);
-    void slotRegionSelected(const QRect& rect);
-    
-private:
-    qreal calcScale(qreal scale, int viewMode, const QSizeF& imgSize) const;
-    QSize viewportSize(bool withScrollbars) const;
-    void resizeEvent(QResizeEvent* event) override;
-    
-private:
-    qreal             m_scale;
-    int               m_viewMode;
-    qreal             m_minScale;
-    qreal             m_maxScale;
-    ImageViewport* m_imgViewport;
-};
-
-#endif // H_KIS_IMAGE_VIEW_H
diff --git a/plugins/dockers/imagedocker/imagedocker.cpp b/plugins/dockers/imagedocker/imagedocker.cpp
deleted file mode 100644
index 4ef37333453..00000000000
--- a/plugins/dockers/imagedocker/imagedocker.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- *  Copyright (c) 2011 Silvio Heinrich <plassy at web.de>
- *
- *  This library is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; version 2.1 of the License.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "imagedocker.h"
-#include "imagedocker_dock.h"
-
-#include <kpluginfactory.h>
-#include <klocalizedstring.h>
-#include <KoDockFactoryBase.h>
-#include <KoDockRegistry.h>
-
-K_PLUGIN_FACTORY_WITH_JSON(ImageDockerPluginFactory, "kritaimagedocker.json", registerPlugin<ImageDockerPlugin>();)
-
-class ImageDockerDockFactory: public KoDockFactoryBase {
-public:
-    ImageDockerDockFactory() { }
-
-    QString id() const override
-    {
-        return QString("ImageDocker");
-    }
-
-    virtual Qt::DockWidgetArea defaultDockWidgetArea() const
-    {
-        return Qt::RightDockWidgetArea;
-    }
-
-    QDockWidget* createDockWidget() override
-    {
-        ImageDockerDock* dockWidget = new ImageDockerDock();
-        dockWidget->setObjectName(id());
-        return dockWidget;
-    }
-
-    DockPosition defaultDockPosition() const override
-    {
-        return DockMinimized;
-    }
-};
-
-ImageDockerPlugin::ImageDockerPlugin(QObject* parent, const QVariantList&):
-    QObject(parent)
-{
-    KoDockRegistry::instance()->add(new ImageDockerDockFactory());
-}
-
-#include "imagedocker.moc"
\ No newline at end of file
diff --git a/plugins/dockers/imagedocker/imagedocker.h b/plugins/dockers/imagedocker/imagedocker.h
deleted file mode 100644
index 76bf719ac98..00000000000
--- a/plugins/dockers/imagedocker/imagedocker.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *  Copyright (c) 2011 Silvio Heinrich <plassy at web.de>
- *
- *  This library is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; version 2.1 of the License.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef H_IMAGEDOCKER_H_
-#define H_IMAGEDOCKER_H_
-
-#include <QObject>
-#include <QVariantList>
-
-class ImageDockerPlugin: public QObject
-{
-    Q_OBJECT
-public:
-    ImageDockerPlugin(QObject* parent, const QVariantList&);
-};
-
-#endif // H_IMAGEDOCKER_H_
diff --git a/plugins/dockers/imagedocker/imagedocker_dock.cpp b/plugins/dockers/imagedocker/imagedocker_dock.cpp
deleted file mode 100644
index 7060aaba4f0..00000000000
--- a/plugins/dockers/imagedocker/imagedocker_dock.cpp
+++ /dev/null
@@ -1,593 +0,0 @@
-/*
- *  Copyright (c) 2011 Silvio Heinrich <plassy at web.de>
- *
- *  This library is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; version 2.1 of the License.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include <kconfig.h>
-#include <kconfiggroup.h>
-#include <ksharedconfig.h>
-
-#include "imagedocker_dock.h"
-#include "image_strip_scene.h"
-#include "image_view.h"
-
-#include <klocalizedstring.h>
-#include <KoCanvasResourceManager.h>
-#include <KoCanvasBase.h>
-#include <KoColorSpaceRegistry.h>
-#include <KoColor.h>
-#include <kis_icon.h>
-
-#include <QFileSystemModel>
-#include <QImageReader>
-#include <QSortFilterProxyModel>
-#include <QFileInfo>
-#include <QMouseEvent>
-#include <QDir>
-#include <QLineEdit>
-#include <QLabel>
-#include <QAbstractListModel>
-#include <QButtonGroup>
-#include <QStandardPaths>
-#include <QTemporaryFile>
-#include <QMimeData>
-
-#include "ui_wdgimagedocker.h"
-#include "ui_wdgImageViewPopup.h"
-
-///////////////////////////////////////////////////////////////////////////////
-// --------- ImageFilter --------------------------------------------------- //
-
-class ImageFilter: public QSortFilterProxyModel
-{
-    bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const override {
-        QFileSystemModel* model = static_cast<QFileSystemModel*>(sourceModel());
-        QModelIndex       index = sourceModel()->index(source_row, 0, source_parent);
-
-        if(model->isDir(index))
-            return true;
-
-        QString ext = model->fileInfo(index).suffix().toLower();
-
-        if(s_supportedImageFormats.isEmpty()) {
-            s_supportedImageFormats = QImageReader::supportedImageFormats();
-        }
-
-        //QImageReader::supportedImageFormats return a list with mixed-case ByteArrays so
-        //iterate over it manually to make it possible to do toLower().
-        Q_FOREACH (const QByteArray& format, s_supportedImageFormats) {
-            if(format.toLower() == ext.toUtf8()) {
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    bool filterAcceptsColumn(int source_column, const QModelIndex& source_parent) const override {
-        Q_UNUSED(source_parent);
-        return source_column == 0;
-    }
-
-    static QList<QByteArray> s_supportedImageFormats;
-};
-
-QList<QByteArray> ImageFilter::s_supportedImageFormats;
-
-///////////////////////////////////////////////////////////////////////////////
-// --------- ImageListModel ------------------------------------------------ //
-
-class ImageListModel: public QAbstractListModel
-{
-    struct Data
-    {
-        QPixmap icon;
-        QString text;
-        qint64  id;
-    };
-
-public:
-    void addImage(const QPixmap& pixmap, const QString& text, qint64 id) {
-        Data data;
-        data.icon = pixmap.scaled(70, 70, Qt::KeepAspectRatio, Qt::SmoothTransformation);
-        data.text = text;
-        data.id   = id;
-        emit layoutAboutToBeChanged();
-        m_data.push_back(data);
-        emit layoutChanged();
-    }
-
-    qint64 imageID(int index) const { return m_data[index].id; }
-
-    void removeImage(qint64 id) {
-        typedef QList<Data>::iterator Iterator;
-
-        for(Iterator data=m_data.begin(); data!=m_data.end(); ++data) {
-            if(data->id == id) {
-                emit layoutAboutToBeChanged();
-                m_data.erase(data);
-                emit layoutChanged();
-                return;
-            }
-        }
-    }
-
-    int indexFromID(qint64 id) {
-        for(int i=0; i<m_data.size(); ++i) {
-            if(m_data[i].id == id)
-                return i;
-        }
-        return -1;
-    }
-
-    int rowCount(const QModelIndex& parent=QModelIndex()) const override {
-        Q_UNUSED(parent);
-        return m_data.size();
-    }
-
-    QVariant data(const QModelIndex& index, int role=Qt::DisplayRole) const override {
-        if(index.isValid() && index.row() < m_data.size()) {
-            switch(role)
-            {
-            case Qt::DisplayRole:
-                return m_data[index.row()].text;
-            case Qt::DecorationRole:
-                return m_data[index.row()].icon;
-            }
-        }
-        return QVariant();
-    }
-
-private:
-    QList<Data> m_data;
-};
-
-
-///////////////////////////////////////////////////////////////////////////////
-// --------- ImageDockerUI ------------------------------------------------- //
-
-struct ImageDockerUI: public QWidget, public Ui_wdgImageDocker
-{
-    ImageDockerUI() {
-        setupUi(this);
-    }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// --------- PopupWidgetUI ------------------------------------------------- //
-
-struct PopupWidgetUI: public QWidget, public Ui_wdgImageViewPopup
-{
-    PopupWidgetUI() {
-        setupUi(this);
-    }
-};
-
-
-///////////////////////////////////////////////////////////////////////////////
-// --------- ImageDockerDock ----------------------------------------------- //
-
-ImageDockerDock::ImageDockerDock():
-    QDockWidget(i18n("Reference Images")),
-    m_canvas(0),
-    m_currImageID(-1)
-{
-    m_ui           = new ImageDockerUI();
-    m_popupUi      = new PopupWidgetUI();
-    m_zoomButtons  = new QButtonGroup();
-    m_imgListModel = new ImageListModel();
-    m_imageStripScene   = new ImageStripScene();
-    m_model        = new QFileSystemModel();
-    m_proxyModel   = new ImageFilter();
-    m_proxyModel->setSourceModel(m_model);
-    m_proxyModel->setDynamicSortFilter(true);
-
-    m_ui->bnBack->setIcon(KisIconUtils::loadIcon("arrow-left"));
-    m_ui->bnUp->setIcon(KisIconUtils::loadIcon("arrow-up"));
-    m_ui->bnHome->setIcon(KisIconUtils::loadIcon("go-home"));
-    m_ui->bnImgPrev->setIcon(KisIconUtils::loadIcon("arrow-left"));
-    m_ui->bnImgNext->setIcon(KisIconUtils::loadIcon("arrow-right"));
-    m_ui->bnImgClose->setIcon(KisIconUtils::loadIcon("window-close"));
-    m_ui->thumbView->setScene(m_imageStripScene);
-    m_ui->treeView->setModel(m_proxyModel);
-    m_ui->cmbImg->setModel(m_imgListModel);
-    m_ui->bnPopup->setIcon(KisIconUtils::loadIcon("zoom-original"));
-    m_ui->bnPopup->setPopupWidget(m_popupUi);
-
-    m_popupUi->zoomSlider->setRange(5, 500);
-    m_popupUi->zoomSlider->setValue(100);
-
-    m_zoomButtons->addButton(m_popupUi->bnZoomFit   , ImageView::VIEW_MODE_FIT);
-    m_zoomButtons->addButton(m_popupUi->bnZoomAdjust, ImageView::VIEW_MODE_ADJUST);
-    m_zoomButtons->addButton(m_popupUi->bnZoom25    , 25);
-    m_zoomButtons->addButton(m_popupUi->bnZoom50    , 50);
-    m_zoomButtons->addButton(m_popupUi->bnZoom75    , 75);
-    m_zoomButtons->addButton(m_popupUi->bnZoom100   , 100);
-
-    installEventFilter(this);
-
-    m_ui->cmbPath->addItem(KisIconUtils::loadIcon("folder-pictures"), QStandardPaths::writableLocation(QStandardPaths::PicturesLocation));
-    m_ui->cmbPath->addItem(KisIconUtils::loadIcon("folder-documents"), QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));
-    m_ui->cmbPath->addItem(KisIconUtils::loadIcon("go-home"), QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
-
-    Q_FOREACH (const QFileInfo &info, QDir::drives()) {
-        m_ui->cmbPath->addItem(KisIconUtils::loadIcon("drive-harddisk"), info.absolutePath());
-    }
-
-    connect(m_ui->cmbPath, SIGNAL(activated(const QString&)), SLOT(slotChangeRoot(const QString&)));
-
-    connect(m_ui->treeView           , SIGNAL(doubleClicked(const QModelIndex&))      , SLOT(slotItemDoubleClicked(const QModelIndex&)));
-    connect(m_ui->bnBack             , SIGNAL(clicked(bool))                          , SLOT(slotBackButtonClicked()));
-    connect(m_ui->bnHome             , SIGNAL(clicked(bool))                          , SLOT(slotHomeButtonClicked()));
-    connect(m_ui->bnUp               , SIGNAL(clicked(bool))                          , SLOT(slotUpButtonClicked()));
-    connect(m_imageStripScene             , SIGNAL(sigImageActivated(const QString&))      , SLOT(slotOpenImage(QString)));
-    connect(m_ui->bnImgNext          , SIGNAL(clicked(bool))                          , SLOT(slotNextImage()));
-    connect(m_ui->bnImgPrev          , SIGNAL(clicked(bool))                          , SLOT(slotPrevImage()));
-    connect(m_ui->bnImgClose         , SIGNAL(clicked(bool))                          , SLOT(slotCloseCurrentImage()));
-    connect(m_ui->cmbImg             , SIGNAL(activated(int))                         , SLOT(slotImageChoosenFromComboBox(int)));
-    connect(m_ui->imgView            , SIGNAL(sigColorSelected(const QColor&))        , SLOT(slotColorSelected(const QColor)));
-    connect(m_ui->imgView            , SIGNAL(sigViewModeChanged(int, qreal))         , SLOT(slotViewModeChanged(int, qreal)));
-    connect(m_popupUi->zoomSlider    , SIGNAL(valueChanged(int))                      , SLOT(slotZoomChanged(int)));
-    connect(m_zoomButtons            , SIGNAL(buttonClicked(int))                     , SLOT(slotZoomChanged(int)));
-    connect(m_zoomButtons            , SIGNAL(buttonClicked(int))                     , SLOT(slotCloseZoomPopup()));
-
-    setWidget(m_ui);
-
-    setAcceptDrops(true);
-}
-
-ImageDockerDock::~ImageDockerDock()
-{
-    saveConfigState();
-
-    delete m_proxyModel;
-    delete m_model;
-    delete m_imageStripScene;
-    delete m_imgListModel;
-    delete m_zoomButtons;
-
-    qDeleteAll(m_temporaryFiles);
-}
-
-void ImageDockerDock::dragEnterEvent(QDragEnterEvent *event)
-{
-    event->setAccepted(event->mimeData()->hasImage() ||
-                       event->mimeData()->hasUrls());
-}
-
-void ImageDockerDock::dropEvent(QDropEvent *event)
-{
-    QImage image;
-    if (event->mimeData()->hasImage()) {
-        image = qvariant_cast<QImage>(event->mimeData()->imageData());
-    }
-
-    if (!image.isNull()) {
-        QTemporaryFile *file = new QTemporaryFile(QDir::tempPath () + QDir::separator() + "krita_reference_dnd_XXXXXX.png");
-        m_temporaryFiles.append(file);
-
-        file->open();
-        image.save(file, "PNG");
-        file->close();
-
-        slotOpenImage(file->fileName());
-    } else if (event->mimeData()->hasUrls()) {
-        QList<QUrl> urls = event->mimeData()->urls();
-
-        Q_FOREACH (const QUrl &url, urls) {
-            QString path = url.path();
-            QFileInfo info(path);
-
-            if (info.exists() &&
-                !QImageReader::imageFormat(path).isEmpty()) {
-
-                slotOpenImage(path);
-            }
-        }
-    }
-}
-
-void ImageDockerDock::showEvent(QShowEvent *)
-{
-    loadConfigState();
-}
-
-void ImageDockerDock::hideEvent(QHideEvent *event)
-{
-    saveConfigState();
-}
-
-void ImageDockerDock::setCanvas(KoCanvasBase* canvas)
-{
-    // Intentionally not disabled if there's no canvas
-
-    // "Every connection you make emits a signal, so duplicate connections emit two signals"
-    if(m_canvas) {
-        m_canvas->disconnectCanvasObserver(this);
-    }
-    m_canvas = canvas;
-}
-
-void ImageDockerDock::addCurrentPathToHistory()
-{
-    m_history.push_back(m_model->filePath(m_proxyModel->mapToSource(m_ui->treeView->rootIndex())));
-}
-
-void ImageDockerDock::updatePath(const QString& path)
-{
-    m_ui->bnBack->setDisabled(m_history.empty());
-    m_imageStripScene->setCurrentDirectory(path);
-}
-
-qint64 ImageDockerDock::generateImageID() const
-{
-    static qint64 id = 0;
-    return ++id;
-}
-
-void ImageDockerDock::setCurrentImage(qint64 imageID)
-{
-    if(m_imgInfoMap.contains(m_currImageID))
-        m_imgInfoMap[m_currImageID].scrollPos = m_ui->imgView->getScrollPos();
-
-    m_ui->bnImgClose->setDisabled(imageID < 0);
-    m_ui->bnPopup->setDisabled(imageID < 0);
-
-    if(imageID < 0) {
-        m_currImageID = -1;
-        m_ui->imgView->setPixmap(QPixmap());
-    }
-    else if(m_imgInfoMap.contains(imageID)) {
-        ImageInfoIter info = m_imgInfoMap.find(imageID);
-
-        m_ui->imgView->blockSignals(true);
-        m_ui->imgView->setPixmap(info->pixmap);
-        setZoom(*info);
-        m_ui->imgView->blockSignals(false);
-
-        m_ui->bnImgPrev->setDisabled(info == m_imgInfoMap.begin());
-        m_ui->bnImgNext->setDisabled((info+1) == m_imgInfoMap.end());
-
-        m_ui->cmbImg->blockSignals(true);
-        m_ui->cmbImg->setCurrentIndex(m_imgListModel->indexFromID(imageID));
-        m_ui->cmbImg->blockSignals(false);
-
-        m_currImageID = imageID;
-    }
-}
-
-void ImageDockerDock::setZoom(const ImageInfo& info)
-{
-    m_ui->imgView->setViewMode(info.viewMode, info.scale);
-    m_ui->imgView->setScrollPos(info.scrollPos);
-
-    int zoom = qRound(m_ui->imgView->getScale() * 100.0f);
-
-    m_popupUi->zoomSlider->blockSignals(true);
-    m_popupUi->zoomSlider->setValue(zoom);
-    m_popupUi->zoomSlider->blockSignals(false);
-}
-
-void ImageDockerDock::saveConfigState()
-{
-    const QString lastUsedDirectory = m_model->filePath(m_proxyModel->mapToSource(m_ui->treeView->rootIndex()));
-
-    KConfigGroup cfg =  KSharedConfig::openConfig()->group("referenceImageDocker");
-    cfg.writeEntry("lastUsedDirectory", lastUsedDirectory);
-}
-
-void ImageDockerDock::loadConfigState()
-{
-    const QString defaultLocation = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
-
-    KConfigGroup cfg =  KSharedConfig::openConfig()->group("referenceImageDocker");
-    QString lastUsedDirectory = cfg.readEntry("lastUsedDirectory", defaultLocation);
-
-    if (!QFileInfo(lastUsedDirectory).exists()) {
-        lastUsedDirectory = defaultLocation;
-    }
-
-    m_model->setRootPath(lastUsedDirectory);
-    m_ui->treeView->setRootIndex(m_proxyModel->mapFromSource(m_model->index(lastUsedDirectory)));
-    updatePath(lastUsedDirectory);
-}
-
-
-// ------------ slots ------------------------------------------------- //
-
-void ImageDockerDock::slotItemDoubleClicked(const QModelIndex& index)
-{
-    QModelIndex mappedIndex = m_proxyModel->mapToSource(index);
-    mappedIndex = m_model->index(mappedIndex.row(), 0, mappedIndex.parent());
-    QString path(m_model->filePath(mappedIndex));
-
-    if(m_model->isDir(mappedIndex)) {
-        addCurrentPathToHistory();
-        updatePath(path);
-        m_ui->treeView->setRootIndex(m_proxyModel->mapFromSource(mappedIndex));
-    }
-    else slotOpenImage(path);
-}
-
-void ImageDockerDock::slotBackButtonClicked()
-{
-    if(!m_history.empty()) {
-        QString     path  = m_history.last();
-        QModelIndex index = m_proxyModel->mapFromSource(m_model->index(path));
-        m_ui->treeView->setRootIndex(index);
-        m_history.pop_back();
-        updatePath(path);
-    }
-}
-
-void ImageDockerDock::slotHomeButtonClicked()
-{
-    addCurrentPathToHistory();
-    QModelIndex index = m_proxyModel->mapFromSource(m_model->index(QDir::homePath()));
-    m_ui->treeView->setRootIndex(index);
-    updatePath(QDir::homePath());
-}
-
-void ImageDockerDock::slotUpButtonClicked()
-{
-    addCurrentPathToHistory();
-
-    QModelIndex index = m_proxyModel->mapToSource(m_ui->treeView->rootIndex());
-    QDir        dir(m_model->filePath(index));
-    dir.makeAbsolute();
-
-    if(dir.cdUp()) {
-        index = m_proxyModel->mapFromSource(m_model->index(dir.path()));
-        m_ui->treeView->setRootIndex(index);
-        updatePath(dir.path());
-    }
-}
-
-void ImageDockerDock::slotOpenImage(const QString& path)
-{
-    QPixmap pixmap(path);
-
-    if(!pixmap.isNull()) {
-        QFileInfo fileInfo(path);
-        ImageInfo imgInfo;
-        imgInfo.id        = generateImageID();
-        imgInfo.name      = fileInfo.fileName();
-        imgInfo.path      = fileInfo.absoluteFilePath();
-        imgInfo.viewMode  = ImageView::VIEW_MODE_FIT;
-        imgInfo.scale     = 1.0f;
-        imgInfo.pixmap    = pixmap;
-        imgInfo.scrollPos = QPoint(0, 0);
-
-        m_imgInfoMap[imgInfo.id] = imgInfo;
-        m_imgListModel->addImage(imgInfo.pixmap, imgInfo.name, imgInfo.id);
-        setCurrentImage(imgInfo.id);
-        m_ui->tabWidget->setCurrentIndex(1);
-    }
-}
-
-void ImageDockerDock::slotCloseCurrentImage()
-{
-    ImageInfoIter info = m_imgInfoMap.find(m_currImageID);
-
-    if(info != m_imgInfoMap.end()) {
-        ImageInfoIter next = info + 1;
-        ImageInfoIter prev = info - 1;
-        qint64        id   = -1;
-
-        if(next != m_imgInfoMap.end())
-            id = next->id;
-        else if(info != m_imgInfoMap.begin())
-            id = prev->id;
-
-        m_imgListModel->removeImage(info->id);
-        m_imgInfoMap.erase(info);
-        setCurrentImage(id);
-
-        if(id < 0)
-            m_ui->tabWidget->setCurrentIndex(0);
-    }
-}
-
-void ImageDockerDock::slotNextImage()
-{
-    ImageInfoIter info = m_imgInfoMap.find(m_currImageID);
-
-    if(info != m_imgInfoMap.end()) {
-        ++info;
-        if(info != m_imgInfoMap.end())
-            setCurrentImage(info->id);
-    }
-}
-
-void ImageDockerDock::slotPrevImage()
-{
-    ImageInfoIter info = m_imgInfoMap.find(m_currImageID);
-
-    if(info != m_imgInfoMap.end() && info != m_imgInfoMap.begin()) {
-        --info;
-        setCurrentImage(info->id);
-    }
-}
-
-void ImageDockerDock::slotImageChoosenFromComboBox(int index)
-{
-    setCurrentImage(m_imgListModel->imageID(index));
-}
-
-void ImageDockerDock::slotZoomChanged(int zoom)
-{
-    if(isImageLoaded()) {
-        ImageInfoIter info = m_imgInfoMap.find(m_currImageID);
-
-        switch(zoom)
-        {
-        case ImageView::VIEW_MODE_FIT:
-        case ImageView::VIEW_MODE_ADJUST:
-            info->viewMode = zoom;
-            break;
-
-        default:
-            info->viewMode = ImageView::VIEW_MODE_FREE;
-            info->scale    = float(zoom) / 100.0f;
-            break;
-        }
-
-        setZoom(*info);
-    }
-}
-
-void ImageDockerDock::slotColorSelected(const QColor& color)
-{
-    if (m_canvas) {
-        m_canvas->resourceManager()->setForegroundColor(KoColor(color, KoColorSpaceRegistry::instance()->rgb8()));
-    }
-}
-
-void ImageDockerDock::slotViewModeChanged(int viewMode, qreal scale)
-{
-    if(isImageLoaded()) {
-        m_imgInfoMap[m_currImageID].viewMode = viewMode;
-        m_imgInfoMap[m_currImageID].scale    = scale;
-
-        int zoom = qRound(scale * 100.0);
-
-        m_popupUi->zoomSlider->blockSignals(true);
-        m_popupUi->zoomSlider->setValue(zoom);
-        m_popupUi->zoomSlider->blockSignals(false);
-    }
-}
-
-void ImageDockerDock::slotCloseZoomPopup()
-{
-    m_ui->bnPopup->hidePopupWidget();
-}
-
-void ImageDockerDock::slotChangeRoot(const QString &path)
-{
-    m_model->setRootPath(path);
-    m_ui->treeView->setRootIndex(m_proxyModel->mapFromSource(m_model->index(path)));
-    updatePath(path);
-}
-
-bool ImageDockerDock::eventFilter(QObject *obj, QEvent *event)
-{
-    Q_UNUSED(obj);
-
-    if (event->type() == QEvent::Resize) {
-        m_ui->treeView->setColumnWidth(0, width());
-        return true;
-    }
-    return false;
-}
diff --git a/plugins/dockers/imagedocker/imagedocker_dock.h b/plugins/dockers/imagedocker/imagedocker_dock.h
deleted file mode 100644
index e1d7685de7e..00000000000
--- a/plugins/dockers/imagedocker/imagedocker_dock.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- *  Copyright (c) 2011 Silvio Heinrich <plassy at web.de>
- *
- *  This library is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; version 2.1 of the License.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef H_IMAGEDOCKER_DOCK_H_
-#define H_IMAGEDOCKER_DOCK_H_
-
-#include <QPointer>
-#include <QDockWidget>
-#include <KoCanvasObserverBase.h>
-#include <QStringList>
-#include <QPixmap>
-#include <QMap>
-
-#include <KoCanvasBase.h>
-
-class QModelIndex;
-class QFileSystemModel;
-class QButtonGroup;
-class ImageFilter;
-class ImageStripScene;
-class ImageListModel;
-class QTemporaryFile;
-struct ImageDockerUI;
-struct PopupWidgetUI;
-
-class ImageDockerDock: public QDockWidget, public KoCanvasObserverBase
-{
-    Q_OBJECT
-    
-    struct ImageInfo
-    {
-        qint64  id;
-        int     viewMode;
-        QString path;
-        QString name;
-        float   scale;
-        QPixmap pixmap;
-        QPoint  scrollPos;
-    };
-    
-    typedef QMap<qint64,ImageInfo>::iterator ImageInfoIter;
-    
-public:
-    ImageDockerDock();
-    ~ImageDockerDock() override;
-    QString observerName() override { return "ImageDockerDock"; }
-    void setCanvas(KoCanvasBase* canvas) override;
-    void unsetCanvas() override {
-        m_canvas = 0; // Intentionally not disabled if there's no canvas
-    }
-    
-private Q_SLOTS:
-    void slotItemDoubleClicked(const QModelIndex& index);
-    void slotBackButtonClicked();
-    void slotUpButtonClicked();
-    void slotHomeButtonClicked();
-    void slotCloseCurrentImage();
-    void slotNextImage();
-    void slotPrevImage();
-    void slotOpenImage(const QString& path);
-    void slotImageChoosenFromComboBox(int index);
-    void slotZoomChanged(int zoom);
-    void slotColorSelected(const QColor& color);
-    void slotViewModeChanged(int viewMode, qreal scale);
-    void slotCloseZoomPopup();
-    void slotChangeRoot(const QString& path);
-    
-protected:
-    bool eventFilter(QObject *obj, QEvent *event) override;
-
-    void dragEnterEvent(QDragEnterEvent *event) override;
-    void dropEvent(QDropEvent *event) override;
-    void showEvent(QShowEvent *) override;
-    void hideEvent(QHideEvent *event) override;
- private:
-    void addCurrentPathToHistory();
-    void updatePath(const QString& path);
-    qint64 generateImageID() const;
-    void setCurrentImage(qint64 imageID);
-    bool isImageLoaded() const { return m_currImageID != -1; }
-    void setZoom(const ImageInfo& info);
-    
-    void saveConfigState();
-    void loadConfigState();
-
-
-private:
-    QFileSystemModel*      m_model;
-    QButtonGroup*          m_zoomButtons;
-    QPointer<KoCanvasBase> m_canvas;
-    ImageFilter*           m_proxyModel;
-    ImageListModel*        m_imgListModel;
-    QStringList            m_history;
-    ImageStripScene*       m_imageStripScene;
-    ImageDockerUI*         m_ui;
-    PopupWidgetUI*         m_popupUi;
-    QMap<qint64,ImageInfo> m_imgInfoMap;
-    qint64                 m_currImageID;
-    QList<QTemporaryFile*> m_temporaryFiles;
-};
-
-#endif // H_IMAGEDOCKER_DOCK_H_
diff --git a/plugins/dockers/imagedocker/kritaimagedocker.json b/plugins/dockers/imagedocker/kritaimagedocker.json
deleted file mode 100644
index 5e5e92f93cf..00000000000
--- a/plugins/dockers/imagedocker/kritaimagedocker.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
-    "Id": "Image Docker",
-    "Type": "Service",
-    "X-KDE-Library": "kritaimagedocker",
-    "X-KDE-ServiceTypes": [
-        "Krita/Dock"
-    ],
-    "X-Krita-Version": "28"
-}


More information about the kimageshop mailing list