Commit graph

679 commits

Author SHA1 Message Date
Albert Vaca Cintora
ce0f00fc2d Limit the ports we try to connect to to the port range of KDE Connect
So we can't trigger connections to other services.

Thanks Matthias Gerstner <mgerstner@suse.de> for reporting this.
2020-10-02 12:52:08 +02:00
Albert Vaca Cintora
613899be24 Do not remember more than a few identity packets at a time
To prevent the kdeconnect process from using too much memory.

Thanks Matthias Gerstner <mgerstner@suse.de> for reporting this.
2020-10-02 12:52:08 +02:00
Albert Vaca Cintora
542d94a70c Limit number of connected sockets from unpaired devices
Thanks Matthias Gerstner <mgerstner@suse.de> for reporting this.
2020-10-02 12:52:08 +02:00
Aleix Pol
8112729eb0 Don't brute-force reading the socket
The package will arrive eventually, and dataReceived will be emitted.
Otherwise we just end up calling dataReceived to no end.

Thanks Matthias Gerstner <mgerstner@suse.de> for reporting this.
2020-10-02 12:52:08 +02:00
Aleix Pol
024e5f23db Do not let lanlink connections stay open for long without authenticating
If there's no information received, close the socket to try again.

Thanks Matthias Gerstner <mgerstner@suse.de> for reporting this.
2020-10-02 12:52:08 +02:00
Aleix Pol
4fbd01a3d4 Limit identity packets to 8KiB
Healthy identity packages shouldn't be that big and we don't want to
allow systems around us to send us ever humongous packages that will
just leave us without any memory.

Thanks Matthias Gerstner <mgerstner@suse.de> for reporting this.
2020-10-02 12:52:08 +02:00
Matthias Gerstner
7e47d04053 Fix use after free in LanLinkProvider::connectError()
If QSslSocket::connectToHost() hasn't finished running.

Thanks Matthias Gerstner <mgerstner@suse.de> for reporting this.
2020-10-02 12:52:08 +02:00
Albert Vaca Cintora
aa84aa5dcb Do not leak the local user in the device name.
Thanks Matthias Gerstner <mgerstner@suse.de> for reporting this.
2020-10-02 12:52:08 +02:00
Albert Vaca Cintora
7b904f47b3 Do not ignore SSL errors, except for self-signed cert errors.
Thanks Matthias Gerstner <mgerstner@suse.de> for reporting this.
2020-10-02 12:52:08 +02:00
Aleix Pol
bf089f3461 Remove unused variable 2020-09-24 18:31:11 +02:00
Aleix Pol
d4cf48901c SocketLineReader: don't call packets bytes 2020-09-16 02:16:06 +02:00
Nicolas Fella
400c800deb [app] Add plugin settings page
Include a page that allows (de)selecting and configuring plugins

This is one of the last missing pieces for feature parity with the KCM.
2020-09-08 20:33:20 +02:00
Richard Liebscher
8d16d05c8a Custom devices 2020-08-18 21:55:24 +02:00
Nicolas Fella
87db95b22f Convert license headers to SPDX expressions 2020-08-17 09:48:10 +00:00
Piyush Aggarwal
771c9dcd22 fix code indentation in lanlinkprovider 2020-08-07 21:22:28 +00:00
Piyush Aggarwal
e3225a1430 fix QSslKey::ca-certificate deprecated warning 2020-08-07 21:22:28 +00:00
Richard Liebscher
f1b3c0e0ca Better device name in Sailfish OS 2020-08-02 19:19:27 +00:00
Richard Liebscher
f3656d962c Save changed device name and type 2020-08-02 18:34:02 +02:00
Nicolas Fella
79164ca8ba Replace manual include dir handling with interface target
We use kdeconnect-version.h in several places and therefore it needs to be in the include path. We currently do this by setting target_include_path in a few places. Replace this with an interface library that we can link against that sets up the correct include path. IMO it is cleaner this way.
2020-07-30 10:53:48 +02:00
Antonio Larrosa
1d36164230 Use ecm_qt_declare_logging_category to declare the logging categories
This automatizes the generation of logging categories so a
kdeconnect-kde.categories is generated and installed to
/usr/share/qlogging-categories5/ so kdebugsettings can use it.

Also, sets the default logging level to Warning. So now the logs
of users won't be filled with debug messages but they can
modify the configuration easily with kdebugsettings.
2020-05-26 18:55:47 +02:00
Nicolas Fella
93e68756bc Port away from deprecated error signal 2020-05-09 17:21:14 +00:00
Nicolas Fella
4254b23d5d trim some whitespace 2020-05-09 16:46:52 +02:00
Nicolas Fella
9277cc537a Implement basic device type detection 2020-04-24 12:24:56 +00:00
Abdel-Rahman Abdel-Rahman
2728f8d864 Close all sockets before suspension 2020-04-16 22:32:57 +00:00
Nicolas Fella
1a9c2dbc4c Fix coding style 2020-04-10 23:43:06 +02:00
Nicolas Fella
28e7e99100 Merge branch 'release/20.04' 2020-03-21 21:21:02 +01:00
Nicolas Fella
eac1e07e29 Revert "Make default name and device type customizable"
This causes a crash described in https://invent.kde.org/kde/kdeconnect-kde/-/merge_requests/206#note_37534

This reverts commit a39a2d562d.
2020-03-21 21:13:41 +01:00
Nicolas Fella
2c8cf96a6c Read payload size as qint64 2020-03-20 19:54:47 +00:00
Richard Liebscher
e066ef9236 Vergotten include in !190 2020-03-10 19:49:41 +00:00
Richard Liebscher
a39a2d562d Make default name and device type customizable 2020-03-01 20:55:40 +00:00
Richard Liebscher
bb5539c8c3 Make plugins work in SailfishConnect 2020-03-01 20:00:40 +00:00
Nicolas Fella
6025f7cc48 Remove usused includes 2020-01-20 22:35:37 +01:00
Richard Liebscher
456d4830fe Made code more explicit and additional tests. 2020-01-04 14:13:36 +01:00
Richard Liebscher
5c0ad3fb85 Remove payload keys when no payload exists 2020-01-03 15:48:48 +01:00
Yuri Chornoivan
ba8ee54558 Fix minor typos 2019-12-22 10:15:58 +02:00
Yuri Chornoivan
01c4d0411b Fix minor EBN issues 2019-12-22 09:49:55 +02:00
Yuri Chornoivan
88fd5eb63d Do not extract messages from the non-existent .ui and .rc files 2019-12-21 10:04:31 +02:00
Kai Uwe Broulik
5da0ae7903 Set total amount of files
Ensures the progress dialog can show the total number of files
and offer additional actions for when a single file was copied.
2019-12-19 15:58:05 +01:00
Richard Liebscher
ba34672cbd Make build for SailfishConnect possible 2019-12-09 22:14:19 +00:00
Nicolas Fella
724a5a14a8 Don't use KIO in core when building for Sailfish 2019-10-27 19:35:18 +00:00
Nicolas Fella
8a25eb6f8a Fix mac build 2019-09-18 14:56:45 +02:00
Nicolas Fella
39fe270cd1 Port Kdeconnectconfig to reference based singleton
It's more expressive in the sense that it makes clear that the user should not delete the object
2019-09-08 17:09:52 +02:00
Erik Duisters
f91b9e9951 Setting m_payloadSize is already handled by qvariant2qobject and it is of type qint64 not int 2019-08-21 19:37:38 +02:00
Nicolas Fella
0d7c504cf0 Rename DbusHelper => DBusHelper 2019-08-14 17:36:19 +02:00
Piyush Aggarwal
ccc8bb8a0e Split config issue fix for Win32 build 2019-08-01 14:01:50 +00:00
Weixuan Xiao
5fadeabce8 Optimization for executable path and resource path on macOS 2019-07-30 13:46:18 +00:00
Nicolas Fella
607b9a6566 Revert "Use ecm_qt_declare_logging_category"
It's missing stuff to work properly. Revert until I figured that out

This reverts commit 8a118a6fae.
2019-07-22 21:29:54 +02:00
Albert Astals Cid
af1255ed99 Use "new" connect syntax 2019-07-21 18:57:09 +00:00
Albert Astals Cid
1f8ba004f8 Use default NetworkPacket copy constuctor and assignment operator
clazy was complaining that the class had copy constructor but no assignment operator, which is usually suspicious

This is a bit of behaviour change though, since now m_payloadTransferInfo is also copied, which before wasn't, not sure if this is actually a good or a bad thing
2019-07-21 17:33:04 +00:00
Albert Astals Cid
9405cb58b0 Add NOTIFY signal to statusIconName property
Device::statusIconName depends on isReachable() and isTrusted()

Not sure how the property is used but it's good that they have a NOTIFY is defined if it's needed for completion
2019-07-21 15:57:38 +00:00
Matthijs Tijink
0b6224fc0e Bluetooth multiplexer integration and assorted fixes 2019-07-20 12:29:33 +02:00
Matthijs Tijink
cda1280456 Add connection multiplexer 2019-07-20 12:29:33 +02:00
Weixuan Xiao
df2ca7f25f Private DBus set launchctl env to fake a session bus 2019-07-09 19:42:08 +00:00
Albert Vaca Cintora
b8e50e976f Revert "Simplify contains + get value"
Broke the tests 🤷

This reverts commit f7e86ed131.
2019-07-05 00:58:33 +02:00
Albert Vaca Cintora
f7e86ed131 Simplify contains + get value 2019-07-05 00:15:05 +02:00
Albert Vaca Cintora
1e9a0f6808 Add braces 2019-07-05 00:13:55 +02:00
Weixuan Xiao
4f4b6c309f Allow to use private DBus 2019-06-18 01:21:31 +00:00
Nicolas Fella
8a118a6fae Use ecm_qt_declare_logging_category 2019-06-13 00:15:12 +02:00
Nicolas Fella
4de0f8cb9e Remove non-toplevel project() definitions 2019-06-12 22:47:17 +02:00
Nicolas Fella
e601755644 Force usage of QStringLiteral and port remaining offenders 2019-06-10 14:40:28 +00:00
Weixuan Xiao
13230ff580 Fix missing sessionBus() in core/notificationserverinfo.cpp 2019-06-09 18:45:03 +00:00
Weixuan Xiao
5431073844 Add wrapper for macos dbus connection 2019-06-09 15:28:49 +00:00
Simon Redman
c7579eb170 Fix LanLinkProviderTest on Windows
## Summary
LanLinkProviderTest fails on Windows. This patch fixes that.

I believe the root cause is that we are using a shared UDP socket to listen for identity broadcasts both in the LanLinkProvider and in the test. Apparently this works on Linux, but on Windows the LanLinkProvider picks up its own identity packet and pairs with itself.

This patch gives a parameter to LanLinkProvider to allow it to listen and broadcast on different ports, then uses that ability in the test to make the test pass on Windows.

## Test Plan

### Before:
lanlinkprovider test fails, first because it can't bind its UDP listener socket, and then because Windows seems to handle shared sockets differently than Linux, so the UDP broadcasts were not reaching the test's listener.

### After:
lanlinkprovider test seems to pass reliably both in my Windows VM and in the CI
2019-06-05 15:14:50 +00:00
Simon Redman
9453e640b3 Refactor testdevice 2019-06-05 02:42:06 +00:00
Simon Redman
4c75626919 Fix build
Commit 637285378d was not properly tested
2019-06-02 22:24:25 -06:00
Simon Redman
637285378d Add error logging to LanLinkProvider when binding the listener socket 2019-06-02 22:14:10 -06:00
Simon Redman
24ab6d15cf ## Summary
pluginloadtest and sendfiletest are crashing. This patch fixes that by allowing Daemon::init() to be called from TestDaemon

## Test Plan

### Before:
Both tests are crashing because it is not able to find any devices. It is not able to find any devices because the LanLinkProvider is not being added because Daemon::init() is not being called.

### After:
pluginloadtest and sendfiletest pass
2019-06-02 21:26:47 +00:00
Nicolas Fella
163f10c797 Remove unneeded include dir definition 2019-06-02 23:02:41 +02:00
Nicolas Fella
96cd55920e Use notification hints from new Plasma notification system 2019-06-02 14:03:11 +00:00
Nicolas Fella
283d014059 Use a compositejob for receiving files 2019-06-02 14:02:21 +00:00
Nicolas Fella
e1827ae33c Print socket error when connection fails 2019-05-26 20:36:35 +02:00
Nicolas Fella
8ea5a06470 Remove superflous spaces from debug message 2019-05-26 20:36:08 +02:00
Nicolas Fella
3c353e7828 Improve debug message wording 2019-05-26 20:30:39 +02:00
Nicolas Fella
2b7026fc10 Fix daemon's error handling 2019-05-13 22:35:25 +00:00
Nicolas Fella
a787b692f6 [FileTransferJob] Set file amount
Summary: This tells the new notification system that we're copying a file and lets it show a better summary.

Test Plan:
{F6821356}
Is the composite job stuff already merged? That probably needs adjusting too

Reviewers: #plasma, nicolasfella

Reviewed By: nicolasfella

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D21182
2019-05-13 12:50:07 +02:00
Nicolas Fella
c4bc7c567d Don't allow to enable nonexistant plugins 2019-05-10 22:20:12 +00:00
Nicolas Fella
67efdc4fef s/Q_DECL_OVERRIDE/override 2019-05-09 01:03:20 +02:00
Albert Vaca Cintora
5ddaadd471 More logging and remove redundant check as per CR 2019-05-09 00:03:59 +02:00
Albert Vaca
3fc7df550b Better error handling when loading cert and key
BUG: 405207
2019-05-09 00:03:59 +02:00
Nicolas Fella
0692295ae7 s/Q_NULLPTR/nullptr/ 2019-05-05 15:45:50 +02:00
Nicolas Fella
89987eb025 Coding style 2019-05-04 19:27:04 +02:00
Nicolas Fella
eef04f124b [backends/lan] Don't fail silently when a UDP packet could not be unserialized 2019-05-04 18:34:59 +02:00
Nicolas Fella
aff3d20e7e [lanlinkprovider] Improve method names 2019-05-04 13:10:27 +00:00
Erik Duisters
6fb67d0261 Delete partially downloaded file when transfer is canceled locally 2019-05-03 17:34:17 +02:00
Nicolas Fella
ecacb0eb80 Remove unneeded disconnects 2019-05-02 12:05:52 +00:00
Nicolas Fella
d3b6d1717d Port old connects 2019-05-01 23:42:24 +02:00
Nicolas Fella
ad0acbfae3 move initialization to initializer list 2019-05-01 23:26:07 +02:00
Nicolas Fella
d4026861ab Clean up includes 2019-04-30 19:03:24 +02:00
Nicolas Fella
b50b794250 Fix crash in daemon 2019-04-14 17:25:02 +00:00
Nicolas Fella
147fb6f35f Tweak Upload job finished notification 2019-03-31 19:19:28 +00:00
Nicolas Fella
3b8fedea1a Replace http GNU urls with https 2019-03-23 17:29:26 +01:00
Nicolas Fella
1f21cffb3e Add CMake flag to activate loop backend 2019-03-13 00:30:24 +00:00
Nicolas Fella
d587bbeeaa Remove unneeded link 2019-03-11 17:35:07 +01:00
Matthijs Tijink
97705c3c76 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-09 18:29:55 +01:00
Nicolas Fella
5c268466c3 Don't use empty QStringLiteral 2019-02-28 14:20:22 +01:00
Nicolas Fella
c9533ff64e Don't make signals const 2019-02-28 14:13:35 +01:00
Albert Vaca Cintora
10c370cc51 More useful error text
This helped me figure out the error in the test
2019-02-13 00:11:03 +01:00
Albert Vaca Cintora
a8e9c0d002 Make test not crash 2019-02-13 00:09:04 +01:00
Albert Vaca Cintora
395536b382 Remove unused include 2019-02-12 22:51:04 +01:00
Nicolas Fella
1f23fa27b2 Don't use QString::null 2019-02-03 02:00:36 +01:00
Nicolas Fella
8548ebd032 Clean up includes 2019-02-03 01:44:22 +01:00
Nicolas Fella
8f31862098 Add email to copyright 2019-02-03 01:20:02 +01:00
Erik Duisters
805795af07 Do not send an update packet until we have actually begun processing sub-jobs 2019-01-27 16:44:05 +01:00
Erik Duisters
0f2a60065a Add packet type "kdeconnect.share.request.update" to allow android to update the share notification 2019-01-27 11:33:02 +01:00
Erik Duisters
205eb8f497 Do not overload kuiserver 2019-01-26 17:44:16 +00:00
Matthijs Tijink
e77c1c87ac Add description of bluetooth multiplexing protocol
Summary:
As mentioned on telegram, there are some fundamental issues with bluetooth. The only approach I could get working was multiplexing: manually sending multiple streams of data over a single connection.

This is the description of that multiplexing protocol. I have an implementation of this protocol, but I'd first like some feedback to see if this is what we're going to use before finishing up those patches.

See the document itself for more details. I make the protocol forward-compatible, although I don't expect we will need ever that.

Test Plan: None, this is just a description.

Reviewers: #kde_connect, andyholmes, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: albertvaka, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17987
2019-01-19 14:03:37 +01:00
Nicolas Fella
1b20ecec32 Allow newer TLS versions
Summary:
Instead of mandating TLS V1.0 use 1.0 or later.
BUG: 400338

Test Plan: Phone connects

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: thomasp, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D18217
2019-01-18 08:59:45 +01:00
Erik Duisters
9f5cdf1a21 Do not close m_socket in socketError()
Summary:
When android closes the payload socket (cancel share) calling m_socket.close() results
in a recursive call to onError eventually leading to a segmentation violation

Test Plan:
Install D16491, share a large file from desktop to android and cancel the share on Android through
 the notification. kdeconnectd crashes almost 100% of the time. (It doesn't crash when it detects
 a disconnect in sendNextPacket)

Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17628
2019-01-06 12:43:10 +01:00
Matthijs Tijink
97551d09ff Add handling for the identity packet to be split across two messages.
Summary: If the identity packet is split across two packets, then save it until we get a notification that more data is available for reading over the bluetooth link.

Test Plan: Connect a phone and laptop over Bluetooth, and verify that both the phone and laptop are able to see each other, and that either side can start and successfully go through the pairing process.

Reviewers: #kde_connect, mtijink

Reviewed By: #kde_connect, mtijink

Subscribers: mtijink, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17789
2018-12-31 13:25:59 +01:00
Nicolas Fella
23703423fb Coding style 2018-12-25 01:52:16 +01:00
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