mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Use gsl::finally in PortalAutostart
This commit is contained in:
parent
b918170464
commit
67eba93e29
1 changed files with 6 additions and 1 deletions
|
@ -172,6 +172,12 @@ PortalAutostart::PortalAutostart(bool start, bool silent) {
|
|||
"Response",
|
||||
requestPath);
|
||||
|
||||
const auto signalGuard = gsl::finally([&] {
|
||||
if (signalId != 0) {
|
||||
connection->signal_unsubscribe(signalId);
|
||||
}
|
||||
});
|
||||
|
||||
connection->call_sync(
|
||||
std::string(kXDGDesktopPortalObjectPath),
|
||||
"org.freedesktop.portal.Background",
|
||||
|
@ -186,7 +192,6 @@ PortalAutostart::PortalAutostart(bool start, bool silent) {
|
|||
QGuiApplicationPrivate::showModalWindow(this);
|
||||
loop.exec();
|
||||
QGuiApplicationPrivate::hideModalWindow(this);
|
||||
connection->signal_unsubscribe(signalId);
|
||||
}
|
||||
} catch (const Glib::Error &e) {
|
||||
if (!silent) {
|
||||
|
|
Loading…
Add table
Reference in a new issue