Git commit 595695176a0b9c51d3d97a61ece9096710c1495f by Nate Graham, on behalf of Nicolas Fella. Committed on 02/12/2021 at 19:10. Pushed by ngraham into branch 'master'.
Drop KIPI support KIPI offers export functionality for various external services However it has been abandoned from its original authors and receives no real development any more A lot, if not all of its providers are defunct and it severly lacks UI polish Spectacle already has integration with Purpose which offers a similar (albeit theoretically reduced) functionality with a much more polished experience M +0 -1 .kde-ci.yml M +0 -5 CMakeLists.txt M +0 -1 doc/index.docbook M +0 -15 src/CMakeLists.txt M +0 -3 src/Config.h.in M +0 -80 src/Gui/ExportMenu.cpp M +0 -14 src/Gui/ExportMenu.h D +0 -56 src/KipiInterface/KSGKipiImageCollectionSelector.cpp D +0 -35 src/KipiInterface/KSGKipiImageCollectionSelector.h D +0 -44 src/KipiInterface/KSGKipiImageCollectionShared.cpp D +0 -35 src/KipiInterface/KSGKipiImageCollectionShared.h D +0 -43 src/KipiInterface/KSGKipiInfoShared.cpp D +0 -31 src/KipiInterface/KSGKipiInfoShared.h D +0 -90 src/KipiInterface/KSGKipiInterface.cpp D +0 -54 src/KipiInterface/KSGKipiInterface.h https://invent.kde.org/graphics/spectacle/commit/595695176a0b9c51d3d97a61ece9096710c1495f diff --git a/.kde-ci.yml b/.kde-ci.yml index dc93ff6..856311f 100644 --- a/.kde-ci.yml +++ b/.kde-ci.yml @@ -19,4 +19,3 @@ Dependencies: 'frameworks/kxmlgui': '@stable' 'frameworks/kwayland': '@stable' 'frameworks/purpose': '@stable' - 'graphics/libkipi': '@same' diff --git a/CMakeLists.txt b/CMakeLists.txt index 11ecd00..4843a2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,11 +69,6 @@ find_package( # optional components -find_package(KF5Kipi) -if (KF5Kipi_FOUND) - set(KIPI_FOUND 1) -endif () - find_package(KF5Purpose) if (KF5Purpose_FOUND) set(PURPOSE_FOUND 1) diff --git a/doc/index.docbook b/doc/index.docbook index 09b27ce..67808dd 100644 --- a/doc/index.docbook +++ b/doc/index.docbook @@ -253,7 +253,6 @@ <listitem> <para>Opens a drop-down menu that will allow you to directly open the screenshot with all programs that are associated with the PNG (Portable Network Graphics) &MIME; type. Depending on what programs are installed, you will be able to open and edit the snapshot in your graphics applications or viewers.</para> - <para>Furthermore, if you have the <application>KIPI Plugins</application> installed, you will be able to email your screenshots and export them directly to some social networks and websites.</para> </listitem> </varlistentry> <varlistentry> diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e3fffbd..0effd16 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -67,21 +67,6 @@ if(XCB_FOUND) ) endif() -if(KIPI_FOUND) - target_sources(spectacle PRIVATE - KipiInterface/KSGKipiInterface.cpp - KipiInterface/KSGKipiImageCollectionShared.cpp - KipiInterface/KSGKipiInfoShared.cpp - KipiInterface/KSGKipiImageCollectionSelector.cpp - KipiInterface/KSGKipiInterface.h - KipiInterface/KSGKipiImageCollectionShared.h - KipiInterface/KSGKipiInfoShared.h - KipiInterface/KSGKipiImageCollectionSelector.h - ) - - target_link_libraries(spectacle KF5::Kipi) -endif() - if(PURPOSE_FOUND) target_link_libraries(spectacle KF5::PurposeWidgets) endif() diff --git a/src/Config.h.in b/src/Config.h.in index a036491..b822d74 100644 --- a/src/Config.h.in +++ b/src/Config.h.in @@ -4,9 +4,6 @@ /* Define to 1 if we are building with XCB */ #cmakedefine XCB_FOUND 1 -/* Define to 1 if we have KIPI */ -#cmakedefine KIPI_FOUND 1 - /* Define to 1 if we have Purpose */ #cmakedefine PURPOSE_FOUND 1 diff --git a/src/Gui/ExportMenu.cpp b/src/Gui/ExportMenu.cpp index e8665ac..eabd268 100644 --- a/src/Gui/ExportMenu.cpp +++ b/src/Gui/ExportMenu.cpp @@ -13,9 +13,6 @@ #include <KLocalizedString> #include <KNotificationJobUiDelegate> #include <KStandardShortcut> -#ifdef KIPI_FOUND -#include <KIPI/Plugin> -#endif #include <QJsonArray> #include <QTimer> @@ -40,14 +37,6 @@ void ExportMenu::populateMenu() loadPurposeMenu(); #endif -#ifdef KIPI_FOUND - mKipiMenu = addMenu(i18n("More Online Services")); - mKipiMenu->addAction(i18n("Please wait...")); - mKipiMenuLoaded = false; - - connect(mKipiMenu, &QMenu::aboutToShow, this, &ExportMenu::loadKipiItems); -#endif - addSeparator(); getKServiceItems(); } @@ -107,75 +96,6 @@ void ExportMenu::getKServiceItems() addAction(openWith); } -#ifdef KIPI_FOUND -void ExportMenu::loadKipiItems() -{ - if (!mKipiMenuLoaded) { - QTimer::singleShot(500, this, &ExportMenu::getKipiItems); - mKipiMenuLoaded = true; - } -} - -void ExportMenu::getKipiItems() -{ - mKipiMenu->clear(); - - mKipiInterface = new KSGKipiInterface(this); - - KIPI::PluginLoader *loader = KIPI::PluginLoader::instance(); - if (!loader) { - // The loader needs to live at least as long as the plugins - // loaded through it, since the plugins use the loader's - // interface() call to get the KIPI interface they conform to. - // - // ASAN may complain about a leak here, because this loader - // pointer goes out of scope, but it is kept around in - // the PluginLoader's static instance() - loader = new KIPI::PluginLoader; - } - - loader->setInterface(mKipiInterface); - loader->init(); - - KIPI::PluginLoader::PluginList pluginList = loader->pluginList(); - - for (const auto &pluginInfo : std::as_const(pluginList)) { - if (!(pluginInfo->shouldLoad())) { - continue; - } - - KIPI::Plugin *plugin = pluginInfo->plugin(); - if (!(plugin)) { - qCWarning(SPECTACLE_GUI_LOG) << i18n("KIPI plugin from library %1 failed to load", pluginInfo->library()); - continue; - } - - plugin->setup(&mDummyWidget); - - const QList<QAction *> actions = plugin->actions(); - QSet<QAction *> exportActions; - - for (auto action : actions) { - KIPI::Category category = plugin->category(action); - if (category == KIPI::ExportPlugin) { - exportActions += action; - } else if (category == KIPI::ImagesPlugin && pluginInfo->library().contains(QLatin1String("kipiplugin_sendimages"))) { - exportActions += action; - } - } - - for (auto action : std::as_const(exportActions)) { - mKipiMenu->addAction(action); - } - } - - // If there are no export actions, then perhaps the kipi-plugins package is not installed. - if (mKipiMenu->isEmpty()) { - mKipiMenu->addAction(i18n("No KIPI plugins available"))->setEnabled(false); - } -} -#endif - #ifdef PURPOSE_FOUND void ExportMenu::loadPurposeMenu() { diff --git a/src/Gui/ExportMenu.h b/src/Gui/ExportMenu.h index f2eab44..426a468 100644 --- a/src/Gui/ExportMenu.h +++ b/src/Gui/ExportMenu.h @@ -12,10 +12,6 @@ #include "Config.h" #include "ExportManager.h" -#ifdef KIPI_FOUND -#include "KipiInterface/KSGKipiInterface.h" -#endif - #ifdef PURPOSE_FOUND #include <Purpose/AlternativesModel> #include <PurposeWidgets/Menu> @@ -40,16 +36,6 @@ Q_SIGNALS: private: void getKServiceItems(); -#ifdef KIPI_FOUND - void getKipiItems(); - void loadKipiItems(); - - bool mKipiMenuLoaded; - QMenu *mKipiMenu; - KSGKipiInterface *mKipiInterface; - QWidget mDummyWidget; -#endif - #ifdef PURPOSE_FOUND void loadPurposeMenu(); void loadPurposeItems(); diff --git a/src/KipiInterface/KSGKipiImageCollectionSelector.cpp b/src/KipiInterface/KSGKipiImageCollectionSelector.cpp deleted file mode 100644 index 4b8120d..0000000 --- a/src/KipiInterface/KSGKipiImageCollectionSelector.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015 Boudhayan Gupta <[email protected]> - * SPDX-FileCopyrightText: 2010 Pau Garcia i Quiles <[email protected]> - * based on code for Gwenview by - * SPDX-FileCopyrightText: 2008 Aurélien Gâteau <[email protected]> - * - * SPDX-License-Identifier: GPL-2.0-or-later - * - */ - -#include "KSGKipiImageCollectionSelector.h" -#include <KLocalizedString> -#include <QVBoxLayout> - -KSGKipiImageCollectionSelector::KSGKipiImageCollectionSelector(KIPI::Interface *interface, QWidget *parent) - : KIPI::ImageCollectionSelector(parent) - , mInterface(interface) - , mListWidget(new QListWidget(this)) -{ - const auto allAlbums = interface->allAlbums(); - for (const auto &collection : allAlbums) { - QListWidgetItem *item = new QListWidgetItem(mListWidget); - QString name = collection.name(); - int imageCount = collection.images().size(); - QString title = i18ncp("%1 is collection name, %2 is image count in collection", "%1 (%2 image)", "%1 (%2 images)", name, imageCount); - item->setText(title); - item->setData(Qt::UserRole, name); - } - connect(mListWidget, &QListWidget::currentRowChanged, this, &KIPI::ImageCollectionSelector::selectionChanged); - - QVBoxLayout *layout = new QVBoxLayout(this); - layout->addWidget(mListWidget); - layout->setContentsMargins(0, 0, 0, 0); -} - -KSGKipiImageCollectionSelector::~KSGKipiImageCollectionSelector() -{ -} - -QList<KIPI::ImageCollection> KSGKipiImageCollectionSelector::selectedImageCollections() const -{ - QListWidgetItem *item = mListWidget->currentItem(); - - QList<KIPI::ImageCollection> selectedList; - if (item) { - QString name = item->data(Qt::UserRole).toString(); - const auto allAlbums = mInterface->allAlbums(); - for (const auto &collection : allAlbums) { - if (collection.name() == name) { - selectedList.append(collection); - break; - } - } - } - return selectedList; -} diff --git a/src/KipiInterface/KSGKipiImageCollectionSelector.h b/src/KipiInterface/KSGKipiImageCollectionSelector.h deleted file mode 100644 index f5d7d04..0000000 --- a/src/KipiInterface/KSGKipiImageCollectionSelector.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015 Boudhayan Gupta <[email protected]> - * SPDX-FileCopyrightText: 2010 Pau Garcia i Quiles <[email protected]> - * based on code for Gwenview by - * SPDX-FileCopyrightText: 2008 Aurélien Gâteau <[email protected]> - * - * SPDX-License-Identifier: GPL-2.0-or-later - * - */ - -#ifndef KSGKIPIIMAGECOLLECTIONSELECTOR_H -#define KSGKIPIIMAGECOLLECTIONSELECTOR_H - -#include <QListWidget> - -#include <KIPI/ImageCollection> -#include <KIPI/ImageCollectionSelector> -#include <KIPI/Interface> - -class KSGKipiImageCollectionSelector : public KIPI::ImageCollectionSelector -{ - Q_OBJECT - -public: - explicit KSGKipiImageCollectionSelector(KIPI::Interface *interface, QWidget *parent); - ~KSGKipiImageCollectionSelector() override; - - QList<KIPI::ImageCollection> selectedImageCollections() const override; - -private: - KIPI::Interface *const mInterface; - QListWidget *const mListWidget; -}; - -#endif // KSGKIPIIMAGECOLLECTIONSELECTOR_H diff --git a/src/KipiInterface/KSGKipiImageCollectionShared.cpp b/src/KipiInterface/KSGKipiImageCollectionShared.cpp deleted file mode 100644 index 9731f0f..0000000 --- a/src/KipiInterface/KSGKipiImageCollectionShared.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015 Boudhayan Gupta <[email protected]> - * SPDX-FileCopyrightText: 2010 Pau Garcia i Quiles <[email protected]> - * Essentially a rip-off of code for Kamoso by: - * SPDX-FileCopyrightText: 2008-2009 Aleix Pol <[email protected]> - * SPDX-FileCopyrightText: 2008-2009 Alex Fiestas <[email protected]> - * - * SPDX-License-Identifier: LGPL-2.0-or-later - */ - -#include "KSGKipiImageCollectionShared.h" -#include "ExportManager.h" - -KSGKipiImageCollectionShared::KSGKipiImageCollectionShared() -{ -} -KSGKipiImageCollectionShared::~KSGKipiImageCollectionShared() -{ -} - -QString KSGKipiImageCollectionShared::name() -{ - return QStringLiteral("Spectacle"); -} -QString KSGKipiImageCollectionShared::comment() -{ - return QString(); -} -QString KSGKipiImageCollectionShared::uploadRootName() -{ - return QStringLiteral("/"); -} -QUrl KSGKipiImageCollectionShared::uploadRoot() -{ - return QUrl(uploadRootName()); -} -bool KSGKipiImageCollectionShared::isDirectory() -{ - return false; -} -QList<QUrl> KSGKipiImageCollectionShared::images() -{ - return QList<QUrl>({ExportManager::instance()->tempSave()}); -} diff --git a/src/KipiInterface/KSGKipiImageCollectionShared.h b/src/KipiInterface/KSGKipiImageCollectionShared.h deleted file mode 100644 index 79716d7..0000000 --- a/src/KipiInterface/KSGKipiImageCollectionShared.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015 Boudhayan Gupta <[email protected]> - * SPDX-FileCopyrightText: 2010 Pau Garcia i Quiles <[email protected]> - * Essentially a rip-off of code for Kamoso by: - * SPDX-FileCopyrightText: 2008-2009 Aleix Pol <[email protected]> - * SPDX-FileCopyrightText: 2008-2009 Alex Fiestas <[email protected]> - * - * SPDX-License-Identifier: LGPL-2.0-or-later - */ - -#ifndef KSGKIPIIMAGECOLLECTIONSHARED_H -#define KSGKIPIIMAGECOLLECTIONSHARED_H - -#include <QUrl> - -#include <KIPI/ImageCollectionShared> - -class KSGKipiImageCollectionShared : public KIPI::ImageCollectionShared -{ -public: - explicit KSGKipiImageCollectionShared(); - ~KSGKipiImageCollectionShared() override; - - QString name() override; - QString comment() override; - QList<QUrl> images() override; - virtual QUrl uploadRoot(); - QString uploadRootName() override; - bool isDirectory() override; - -private: - QList<QUrl> mImages; -}; - -#endif diff --git a/src/KipiInterface/KSGKipiInfoShared.cpp b/src/KipiInterface/KSGKipiInfoShared.cpp deleted file mode 100644 index 8745118..0000000 --- a/src/KipiInterface/KSGKipiInfoShared.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2010 Pau Garcia i Quiles <[email protected]> - * Essentially a rip-off of code for Kamoso by: - * SPDX-FileCopyrightText: 2008-2009 Aleix Pol <[email protected]> - * SPDX-FileCopyrightText: 2008-2009 Alex Fiestas <[email protected]> - * - * SPDX-License-Identifier: LGPL-2.0-or-later - */ - -#include "KSGKipiInfoShared.h" -#include <KLocalizedString> - -KSGKipiInfoShared::KSGKipiInfoShared(KIPI::Interface *interface, const QUrl &url) - : KIPI::ImageInfoShared(interface, url) -{ -} - -KSGKipiInfoShared::~KSGKipiInfoShared() -{ -} - -// no-op functions - -void KSGKipiInfoShared::delAttributes(const QStringList &) -{ -} -void KSGKipiInfoShared::addAttributes(const QMap<QString, QVariant> &) -{ -} -void KSGKipiInfoShared::clearAttributes() -{ -} -QMap<QString, QVariant> KSGKipiInfoShared::attributes() -{ - return QMap<QString, QVariant>(); -} -void KSGKipiInfoShared::setDescription(const QString &) -{ -} -QString KSGKipiInfoShared::description() -{ - return i18n("Taken with Spectacle"); -} diff --git a/src/KipiInterface/KSGKipiInfoShared.h b/src/KipiInterface/KSGKipiInfoShared.h deleted file mode 100644 index d2f52e9..0000000 --- a/src/KipiInterface/KSGKipiInfoShared.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015 Boudhayan Gupta <[email protected]> - * SPDX-FileCopyrightText: 2010 Pau Garcia i Quiles <[email protected]> - * Essentially a rip-off of code for Kamoso by: - * SPDX-FileCopyrightText: 2008-2009 Aleix Pol <[email protected]> - * SPDX-FileCopyrightText: 2008-2009 Alex Fiestas <[email protected]> - * - * SPDX-License-Identifier: LGPL-2.0-or-later - */ - -#ifndef KSGKIPIINFOSHARED_H -#define KSGKIPIINFOSHARED_H - -#include <KIPI/ImageInfoShared> -#include <KIPI/Interface> - -class KSGKipiInfoShared : public KIPI::ImageInfoShared -{ -public: - explicit KSGKipiInfoShared(KIPI::Interface *interface, const QUrl &url); - ~KSGKipiInfoShared() override; - - void addAttributes(const QMap<QString, QVariant> &) override; - void delAttributes(const QStringList &) override; - void clearAttributes() override; - QMap<QString, QVariant> attributes() override; - virtual void setDescription(const QString &); - virtual QString description(); -}; - -#endif diff --git a/src/KipiInterface/KSGKipiInterface.cpp b/src/KipiInterface/KSGKipiInterface.cpp deleted file mode 100644 index 76805e5..0000000 --- a/src/KipiInterface/KSGKipiInterface.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015 Boudhayan Gupta <[email protected]> - * SPDX-FileCopyrightText: 2010 Pau Garcia i Quiles <[email protected]> - * Essentially a rip-off of code for Kamoso by: - * SPDX-FileCopyrightText: 2008-2009 Aleix Pol <[email protected]> - * SPDX-FileCopyrightText: 2008-2009 Alex Fiestas <[email protected]> - * - * SPDX-License-Identifier: LGPL-2.0-or-later - */ - -#include "KSGKipiInterface.h" -#include "KSGKipiImageCollectionSelector.h" -#include "KSGKipiImageCollectionShared.h" -#include "KSGKipiInfoShared.h" - -KSGKipiInterface::KSGKipiInterface(QObject *parent) - : KIPI::Interface(parent) -{ -} - -KSGKipiInterface::~KSGKipiInterface() -{ -} - -// no-op single image handlers - -bool KSGKipiInterface::addImage(const QUrl &, QString &) -{ - return true; -} -void KSGKipiInterface::delImage(const QUrl &) -{ -} -void KSGKipiInterface::refreshImages(const QList<QUrl> &) -{ -} - -// album handlers. mostly no-op - -KIPI::ImageCollection KSGKipiInterface::currentAlbum() -{ - return KIPI::ImageCollection(new KSGKipiImageCollectionShared); -} - -KIPI::ImageCollection KSGKipiInterface::currentSelection() -{ - return currentAlbum(); -} - -QList<KIPI::ImageCollection> KSGKipiInterface::allAlbums() -{ - return QList<KIPI::ImageCollection>({currentAlbum()}); -} - -// features and info - -KIPI::ImageInfo KSGKipiInterface::info(const QUrl &url) -{ - return KIPI::ImageInfo(new KSGKipiInfoShared(this, url)); -} - -int KSGKipiInterface::features() const -{ - return KIPI::ImagesHasTime; -} - -// widgets and selectors - -KIPI::ImageCollectionSelector *KSGKipiInterface::imageCollectionSelector(QWidget *parent) -{ - return new KSGKipiImageCollectionSelector(this, parent); -} - -KIPI::UploadWidget *KSGKipiInterface::uploadWidget(QWidget *parent) -{ - return new KIPI::UploadWidget(parent); -} - -// deal with api breakage - -KIPI::FileReadWriteLock *KSGKipiInterface::createReadWriteLock(const QUrl &url) const -{ - Q_UNUSED(url); - return nullptr; -} - -KIPI::MetadataProcessor *KSGKipiInterface::createMetadataProcessor() const -{ - return nullptr; -} diff --git a/src/KipiInterface/KSGKipiInterface.h b/src/KipiInterface/KSGKipiInterface.h deleted file mode 100644 index 910be0f..0000000 --- a/src/KipiInterface/KSGKipiInterface.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015 Boudhayan Gupta <[email protected]> - * SPDX-FileCopyrightText: 2010 Pau Garcia i Quiles <[email protected]> - * Essentially a rip-off of code for Kamoso by: - * SPDX-FileCopyrightText: 2008-2009 Aleix Pol <[email protected]> - * SPDX-FileCopyrightText: 2008-2009 Alex Fiestas <[email protected]> - * - * SPDX-License-Identifier: LGPL-2.0-or-later - */ - -#ifndef KSGKIPIINTERFACE_H -#define KSGKIPIINTERFACE_H - -#include <QList> -#include <QWidget> - -#include <KIPI/ImageCollection> -#include <KIPI/ImageCollectionSelector> -#include <KIPI/ImageInfo> -#include <KIPI/Interface> -#include <KIPI/PluginLoader> -#include <KIPI/UploadWidget> - -class KSGKipiInterface : public KIPI::Interface -{ - Q_OBJECT - -public: - explicit KSGKipiInterface(QObject *parent = nullptr); - ~KSGKipiInterface() override; - - bool addImage(const QUrl &, QString &err) override; - void delImage(const QUrl &) override; - void refreshImages(const QList<QUrl> &urls) override; - - KIPI::FileReadWriteLock *createReadWriteLock(const QUrl &url) const override; - KIPI::MetadataProcessor *createMetadataProcessor() const override; - - KIPI::ImageCollection currentAlbum() override; - KIPI::ImageCollection currentSelection() override; - QList<KIPI::ImageCollection> allAlbums() override; - - KIPI::ImageCollectionSelector *imageCollectionSelector(QWidget *parent) override; - KIPI::UploadWidget *uploadWidget(QWidget *parent) override; - - int features() const override; - KIPI::ImageInfo info(const QUrl &) override; - -private: - QObject *mScreenGenie = nullptr; - KIPI::PluginLoader *mPluginLoader = nullptr; -}; - -#endif // KSGKIPIINTERFACE_H
