Remove unneeded ID systems
[gregoa/zavai.git] / src / gsm.vala
index 19a854da04554e5fb56391cd120b274619e19c41..e5545038cbcd197cafea0fb6eed035b4ea44fa19 100644 (file)
@@ -128,11 +128,12 @@ public class GSM: zavai.ScriptMonitorService
     protected class CallInfo
     {
         public int gsm_id;
-        public uint log_id;
+        public zavai.log.Log log;
     }
     protected List<CallInfo> calls;
 
     public string info_provider;
+    public string info_registration;
     public int info_signal_strength;
 
     public signal void status_changed(string message);
@@ -165,7 +166,16 @@ public class GSM: zavai.ScriptMonitorService
             if (info_provider != vprovider.get_string())
             {
                 info_provider = vprovider.get_string();
-stderr.printf("ACQUIRE PROV %s\n", info_provider);
+                changed = true;
+            }
+        }
+
+        var vregistration = status.lookup("registration");
+        if (vregistration != null)
+        {
+            if (info_registration != vregistration.get_string())
+            {
+                info_registration = vregistration.get_string();
                 changed = true;
             }
         }
@@ -343,7 +353,7 @@ stderr.printf("ACQUIRE SIG %d\n", info_signal_strength);
 
             info = new CallInfo();
             info.gsm_id = index;
-            info.log_id = zavai.log.log.start("call", title);
+            info.log = zavai.log.log.start("call", title);
             calls.append(info);
         }
 
@@ -354,12 +364,12 @@ stderr.printf("ACQUIRE SIG %d\n", info_signal_strength);
             Value? v = (Value?)pv;
             call_info = call_info + "%s: %s\n".printf(k, v == null ? "(null)" : v.strdup_contents());
         });
-        zavai.log.log.add(info.log_id, call_info);
+        info.log.add(call_info);
 
         // Remove entry when it's the last possible status
         if (status == "release")
         {
-            zavai.log.log.end(info.log_id);
+            zavai.log.log.end(info.log);
             for (weak List<CallInfo> i = calls; i != null; i = i.next)
                 if (i.data.gsm_id == index)
                 {