Commit 8f0e1a22 authored by Albert Vaca Cintora's avatar Albert Vaca Cintora

Renamed plugin filetransfer -> sharereceiver

parent 920d945a
......@@ -30,7 +30,7 @@
#define PACKAGE_TYPE_TELEPHONY QString("kdeconnect.telephony")
#define PACKAGE_TYPE_CLIPBOARD QString("kdeconnect.clipboard")
#define PACKAGE_TYPE_MPRIS QString("kdeconnect.mpris")
#define PACKAGE_TYPE_FILETRANSFER QString("kdeconnect.filetransfer")
#define PACKAGE_TYPE_SHARE QString("kdeconnect.share")
#endif // NETWORKPACKAGETYPES_H
......@@ -7,6 +7,6 @@ add_subdirectory(mpriscontrol)
add_subdirectory(clipboard)
add_subdirectory(telephony)
add_subdirectory(battery)
add_subdirectory(filetransfer)
add_subdirectory(sharereceiver)
add_subdirectory(notifications)
......@@ -11,8 +11,8 @@ include_directories(
${CMAKE_SOURCE_DIR}
)
set(kdeconnect_filetransfer_SRCS
filetransferplugin.cpp
set(kdeconnect_sharereceiver_SRCS
sharereceiverplugin.cpp
autoclosingqfile.cpp
../kdeconnectplugin.cpp
../pluginloader.cpp
......@@ -21,9 +21,9 @@ set(kdeconnect_filetransfer_SRCS
../../device.cpp
)
kde4_add_plugin(kdeconnect_filetransfer ${kdeconnect_filetransfer_SRCS})
kde4_add_plugin(kdeconnect_sharereceiver ${kdeconnect_sharereceiver_SRCS})
target_link_libraries(kdeconnect_filetransfer
target_link_libraries(kdeconnect_sharereceiver
${KDE4_KDECORE_LIBS}
${KDE4_KDEUI_LIBS}
${KDE4_KIO_LIBS}
......@@ -32,5 +32,5 @@ target_link_libraries(kdeconnect_filetransfer
${QCA2_LIBRARIES}
)
install(TARGETS kdeconnect_filetransfer DESTINATION ${PLUGIN_INSTALL_DIR} )
install(FILES kdeconnect_filetransfer.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
install(TARGETS kdeconnect_sharereceiver DESTINATION ${PLUGIN_INSTALL_DIR} )
install(FILES kdeconnect_sharereceiver.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
It receives a packages with type kdeconnect.filetransfer. If they have a payload
It receives a packages with type kdeconnect.share. If they have a payload
attached, it will download it as a file with the filename set in the field
"filename" (string). If that field is not set it should generate a filename.
......
......@@ -2,26 +2,14 @@
Encoding=UTF-8
Type=Service
ServiceTypes=KdeConnect/Plugin
X-KDE-Library=kdeconnect_filetransfer
X-KDE-Library=kdeconnect_sharereceiver
X-KDE-PluginInfo-Author=Albert Vaca
X-KDE-PluginInfo-Email=albertvaka@gmail.com
X-KDE-PluginInfo-Name=kdeconnect_filetransfer
X-KDE-PluginInfo-Name=kdeconnect_sharereceiver
X-KDE-PluginInfo-Version=0.1
X-KDE-PluginInfo-Website=http://albertvaka.wordpress.com
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-EnabledByDefault=true
Icon=folder-downloads
Name=File transfer
Name[pt]=Transferência de ficheiros
Name[pt_BR]=Transferência de arquivos
Name[sv]=Filöverföring
Name[uk]=Модуль передавання файлів
Name[x-test]=xxFile transferxx
Comment=Send and receive files from dolphin
Comment[de]=Dateien aus Dolphin senden und empfangen
Comment[nl]=Bestanden verzenden en ontvangen vanuit dolphin
Comment[pt]=Enviar e receber ficheiros a partir do Dolphin
Comment[pt_BR]=Envia e recebe arquivos a partir do Dolphin
Comment[sv]=Skicka och ta emot filer med Dolphin
Comment[uk]=Надсилання і отримання файлів з dolphin
Comment[x-test]=xxSend and receive files from dolphinxx
Name=Share receiver
Comment=Receive files and URLs shared from your phone
......@@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "filetransferplugin.h"
#include "sharereceiverplugin.h"
#include <KIcon>
#include <KLocalizedString>
......@@ -32,10 +32,10 @@
#include "../../filetransferjob.h"
#include "autoclosingqfile.h"
K_PLUGIN_FACTORY( KdeConnectPluginFactory, registerPlugin< FileTransferPlugin >(); )
K_EXPORT_PLUGIN( KdeConnectPluginFactory("kdeconnect_filetransfer", "kdeconnect_filetransfer") )
K_PLUGIN_FACTORY( KdeConnectPluginFactory, registerPlugin< ShareReceiverPlugin >(); )
K_EXPORT_PLUGIN( KdeConnectPluginFactory("kdeconnect_sharereceiver", "kdeconnect_sharereceiver") )
FileTransferPlugin::FileTransferPlugin(QObject* parent, const QVariantList& args)
ShareReceiverPlugin::ShareReceiverPlugin(QObject* parent, const QVariantList& args)
: KdeConnectPlugin(parent, args)
{
//TODO: Use downloads user path
......@@ -44,7 +44,7 @@ FileTransferPlugin::FileTransferPlugin(QObject* parent, const QVariantList& args
if (!mDestinationDir.endsWith('/')) mDestinationDir.append('/');
}
bool FileTransferPlugin::receivePackage(const NetworkPackage& np)
bool ShareReceiverPlugin::receivePackage(const NetworkPackage& np)
{
/*
//TODO: Move this code to a test and add a diff between files
......@@ -52,7 +52,7 @@ bool FileTransferPlugin::receivePackage(const NetworkPackage& np)
qDebug() << "sending file" << (QDesktopServices::storageLocation(QDesktopServices::HomeLocation) + "/.bashrc");
NetworkPackage out(PACKAGE_TYPE_FILETRANSFER);
NetworkPackage out(PACKAGE_TYPE_SHARE);
out.set("filename", mDestinationDir + "itworks.txt");
//TODO: Use shared pointers
AutoClosingQFile* file = new AutoClosingQFile(QDesktopServices::storageLocation(QDesktopServices::HomeLocation) + "/.bashrc"); //Test file to transfer
......@@ -66,7 +66,7 @@ bool FileTransferPlugin::receivePackage(const NetworkPackage& np)
}
*/
if (np.type() != PACKAGE_TYPE_FILETRANSFER) return false;
if (np.type() != PACKAGE_TYPE_SHARE) return false;
qDebug() << "File transfer";
if (np.hasPayload()) {
......@@ -103,7 +103,7 @@ bool FileTransferPlugin::receivePackage(const NetworkPackage& np)
}
void FileTransferPlugin::finished(KJob* job)
void ShareReceiverPlugin::finished(KJob* job)
{
qDebug() << "File transfer finished";
......@@ -118,7 +118,7 @@ void FileTransferPlugin::finished(KJob* job)
notification->sendEvent();
}
void FileTransferPlugin::openDestinationFolder()
void ShareReceiverPlugin::openDestinationFolder()
{
QDesktopServices::openUrl(mDestinationDir);
}
......@@ -18,21 +18,21 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FILETRANFERPLUGIN_H
#define FILETRANFERPLUGIN_H
#ifndef SHARERECEIVERPLUGIN_H
#define SHARERECEIVERPLUGIN_H
#include <KNotification>
#include <KIO/Job>
#include "../kdeconnectplugin.h"
class FileTransferPlugin
class ShareReceiverPlugin
: public KdeConnectPlugin
{
Q_OBJECT
public:
explicit FileTransferPlugin(QObject *parent, const QVariantList &args);
explicit ShareReceiverPlugin(QObject *parent, const QVariantList &args);
public Q_SLOTS:
virtual bool receivePackage(const NetworkPackage& np);
......
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