Reduced usage of Gee
authorEnrico Zini <enrico@enricozini.org>
Wed, 16 Dec 2009 16:40:09 +0000 (16:40 +0000)
committerEnrico Zini <enrico@enricozini.org>
Wed, 16 Dec 2009 16:40:09 +0000 (16:40 +0000)
src/app_power.vala
src/app_wm.vala
src/core.vala

index 74415d221a04262e264a386fc9f4f8bcf013ff68..f2b4da8f4cb44eb982db98e08a712a74e24e8d41 100644 (file)
@@ -598,7 +598,7 @@ public class TogglePowerMenu : Gtk.Button
 
 Power power;
 PowerMenu power_menu;
-Gee.ArrayList<BatteryIcon> battery_icons;
+List<BatteryIcon> battery_icons;
 Backlight backlight;
 BrightnessAdjustment brightness;
 //TogglePowerMenu tpm;
@@ -610,7 +610,7 @@ public void init()
        brightness = new BrightnessAdjustment();
        
        try {
-               battery_icons = new Gee.ArrayList<BatteryIcon>();
+               battery_icons = new List<BatteryIcon>();
                // Enumerate batteries
                var c = new Dkp.Client();
                unowned GLib.PtrArray devs = c.enumerate_devices();
@@ -623,7 +623,7 @@ public void init()
                        if (!dev.is_rechargeable) continue;
                        var bi = new BatteryIcon(dev);
                        bi.set_visible(true);
-                       battery_icons.add(bi);
+                       battery_icons.append(bi);
                }
 
                power_menu = new PowerMenu();
index e3c3bcb89ccd380c198a03e4eefef4a6c0320166..c24567d9041694cde8db47a2da9c192f493081ff 100644 (file)
@@ -190,7 +190,8 @@ public class Launcher: Applet
 
         FileInfo file_info;
         var icon_theme = Gtk.IconTheme.get_default();
-        Gee.ArrayList<LauncherButton> buttons = new Gee.ArrayList<LauncherButton>();
+        List<LauncherButton> buttons = new List<LauncherButton>();
+        int buttons_size = 0;
         while ((file_info = enumerator.next_file(null)) != null)
         {
             if (!file_info.get_name().has_suffix(".desktop")) continue;
@@ -224,13 +225,14 @@ public class Launcher: Applet
                 }
             }
             button.clicked += a => { this.back_to_main(); zavai.app.ensure_hidden(); };
-            buttons.add(button);
+            buttons.append(button);
+            ++buttons_size;
         }
 
         // Create the table with the launcher buttons
         uint ROWMAX = 5;    // Maximum number of rows
-        uint cols = 1 + (buttons.size + 1) / ROWMAX; // ceil(size/ROWMAX)
-        uint rows = (buttons.size + 1) / cols;   // ceil(size/cols)
+        uint cols = 1 + (buttons_size + 1) / ROWMAX; // ceil(size/ROWMAX)
+        uint rows = (buttons_size + 1) / cols;   // ceil(size/cols)
         var table = new Gtk.Table(rows, cols, true);
 
         // Attach the buttons in the table
index 7881d04d1478df0d4b665b47365723acfb78ec4d..c8b4047d38fc637bd0a271831e501ca76cd03f2e 100644 (file)
@@ -19,7 +19,6 @@
  */
 
 using GLib;
-using Gee;
 
 namespace zavai {