Skip to content

Commit

Permalink
Single hashtable lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit committed Feb 26, 2024
1 parent 98074c0 commit 8986723
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Wallpaper/Portal.vala
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ public class Wallpaper.Portal : Object {
var set_on = "both"; // Possible values are background, lockscreen or both.
var show_preview = false;

if ("set-on" in options && options["set-on"].get_type_string () == "s") {
set_on = options["set-on"].get_string ();
unowned var _set_on = options.get ("set-on");
if (_set_on.get_type_string () == "s") {
set_on = _set_on.get_string ();
}

if ("show-preview" in options && options["show-preview"].get_type_string () == "b") {
show_preview = options["show-preview"].get_boolean ();
unowned var _show_preview = options.get ("show-preview");
if (_show_preview.get_type_string () == "b") {
show_preview = _show_preview.get_boolean ();
}

// Currently only support Both
Expand Down

0 comments on commit 8986723

Please sign in to comment.