Skip to content

Commit

Permalink
main: Do not export Settings without implementations
Browse files Browse the repository at this point in the history
If no settings portal implementations are found, the `settings_create()`
function currently returns NULL and the `No skeleton to export` warning.
This change guards against that, which is more consistent with the other
portals.
  • Loading branch information
kleifgch authored and smcv committed Jan 9, 2025
1 parent a18f69f commit 34ff12c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/xdg-desktop-portal.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ on_bus_acquired (GDBusConnection *connection,
export_portal_implementation (connection, realtime_create (connection));

impls = find_all_portal_implementations ("org.freedesktop.impl.portal.Settings");
export_portal_implementation (connection, settings_create (connection, impls));
if (impls->len > 0)
export_portal_implementation (connection, settings_create (connection, impls));
g_ptr_array_free (impls, TRUE);

implementation = find_portal_implementation ("org.freedesktop.impl.portal.FileChooser");
Expand Down

0 comments on commit 34ff12c

Please sign in to comment.