diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,7 +64,6 @@ add_subdirectory(plugins) add_subdirectory(cli) add_subdirectory(indicator) -add_subdirectory(fileitemactionplugin) add_subdirectory(urlhandler) add_subdirectory(nautilus-extension) diff --git a/fileitemactionplugin/CMakeLists.txt b/fileitemactionplugin/CMakeLists.txt deleted file mode 100644 --- a/fileitemactionplugin/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -add_definitions(-DTRANSLATION_DOMAIN="kdeconnect-fileitemaction") -include_directories(${CMAKE_SOURCE_DIR}) - -add_library(kdeconnectfileitemaction MODULE sendfileitemaction.cpp) -target_link_libraries(kdeconnectfileitemaction - KF5::KIOWidgets - KF5::I18n - kdeconnectinterfaces -) -install(TARGETS kdeconnectfileitemaction DESTINATION ${PLUGIN_INSTALL_DIR}) -install(FILES kdeconnectsendfile.desktop DESTINATION ${SERVICES_INSTALL_DIR}) diff --git a/fileitemactionplugin/Messages.sh b/fileitemactionplugin/Messages.sh deleted file mode 100644 --- a/fileitemactionplugin/Messages.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -$XGETTEXT `find . -name '*.cpp'` -o $podir/kdeconnect-fileitemaction.pot diff --git a/fileitemactionplugin/kdeconnectsendfile.desktop b/fileitemactionplugin/kdeconnectsendfile.desktop deleted file mode 100644 --- a/fileitemactionplugin/kdeconnectsendfile.desktop +++ /dev/null @@ -1,88 +0,0 @@ -[Desktop Entry] -Type=Service -Name=Send file via KDE Connect service -Name[ar]=أرسل ملفًّا عبر خدمة «كدي المتّصل» -Name[ast]=Unviar ficheru pel serviciu de KDE Connect -Name[bg]=Изпращане на файл през услугата KDE Connect -Name[bs]=Pošalji datoteku putem KDE Connect servisa -Name[ca]=Envia un fitxer a través del servei KDE Connect -Name[ca@valencia]=Envia un fitxer a través del servei KDE Connect -Name[cs]=Poslat soubor přes službu KDE Connect -Name[da]=Send fil via KDE Connect-tjeneste -Name[de]=Datei mit KDE-Connect -Dienst versenden -Name[el]=Αποστολή αρχείου μέσω της υπηρεσίας KDE Connect -Name[en_GB]=Send file via KDE Connect service -Name[es]=Enviar archivo usando el servicio KDE Connect -Name[et]=Faili saatmine KDE Connecti teenuse kaudu -Name[eu]=Bidali fitxategia KDE Connect zerbitzuaren bidez -Name[fi]=Lähetä tiedosto KDE Connect -palvelulla -Name[fr]=Envoyer un fichier via le service KDE Connect -Name[gl]=Enviar un ficheiro mediante o servizo de KDE Connect -Name[he]=שלח קובץ דרך שירות KDE Connect -Name[hu]=Fájl küldése a KDE csatlakozás szolgáltatáson keresztül -Name[id]=Kirim file via layanan KDE Connect -Name[it]=Invia un file tramite il servizio KDE Connect -Name[ko]=KDE Connect 서비스로 파일 보내기 -Name[nl]=Bestand via de service KDE Connect versturen -Name[nn]=Send fil med KDE Connect-tenesta -Name[pl]=Wyślij plik przez usługę KDE Connect -Name[pt]=Enviar um ficheiro pelo serviço KDE Connect -Name[pt_BR]=Enviar arquivo pelo serviço KDE Connect -Name[ru]=Отправить файл через KDE Connect -Name[sk]=Poslať súbor cez službu KDE Connect -Name[sr]=Шаљи фајл преко КДЕ‑конекцијиног сервиса -Name[sr@ijekavian]=Шаљи фајл преко КДЕ‑конекцијиног сервиса -Name[sr@ijekavianlatin]=Šalji fajl preko KDE‑konekcijinog servisa -Name[sr@latin]=Šalji fajl preko KDE‑konekcijinog servisa -Name[sv]=Skicka fil via KDE:s anslutningstjänst -Name[tr]=KDE Connect servisi ile dosya gönderin -Name[uk]=Надсилання файла за допомогою служби з’єднання KDE -Name[x-test]=xxSend file via KDE Connect servicexx -Name[zh_CN]=通过 KDE Connect 服务发送文件 -Name[zh_TW]=以已經連結到KDE之服務或裝置來傳送檔案 -X-KDE-Library=kdeconnectfileitemaction -X-KDE-Submenu=Connect -X-KDE-Submenu[ar]=اتّصل,اتصل -X-KDE-Submenu[ast]=Coneutar -X-KDE-Submenu[bg]=Свързване -X-KDE-Submenu[bs]=Uspostavi vezu -X-KDE-Submenu[ca]=Connecta -X-KDE-Submenu[ca@valencia]=Connecta -X-KDE-Submenu[cs]=Připojit -X-KDE-Submenu[da]=Forbind -X-KDE-Submenu[de]=Verbinden -X-KDE-Submenu[el]=Σύνδεση -X-KDE-Submenu[en_GB]=Connect -X-KDE-Submenu[es]=Conectar -X-KDE-Submenu[et]=Ühendus -X-KDE-Submenu[eu]=Konektatu -X-KDE-Submenu[fi]=Yhdistä -X-KDE-Submenu[fr]=Connecter -X-KDE-Submenu[gl]=Conectar -X-KDE-Submenu[he]=חיבור -X-KDE-Submenu[hu]=Csatlakozás -X-KDE-Submenu[ia]=Connecte -X-KDE-Submenu[id]=Connect -X-KDE-Submenu[it]=Connetti -X-KDE-Submenu[ko]=연결 -X-KDE-Submenu[nl]=Verbinden -X-KDE-Submenu[nn]=Kopla til -X-KDE-Submenu[pl]=Połącz -X-KDE-Submenu[pt]=Ligar -X-KDE-Submenu[pt_BR]=Conectar -X-KDE-Submenu[ru]=KDE Connect -X-KDE-Submenu[sk]=Pripojiť -X-KDE-Submenu[sr]=Повежи се -X-KDE-Submenu[sr@ijekavian]=Повежи се -X-KDE-Submenu[sr@ijekavianlatin]=Poveži se -X-KDE-Submenu[sr@latin]=Poveži se -X-KDE-Submenu[sv]=Anslut -X-KDE-Submenu[tr]=Bağlan -X-KDE-Submenu[uk]=З’єднання -X-KDE-Submenu[x-test]=xxConnectxx -X-KDE-Submenu[zh_CN]=连接 -X-KDE-Submenu[zh_TW]=連線 - -Icon=preferences-system-network -ServiceTypes=KFileItemAction/Plugin -MimeType=application/octet-stream diff --git a/fileitemactionplugin/sendfileitemaction.h b/fileitemactionplugin/sendfileitemaction.h deleted file mode 100644 --- a/fileitemactionplugin/sendfileitemaction.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2011 Alejandro Fiestas Olivares - * Copyright (C) 2014 Aleix Pol Gonzalez - * - * 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 of the License, 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 library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef SENDFILEITEMACTION_H -#define SENDFILEITEMACTION_H - -#include -#include -#include - -class QAction; -class KFileItemListProperties; -class QWidget; - -Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_FILEITEMACTION) -class SendFileItemAction : public KAbstractFileItemActionPlugin -{ -Q_OBJECT -public: - SendFileItemAction(QObject* parent, const QVariantList& args); - QList< QAction* > actions(const KFileItemListProperties& fileItemInfos, QWidget* parentWidget) override; - -private Q_SLOTS: - void sendFile(); - -}; - -#endif // SENDFILEITEMACTION_H diff --git a/fileitemactionplugin/sendfileitemaction.cpp b/fileitemactionplugin/sendfileitemaction.cpp deleted file mode 100644 --- a/fileitemactionplugin/sendfileitemaction.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (C) 2011 Alejandro Fiestas Olivares - * Copyright (C) 2014 Aleix Pol Gonzalez - * - * 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 of the License, 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 library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "sendfileitemaction.h" - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include - -K_PLUGIN_FACTORY(SendFileItemActionFactory, registerPlugin();) - -Q_LOGGING_CATEGORY(KDECONNECT_FILEITEMACTION, "kdeconnect.fileitemaction") - -SendFileItemAction::SendFileItemAction(QObject* parent, const QVariantList& ): KAbstractFileItemActionPlugin(parent) -{ -} - -QList SendFileItemAction::actions(const KFileItemListProperties& fileItemInfos, QWidget* parentWidget) -{ - QList actions; - - DaemonDbusInterface iface; - if (!iface.isValid()) { - return actions; - } - - QDBusPendingReply reply = iface.devices(true, true); - reply.waitForFinished(); - const QStringList devices = reply.value(); - for (const QString& id : devices) { - DeviceDbusInterface deviceIface(id); - if (!deviceIface.isValid()) { - continue; - } - if (!deviceIface.hasPlugin(QStringLiteral("kdeconnect_share"))) { - continue; - } - QAction* action = new QAction(QIcon::fromTheme(deviceIface.iconName()), deviceIface.name(), parentWidget); - action->setProperty("id", id); - action->setProperty("urls", QVariant::fromValue(fileItemInfos.urlList())); - action->setProperty("parentWidget", QVariant::fromValue(parentWidget)); - connect(action, &QAction::triggered, this, &SendFileItemAction::sendFile); - actions += action; - } - - if (actions.count() > 1) { - QAction* menuAction = new QAction(QIcon::fromTheme(QStringLiteral("kdeconnect")), i18n("Send via KDE Connect"), parentWidget); - QMenu* menu = new QMenu(parentWidget); - menu->addActions(actions); - menuAction->setMenu(menu); - return QList() << menuAction; - } else { - if(actions.count() == 1) { - actions.first()->setText(i18n("Send to '%1' via KDE Connect", actions.first()->text())); - } - return actions; - } -} - -void SendFileItemAction::sendFile() -{ - const QList urls = sender()->property("urls").value>(); - QString id = sender()->property("id").toString(); - for (const QUrl& url : urls) { - QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.kde.kdeconnect"), "/modules/kdeconnect/devices/"+id+"/share", QStringLiteral("org.kde.kdeconnect.device.share"), QStringLiteral("shareUrl")); - msg.setArguments(QVariantList() << url.toString()); - QDBusConnection::sessionBus().call(msg); - } -} - -#include "sendfileitemaction.moc"