Commit graph

369 commits

Author SHA1 Message Date
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