From 2824ac33eb039eae9dfd801ade49faa5438b15f8 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Tue, 20 Jan 2015 08:54:38 -0500 Subject: [PATCH] gui: Start idle callbacks directly from the collection manager Signed-off-by: Anna Schumaker --- gui/manager.cpp | 11 ++++++++--- include/lib/lib.h | 1 - 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gui/manager.cpp b/gui/manager.cpp index c5a6b219..669f33c4 100644 --- a/gui/manager.cpp +++ b/gui/manager.cpp @@ -115,22 +115,27 @@ static bool on_idle() return ret; } +static void idle_enable() +{ + Glib :: signal_idle().connect(sigc::ptr_fun(on_idle)); +} + static void on_add() { list_path(library :: add(c_chooser->get_filename())); - lib :: idle(on_idle); + idle_enable(); } static void on_update() { library :: update_all(); - lib :: idle(on_idle); + idle_enable(); } static void on_row_activated(const Gtk::TreePath &path, Gtk::TreeViewColumn *col) { library :: update(get_library(path)); - lib :: idle(on_idle); + idle_enable(); } static void on_cursor_changed() diff --git a/include/lib/lib.h b/include/lib/lib.h index d7f1c7f4..64e6321f 100644 --- a/include/lib/lib.h +++ b/include/lib/lib.h @@ -14,7 +14,6 @@ namespace lib const std::string share_file(const std::string &); Glib::RefPtr &get_builder(); const std::string key_name(GdkEventKey *); - void idle(bool (*)()); void schedule(bool (*)(), unsigned int); template