RooRepo.vala
[gitlive] / RooRepo.vala
1
2
3 static RooRepo _RooRepo ;
4
5 public class RooRepo : Object 
6 {
7  
8         
9
10         public string  id; // not really important that they are numbers..
11         public string project_id;
12         public string description;
13         public string shortname;
14         
15         
16         static RooRepo init()
17         {
18                 if (_RooRepo == null) {
19                         _RooRepo = new RooRepo();
20                         RooRepo.load();
21                 }
22                 return _RooRepo;
23         }
24         
25         static Gee.ArrayList<RooRepo> _repos; // only available for singletonn.         
26         static public  Gee.ArrayList<RooRepo>() {
27                 RooRepo.init();
28                 return RooRepo._repos;
29         }
30         public RooRepo add(Json.Object t)
31         {
32                 var add = new RooRepo();
33                 add.id = t.get_string_member("id");
34                 add.shortname = t.get_string_member("shortname");
35                 add.description = t.get_string_member("description");           
36                 add.project_id = t.get_string_member("project_id");                                             
37                 RooRepo._repos.add(add);
38                 GLib.debug("ADD project  %s : %s : %s", add.id, add.shortname, add.project_id);
39                 return add;
40         }
41
42
43
44
45 }