RooTicket.vala
[gitlive] / RooTicket.vala
index 18f5e6b..3447ba7 100644 (file)
@@ -4,18 +4,6 @@ code to fetch ticket info...
 
 */
 
-public class RooRepo : Object 
-{
-
-       public string  id; // not really important that they are numbers..
-       public string project_id;
-       public string description;
-       public string shortname;
-       
-
-}
 
 public class RooOption : Object 
 {
@@ -58,14 +46,14 @@ public class RooTicket : Object
             _RooTicket = new RooTicket();
             _RooTicket.tickets = new Gee.ArrayList<RooTicket>();
  
-            _RooTicket.repos = new Gee.ArrayList<RooRepo>();
-            _RooTicket.loadRepos(); // initalize it..        
         }
         return _RooTicket;
     }
        public Gee.ArrayList<RooTicket> tickets; // only available for singletonn.
  
-       public Gee.ArrayList<RooRepo> repos; // only available for singletonn.          
+
        
        public Gee.ArrayList<RooOption> milestones;
        public Gee.ArrayList<RooOption> priorities;
@@ -132,49 +120,8 @@ public class RooTicket : Object
                return add;
        }
         
-       public RooRepo addRepo(Json.Object t)
-       {
-               var add = new RooRepo();
-               add.id = t.get_string_member("id");
-               add.shortname = t.get_string_member("shortname");
-               add.description = t.get_string_member("description");           
-               add.project_id = t.get_string_member("project_id");                                             
-               this.repos.add(add);
-               GLib.debug("ADD project  %s : %s : %s", add.id, add.shortname, add.project_id);
-               return add;
-       }
-       
-       public RooProject? getProjectByRepo(GitRepo repo)
-       {
-               var rt = RooTicket.singleton();
-               
-               if (rt.repos.size < 1) {
-                       rt.loadRepos();
-               }
-                
-               
-               var pid = "";
-               foreach(var roo_repo in rt.repos) {
-                       if (roo_repo.shortname == repo.name) {
-                               pid = roo_repo.project_id;
-                               break;
-                       }
-               }
-               if (pid == "") {
-                       GLib.debug("getProjectByRepo: repo has no project");            
-                       return null;
-               }
-               // get project by id...
-               foreach(var roo_project in RooProject.projects()) {
-                       if (roo_project.id == pid) {
-                               GLib.debug("getProjectByRepo: project_id = %s", pid);
-                               return roo_project;
-                       }
-               }
-               GLib.debug("getProjectByRepo: can not find project");                           
-               return null;
-       
-       }
        
        
        public static RooTicket fakeTicket()