Add proper build-time checks to AutostartSupported on Linux

This commit is contained in:
Ilya Fedin 2022-11-25 20:36:11 +04:00 committed by John Preston
parent 70b039a6e4
commit 4ade80905f
1 changed files with 4 additions and 0 deletions

View File

@ -572,11 +572,15 @@ std::optional<bool> IsDarkMode() {
}
bool AutostartSupported() {
#ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION
// snap sandbox doesn't allow creating files
// in folders with names started with a dot
// and doesn't provide any api to add an app to autostart
// thus, autostart isn't supported in snap
return !KSandbox::isSnap();
#else // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION
return false;
#endif // DESKTOP_APP_DISABLE_DBUS_INTEGRATION
}
void AutostartToggle(bool enabled, Fn<void(bool)> done) {