X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=RooRepo.vala;h=eb4740684450124ebd9303a074863ac3fc12a2c4;hb=eb1dde5c919998e69c37e5e13f793d5fbd62345f;hp=d7bf4f44b847553f2baeb540f55abd0f7c05dfbc;hpb=b1b98af2ead4d07eac8ef64e1f1e1d041f99b15f;p=gitlive diff --git a/RooRepo.vala b/RooRepo.vala index d7bf4f44..eb474068 100644 --- a/RooRepo.vala +++ b/RooRepo.vala @@ -5,25 +5,29 @@ static RooRepo _RooRepo ; public class RooRepo : Object { - const string roourl = "https://roojs.com/admin.php/Roo"; - + public string id; // not really important that they are numbers.. public string project_id; public string description; public string shortname; + // -- static below... + const string roourl = "https://roojs.com/admin.php/Roo"; + static Gee.ArrayList _repos; // only available for singletonn. + static int loadcount = 0; + static RooRepo init() { if (_RooRepo == null) { _RooRepo = new RooRepo(); + RooRepo.loadcount = 0; RooRepo.load(); } return _RooRepo; } - static Gee.ArrayList _repos; // only available for singletonn. - static int loadcount = 0; + public static Gee.ArrayList repos() { RooRepo.init(); return RooRepo._repos; @@ -40,6 +44,16 @@ public class RooRepo : Object GLib.debug("ADD project %s : %s : %s", add.id, add.shortname, add.project_id); return add; } + + public static void reload() /// has to be called on singleton.. + { + RooRepo.loadcount = 0; + RooRepo.init(); + if (RooRepo.loadcount == 0 ) { + RooRepo.load(); + } + } + static void load() // only called from above {