Commit 721047cb authored by Alexander Lohnau's avatar Alexander Lohnau 💬

Remove WallpaperPlugin

It was used to show the KNS dialog to download
wallpaper plugins. But nowadays we can and should
just use the QML components provided by KNewStuff directly.

All occurency in plasma-desktop, plasma-bigscreen and
plasma-nano have open MRs to port away from it (or just remove the import).
parent 3daeb0f3
......@@ -8,7 +8,6 @@ endif (KF5TextEditor_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-shellprivate.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-shellprivate.h)
set(plasmashellprivateplugin_SRCS
wallpaperplugin/wallpaperplugin.cpp
widgetexplorer/kcategorizeditemsviewmodels.cpp
widgetexplorer/plasmaappletitemmodel.cpp
widgetexplorer/openwidgetassistant.cpp
......@@ -44,7 +43,7 @@ endif (KF5TextEditor_FOUND)
install(TARGETS plasmashellprivateplugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/private/shell)
install(FILES
wallpaperplugin/wallpaperplugin.knsrc
wallpaperplugin.knsrc
widgetexplorer/plasmoids.knsrc
DESTINATION ${KDE_INSTALL_KNSRCDIR}
)
......
......@@ -25,7 +25,6 @@
#include <QQmlEngine>
#include "wallpaperplugin/wallpaperplugin.h"
#include "widgetexplorer/widgetexplorer.h"
#include <Plasma/Containment>
......@@ -38,7 +37,6 @@ void PlasmaShellPrivatePlugin::registerTypes(const char *uri)
Q_ASSERT(uri == QLatin1String("org.kde.plasma.private.shell"));
qmlRegisterType<Plasma::Containment>();
qmlRegisterType<WallpaperPlugin>(uri, 2, 0, "WallpaperPlugin");
qmlRegisterType<WidgetExplorer>(uri, 2, 0, "WidgetExplorer");
#if KF5TextEditor_FOUND
qmlRegisterType<InteractiveConsoleItem>(uri, 2, 0, "InteractiveConsoleWindow");
......
/*
* Copyright (C) 2018 Chris Holland <zrenfire@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library/Lesser General Public License
* version 2, or (at your option) any later version, as published by the
* Free Software Foundation
*
* This program 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 General Public License for more details
*
* You should have received a copy of the GNU Library/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 "wallpaperplugin.h"
#include <QQuickItem>
#include <QQuickWindow>
#include <KNewStuff3/KNS3/DownloadDialog>
#include <klocalizedstring.h>
#include <Plasma/Theme>
WallpaperPlugin::WallpaperPlugin(QObject *parent)
: QObject(parent)
{
}
WallpaperPlugin::~WallpaperPlugin()
{
}
void WallpaperPlugin::getNewWallpaperPlugin(QQuickItem *ctx)
{
if (!m_newStuffDialog) {
m_newStuffDialog = new KNS3::DownloadDialog( QString::fromLatin1("wallpaperplugin.knsrc") );
m_newStuffDialog->setTitle(i18n("Download Wallpaper Plugins"));
}
if (ctx && ctx->window()) {
m_newStuffDialog->setWindowModality(Qt::WindowModal);
m_newStuffDialog->winId(); // so it creates the windowHandle();
m_newStuffDialog->windowHandle()->setTransientParent(ctx->window());
}
m_newStuffDialog->show();
}
/*
* Copyright (C) 2018 Chris Holland <zrenfire@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library/Lesser General Public License
* version 2, or (at your option) any later version, as published by the
* Free Software Foundation
*
* This program 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 General Public License for more details
*
* You should have received a copy of the GNU Library/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 WALLPAPERPLUGIN_H
#define WALLPAPERPLUGIN_H
#include <QObject>
#include <QPointer>
class QQuickItem;
namespace KNS3 {
class DownloadDialog;
}
class WallpaperPlugin : public QObject
{
Q_OBJECT
public:
explicit WallpaperPlugin(QObject* parent = nullptr);
~WallpaperPlugin() override;
Q_INVOKABLE void getNewWallpaperPlugin(QQuickItem *ctx = nullptr);
private:
QPointer<KNS3::DownloadDialog> m_newStuffDialog;
};
#endif
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