Commit graph

669 commits

Author SHA1 Message Date
Nicolas Fella
a45921685b Extract code to methods 2018-12-25 01:42:42 +01:00
Nicolas Fella
b73472735f Remove comment 2018-12-25 01:04:22 +01:00
Nicolas Fella
8f16c3fd9a Remove unneeded methods
Remove unneeded declaration
2018-12-25 00:58:03 +01:00
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
Jean Vincent
25b86c6c7f Determine which IP address to use for sshfs
Summary:
There is currently an issue where the device doesn't send the correct IP address for sshfs when a VPN is present.

Instead of asking the device to find and send its address, we can store it from when the device link is created then reuse it.

Test Plan:
All unit tests pass.

In these different situations:
  - without a VPN
  - with a VPN running
  - with a VPN started then stopped (the tun interface might still be there)
Try to remotely browse the device. It should work in all cases.

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: albertvaka, apol, nicolasfella, sredman

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D6730
2017-07-22 11:18:06 +02:00
Jean Vincent
c864267f04 Replace Q_FOREACH with C++11 range-for
Summary:
The use of Q_FOREACH is advised against (https://doc.qt.io/qt-5/qtglobal.html#Q_FOREACH) since Qt 5.7 and will eventually be removed from Qt.

I replaced all occurrences with the range-for loop introduced in C++11 (except for the one in daemon.cpp in deviceIdByName which might have a bug / typo in it).

I added const to the container or casted it with qAsConst when appropriate to avoid unnecessary copies.

(This is my first submission. I did all the unit tests, and they all passed but I don't know how to show it here.)

Reviewers: #kde_connect, nicolasfella, apol

Reviewed By: #kde_connect, nicolasfella, apol

Subscribers: albertvaka, apol, nicolasfella

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D6724
2017-07-21 09:57:19 +02:00
Aleix Pol
d7ec24725f Make sure we keep track of changes when the device link changes
Especially useful because it contains the announce name.

CCBUG: 364150
2017-07-14 03:30:49 +02:00
Albert Vaca
f7b2cee995 Remove debug message 2017-07-14 02:17:59 +02:00
Aleix Pol
27876542ab Unpair whenever there's a QSSLError 2017-07-14 02:17:59 +02:00
Aleix Pol
209e3e2842 Reflect property change when unpairing
There's no pairStatusChanged when the device is not connected to
anything (be it because it's unreachable at the moment).
2017-07-14 01:01:15 +02:00
Albert Vaca
b67761a442 Remove debug messages 2017-07-14 00:32:40 +02:00
Albert Vaca
ebbf43f760 Coding style 2017-07-14 00:19:56 +02:00
Albert Vaca
83c250e9f1 Trust the name stored in the certificate
Having a separate copy of it in the config leads to them not being in sync

BUG: 381542
2017-07-14 00:19:26 +02:00
Aleix Pol
29888cb78b Improve debug information
If we're ignoring an ssl issue, at least show it.
On connected show whether the socket is valid, otherwise we get remote
devices disconnected without any message. (In this case HostNameMismatch)
Also fixes a typo

CCBUG: 381542
2017-07-07 17:26:55 +02:00
Àlex Fiestas
abfa8c8183
Port to newer api
This is a blind port, I have not tested it but allows this code to
compile.
2017-05-24 23:54:59 +02:00
Àlex Fiestas
c0a417e9e4
Make Bluetooth optional
This way we can merge this code in master with the hope of it getting
more attention.
2017-05-24 23:54:59 +02:00
Àlex Fiestas
54ef8862eb
(Bluetooth) Remove compatibility with Qt < 5.4.0 2017-05-24 23:54:59 +02:00
Àlex Fiestas
11a01d2f4e
Set unique include guard
Otherwise the code will not compile if both, lan and bluetooth are
enabled.
2017-05-24 23:54:59 +02:00
Albert Vaca
6792b45fae
Adapt to new API in master 2017-05-24 23:54:58 +02:00
Saikrishna Arcot
d711547ab5
Add initial Bluetooth backend implementation.
KDE Connect runs, and the bluetooth service gets published in the SDP
(service discovery protocol), which other devices use to determine what
services are available.

The getPairedDevices() method in the link provider class uses D-Bus to get
the list of paired devices, since Qt doesn't have a method giving that
information. As a result, that part of the code only works on Linux.

REVIEW: 122174
2017-05-24 23:54:58 +02:00
Nicolas Fella
f0010763e7 Fixed filetransferjob broken after adding icons.
The plasmoid didn't know the transfer ended.

REVIEW: 130116
2017-05-07 20:16:19 +02:00
Nicolas Fella
891f1bd355 Notification icons from Android are now displayed
- FileTransferJob is now nonblocking.
- Files are stored based on the image MD5.
- Some improvements in displaying the notification, e.g. title is only
  displayed when different than the app name.
- Most of the notification display code moved to the Notification class.

REVIEW: 130050
2017-04-13 21:32:03 +02:00
Albert Vaca
34d419756b Merge branch '1.x' 2017-04-13 21:23:29 +02:00
Albert Vaca
a4f2a60d47 Do not use the default proxy.
Qt uses the system proxy if set up, explicitly disable it.

BUG: 376187
2017-03-06 22:02:08 +01:00
Albert Vaca
7cc39aada8 Added an option to the cli to return your own device id 2017-02-24 22:37:22 +01:00
Aleix Pol
f65392ca6b Expose pair requests on the KCM 2017-02-20 21:00:26 +01:00
Albert Vaca
b75d52fe31 Do not use a location under home as mount point
Try to use XDG_RUNTIME_DIR and fall back to /tmp.

https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
2017-02-18 16:14:51 +01:00
Albert Vaca
1b308a547d Fix warning because of missing enum value in switch 2017-02-18 15:32:55 +01:00
Albert Vaca
2c1c8525e5 Now a 100% more compiling 2017-02-14 23:03:59 +01:00
Albert Vaca
25e0cea373 Make error message reflect the actual ports we use 2017-02-14 22:52:37 +01:00
Albert Vaca
f0a96a3ab9 Do not error if we try to request pair again 2017-02-10 00:54:03 +01:00
Albert Vaca
7e63a90da6 Merge branch '1.x'
# Conflicts:
#	app/org.kde.kdeconnect.app.desktop
#	plugins/kdeconnect.notifyrc
#	plugins/remotecommands/kdeconnect_remotecommands.json
#	plugins/sendnotifications/kdeconnect_sendnotifications_config.desktop
2017-02-05 16:12:25 +01:00
Albert Vaca
12a3027be6 Wrong order, condition was always false. 2017-02-05 16:08:20 +01:00
Albert Vaca
768fdb443f Fixed sftp plugin
Scriptable slots show be exposed on dbus
2017-01-27 01:39:03 +01:00
Aleix Pol
6c77bc5a9f Debug pairing handlers
Make sure we don't emit if it doesn't actually change
Make sure if it changed when we react to a pairing

Pair-programmed with Albert Vaca
2017-01-25 01:18:14 +01:00
Aleix Pol
5d088041c0 Don't leak pairing handlers 2017-01-25 01:16:07 +01:00
Aleix Pol
ea41d3786e Expose pairing state for devices
Will allow to have information about whether we're pairing, mostly for
better GUI.

Pair-programmed with Albert Vaca
2017-01-25 00:22:22 +01:00
Albert Vaca
461874f4a5 Comment got displaced 2017-01-14 02:50:25 +01:00
Aleix Pol
c038c41eec Remove unused enum 2017-01-13 17:48:37 +01:00
Holger Kaelberer
8c9253440d Export scriptable plugin signals
A plugin should have the possibility to define signals to be exposed
on dbus.

REVIEW: 129811
2017-01-13 08:05:35 +01:00
Aleix Pol
3734d6ce4d Reduce API exposed through dbus
Summary:
Don't use QDBusConnection::ExportAllContents
No need to make connect and receivedPackage public slots (they're are the
parent's already)

Fixes T4975

Test Plan: Rough manual test

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Maniphest Tasks: T4975

Differential Revision: https://phabricator.kde.org/D3871
2017-01-10 18:15:01 +01:00
Holger Kaelberer
a75e0ba031 Make pairing notifications more persistent
Notifications are not persistent, and once gone there is no
way to accept the request. Clicking the notification in the
notification history does nothing in plasma and gnome.

There make them persistent and close them after the pairing timeout,
after which they are no longer useful.

BUG: https://phabricator.kde.org/T5002
2017-01-05 19:11:55 +01:00
Aleix Pol
e72bbfe1d2 Remove dash in icon
We use it to display the state and we're providing them as fallback,
they will always be available.
Otherwise, on some platform this clashes with the icon engine falling
back to less specific version of the icon (i.e. smartphone instead of
smartphone-connected).

https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html

Reviewed by Albert Vaca
2016-11-28 16:27:34 +01:00
Albert Vaca
3df5e0dc11 Define the debug category in core_debug.cpp 2016-11-28 15:57:58 +01:00
Albert Vaca
6a2a0b1c76 Merge branch '1.x'
# Conflicts:
#	plugins/mpriscontrol/mpriscontrolplugin.cpp
#	plugins/sendnotifications/kdeconnect_sendnotifications.json
2016-11-26 16:40:24 +01:00
Albert Vaca
f41883f2f3 Known size, reserve. 2016-11-26 16:36:34 +01:00
Albert Vaca
b7bb8d94c5 Fixed QStrings not being passed by ref 2016-11-26 16:36:34 +01:00
Albert Vaca
beeae63086 Missing Q_OBJECT macro 2016-11-26 16:36:34 +01:00
Albert Vaca
1a2b227dff Q_GLOBAL_STATIC is unnecessary on basic data types. 2016-11-26 16:21:30 +01:00
Albert Vaca
60331ccbf1 Clazy says all this QStringLiteral and QLatin1String were missing/wrong 2016-11-26 16:21:29 +01:00
Albert Vaca
a1340c8042 Fixed old style connects with clazy 2016-11-26 15:14:19 +01:00
Albert Vaca
1a1f94fd94 Fixed old style connects with clazy 2016-11-26 15:12:38 +01:00
Albert Vaca
33b5e556e6 Merge branch '1.x' 2016-11-24 15:12:06 +01:00
Albert Vaca
7638683c85 Print a qCritical in addition to showing a notification 2016-11-24 15:11:30 +01:00
Albert Vaca
3d0f7c3fcb Changed signal reachableStatusChanged() to reachableChanged(bool)
And proxied it on the C++ dbus interface.
2016-11-23 17:24:35 +01:00
Albert Vaca
f845b33392 Fixed bug on Windows 2016-11-20 04:25:11 +01:00
Albert Vaca
f901655ef4 Warning 2016-11-16 21:37:07 +01:00
Albert Vaca
f61dde5bbb Use different files instead of different groups 2016-09-19 13:35:03 +02:00
Kai Uwe Broulik
6f7c419baa Merge branch '1.x' 2016-09-10 22:53:37 +02:00
Kai Uwe Broulik
77ad9336b6 [FileTransferJob] Fix division by null and use elapsed timer
When sending multiple files from my phone to my PC, kdeconnectd usually received a SIGFPE.
To get the transfer speed it divides the number of bytes received by the elapsed time which can be zero.

Also, since we're only interested in the time that has elapsed, use QElapsedTimer,
which is exactly for this. QTime::elapsed() also needs to take into account potentially
ocurred timezone or DST changes.

REVIEW: 128861
2016-09-10 22:52:03 +02:00
Albert Vaca
b585e4d48a Don't return an empty list of supported plugins
If we don't know it yet return them all.
2016-09-06 10:53:19 +02:00
Albert Vaca
5ad007a981 Merge branch '1.x' 2016-08-29 20:46:48 +02:00
Thmoas Posch
a759cdf678 Device::encryptionInfo returned the entire certificate instead of the hash
BUG: 367897
2016-08-29 20:41:06 +02:00
Albert Vaca
c9cfac7253 Remove debug logs 2016-08-29 11:00:35 +02:00
Albert Vaca
6281b9c232 Make it compile with Qt < 5.6 2016-08-28 11:19:00 +02:00
Albert Vaca
54801aac3b Use a new config group so we don't conflict with older versions' config 2016-08-25 18:06:01 +02:00
Aleix Pol
d9e7f308c2 Show the announcedName in the qml app
Makes it possible to display it and modify it
Introduces a DBusProperty component that can be used if we don't want
to go through the QtDBus property generation hell.
2016-08-21 19:38:15 +02:00
Aleix Pol
f765e9c0a8 Actually compare the old plugin map
We were comparing to the result after removing all the actually used
plugins
2016-08-21 13:21:40 +02:00
Aleix Pol
0774020899 Merge branch '1.0' into 1.x 2016-08-14 21:15:13 +02:00
Aleix Pol
426bf2a105 Merge branch '1.0' 2016-08-08 19:39:21 +02:00
Aleix Pol
91f952f5f1 Fix test
Use the right port
Store the port in a public variable, so it can be used from the test.
2016-08-08 19:38:58 +02:00
Albert Vaca
50496a3442 Reverted change that introduced a crash.
If there are ssl erros with unpaired devices, link was null.

This reverts commit 7da30ddbb1.
2016-08-03 22:01:04 +02:00
Albert Vaca
2cdf7d5499 Reduced logging 2016-07-12 12:49:21 +02:00
Albert Vaca
f41877fbec Disabled removing links when exiting discovery mode because it was broken.
If both devices are in "discovery mode" (ie: both want to keep links
established) and the last one to create the link goes out of discovery
mode, it will close the link when it shouldn't (because the other end still
was "using" it to display it to the user).
2016-07-12 12:38:40 +02:00
Albert Vaca
7da30ddbb1 Use the pairing handler instead of accessing the device directly on error 2016-07-12 12:34:56 +02:00
Albert Vaca
0b3de33d74 Minor 2016-07-12 12:33:57 +02:00
Albert Vaca
4e8a325479 Do not specify type for struct 2016-07-12 12:32:58 +02:00
Albert Vaca
6248f03256 Made a QString const refrence. 2016-07-07 01:09:07 +02:00
Albert Vaca
47c78427cb Removed outdated comment 2016-07-07 01:07:51 +02:00
Aleix Pol
81634303b2 Make capabilities static
As discussed with Albert, move the population of capabilities into the
identity package, making them static along the execution of the link.

When we receive the identityPackage, we collect the plugins we can use with
the device and stick to those. This should simplify the implementation and
remove the possibility to lose packages if packages are received before the
capabilities are processed in the former approach.

REVIEW: 128386
2016-07-06 17:37:22 +02:00
Aleix Pol
afdac88885 Proper i18n use 2016-07-06 16:41:38 +02:00
Aleix Pol
8d7d820ef4 Naming consistency. Capabilities is the correct name 2016-07-06 15:55:04 +02:00
Aleix Pol
0e76082fc6 Remove commented code
Used to be used when we encrypted and decrypted using QCA. Now it's done
by the device link.
2016-07-06 00:59:37 +02:00
Albert Vaca
5933c6810c More unused includes cleanup 2016-07-05 14:27:53 +02:00
Albert Vaca
7c0fbbc034 Unused include cleanup 2016-07-05 14:13:48 +02:00
Aleix Pol
0d6a7bafcf Remove unused variable 2016-07-05 13:14:55 +02:00
Aleix Pol
5a265a55de Start consuming right away, if there's data available from the start
Fixes sendfiletest
2016-07-05 13:14:47 +02:00
Albert Vaca
963a15bd08 Fixed crash where a device was destroyed but links tried to use it. 2016-07-05 12:42:57 +02:00
Albert Vaca
9c736583e2 Use the actual connection origin, so we don't keep all connections open. 2016-07-05 12:42:39 +02:00
Aleix Pol
2b451097eb Make sure errors get reported 2016-07-05 01:00:02 +02:00
Albert Vaca
385bf77480 Fixed bug which didn't allow to pair a new device 2016-07-04 19:52:37 +02:00
Aleix Pol
359194c2ed Use initializers to construct it 2016-07-04 19:18:13 +02:00
Albert Vaca
04713de718 Remove qdebugs 2016-06-26 15:48:37 +02:00
Aleix Pol
ef98fb4587 Fix file transfer under SSL
Introduces a big fat buffer :(
Actually test the trasfers :)
Takes QSslSocket causistic into account, for some reason QNAM refuses to
mark as finished when the QSslSocket (through QIODevice) closes.
It would be good to look into dropping the QBuffer, doing so with the test
in place will help.
2016-06-22 17:49:45 +02:00
Aleix Pol
86b086e392 Make warnings actual warnings 2016-06-22 16:31:01 +02:00
Albert Vaca
01139d31d1 De-duplicated socket SSL configuration code 2016-06-22 14:27:09 +02:00
Aleix Pol
f011191eca Fix few issues in FileTransferJob
Handle errors from different endpoints
Don't ::startTransfer when we find a colliding file
2016-06-22 12:42:51 +02:00
Aleix Pol
4cb50d69d8 Fix some issues in the downloadjob and its test
Test on KJob abstraction, this way we can check if it has an error when it
breaks.
Handle errors in a different branch of the code.
2016-06-22 12:40:14 +02:00
Aleix Pol
f9406e8afc Introduce QVariantMap as an argument of NetworkPackage
Makes it possible to specify the different properties sent at once,
rather than one by one as we used to do.

Also port whenever possible to the initializer-list syntax.

REVIEW: 128269
2016-06-21 20:07:12 +02:00
Albert Vaca
aa41b40ab5 Changed magic number by constant 2016-06-21 18:42:53 +02:00
Albert Vaca
e880e14ed5 Preffer Q_FOREACH to foreach 2016-06-21 14:50:17 +02:00
Albert Vaca
5abd081b85 Changed port so we don't conflict with Houdini 2016-06-21 14:42:32 +02:00
Aleix Pol
bfd698af36 Fix issues detected by clazy
Don't use for(:) on Qt containers. It detaches without need.
2016-06-20 19:22:29 +02:00
Aleix Pol
596e4484f4 Clean up use of virtual and override keywords
Only use virtual when actually virtual, to override just use override.
2016-06-20 19:22:29 +02:00
Albert Vaca
cc0fdacbf5 Fixed compilation on Windows 2016-06-20 02:31:55 +02:00
Albert Vaca
c4d7c2f39b Improved comments 2016-06-17 02:00:23 +02:00
Albert Vaca
e379fcd69d Destroying a socket should not destroy the link.
Also, sockets can be destroyed as soon as the socketreader is deleted.
2016-06-17 02:00:23 +02:00
Aleix Pol
83a56c47e9 Drop NetworkPackage QObject heritage
It was only used for introspection and we can use Q_GADGET for that.
Make the NetworkPackage objects much lighter.

REVIEW: 124166
2016-06-16 20:33:13 +02:00
Albert Vaca
91c23dfdea Do not compare against the current version of the protocol 2016-06-16 19:48:23 +02:00
Albert Vaca
cb0fd1fe20 Removed a case where we would still add a link on old protocol versions 2016-06-15 20:38:57 +02:00
Aleix Pol
b9be1e17d1 Specify for which device we're not delivering the packages 2016-06-12 20:16:58 +02:00
Aleix Pol
5715926c5c Export the symbols needed by the tests 2016-06-10 15:07:33 +02:00
Albert Vaca
3177143439 Fixed build on windows 2016-06-09 02:36:02 +02:00
Albert Vaca
1c315af108 Revert "Fix file transfers"
This reverts commit 252ea4ba20.
2016-06-07 00:28:52 +02:00
Aleix Pol
c7429b56b7 In the CLI interface, make it possible to refer a device by name
Only works with trusted devices
2016-06-06 01:21:37 +02:00
Aleix Pol
751bd5849b small style changes 2016-06-06 01:21:37 +02:00
Frederik Schwarzer
a594324d4f Fix message wording. 2016-06-03 21:33:25 +02:00
Aleix Pol
252ea4ba20 Fix file transfers 2016-06-03 16:38:04 +02:00
Aleix Pol
8736d2559e Notify if a package is being discarded 2016-06-03 15:51:05 +02:00
Aleix Pol
fd19426756 Make it possible to put NetworkPackage right into qDebug 2016-06-03 15:50:46 +02:00
Albert Vaca
7a0bb09353 Make sure we don't broadcast more than once at the same time.
Race conditions might happen because two links will be created.
2016-06-02 12:18:51 +02:00
Albert Vaca
7a67274a18 Fixed memory leak. 2016-06-02 12:17:07 +02:00
Albert Vaca
0c48c00fa7 Added debug function to print a stack trace 2016-06-01 12:43:34 +02:00
Aleix Pol
70d447f58f better debug information 2016-06-01 01:14:30 +02:00
Aleix Pol
702fbd09af If interfaces are required is up to the plugin 2016-05-31 20:46:48 +02:00
Aleix Pol
16eccd46d3 Restore having plugins without any capabilities
These won't need to be matched by the other device
2016-05-31 20:16:25 +02:00
Albert Vaca
4383a42703 Changed the way we detect if capabilities are supported 2016-05-31 20:10:35 +02:00
Albert Vaca
5654300249 Removed logs 2016-05-31 20:09:52 +02:00
Aleix Pol
9aa794b0da Merge branch 'master' into sslrefactor 2016-05-31 17:29:06 +02:00
Aleix Pol
c2349bacd7 Make sure we don't eat all system memory
I had wrong configuration files, the encription algorithm definitely
doesn't take it into account.
2016-05-05 17:45:49 +02:00
Vineet Garg
b96227ae75 Changed protocol version to TLS 1.0, as TLS 1.2 not supported on many Android device
Choosing cipher suites manually, same as of Android
2016-04-30 20:39:34 +05:30
David Kahles
abc5fa3c56 Remove second UDP socket in LanLinkProvider
We don't need two sockets for reading and writing.

REVIEW: 127769
2016-04-28 00:19:20 +02:00
Albert Vaca
29d3f9aa7a Expose protocol version 2016-04-14 18:52:31 -07:00
David Kahles
174cf3d3ce Don't reset m_pairStatus when unpair is requested by remote device
unpairInternal() will take care of this, otherwise pairingChanged() will not
be emited and though, the model won't notice it.

REVIEW: 127641
2016-04-13 08:44:47 +02:00
Albert Vaca
78d4ba2106 Cleanup 2016-03-08 07:29:34 -08:00
Albert Vaca
ff9775e1c9 Better logging of what's going on 2016-03-07 16:01:44 -08:00
Albert Vaca
8f9fde8f40 Fixed crash when pairing old Android apps. 2016-03-02 16:38:03 -08:00
Albert Vaca
ebd429629a Fixed unpairs never being sent 2016-03-02 16:17:38 -08:00
Albert Vaca
ea812f1101 Attribute not needed 2016-03-02 15:50:06 -08:00
Albert Vaca
b1ef3f9fc9 Use a different key for settings, so we don't clash with older versions. 2016-03-02 15:36:45 -08:00
Albert Vaca
90d2b0ad69 Changing TLS version to what is used in LanLinkProvider.
Android<16 doesn't support TLS>1.0
2016-02-12 09:02:56 -08:00
Albert Vaca
6cde0271fb Removed loopbackpairinghandler 2016-02-12 07:59:12 -08:00
Albert Vaca
aa4150f0c9 Moved ConnectionStarted from DeviceLink to LanDeviceLink 2016-01-10 07:12:13 -08:00
Albert Vaca
2aca5ca11e Added error message when trying to pair older devices 2015-12-17 09:24:34 -08:00
Aleix Pol
8a019ccddf Fix assert 2015-12-17 17:58:33 +01:00
Albert Vaca
7ed012e4a5 Fixed broadcast 2015-12-17 08:59:08 -08:00
Albert Vaca
f5404ea11b Removed more references to publicKey 2015-12-17 08:22:18 -08:00
Albert Vaca
918bb82ffa Do not store certificate and key in landevicelink
The socket already stores the certificate, and the public key is only used
in the sftp plugin, so it should be moved there or dropped.
2015-12-17 07:46:13 -08:00
Albert Vaca
4c84499e6a Don't addLink twice for the same link 2015-12-17 07:44:29 -08:00
Albert Vaca
dd7d4093ed Removed sendPackageEncrypted from DeviceLink 2015-12-17 07:43:52 -08:00
Albert Vaca
d37830b429 Simplified pairing logic 2015-12-17 06:54:29 -08:00
Albert Vaca
10b4ca00fb Set certificate in outgoing pairing packet 2015-12-17 06:53:57 -08:00
Albert Vaca
af43a21864 Propagate pairingError 2015-12-17 06:53:29 -08:00
Albert Vaca
1848e96a91 Fixed old signal name 2015-12-17 05:54:37 -08:00
Albert Vaca
49a24c258b Fixed crash 2015-12-17 05:54:24 -08:00
Albert Vaca
813c9fedb3 Calling setDeviceLink in pairing handler is not required anymore
Since we re-use the same device link object forever now
2015-12-17 04:41:53 -08:00
Albert Vaca
ddca4d6d63 Store and restore certificate and public key in lan link 2015-12-17 04:41:10 -08:00
Albert Vaca
945da8a84f Removed encrypted package type define 2015-12-10 19:06:55 -08:00
Albert Vaca
79a8103120 Added some asserts 2015-12-10 19:06:55 -08:00
Albert Vaca
2e4c3762e9 Re-use landevicelink objects instead of re-creating one each time 2015-12-10 17:11:48 -08:00
Albert Vaca
77facdbcfd Merge branch 'master' into sslrefactor 2015-12-07 03:38:06 -08:00
Albert Vaca
2e4ce90656 Commented out old encryption functions 2015-12-07 03:34:41 -08:00
Aleix Pol
d69cdce4c1 Make sure incoming Lan pair packages are processed by the LanPairHandler 2015-12-06 02:12:29 +01:00
Aleix Pol
7041c72aed Fix connect 2015-12-06 02:11:50 +01:00
Aleix Pol
e10b2e80c9 Propagate pairing errors 2015-12-06 01:51:53 +01:00
Aleix Pol
90c8f588bc Only respond to local broadcasts 2015-12-06 01:19:55 +01:00
Aleix Pol
69d899ed48 Only broadcast when the newly reported configuration is actually active 2015-12-06 01:19:20 +01:00
Aleix Pol
97d97ffa1b Fix connect 2015-12-06 01:18:27 +01:00
Holger Kaelberer
f072a0c615 notifications: allow to configure how to sync desktop notifications
Added kcm ui with global and app-specific config options.

Global options affect all notifications:

- Persistent only? --> Sync only notifications with timeout == 0?
- Include body? --> Add body string to summary when syncing?
- Minimum urgency

Per-application options affect notifications sent by a specific
application:

- Sync it at all?
- If yes, allow to define a "blacklist" pattern (QRegularExpression)
  to define which notifications should *not* be synced.

Applications are maintained in the per-device config and added when
seen the first time by the notification listener. From that moment on
they can be configured in the kcm ui.
2015-12-05 23:23:22 +01:00
Albert Vaca
03926cc3bf WIPx4 2015-12-02 11:04:35 -08:00
Albert Vaca
af5be6e9e0 Added a test mode to lanlinkprovider
Should fix tests when you run them on networks with real kdeconnects
running.
2015-12-02 09:49:00 -08:00
Albert Vaca
cf6cbd2925 WIPx3! 2015-12-01 10:45:14 -08:00
Albert Vaca
82bc73dd9b WIPx2 2015-12-01 07:25:34 -08:00
Albert Vaca
16f9af908a WIP 2015-11-30 10:36:01 -08:00
Albert Vaca
30d2dd991b Merge branch 'master' into sslmaster 2015-11-30 03:40:07 -08:00
Aleix Pol
0bca50af93 Merge branch '0.9' 2015-10-19 17:48:13 +02:00
Albert Vaca
d2b4a6f214 Indentation 2015-10-18 21:51:51 -07:00
Albert Vaca
e2f068b286 Fixed a memory leak making the DownloadJob destroy itself on disconnect
There are still some code paths where it doesn't get destroyed though,
like when the device gets unreachable (and the download socket doesn't
close for some reason).
2015-10-18 21:51:51 -07:00
Albert Vaca
229e3aa070 Removed unused class 2015-10-18 19:42:40 -07:00
Albert Vaca
4574aa3639 Make the origin also contain the file name, not only the device name 2015-10-17 13:32:57 -07:00
Vineet Garg
646196b3eb Added loopback pairing handler 2015-09-14 16:36:04 +05:30
Vineet Garg
73a80f0296 Fixed Lan Link Provider Test
Pairing timer was started even when pair package sending is failed, fixed that
2015-09-13 01:45:19 +05:30
David Edmundson
97034e3bbd Don't cleanup devices if pairing 2015-09-12 22:03:56 +02:00
David Edmundson
f1f3f48aaf Export pairStatus 2015-09-12 22:03:39 +02:00
Aleix Pol
2c2cb21ee1 Don't clean the devices that looked us up in the first place 2015-09-12 20:53:05 +02:00
Albert Vaca
217d4b60ff Fixed outging capabilities 2015-09-12 08:51:39 -07:00
Albert Vaca
4230f4fb44 Added a signal so plugins know when we update the config 2015-09-12 04:50:20 -07:00
Aleix Pol
f7423c6ad6 Better use of error information 2015-09-12 09:47:47 +02:00
Aleix Pol
4730022810 Pass arguments as const-reference 2015-09-12 09:45:59 +02:00
Aleix Pol
5e0a7a34b9 Merge branch 'master' into ssl
# Conflicts:
#	cli/kdeconnect-cli.cpp
#	core/backends/lan/landevicelink.cpp
#	core/backends/lan/landevicelink.h
#	core/backends/lan/lanlinkprovider.cpp
#	core/backends/lan/lanlinkprovider.h
#	core/backends/lan/socketlinereader.h
#	core/backends/lan/uploadjob.cpp
#	core/backends/lan/uploadjob.h
#	core/backends/loopback/loopbackdevicelink.h
#	core/daemon.cpp
#	core/daemon.h
#	core/device.cpp
#	core/device.h
2015-09-11 17:25:23 +02:00
Aleix Pol
b62349cae6 Merge branch 'stable' 2015-09-11 17:03:57 +02:00
Aleix Pol
9fedfcdb3d Notify QNAM about the file received size 2015-09-11 17:03:11 +02:00
Albert Vaca
89afa5b9af Renamed capabilties so we don't clash with KDE4's broken implementation 2015-09-11 06:20:15 -07:00
Aleix Pol
47147c5fa1 Merge branch 'stable' 2015-09-11 14:04:54 +02:00
Aleix Pol
c2acc37da6 Fix filtering of plugins that don't support capabilities 2015-09-11 14:00:15 +02:00
Aleix Pol
95f01c4bea Use C++ for setting the default argument 2015-09-11 12:34:52 +02:00
Aleix Pol
ca4a81b8e8 Merge branch 'stable' 2015-09-11 12:24:15 +02:00
Aleix Pol
2b8a54357e Remove redundant copy constructor 2015-09-11 12:22:59 +02:00
Aleix Pol
c62fac0bcf Don't join hte interfaces in 1 string
Let NetworkPackage do the serialization
2015-09-11 12:14:19 +02:00
Albert Vaca
4c98e2e7b3 Less verbose output 2015-09-11 02:29:57 -07:00
Albert Vaca
b07e442b97 Less verbose plugin loader 2015-09-11 01:12:34 -07:00
Albert Vaca
4df14d1c7d Fixed plugins without incoming nor outgoing packages being disabled 2015-09-11 01:12:22 -07:00
Patrick von Reth
da5c9bd30e Fix compilation on Windows. 2015-09-10 15:51:38 +02:00
Aleix Pol
4cccb7344a ++verbosity on error 2015-09-09 20:12:16 +02:00
Aleix Pol
a9d2840664 Use acquire and release instead of a boolean property
This way we hope we won't end up without discovery if 2 instances need
discovery at the same time.

Reviewed by Albert Vaca
2015-09-09 20:09:04 +02:00
Aleix Pol
32daa4e51f Fix misbehaviour
Delete devices, not links
2015-09-09 13:42:28 +02:00
Aleix Pol
77e92262fe Fix build 2015-09-09 13:03:08 +02:00
Aleix Pol
26b0ec8b98 Make sure we don't disconnect from discovering remotes
Otherwise it's hard to let other devices connect to us, without having both
devices in discoverability mode.

Reviewed by Albert Vaca
2015-09-09 13:01:38 +02:00
Albert Vaca
c65be84a89 Only send capabilities packets for paired devices 2015-09-09 01:19:38 -07:00
Aleix Pol
a0da8ba858 Let the KPluginSelector react to changes in the plugin configuration
Mainly whenever the remote capabilities change.

Reviewed by The Vaca Man
2015-09-08 20:03:44 +02:00
Aleix Pol
b101e828a4 Fix capabilities detection
Only consider capabilities as unsupported if both incoming and outgoing are
empty, rather than either.

Reviewed by Albert Vaca
2015-09-08 17:58:40 +02:00
Aleix Pol
6a379e9227 Rename missingPlugins to unsupportedPlugins 2015-09-08 17:38:33 +02:00
Aleix Pol
617b66aeb8 small code simplification
removes changes from list to set
always uses the same path for figuring out the interfaces.

reviewed by Albert Vaca
2015-09-08 17:35:30 +02:00
Aleix Pol
df3581459a Add a test that makes sure that capabilities are gathered correctly
While at it, fix the logic, because it wasn't working all that well.

Reviewed by Albert Vaca
2015-09-08 17:35:30 +02:00
Albert Vaca
854e4227fa Read the capabilities in the first addLink instead of only the constructor 2015-09-08 08:37:43 -07:00
Aleix Pol
817fcbc9d6 Merge branch 'stable' 2015-09-08 10:51:41 +02:00
Aleix Pol
d58f6314fe run Clang Modernize
Minus the auto change
2015-09-08 10:47:37 +02:00
Albert Vaca
1a63d18ada Print more info 2015-09-08 01:12:00 -07:00
Aleix Pol
4023bf0599 Only keep connections alive with unpaired devices when discovery is enabled
At the moment, we were keeping the connection alive with every reachable
device. While this works optimally for most use-cases, on networks with
several devices with KDE Connect, the amount of connections grows
exponentially.

Reviewed by Albert Vaca

CCBUG: 352424
2015-09-08 09:30:55 +02:00
Aleix Pol
774893d3f9 cleanup
make attribute const
construct when initializing
no need to have all methods as slots
2015-09-08 09:22:31 +02:00
Aleix Pol
e1be5319f5 Only broadcast again if the network configuration actually changes
Reviewed Albert Vaca
2015-09-08 09:05:06 +02:00
Aleix Pol
4960247fb5 Add a package type that updates the device capabilities
Every time we reload the plugin list, report the plugins that we support.
If the remote devices' capabilities change, update the plugin list.

Reviewed by Albert Vaca
2015-09-07 20:03:05 +02:00
Aleix Pol
f65a1f206f Turn core qWarnings into qCWarning 2015-09-07 19:35:07 +02:00
Aleix Pol
91351773fd Mark incompatible plugins as such in the kcm
If a plugin isn't available, display it as unsupported by the device. This
is figured out through capabilities.

Reviewed by Albert Vaca
2015-09-07 19:35:07 +02:00
Aleix Pol
61f357a512 Fix regression
Reviewed by Albert Vaca
2015-09-07 17:12:28 +02:00
Aleix Pol
d835d01a09 Add a test for file sending, using the loopback device
Extends unit testing by making sure that file sharing works locally.

REVIEW: 125086
2015-09-07 15:03:04 +02:00
Vineet Garg
78e9c08732 Merge branch 'master' into ssl
Conflicts:
	core/backends/lan/socketlinereader.h
	core/backends/lan/uploadjob.h
	core/networkpackage.h
2015-08-25 03:43:41 +05:30
Vineet Garg
17da38e5ba Explicity using TLSv1 because using AnyProtocol causes a default TLSv1.2 handshake which not supported on older android version
Was using QueryPeer instead of VerifyPeer of isDeviceTrusted of connected slot
2015-08-25 01:14:24 +05:30
Boris Egorov
1924173df2 Fix various krazy2 warnings
Fix following krazy2 warning types:
[explicit], [endswithnewline], [doublequote_chars], [includes], [normalize],
[postfixop], [spelling]

See http://ebn.kde.org/krazy/reports/playground/base/kdeconnect-kde/index.html
for details.

SLOT/SIGNAL normalization done with Qt normalize utility:
https://github.com/qtproject/qtrepotools/tree/master/util/normalize

REVIEW: 124857
2015-08-21 22:38:54 +06:00
Vineet Garg
44c0ec1c78 If remote device certificate is changes, in sslError due to simulataneous multiple connections, unpair was called on null pointer 2015-08-17 20:04:41 +05:30
Vineet Garg
eff84a49d4 We support any protocol instead of TLSv1.2 2015-08-16 21:19:56 +05:30
Vineet Garg
9bc93b6337 We generate certificate from present date -1 year to present date + 10 year, this avoids the case where certificate is not valid due to difference of time zones 2015-08-14 17:50:58 +05:30
Vineet Garg
75bd15ed65 Added default value while checking for link name in pairing handler, this provides backward compatibility 2015-08-14 17:33:08 +05:30
Vineet Garg
6fe1399a18 Fixed minor issues in pairing handler 2015-08-13 14:56:28 +05:30
Vineet Garg
c5a399b94b Fixed code identation issue 2015-08-12 23:49:15 +05:30
Vineet Garg
6acb4204a2 Added KdeConnectConfigTest, TestSslSocketLineReader, LanLinkProviderTest 2015-08-12 23:42:27 +05:30
Vineet Garg
cf3d37b504 Fixed issue pointed out on RR
Fixed some pairing handler issues
2015-08-11 09:04:02 +05:30
Vineet Garg
2824e73617 Pairing handler implemented 2015-07-27 20:58:58 +05:30
Vineet Garg
27515546a0 Now per device per link type pairing handlers are there 2015-07-25 17:15:19 +05:30
Vineet Garg
1b430db4a3 Fixed indentation 2015-07-19 21:59:27 +05:30
Vineet Garg
eda2563d03 Fixed encryption info in cli 2015-07-19 20:25:28 +05:30
Vineet Garg
20e46418ba Encryption info in cli 2015-07-18 18:54:10 +05:30
Vineet Garg
e6da860fb7 Fixed issues pointed out on CR 2015-07-14 17:34:04 +05:30
Vineet Garg
781adac15b Removed whitespace 2015-07-13 19:55:22 +05:30
Vineet Garg
1ba68150a7 Made server like normal QTcpServer 2015-07-10 03:57:27 +05:30
Vineet Garg
7c777e6279 Implemented pairing handler interface 2015-07-10 03:21:08 +05:30
Vineet Garg
e7617f3da9 Use Q_DECL_OVERRIDE in server 2015-07-08 02:45:59 +05:30
Vineet Garg
8b0f06e484 Code cleanup, fixed socket deletelater issue 2015-07-08 00:22:10 +05:30
Vineet Garg
b6b5257ba4 Added ssl support in download job 2015-07-06 03:19:58 +05:30
Vineet Garg
0c110e4392 Added SSL encryption in file upload
DeviceId is used for peerVerifyName
2015-07-06 02:35:26 +05:30
Vineet Garg
148a713176 Initial working implementation of ssl 2015-07-05 18:53:53 +05:30