Fix duplicate object path in SandboxAutostart and add some logging

This commit is contained in:
Ilya Fedin 2020-01-30 21:03:20 +04:00 committed by John Preston
parent a831c1703a
commit d80b3fda7d
2 changed files with 10 additions and 3 deletions

View File

@ -47,7 +47,7 @@ std::vector<QString> GetServerInformation(
}
} else if (serverInformationReply.type() == QDBusMessage::ErrorMessage) {
LOG(("Native notification error: %1")
.arg(QDBusError(serverInformationReply).message()));
.arg(serverInformationReply.errorMessage()));
} else {
LOG(("Native notification error: "
"error while getting information about notification daemon"));

View File

@ -55,11 +55,18 @@ void SandboxAutostart(bool autostart) {
});
options["dbus-activatable"] = false;
QDBusInterface(
const auto requestBackgroundReply = QDBusInterface(
qsl("org.freedesktop.portal.Desktop"),
qsl("/org/freedesktop/portal/desktop"),
qsl("/org/freedesktop/portal/desktop")
qsl("org.freedesktop.portal.Background")
).call(qsl("RequestBackground"), QString(), options);
if (requestBackgroundReply.type() == QDBusMessage::ErrorMessage) {
LOG(("Flatpak autostart error: %1")
.arg(requestBackgroundReply.errorMessage()));
} else if (requestBackgroundReply.type() != QDBusMessage::ReplyMessage) {
LOG(("Flatpak autostart error: invalid reply"));
}
}
#endif