Skip to content

Commit

Permalink
Much cleaner type check
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit committed Feb 26, 2024
1 parent 3dd4c5f commit 0f01778
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Wallpaper/Portal.vala
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ public class Wallpaper.Portal : Object {
unowned bool show_preview = false; // FIXME: implement preview dialog

unowned var _set_on = options.get ("set-on");
if (_set_on.get_type_string () == "s") {
if (_set_on.is_of_type (GLib.VariantType.STRING)) {
set_on = _set_on.get_string ();
}

unowned var _show_preview = options.get ("show-preview");
if (_show_preview.get_type_string () == "b") {
if (_show_preview.is_of_type (GLib.VariantType.BOOLEAN)) {
show_preview = _show_preview.get_boolean ();
}

Expand Down

0 comments on commit 0f01778

Please sign in to comment.