[gnome-games] gnome-mahjongg: Stop using GamesFileList
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] gnome-mahjongg: Stop using GamesFileList
- Date: Tue, 21 Aug 2012 04:46:51 +0000 (UTC)
commit 097a8a4ac45d53b4b825942a7f8b347885a5e2ce
Author: Robert Ancell <robert ancell canonical com>
Date: Tue Aug 21 12:48:17 2012 +1200
gnome-mahjongg: Stop using GamesFileList
gnome-mahjongg/src/gnome-mahjongg.vala | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/gnome-mahjongg/src/gnome-mahjongg.vala b/gnome-mahjongg/src/gnome-mahjongg.vala
index 482ab50..b6a02d2 100644
--- a/gnome-mahjongg/src/gnome-mahjongg.vala
+++ b/gnome-mahjongg/src/gnome-mahjongg.vala
@@ -683,10 +683,23 @@ public class Mahjongg : Gtk.Application
/* Add the builtin map */
maps.append (new Map.builtin ());
- var filelist = new GnomeGamesSupport.FileList ("*.map", ".", Path.build_filename (DATA_DIRECTORY, "maps"), null);
- for (var i = 0; i < filelist.length (); i++)
+ Dir dir;
+ try
+ {
+ dir = Dir.open (Path.build_filename (DATA_DIRECTORY, "maps"));
+ }
+ catch (FileError e)
+ {
+ return;
+ }
+ while (true)
{
- var filename = filelist.get_nth (i);
+ var filename = dir.read_name ();
+ if (filename == null)
+ break;
+
+ if (!filename.has_suffix (".map"))
+ continue;
var loader = new MapLoader ();
try
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]