aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/user-list.vala21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/user-list.vala b/src/user-list.vala
index 319e833..82ebc73 100644
--- a/src/user-list.vala
+++ b/src/user-list.vala
@@ -1179,18 +1179,25 @@ public class UserList : GreeterList
test_backgrounds = new List<string> ();
try
{
- var dir = Dir.open ("/usr/share/backgrounds/");
- while (true)
- {
- var bg = dir.read_name ();
- if (bg == null)
- break;
- test_backgrounds.append ("/usr/share/backgrounds/" + bg);
+
+ var directory = File.new_for_path ("/usr/share/backgrounds");
+
+ var enumerator = directory.enumerate_children (FileAttribute.STANDARD_NAME, 0);
+
+ FileInfo file_info;
+ while ((file_info = enumerator.next_file ()) != null) {
+ if(file_info.get_file_type() != FileType.DIRECTORY)
+ {
+ test_backgrounds.append ("/usr/share/backgrounds/" + file_info.get_name());
+ }
}
}
catch (FileError e)
{
}
+ catch (GLib.Error e)
+ {
+ }
if (!ArcticaGreeter.singleton.hide_users_hint())
while (add_test_entry ());