[cheese/gnome-3-0] thumb-view: start monitoring at startup



commit 6699556a30cae53c3a2447f146a4cafda0f944e4
Author: Raluca Elena Podiuc <ralucaelena1985 gmail com>
Date:   Wed Jul 13 14:14:54 2011 +0300

    thumb-view: start monitoring at startup
    
    Before this we started monitoring each for each photo/video
    capture. That was a bit inefficient as the directories in which photos
    and videos are saved are known and don't change during the program's
    lifetime.
    
    Now we start the monitoring at startup only once.

 src/cheese-main.vala   |    1 +
 src/cheese-window.vala |   10 +++++-----
 2 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/cheese-main.vala b/src/cheese-main.vala
index 9dbdc81..b154eca 100644
--- a/src/cheese-main.vala
+++ b/src/cheese-main.vala
@@ -60,6 +60,7 @@ public class Cheese.Main : Gtk.Application
       Gtk.IconTheme.get_default ().append_search_path (GLib.Path.build_filename (Config.PACKAGE_DATADIR, "icons"));
 
       main_window.setup_ui ();
+      main_window.start_thumbview_monitors ();
 
       if (wide)
         main_window.set_startup_wide_mode ();
diff --git a/src/cheese-window.vala b/src/cheese-window.vala
index 8886f46..f1a7a41 100644
--- a/src/cheese-window.vala
+++ b/src/cheese-window.vala
@@ -659,11 +659,6 @@ public class Cheese.MainWindow : Gtk.Window
     {
       string file_name = fileutil.get_new_media_filename (this.current_mode);
 
-      if (current_mode == MediaMode.VIDEO)
-        thumb_view.start_monitoring_video_path (fileutil.get_video_path ());
-      else
-        thumb_view.start_monitoring_photo_path (fileutil.get_photo_path ());
-
       if (settings.get_boolean ("flash"))
       {
         this.flash.fire ();
@@ -1277,4 +1272,9 @@ public class Cheese.MainWindow : Gtk.Window
     camera.state_flags_changed.connect (camera_state_changed);
     camera.play ();
   }
+  public void start_thumbview_monitors ()
+  {
+    thumb_view.start_monitoring_video_path (fileutil.get_video_path ());
+    thumb_view.start_monitoring_photo_path (fileutil.get_photo_path ());
+  }
 }



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