Actually decrement usage count when releasing a service
authorEnrico Zini <enrico@enricozini.org>
Sat, 3 Apr 2010 19:06:45 +0000 (20:06 +0100)
committerEnrico Zini <enrico@enricozini.org>
Sat, 3 Apr 2010 19:06:45 +0000 (20:06 +0100)
src/app_keyboard.vala
src/core.vala

index 18efc2b70f47b8ea72b0616bfec5a8819f0e9ef9..31c049276712cedc55f05c8d74b133e1eca8f3a2 100644 (file)
@@ -44,7 +44,6 @@ public class Keyboard : Service
     {
         string script = zavai.config.find_script("keyboard");
         if (script == null) return;
-
         string[] args = { script, null };
         int opid;
         try {
@@ -115,41 +114,6 @@ public class KeyboardIcon : Gtk.StatusIcon
     }
 }
 
-/*
-public class GPSRequestLink : Gtk.ToggleButton
-{
-    public GPSRequestLink()
-    {
-        // GPS status icon
-        status_icon = new Gtk.StatusIcon();
-        status_icon.set_visible(true);
-        status_icon.activate += on_status_activate;
-        update_icon();
-    }
-
-    private void on_fix_status_changed(dynamic DBus.Object pos, int fix_status)
-    {
-        this.fix_status = fix_status;
-        update_icon();
-    }
-
-    private void on_toggled(Gtk.Button src)
-    {
-        Service s = zavai.registry.gets(service_name);
-        if (get_active())
-            s.request("servicerequestlink");
-        else
-            s.release("servicerequestlink");
-        set_label(get_active() ? label_stop : label_start);
-        update_icon();
-    }
-
-    private void on_status_activate()
-    {
-        set_active(!get_active());
-    }
-}
-*/
 
 Keyboard keyboard;
 KeyboardIcon icon;
index 2e2191550fcb8d7a948b4538d7fd509a7f34f721..6eb4de43e8a32e9c3c1dca964e369f6d7cfe4301 100644 (file)
@@ -141,7 +141,7 @@ public abstract class Service : Object, Resource {
         if (el == null)
             return false;
 
-        ++el.data.count;
+        --el.data.count;
         if (el.data.count == 0)
             requests.delete_link(el);
 
@@ -261,7 +261,6 @@ public abstract class ScriptMonitorService : Service
     protected void on_child(Pid pid, int status)
     {
         zavai.log.info("Exited");
-stderr.printf("STATUS %d\n", status);
         Process.close_pid(pid);
 
         try {