[cheese] add identity effect manually at the first position of the effect list



commit 67666646e2dbb430aa180f53427282f9a3057f23
Author: daniel g. siegel <dgsiegel gnome org>
Date:   Tue Aug 10 01:08:10 2010 +0200

    add identity effect manually at the first position of the effect list

 src/cheese-effects-manager.vala |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)
---
diff --git a/src/cheese-effects-manager.vala b/src/cheese-effects-manager.vala
index d80e267..6c9e102 100644
--- a/src/cheese-effects-manager.vala
+++ b/src/cheese-effects-manager.vala
@@ -26,7 +26,7 @@ const string GROUP_NAME = "Effect";
 
 internal class Cheese.EffectsManager : GLib.Object
 {
-  public static Cheese.Effect ? parse_effect_file (string filename)
+  public static Cheese.Effect? parse_effect_file (string filename)
   {
     KeyFile kf     = new KeyFile ();
     Effect  eff    = new Effect ();
@@ -109,15 +109,13 @@ internal class Cheese.EffectsManager : GLib.Object
     string user_effects = GLib.Path.build_filename (Environment.get_user_data_dir (), "gnome-video-effects");
     effects.add_all (load_effects_from_directory (user_effects));
 
-    /* GROSS HACK: to make identity element appear first */
-    foreach (Effect e in effects)
+    /* add identity effect as the first in the effect list */
+    if (effects.size > 0)
     {
-      if (e.pipeline_desc == "identity")
-      {
-        effects.remove (e);
-        effects.insert (0, e);
-        break;
-      }
+      Effect e = new Effect ();
+      e.name          = _("No Effect");
+      e.pipeline_desc = "identity";
+      effects.insert (0, e);
     }
   }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]