Commit graph

121 commits

Author SHA1 Message Date
Aleix Pol
d58f6314fe run Clang Modernize
Minus the auto change
2015-09-08 10:47:37 +02:00
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
Aleix Pol
7d6912c11f Revert "Drop NetworkPackage QObject heritage"
It makes us depend on unreleased Qt 5.5. Will un-revert it
when Qt 5.5 is a dependency we can take.

CCMAIL: kdeconnect@kde.org

This reverts commit 1a2f569a47.
2015-06-27 20:54:07 +02:00
Aleix Pol
43451d6ae1 Simplify Device::id management
Removes the id->row mapping. It was broken as the indices weren't updated
when a row was added or removed.
Stop exposing Device::id through dbus, just store it in the interface
class.
* It's redundant as it's part of the interface definition
* If we keep it it will save us quite some dbus round-trips
* It will be reliable, as nowadays id() sometimes QString() if the dbus
connection is invalid.

REVIEW: 124158
2015-06-24 20:57:17 +02:00
Aleix Pol
1a2f569a47 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
2015-06-24 20:57:17 +02:00
Albert Vaca
77256e1932 Devices where not removed if they were unpaired after going offline 2015-06-21 19:40:05 -07:00
Albert Vaca
08938689c5 Emit less redundant events 2015-06-21 19:39:04 -07:00
Aleix Pol
68b206e525 Move the generation of dbus interfaces into interfaces/
Simplifies the code altogether by centralizing the generation into 1 call
that does all the steps.

REVIEW: 124120
2015-06-18 19:06:14 +02:00
Aleix Pol
5c79e8a7a6 Implement an MPRIS client plugin
Makes it possible to control remote MPRIS instances.

REVIEW: 124100
2015-06-18 04:01:01 +02:00
Albert Vaca
a4c8934ee7 If both devices request pairing at the same time, we just pair.
The second device accepts the request instead of failing.
2015-06-15 09:03:26 -07:00
Albert Vaca
2dab79bc3f Fixed warning. 2015-06-15 09:03:26 -07:00
Albert Vaca
09557b8a14 Moved network change detection from daemon to lanlink 2015-06-14 13:54:52 -07:00
Aleix Pol
cee2c6b057 Remove unused declaration 2015-06-13 01:27:16 +02:00
Aleix Pol
ef788e0658 Restore removed API, deprecate
REVIEW: 124084
2015-06-12 17:54:47 +02:00
Aleix Pol
b592dc99a0 Merge pairingSuccessful and unpaired signals into pairingChanged(bool)
REVIEW: 124067
2015-06-11 16:19:00 +02:00
Albert Vaca
e5b897884c Added device status icons to be used in the KCM instead of the IM ones 2015-05-17 23:28:58 -07:00
Aleix Pol
11996f56ca Drop dependency of KIO from kdeconnectcore
Use QNetworkAccessManager for storing the files we receive instead of
directly KIO, then provide the KIO-based QNetworkAccessManager from the
daemon. This way we'll still get the KIO network-transparency, but the
library only depenends on QtNetwork, which will be easier to get in some
platforms.

After this change, we only depend on KConfig, KI18n and KCoreAddons, which
are tier1 and really easy to work with on any platform.

REVIEW: 123325
2015-05-05 01:07:29 +02:00
Àlex Fiestas
ba4c87abc1 Consume all pendingDatagrams from udpServer
This fixes a bug where receiving broadcast messages would stop working
in case 2 messages have been received at the same time.

The problem is that readReady will only emit once per batch of datagrams
received, in case we receive 2 datagrams but only consume 1, readReady
will never be emitted again.
2015-05-05 01:04:50 +02:00
Albert Vaca
2f7e6f7de2 Fixed compilation warnings in clang (one of them is actually an issue!) 2015-04-19 22:50:12 -07:00
Aleix Pol
3caf5e7908 Move some find_package dependencies to the children directories as agreed 2015-04-10 17:48:48 +02:00
Aleix Pol
48cb087ec8 Remove unneeded KService include 2015-04-10 17:47:54 +02:00
Ashish Bansal
c8eb5e3074 Changed KF5 5.8 to 5.9 2015-04-09 16:22:56 +05:30
Albert Vaca
07773b8141 disconnected is specific to Sockets, abouTtoClose is generic to IODevice 2015-04-04 19:04:11 -07:00
Albert Vaca
fbbaa854b2 Const 2015-04-04 19:03:24 -07:00
Albert Vaca
dacaee6629 Fixed daemon sending lots of identity packets at startup
The way we were detecting the active network interfaces caused to detect
all of them at the application startup.
2015-04-04 16:32:15 -07:00
Albert Vaca
6c6f2b1a03 Fixed uninitialized members 2015-04-04 10:17:08 -07:00
Aleix Pol
c9700de391 cleanup
Don't store into a const-reference
Fix typo
2015-04-02 00:02:09 +02:00
Aleix Pol
9ab7e2356e Use QMetaObject for introspecting a QObject
It will be faster and will provide better error messages.

REVIEW: 123214
2015-04-01 23:38:32 +02:00
Aleix Pol
80d77fa9b6 Fix crash when incoming FileTransfer
Otherwise qobject2qvairant complains that a property is missing.

REVIEW: 123214
2015-04-01 23:37:25 +02:00
Yuri Chornoivan
0452839893 Add missing spaces 2015-03-25 19:46:29 +02:00
Aleix Pol
8f777040f7 Remove KNotifications dependency from libkdeconnectcore
Moves the implementation into the actual daemon. This opens the
possibility for different ways to expose these notifications depending on
where the libkdeconnect will be deployed.

REVIEW: 123076
2015-03-24 12:26:37 +01:00
Albert Vaca
a77a3dc0d5 Fixed broken compilation :/
BUG: 345460
2015-03-23 20:44:09 -07:00
Albert Vaca
a5e5b10d9a Code styling 2015-03-21 23:12:04 -07:00
Albert Vaca
a649bb5668 Added some error messages when ports are not available 2015-03-21 23:11:50 -07:00
Albert Vaca
e20c3c907d Fixed config memory leak. 2015-03-21 22:21:34 -07:00
Aleix Pol
c7cee37330 Port away from KServiceTrader
Uses KPluginLoader+KPluginMetadata instead.
Describes plugins in json instead of desktop files. These desktop files are
then embedded into the .so file. All the plugins will be in a kdeconnect/
directory, and those will be the ones to look for.

Note it doesn't drop the KService dependency as KIOCore is a KDE Connect
dependency as well.

REVIEW: 123042
2015-03-19 16:36:53 +01:00
Ashish Bansal
6b4d5be618 Used QSettings instead of KConfig in KdeConnectSettings
REVIEW: 122936
2015-03-15 19:31:01 -07:00
Albert Vaca
654ee39b37 Fixed bug when pairing fails if initiated by the desktop
If the phone thinks that it's already paired with the computer when
receiving a pairing request, it will answer stuff back that will cause
the desktop to abort the pairing process.
2015-03-15 19:31:01 -07:00
Albert Vaca
856bd1e346 kDebug -> qCDebug 2015-03-15 19:31:01 -07:00
Albert Vaca
563233cac7 Fixed unpair still using the old KConfig 2015-03-15 19:31:01 -07:00
Aleix Pol
63bb2bda85 Fix build
We require KF5 5.9 but the frameworks haven't updated the version
name, so keep the last version for sanity.
2015-03-14 14:33:12 +01:00
Albert Vaca
02a2990720 Added a baseclass for the plugins' KCMs and a class for the plugins' config
Centralizing the plugins' config will ensure that all the plugins store it
the same way (ie: not in random files scattered around, like until now).
The base KCM class, together with the already existing base plugin class,
will give easy access to all the plugins to this centralized config. Also,
now the settings are not shared across devices (that is: every device can
have different config for a same plugin).

Note: This commit requires KCMUtils 5.9

REVIEW: 122927
2015-03-13 21:22:21 -07:00
Albert Vaca
a3decd542c Includes cleanup 2015-03-13 21:20:58 -07:00
Albert Vaca
549f4c0815 KdeConnectConfig now displays initialization errors as notification
NOTE: This patch requires KNotifications 5.9
2015-03-13 21:20:58 -07:00
Aleix Pol
6fe7a9b158 Make it possible for the DevicesModel to react to device name changes 2015-03-14 04:28:54 +01:00
Aleix Pol
9c45c5469c Prefer to specify the property
Tie the change signal to the getter, makes the interface easier to read
and opens the possibility to adopt certain optimizations in the Qt side.
2015-03-14 04:09:14 +01:00
Aleix Pol
807926473d Use better types to store the device internal data
https://marcmutz.wordpress.com/effective-qt/containers/
2015-03-14 04:07:55 +01:00
Aleix Pol
0e96d837ff Make sure the capabilities don't change over time by constifying
It exposed a problem later on, where we'd end up removing our own
capabilities into the remote's.
2015-03-14 02:44:21 +01:00
Aleix Pol
4c195e1a16 No need to set up the timeout every time 2015-03-14 00:39:13 +01:00
Jonathan Riddell
ce2bb1e433 don't install library dev files until there is an API/ABI policy 2015-03-12 12:42:10 +01:00