Skip to content

Commit 57f0f3e

Browse files
committed
Use query_exists
1 parent 3b311fb commit 57f0f3e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Background/BackgroundSource.vala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,16 @@ public class Gala.BackgroundSource : Object {
119119
private string? get_background_path () {
120120
if (Drawing.StyleManager.get_instance ().prefers_color_scheme == DARK) {
121121
var uri = gnome_background_settings.get_string ("picture-uri-dark");
122-
var path = File.new_for_uri (uri).get_path ();
123-
if (path != null && FileUtils.test (path, EXISTS)) {
124-
return path;
122+
var file = File.new_for_uri (uri);
123+
if (file.query_exists (null)) {
124+
return file.get_path ();
125125
}
126126
}
127127

128128
var uri = gnome_background_settings.get_string ("picture-uri");
129-
var path = File.new_for_uri (uri).get_path ();
130-
if (path != null && FileUtils.test (path, EXISTS)) {
131-
return path;
129+
var file = File.new_for_uri (uri);
130+
if (file.query_exists (null)) {
131+
return file.get_path ();
132132
}
133133

134134
return null;

0 commit comments

Comments
 (0)