Commit graph

416 commits

Author SHA1 Message Date
Nicolas Fella
b4e61678a4 Remove unneeded variable 2018-12-25 00:35:32 +01:00
Yuri Chornoivan
5c468f0ecd Fix minor typos 2018-12-11 19:23:06 +02:00
Erik Duisters
b6c15289f5 Combine multiple upload jobs into a single KCompositeJob so only 1 notification will be shown
Summary:
Combine multiple upload jobs for files into a single KCompositeJob so only 1 notification will be shown
Includes changes introduced in D16279

Test Plan:
1. Share of multiple files is performed using 1 composite job

   Setup:
	- Select multiple (big) files in dolphin and share with an Android device
   Result:
	- The files will be transferred using 1 CompositeUploadJob and showing only 1 notification

2. Share of file while another share is already running adds job to existing composite job

   Setup:
	- Select multiple (big) files in dolphin and share with an Android device
	- Share an additional file with the same Android device
   Result:
	- The files are all transferred using 1 CompositeUploadJob and showing only 1 notification
	- The notification is updated after adding the last file

3. Other packets are transmitted as usual

   Setup:
        - Setup sharing desktop notification with device
	- Share a big file with an Android device
	- Generate a desktop notification (eg. sending or receiving an email)

   Result:
	- Notification packet is send immediately

Reviewers: #kde_connect, nicolasfella, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: albertvaka, apol, nicolasfella, broulik, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17081
2018-11-30 08:26:00 +01:00
Erik Duisters
2c9fde483a Show progress when sending a file from desktop
Summary:
Show progress when sending a file from the desktop

BUG: 355044

Test Plan:
Complete transfer:
-Right click on a big file in dolphin
-Select Send to xx via KDE Connect
-Open the Notifications widget and verify progress is shown correctly

Stop transfer:
-Right click on a big file in dolphin
-Select Send to xx via KDE Connect
-Open The Notifications widget and press the stop/kill button
-Observe that the file upload is stopped

Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: apol, broulik, nicolasfella, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D16279
2018-11-26 18:32:43 +01:00
Nicolas Fella
ded463eb49 [clazy] Properly emit signals
Test Plan: Receive a file

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17166
2018-11-26 13:25:16 +01:00
Nicolas Fella
bd17dc2041 Fix container detach warnings from clazy
Reviewers: #kde_connect, apol

Reviewed By: #kde_connect, apol

Subscribers: apol, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17164
2018-11-26 13:21:39 +01:00
Albert Vaca
b9932769c9 Fix env variable on Windows 2018-11-20 21:49:46 +01:00
Erik Duisters
fb0990743a QTcpServer already has a list of pending connections and emits newConnection after calling incomingConnection
Summary:
No need to emit newConnection in Server::incomingConnection because QTcpServer will emit it after incomingConnection returns
QTcpServer also already has a list of pending connections so use that

Test Plan: Send a file from desktop to android and observe that newConnection is only called once

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17009
2018-11-19 14:13:41 +01:00
Erik Duisters
931d3974ec Why cast sender() to server when we have m_server
Summary: Why cast sender() to server when we have m_server

Reviewers: #kde_connect, apol

Reviewed By: #kde_connect, apol

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D16760
2018-11-10 11:45:17 +01:00
Erik Duisters
7cb4de20c1 Test if file was received completely if not delete the partial file
Summary: If the number of bytes received != m_size report failure and delete the partial file

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D16778
2018-11-10 11:41:39 +01:00
Albert Vaca
06d4cb580e Disable bad cipher suites now that we dropped support for Android<14
BUG: 400722
2018-11-07 16:31:54 +01:00
Nicolas Fella
276d18a02a Fix clang-tidy warning 2018-11-03 02:17:25 +01:00
Simon Redman
0f5c9cd96c Make NetworkPacket Metatype-capable
Summary: I am open to discussion for whether this is desireable. The use-case is for moving NetworkPacket receive handling to a thread other than the one handling the rest of the device. In order to do this, we need to use a QtConnectionType::QueuedConnection. In order for that to work (with NetworkPackets), NetworkPacket has to be registered in the Metatype system.

Test Plan: Nothing should be functionally different from before

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: albertvaka, apol, nicolasfella, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D16469
2018-10-29 10:42:12 -06:00
Simon Redman
08b31ce258 Properly Assign LanLinkProvider as the Parent of its child objects
Summary: This is not a hugely important change. I noticed it while I was working on something else, and it seems like it ought to be this way

Test Plan: Nothing should be noticeably different

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: apol, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D16468
2018-10-29 09:48:09 -06:00
Adam Pigg
ee52c8cd03 use libkeepalive to wakeup daemon
Summary:
Main change is to use libkeepalive to wake up the system to ensure connections stay alive

Other minor changes are:
-Log daemon messages for debugging purposes
-Add way to forece refresh of device list
-Minor spec improvements

The keepalive changes certainly seem to help, not sure if it completely solves the problems
The logging changes are temporary, and I could use them locally, but they only affect sailfish users
Im not sure if the refresh method is correct, but seems to force the daemon to check for devices

Reviewers: #kde_connect, nicolasfella, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D15414
2018-10-23 08:30:48 +01:00
Yuri Chornoivan
5fe74ce041 Fix minor EBN issues and typos 2018-10-07 21:23:20 +03:00
Matthijs Tijink
7cab490cc5 Fix receiving payloads using a bluetooth connection
Summary:
This fixes receiving payloads using the bluetooth backend.

This looks like some bug in Qt, but I couldn't figure out what happens exactly (will report a bug though).

Test Plan: Receiving files now works!

Reviewers: #kde_connect, apol

Reviewed By: #kde_connect, apol

Subscribers: kdeconnect, nicolasfella, apol, #kde_connect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D12153
2018-10-04 19:05:34 +02:00
Albert Vaca
f78d9d9f5f Fix regression where incoming transfers would fail
Introduced in 1d1fdf8ef5
2018-09-08 00:40:20 +02:00
Nicolas Fella
1d1fdf8ef5 [WIP] Get rid of DownloadJob
Summary:
It doesn't do much and can be inlined into LanDeviceLink.

TODO: Figure out why sendfiletest fails

Test Plan: Receiving files still works

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: albertvaka, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D14597
2018-08-15 17:18:40 +02:00
Nicolas Fella
e4385042eb Show icons in plugin list
Summary:
Show the plugin's icons in the list

Depends on D14567

{F6172885}

Reviewers: #kde_connect, apol

Reviewed By: #kde_connect, apol

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D14571
2018-08-03 02:25:39 +02:00
Adam Pigg
9a8f1b48a0 Build kdeconnect on sailfish and port some simple plugins
Summary:
Below is a lost of the commits, but, in summary
Port the build system for Sailfish, which means selectively building only the bits we need/can, and only against the KF5 libs that are available.
Allow to build on Qt 5.6
Switch from knotification to nemo notification (not complete!)
Add a very simple example sailfish app.

Note, there is still much missing functionality.  Notifications dont work, pairing sort of works but not really, but when it is paired you can send a ping to the desktop client

Dont build kio for Sailfish

Port core build system

Port daemon buld system

Require CoreAddons on Sailfish

Port plugins build for sailfish and include the ping plugin for now

Final build changes for sailfish.

Disable tests and other not needed parts

Add includes for QCA

Fix build errors on sailfish

Get core/ to build on sailfish

Get interfaces/ to build on sailfish

Build daemon on sailfish

On sailfish, dont install the kcm file

Start port plugin to sailfish

Fixup installed files

Add sfos app

Hack declarative plugin to give a public interface

Build sfos app

Compile declarativeplugin into the sfos app for now

Redefine qAsConst for qt 5.6

Packaging fixes

Use official icon

Package .desktop

Reviewers: #kde_connect, apol, nicolasfella, albertvaka

Reviewed By: #kde_connect, apol, nicolasfella, albertvaka

Subscribers: kdeconnect, andyholmes, albertvaka, kossebau, mtijink, vonreth, apol, #kde_connect, nicolasfella

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D10703
2018-08-02 20:10:59 +01:00
Albert Vaca
76ea0dd12d Remove characters from UUID that aren't legal in URLs 2018-08-01 11:10:14 +02:00
Nicolas Fella
69698f3407 Fix typos 2018-07-27 15:00:23 +02:00
Bart Ribbers
0e90fe0bd0 Fix build failure on musl based systems
Summary:
Musl lacks backtrace support, so this patch fixes the build by making sure it only gets compiled when using a glibc system.

Bug: 395161

Reviewers: #kde_connect

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D13446
2018-06-09 22:45:19 +02:00
Nicholas D Steeves
6d8fa21572 Fix typo in backend
Bug: 394929 394929 394929 394929 394929 394929 394929 394929 394929 394929 394929 394929 394929 394929 394929 394929 394929 394929 394929 394929 394929 394929 394929 394929 394929 394929 394929 394929 394929 394929 394929 394929
2018-06-02 20:22:29 +02:00
Albert Vaca
bf879a8579 Add a generic "something changed" signal 2018-05-29 21:09:45 +02:00
Caio Carvalho
4097b6f71f Including d-pointer in Device class
Summary:
Including d-pointer pattern in Device class.

Related to this task: https://phabricator.kde.org/T6805

Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: nicolasfella, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D12863
2018-05-15 19:15:05 -03:00
Yoann Laissus
c6ebdbe89b Add detection of Android TV devices with a proper icon
Android app :  https://phabricator.kde.org/D12803

Test Plan: Tested with an Android TV device (Nvidia Shield)

Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D12802
2018-05-10 17:55:55 +02:00
Matthijs Tijink
1b570d4719 Make bluetooth payload upload work & asynchronous
Summary: Sharing files to the Android bluetooth backend now works. The code is asynchronous now too.

Test Plan: I tested several files, and they all get transferred correctly. The socket gets destroyed correctly too.

Reviewers: #kde_connect, apol

Reviewed By: #kde_connect, apol

Subscribers: apol, #kde_connect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D12264
2018-04-24 20:33:55 +02:00
Albert Astals Cid
17b304c42a Do not call deleteLater on a null QObject
We don't always have a pairing handler for a given device link

Also change the assert not to trigger a warning in ubsan

Reviewed by Albert Vaca
2018-03-24 19:02:06 +01:00
Albert Vaca
b009c5fd0b Add a function to list device names
To ease dbus scripting
2018-03-24 17:37:06 +01:00
Adam Pigg
ebc316f703 Add a method for creating simple notifications
Summary:
Add a helper function to the daemon interface, which must be subclassed
by the implementations, which creates a simple notification.

For more complex needs, involving interacting with the notification, it
will still be nescessary to use KNotification directly, but this allows
for other future implementations to create a simple notification without
ifdef'ing the code.

Reviewers: kdeconnect, apol

Reviewed By: apol

Subscribers: kdeconnect

Differential Revision: https://phabricator.kde.org/D11104
2018-03-18 12:52:22 +01:00
Friedrich W. H. Kossebau
bb3ab8b631 Clean-up requirements: cmake 3.0, qt 5.7, use min versions, deduplicate KF5
Summary:
* cmake 2.8.12 is really outdated, 3.0 is minimum in plasma & kf5
* cmake_minimum_required should be at begin of toplevel CMakeLists.txt
* bump qt version to 5.7, matching the min Qt version of kf5 5.42
* with ecm being part of kf5 since early versions, share ${KF5_MIN_VERSION}
* use QT_MIN_VERSION & KF5_MIN_VERSION also for separate find_package calls
* deduplicate all KF5 components searched for in unconditionally included
  subdirs

Test Plan: Still configures and builds with all options OFF & ON

Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: nicolasfella

Differential Revision: https://phabricator.kde.org/D11418
2018-03-17 23:34:33 +01:00
Albert Vaca
f47f517827 Rename NetworkPackage -> NetworkPacket
Summary: KDE Connect, now with correct naming!

Test Plan: It still builds.

Reviewers: #kde_connect, apol, nicolasfella

Reviewed By: #kde_connect, apol, nicolasfella

Subscribers: nicolasfella

Differential Revision: https://phabricator.kde.org/D11036
2018-03-05 20:03:23 +01:00
Tobias Fella
2aeae44569 Fixed Typo
Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: nicolasfella, #kde_connect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D10998
2018-03-03 20:31:21 +01:00
Nicolas Fella
b6972e4cb9 Replace qSort with std::sort 2018-02-26 20:41:25 +01:00
Matthijs Tijink
d6f9c30749 Add support for new Android 2.3 (API 9+) cipher
Summary: Desktop counterpart of D9449.

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Differential Revision: https://phabricator.kde.org/D9451
2017-12-22 13:27:04 +01:00
Aleix Pol
956d515fe9 Merge branch '1.x' 2017-09-18 20:02:53 +02:00
Nicolas Fella
9336c05360 Fix build with Bluetooth enabled
Summary: A variable was not renamed correctly because nobody tested it with Bluetooth enabled

Test Plan: compiles

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: albertvaka, #kde_connect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D7777
2017-09-16 14:03:51 +02:00
Albert Vaca
84bba9429f Merge branch 'master' into 1.x
# Conflicts:
#	core/backends/lan/downloadjob.cpp
#	core/backends/lan/downloadjob.h
#	core/filetransferjob.cpp
#	core/filetransferjob.h
#	plugins/notifications/sendreplydialog.cpp
#	plugins/notifications/sendreplydialog.h
#	plugins/telephony/sendsmsdialog.cpp
#	plugins/telephony/sendsmsdialog.h
2017-09-03 22:05:54 +02:00
Jean Vincent
72535ecf48 Make member variable names, & placement and * placement more coherent
Summary:
Change all member variables to the form m_fooBar because it is the preferred form in Qt (it was half and half between this and mFooBar, and a minority didn't have anything).
Place all references and pointers on the side of the type since it is the majority.

Basically:
 - mFoo -> m_foo
 - foo -> m_foo (if it is a member variable)
 - Type &ref -> Type& ref
 - Type *ptr -> Type* ptr

Reviewers: #kde_connect, nicolasfella, albertvaka

Reviewed By: #kde_connect, nicolasfella, albertvaka

Subscribers: albertvaka, #kde_connect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D7312
2017-09-03 21:45:08 +02:00
Albert Vaca
239f7f6830 Expose isPluginEnabled and setPluginEnabled
BUG: 383795
2017-08-22 15:34:18 +02:00
Aleix Pol
364ab02aad set total amount later
Otherwise the kwidgetjobtracker wouldn't notice it and it wouldn't be
reported properly.
2017-08-02 01:48:37 +02:00
Albert Astals Cid
d1d84bc464 Fix DownloadJob not finishing
We stop using a buffer so it's less memory intensive and allows for larger files to be sent.

With current KIO has CPU usage issues, there's a patch in review that fixes them.

BUGS: 378488
2017-08-02 00:39:19 +02:00
Albert Vaca
88e43ada1e Fix rounding 2017-08-01 23:18:15 +02:00
Aleix Pol
2b17d89fc1 Revert "No need to use a QBuffer in DownloadJob"
We need to wait for KF5 release, I didn't mean to commit it

This reverts commit af778b71b1.
2017-08-01 22:46:38 +02:00
Aleix Pol
d61d52ac1f Fix reported file transfer speed
Don't mix milliseconds and seconds
Start calculating in the beginning
Output the requested file size
2017-08-01 22:45:28 +02:00
Albert Astals Cid
af778b71b1 No need to use a QBuffer in DownloadJob
Summary:
QSslSocket is already a QIODevice so just use that.

Should fix the issue of transfering *big* files.

Unfortunately this seems to trigger a bug in KIO and CPU usage goes through the roof, so haven't really been able to test it does actually fix things.

Please don't merge/approve yet

Reviewers: apol, albertvaka, kdeconnect

Subscribers: #kde_connect

Differential Revision: https://phabricator.kde.org/D6039
2017-08-01 21:03:55 +02:00
Albert Vaca
ef0e80c91f Merge branch 'master' into 1.x
# Conflicts:
#	indicator/org.kde.kdeconnect.nonplasma.desktop
#	org.kde.kdeconnect.kcm.appdata.xml
#	plugins/runcommand/kdeconnect_runcommand.json
#	urlhandler/org.kde.kdeconnect.telhandler.desktop
2017-07-24 16:49:06 +02:00
Albert Vaca
df61e8f0e6 Check if the IPv6 to v4 conversion succeeds, use v6 if it doesn't. 2017-07-22 11:25:07 +02:00