Commit graph

22 commits

Author SHA1 Message Date
Nicolas Fella
a918ffc0cb Add and make use of ECM's clang-format integration 2022-09-11 23:21:58 +00: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
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
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
Weixuan Xiao
4f4b6c309f Allow to use private DBus 2019-06-18 01:21:31 +00:00
Albert Vaca
3fc7df550b Better error handling when loading cert and key
BUG: 405207
2019-05-09 00:03:59 +02:00
Nicolas Fella
3b8fedea1a Replace http GNU urls with https 2019-03-23 17:29:26 +01:00
Nicolas Fella
a45921685b Extract code to methods 2018-12-25 01:42:42 +01:00
Nicolas Fella
8f16c3fd9a Remove unneeded methods
Remove unneeded declaration
2018-12-25 00:58:03 +01: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
b7bb8d94c5 Fixed QStrings not being passed by ref 2016-11-26 16:36:34 +01:00
Albert Vaca
cc0fdacbf5 Fixed compilation on Windows 2016-06-20 02:31:55 +02:00
Albert Vaca
16f9af908a WIP 2015-11-30 10:36:01 -08:00
Albert Vaca
30d2dd991b Merge branch 'master' into sslmaster 2015-11-30 03:40:07 -08:00
Aleix Pol
4730022810 Pass arguments as const-reference 2015-09-12 09:45:59 +02:00
Vineet Garg
2824e73617 Pairing handler implemented 2015-07-27 20:58:58 +05:30
Vineet Garg
eda2563d03 Fixed encryption info in cli 2015-07-19 20:25:28 +05:30
Vineet Garg
148a713176 Initial working implementation of ssl 2015-07-05 18:53:53 +05:30
Albert Vaca
2f7e6f7de2 Fixed compilation warnings in clang (one of them is actually an issue!) 2015-04-19 22:50:12 -07: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
c7c91c1289 Added KdeConnectConfig class that aims to be a KConfig abstraction
Benefits:
- We had config files in different paths, now they will be centralized.
- Daemon, LanLinkProvider and NetworkPackage depend only on Qt now.
- KConfig is accessed with strings as keys, where a typo can go unnoticed.
- Daemon is now thinner, as it doesn't need to initialize config values.
- QCA::Initializer is in a single place now (was in Daemon and Plugin).
2015-03-01 20:16:07 -08:00