Commit graph

223 commits

Author SHA1 Message Date
Albert Vaca Cintora
2cfde60ab9 Fix clazy warning about re-defining signal 2023-08-08 20:24:22 +02:00
Alexander Lohnau
405f61bf85 Discard unused params more elegantly
By commenting out the parameter name, we get compile-time checks
Also, we can omit them for slots and Qt will not forward the parameters.

In case we had TODOs next to the code, I kept the Q_UNUSED statements
for now.
2023-08-05 20:22:18 +00:00
Alexander Lohnau
46feeda0cb Remove unused default destructors
Overriding and defaulting them in the header doesn't make sense

For the dbus interfaces, we don't have any reasources to clean up or memory to be released. Meaning we can drop those lines too
2023-08-05 20:22:18 +00:00
Alexander Lohnau
6fbecf28da Remove trailing / for KPluginMetaData::findPlugins
This is not needed and pretty much all usages of this method don't do it too
2023-07-31 06:39:08 +00:00
Alexander Lohnau
2e67f95017 Add explicit moc includes to cpp files
The rationale is explained in https://planet.kde.org/friedrich-kossebau-2023-06-28-include-also-moc-files-of-headers/

In case of KDEConnect, it impressively speeds up compilation. Before it
took 390 seconds on a clean build and with this change it took 330 seconds.
This is due to the mocs_compilation having to include the header files
and thus all their headers. Due to the lots of small plugins we have,
this means that the same headers must be compiled plenty of times.
When we include the moc files directly in the C++ file, they are already
available.
2023-07-30 07:27:45 +00:00
Alexander Lohnau
a1195a72a3 Use versionless Qt targets where possible
We depend on 5.15 which allows us to use those
2023-07-25 18:29:38 +02:00
Albert Vaca Cintora
59adbc2da4 Move all generated dbus interfaces to kdeconnectinterfaces exclude them from clazy
* Moves the XML definitions of DBus interfaces and code generation from the different plugins
  to kdeconnectinterfaces. Before each plugin had their own, some of them duplicated.
* Appends `// clazy:skip` to the generated interface files, so Clazy doesn't emit warnings
  about them because they are missing the NOTIFY/CONSTANT keywords on Q_PROPERTIES.
* Makes kdeconnectinterfaces static on Qt5 as well (removes a difference with Qt6).
* Moves the generated files to a `generated` directory and updates the includes so they are
  easily distinguished from other header files.
2023-07-24 12:18:47 +00:00
Albert Vaca Cintora
bd72602875 Move setWhenAvailable from dbusinterfaces to dbushelpers 2023-07-23 16:53:57 +02:00
Albert Astals Cid
7860280158 pretend autogenerated headers are system ones 2023-07-23 16:43:41 +02:00
Alexander Lohnau
e894f7c000 PluginModel: Do not call begin/end resetModel in constructor
This is only needed if we update the data afterward
2023-07-22 20:51:19 +00:00
Alexander Lohnau
9fdc2901b2 Use target-centric CMake approach rest of logging categories 2023-07-22 20:51:19 +00:00
Albert Vaca Cintora
dd4831f823 Add missing NOTIFY to properties 2023-07-22 20:09:46 +02:00
Albert Vaca Cintora
46cac0bf61 Fix qml runtime warning when accessing property without NOTIFIY 2023-07-22 19:58:56 +02:00
Alexander Lohnau
7d66b07ef7 Remove unused createId methods 2023-07-22 19:12:33 +02:00
Alexander Lohnau
ac3d439a2a Clean up unneeded version checks
With the min. version bumped, those can be safely removed
2023-07-22 16:17:24 +02:00
Nicolas Fella
d1d3e47eab Enable PIC for static lib
Otherwise it doesn't link
2023-07-20 16:17:56 +02:00
Alexander Lohnau
5456f726af Do not use empty QStringLiteral macro
QString is recommended instead
2023-07-20 13:32:16 +03:00
Alexander Lohnau
3effb006f3 interfaces: Build lib in Qt6 STATIC
Otherwise, the Q_OBJECT stuff is not properly exported and will result in linker errors
2023-07-20 11:16:04 +03:00
Alexander Lohnau
a9292f651f Port deprecated KPluginLoader usage 2023-07-20 11:15:46 +03:00
Alexander Lohnau
c5bfc4a5b0 Allow building against Qt6/KF6 2023-07-20 11:15:41 +03:00
Albert Vaca Cintora
22be63ae9e Remove compatibility with Qt < 5.15
In theory we support Qt 5.6 (because of SailfishOS) but in practice we are not checking that in the CI so probably we broke the compatibility long ago. Also, I don't think anyone is using this code in SailfishOS, so we can greatly simplify the code by requiring Qt 5.15 or later.
2023-07-18 20:13:27 +00:00
Albert Vaca Cintora
9c87393b28 clang-format pass 2023-07-16 16:20:34 +02:00
Albert Vaca Cintora
2e0550651e Remove mpris "nowPlaying" field
We've had separate title & artist for a while, and all clients should be
using those by now.

Also fixes the position change not being emitted when the song changes,
and fixes the values being written after emitting that they changed.
2023-06-08 21:58:58 +00:00
Albert Vaca Cintora
144a60b58a Allow disabling clipboard auto-share and add option to share manually
Continues the work started in !396 by rebasing it onto latest master and
making the "send clipboard" button from the plasmoid invisible when
automatic syncing is enabled.
    
I didn't find a way to do the same in kdeconnect-indicator and
kdeconnect-app (why do we have 3 UIs???), so in those we always show the
option for now.
2023-06-07 19:48:25 +00:00
Albert Vaca Cintora
064ddfa3fe Refactor PairingHandler
We now have a single PairingHandler for all types of links.

The implementation now is more aligned with the one for Android.
2023-06-02 16:38:52 +00:00
Volker Krause
002848efa8 Adapt build system to also support Qt 6
This is complicated by the Qt 5.6 requirement of SailfishOS, hopefully
that didn't get broken by this.
2022-10-29 16:51:41 +02:00
Simon Redman
8cfa308140 Fix some Qt and KF5 deprecation warnings
## Summary

Fixes a few warnings about deprecated fields and methods.

## Test Plan

Things still seem to be basically working 🤷
2022-10-17 21:17:49 +00:00
Kareem Abduljaleel
4ecf463cd1 [plasmoid] Add Photo to Plasmoid menu
Adds a menu entry to ask the remote device to take a photo to the Plasmoid menu
2022-09-28 13:03:48 +00:00
Nicolas Fella
a918ffc0cb Add and make use of ECM's clang-format integration 2022-09-11 23:21:58 +00:00
Laurent Montel
ba69e4a05a Remove extra ';' 2022-06-23 06:47:52 +02:00
Aleix Pol
084bfebcc8 Introduce the VirtualMonitor plugin
It allows to use other paired devices as external displays
transparently.
2022-05-25 00:04:47 +02:00
Nicolas Fella
8010739a8a [smsapp] Refactor and fix argument handling
Use a singleton instead of context properties for data handling

Fix passing initial message

Make device menu creation more declarative

Fix initial device handling

Update current device when new instance with initial device is requested
2022-05-23 22:10:07 +00:00
Nicolas Fella
f7f3c01ec8 Use undeprecated install dirs
Using kde-dev-scripts/kf5/cmakelists_install_vars.pl
2022-04-21 00:50:14 +02:00
Weixuan Xiao
f1843cb492 Improve D-Bus implementation on macOS
Better patch to replace !218.

- Auto and quick detection of previous D-Bus instance;
- Remove private D-Bus compile definition, only use it on macOS without an existing D-Bus instance;
- Safe reboot after crashes because the indicator is not relating on the kdeconnectd to run a D-Bus session;
- Safe exit after clicking on `Quit` in the systray.


More details in commit logs:

Only enable private D-Bus on macOS because the other platforms do not
need them.
The app should be able to easily detect the session bus from the env
DBUS_LAUNCHD_SESSION_BUS_SOCKET from launchd through launchctl.
Because https://gitlab.freedesktop.org/dbus/dbus/-/blob/master/dbus/dbus-sysdeps-unix.c#L4392
shows that it is the only probing method on macOS with launchd.

The D-Bus session bus can be easily found from launchd/launchctl
with DBUS_LAUNCHD_SESSION_BUS_SOCKET env. It can be an external one
(installed from HomeBrew) or an internal one (launched by a previous
instance followed by a crash).

The indicator helper on macOS can now automatically detect whether we can use a potentially
(with launchd/launchctl env set, or KDE Connect macOS
private_bus_address set) existed and usable session bus.
If previous bus is usable, just try to launch the kdeconnectd with us.
Otherwise, launch a private D-Bus daemon, export the launchd/launchctl
env, and run a kdeconnectd instance.

Everything works better and quicker now :)
2022-04-12 05:40:03 +00:00
Laurent Montel
6957b6aa39 GIT_SILENT: add missing override 2021-10-27 06:53:06 +02:00
Nicolas Fella
eb5bd219f2 [interfaces] Make KConfig linkage public
It is used in a header so consumers need to link it too
2021-04-05 23:02:23 +02:00
David Shlemayev
a75da62f4d Add backend for ConnectivityReport plugin 2021-03-12 23:27:16 +00:00
Nicolas Fella
44a7fc226f Remove dead files 2021-02-27 20:06:10 +01:00
Bharadwaj Raju
ffdbd9aefe Fix notifications in the KDE Connect plasmoid
Corrects the DBus path to use for notifications, so now notifications
appear in the KDE Connect plasmoid as they should.

BUG: 432337
2021-01-31 18:57:12 +05:30
Jason Nader
b5ac96ce5b
plugins/battery: add battery charge info to the update signal 2020-12-13 21:28:23 +09:00
Nicolas Fella
473b1f07c3 [app] Improve plugin config delegates
Add description and make them more consistent with other list items in
KDE.
2020-11-16 12:21:47 +00:00
Nicolas Fella
753b1a2b0c Constify variable 2020-11-16 12:21:47 +00:00
Nicolas Fella
8be089472f Port plugin model away from KPluginInfo 2020-11-16 12:21:47 +00:00
Nicolas Fella
4439e7c662 [plugins/notifications] Merge notificationsdbusinterface and notificationsplugin
We can just expose the plugin itself to DBus like we do for all other plugins.
This way we don't need a separate adaptor class any more.
2020-10-18 21:42:06 +00: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
Aniket Kumar
706fc314fb Adding support to send attachments to the remote device. 2020-08-31 15:35:25 +05:30
Nicolas Fella
f90d6a019f Rework the battery plugin
Instead of having the DBus stuff in a separate class expose the plugin class itself like we do for the other plugins.

Replace the method-based API with properties.

Change the path to <device>/battery for consistency with other plugins
2020-08-27 15:04:40 +00: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
Nicolas Fella
950366092b Remove modeltest
It's only a development tool and there's a more modern alternative: https://doc.qt.io/qt-5/qabstractitemmodeltester.html
2020-08-14 14:01:19 +02:00