+ public string summaryToBranchName()
+ {
+ // first 5 words of summary..
+ var regex = new Regex ("[^A-Za-z0-9 ]+");
+ var str = regex.replace(this.summary, this.summary.length,0, "");
+ string[] words = Regex.split_simple ("[ \t]+", str);
+ var ret = "";
+ for (var i =0; i< (words.length > 5 ? 5 : words.length); i++) {
+ ret += ret.length > 0 ? "_" : "";
+ ret += words[i];
+ }
+ return ret;
+ }
+ public string usernameLocal()
+ {
+ // git username is an email addres... - so this reutrns the local part..
+ //?? assumes that all members are under the same domain... normally the case......
+ return RooTicket.singleton().username.split("@")[0];
+
+ }
+
+
+ public void addTicket(Json.Object t)
+ {
+ var add = new RooTicket();
+ add.id = t.get_string_member("id");
+ add.summary = t.get_string_member("summary");
+ add.description = t.get_string_member("description");
+ add.project_id_name = t.get_string_member("project_id_name");
+ this.tickets.add(add);
+ GLib.debug("ADD ticket %s : %s : %s", add.id, add.summary, add.project_id_name);
+ }
+
+ public RooTicket? getById(string id)
+ {
+ foreach(var t in this.tickets) {
+ if (t.id == id) {
+ return t;
+ }
+ }
+ return null;
+
+ }
+
+