Commit graph

395 commits

Author SHA1 Message Date
David Faure
8f1660d580 Port away from QString::null 2019-07-20 18:36:47 +02:00
Nicolas Fella
377f478aeb Print socket error when connection fails 2019-06-05 20:38:50 +02:00
Nicolas Fella
a28059315e [backends/lan] Don't fail silently when a UDP packet could not be unserialized 2019-06-05 20:28:36 +02:00
Nicolas Fella
ef78640caf Fix crash in daemon 2019-06-05 20:27:03 +02:00
Matthijs Tijink
a2c6f0a806 Retry the network packet if it failed to unserialize
This happens if the network packet is big enough to not transfer in one
go.
2019-03-23 22:11:20 +01:00
Bart Ribbers
43e6fed43d 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-10-30 22:04:14 +01:00
Albert Vaca
0fc98240c0 Remove characters from UUID that aren't legal in URLs 2018-09-06 18:20:07 +02:00
Albert Vaca
3c82c358ab Add a generic "something changed" signal 2018-05-30 20:24:16 +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