OSDN Git Service

kill plasma remote support with fire
authorIvailo Monev <xakepa10@gmail.com>
Wed, 3 Dec 2014 23:30:33 +0000 (23:30 +0000)
committerIvailo Monev <xakepa10@gmail.com>
Wed, 3 Dec 2014 23:30:33 +0000 (23:30 +0000)
plasma/desktop/shell/dbus/org.kde.plasma.App.xml
plasma/desktop/shell/plasmaapp.cpp
plasma/desktop/shell/plasmaapp.h
plasma/generic/tools/CMakeLists.txt
plasma/generic/tools/plasma-remote-helper/CMakeLists.txt [deleted file]
plasma/generic/tools/plasma-remote-helper/Messages.sh [deleted file]
plasma/generic/tools/plasma-remote-helper/main.cpp [deleted file]

index 6bf4062..aca3eae 100644 (file)
@@ -36,9 +36,6 @@
     </method>
     <method name="toggleActivityManager">
     </method>
-    <method name="addRemotePlasmoid">
-      <arg name="location" type="s" direction="in"/>
-    </method>
     <method name="supportInformation">
       <arg type="s" direction="out"/>
     </method>
index fe7b2d6..43c365e 100644 (file)
@@ -59,7 +59,6 @@
 
 #include <Plasma/AbstractToolBox>
 #include <Plasma/AccessAppletJob>
-#include <Plasma/AccessManager>
 #include <Plasma/AuthorizationManager>
 #include <Plasma/Containment>
 #include <Plasma/Context>
@@ -255,17 +254,6 @@ PlasmaApp::PlasmaApp()
     KGlobal::setAllowQuit(true);
     KGlobal::ref();
 
-    connect(m_mapper, SIGNAL(mapped(QString)),
-            this, SLOT(addRemotePlasmoid(QString)));
-    connect(Plasma::AccessManager::self(),
-            SIGNAL(finished(Plasma::AccessAppletJob*)),
-            this, SLOT(plasmoidAccessFinished(Plasma::AccessAppletJob*)));
-    connect(Plasma::AccessManager::self(),
-            SIGNAL(remoteAppletAnnounced(Plasma::PackageMetadata)),
-            this, SLOT(remotePlasmoidAdded(Plasma::PackageMetadata)));
-
-    Plasma::AuthorizationManager::self()->setAuthorizationPolicy(Plasma::AuthorizationManager::PinPairing);
-
     QTimer::singleShot(0, this, SLOT(setupDesktop()));
     kDebug() << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "plasma app ctor end" << "(line:" << __LINE__ << ")";
 }
@@ -1378,71 +1366,12 @@ void PlasmaApp::panelRemoved(QObject *panel)
     m_panels.removeAll((PanelView *)panel);
 }
 
-void PlasmaApp::remotePlasmoidAdded(Plasma::PackageMetadata metadata)
-{
-    //kDebug();
-    if (m_desktops.isEmpty()) {
-        return;
-    }
-
-    if (m_corona->immutability() == Plasma::SystemImmutable) {
-        kDebug() << "Corona is system locked";
-        return;
-    }
-
-    // the notification ptr is automatically delete when the notification is closed
-    KNotification *notification = new KNotification("newplasmoid", m_desktops.at(0));
-    notification->setText(i18n("A new widget has become available on the network:<br><b>%1</b> - <i>%2</i>",
-                               metadata.name(), metadata.description()));
-
-    // setup widget icon
-    if (!metadata.icon().isEmpty()) {
-        notification->setPixmap(KIcon(metadata.icon()).pixmap(IconSize(KIconLoader::Desktop)));
-    }
-
-    // locked, but the user is able to unlock
-    if (m_corona->immutability() == Plasma::UserImmutable) {
-        m_unlockCorona = true;
-        notification->setActions(QStringList(i18n("Unlock and add to current activity")));
-    } else {
-        // immutability == Plasma::Mutable
-        notification->setActions(QStringList(i18n("Add to current activity")));
-    }
-
-    m_mapper->setMapping(notification, metadata.remoteLocation().prettyUrl());
-    connect(notification, SIGNAL(action1Activated()), m_mapper, SLOT(map()));
-
-    kDebug() << "firing notification";
-    notification->sendEvent();
-}
-
-void PlasmaApp::addRemotePlasmoid(const QString &location)
-{
-    if (m_unlockCorona) {
-        m_unlockCorona = false;
-        m_corona->setImmutability(Plasma::Mutable);
-    }
-
-    Plasma::AccessManager::self()->accessRemoteApplet(KUrl(location));
-}
 
 QString PlasmaApp::supportInformation() const
 {
     return SupportInformation::generateSupportInformation(m_corona);
 }
 
-void PlasmaApp::plasmoidAccessFinished(Plasma::AccessAppletJob *job)
-{
-    if (m_desktops.isEmpty()) {
-        return;
-    }
-
-    Plasma::Containment *c = m_desktops.at(0)->containment();
-    if (c) {
-        kDebug() << "adding applet";
-        c->addApplet(job->applet(), QPointF(-1, -1), false);
-    }
-}
 
 void PlasmaApp::createActivity(const QString &plugin)
 {
index 6614a06..f37efcf 100644 (file)
@@ -127,8 +127,6 @@ public Q_SLOTS:
 
     void toggleActivityManager();
 
-    void addRemotePlasmoid(const QString &location);
-
     QString supportInformation() const;
 
 protected:
@@ -157,8 +155,6 @@ private Q_SLOTS:
     void configureContainment(Plasma::Containment*);
     void checkVirtualDesktopViews(int numDesktops);
     void setWmClass(WId id);
-    void remotePlasmoidAdded(Plasma::PackageMetadata metadata);
-    void plasmoidAccessFinished(Plasma::AccessAppletJob *job);
     void wallpaperCheckedIn();
     void wallpaperCheckInTimeout();
     void dashboardClosed();
index 555096d..575dea7 100644 (file)
@@ -1,2 +1 @@
 add_subdirectory(plasmapkg)
-add_subdirectory(plasma-remote-helper)
diff --git a/plasma/generic/tools/plasma-remote-helper/CMakeLists.txt b/plasma/generic/tools/plasma-remote-helper/CMakeLists.txt
deleted file mode 100644 (file)
index c2eddb2..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-set(plasma_remote_helper_SRCS
-    main.cpp
-)
-
-kde4_add_executable(plasma-remote-helper ${plasma_remote_helper_SRCS})
-
-target_link_libraries(plasma-remote-helper ${KDE4_KDEUI_LIBS})
-
-install(TARGETS plasma-remote-helper ${INSTALL_TARGETS_DEFAULT_ARGS})
-
diff --git a/plasma/generic/tools/plasma-remote-helper/Messages.sh b/plasma/generic/tools/plasma-remote-helper/Messages.sh
deleted file mode 100755 (executable)
index f334369..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/bash
-$XGETTEXT *.cpp -o $podir/plasma-remote-helper.pot
diff --git a/plasma/generic/tools/plasma-remote-helper/main.cpp b/plasma/generic/tools/plasma-remote-helper/main.cpp
deleted file mode 100644 (file)
index cda83ab..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Copyright 2011 Kevin Ottens <ervin@kde.org>
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2,
-   or (at your option) any later version.
-
-   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 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 <iostream>
-
-#include <QtDBus/QDBusInterface>
-#include <QtDBus/QDBusReply>
-
-#include <KDE/KApplication>
-#include <KDE/KAboutData>
-#include <KDE/KCmdLineArgs>
-
-static const char description[] = I18N_NOOP("Trigger the installation of a remote Plasma Widget");
-static const char version[] = "0.1";
-
-int addRemotePlasmoidToShell(const QString &shellName, const QString &url)
-{
-    QString serviceName = "org.kde." + shellName;
-    QDBusInterface iface(serviceName, "/App");
-
-    if (!iface.isValid()) {
-        std::cerr << "Error: Couldn't contact "
-                  << shellName.toLocal8Bit().constData() << std::endl;
-        return 1;
-    } else {
-        QDBusReply<void> reply = iface.call("addRemotePlasmoid", url);
-        if (!reply.isValid()) {
-            std::cerr << "Error: Couldn't call addRemotePlasmoid on "
-                      << shellName.toLocal8Bit().constData() << std::endl;
-            return 1;
-        }
-    }
-
-    return 0;
-}
-
-int main(int argc, char **argv)
-{
-    KAboutData aboutData("plasma-remote-helper", 0, ki18n("Plasma Remote Widget Helper"),
-                         version, ki18n(description), KAboutData::License_GPL,
-                         ki18n("(C) 2011 Kevin Ottens"));
-    aboutData.addAuthor( ki18n("Kevin Ottens"),
-                         ki18n("Original author"),
-                        "ervin@kde.org" );
-
-    KComponentData componentData(aboutData);
-
-    KCmdLineArgs::init( argc, argv, &aboutData );
-
-    KCmdLineOptions options;
-    options.add("+<url>", ki18n("URL to the Plasma Remote Widget."));
-    KCmdLineArgs::addCmdLineOptions( options );
-
-    KApplication app;
-
-    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
-    if (args->count()<1) {
-        KCmdLineArgs::usageError(i18n("Syntax Error: Not enough arguments"));
-    } else if (args->count()>1) {
-        KCmdLineArgs::usageError(i18n("Syntax Error: Too many arguments"));
-    }
-
-    QString url = args->arg(0);
-    return addRemotePlasmoidToShell("plasma-desktop", url);
-}
-