kdeconnect-kde/indicator
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
..
systray_actions connectivity_action: replace manual ifs with code 2021-07-13 23:25:02 +05:30
CMakeLists.txt indicator: add connectivity action 2021-06-17 15:03:21 +00:00
deviceindicator.cpp Improve D-Bus implementation on macOS 2022-04-12 05:40:03 +00:00
deviceindicator.h Convert license headers to SPDX expressions 2020-08-17 09:48:10 +00:00
indicatorhelper.cpp Convert license headers to SPDX expressions 2020-08-17 09:48:10 +00:00
indicatorhelper.h indicatorhelper_win: make sure we kill all kdeconnect executables when Quit is triggered 2021-06-15 13:34:17 +05:30
indicatorhelper_mac.cpp Improve D-Bus implementation on macOS 2022-04-12 05:40:03 +00:00
indicatorhelper_win.cpp indicatorhelper_win: make sure we kill all kdeconnect executables when Quit is triggered 2021-06-15 13:34:17 +05:30
Info.plist Add "Send File via KDE Connect" Finder integration on macOS 2020-05-19 13:41:02 +00:00
main.cpp Improve D-Bus implementation on macOS 2022-04-12 05:40:03 +00:00
Messages.sh Fix i18n: extract messages 2019-12-21 16:16:33 +02:00
org.kde.kdeconnect.nonplasma.desktop SVN_SILENT made messages (.desktop file) - always resolve ours 2022-03-20 02:05:33 +00:00
serviceregister_mac.h Convert license headers to SPDX expressions 2020-08-17 09:48:10 +00:00
serviceregister_mac.mm Convert license headers to SPDX expressions 2020-08-17 09:48:10 +00:00