Hiroyuki Ikezoe
ikezo****@users*****
Tue Jan 2 20:30:52 JST 2007
Index: kazehakase/src/bookmarks/kz-session.c diff -u kazehakase/src/bookmarks/kz-session.c:1.10 kazehakase/src/bookmarks/kz-session.c:1.11 --- kazehakase/src/bookmarks/kz-session.c:1.10 Tue Jan 2 19:07:15 2007 +++ kazehakase/src/bookmarks/kz-session.c Tue Jan 2 20:30:51 2007 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Id: kz-session.c,v 1.10 2007/01/02 10:07:15 ikezoe Exp $ + * $Id: kz-session.c,v 1.11 2007/01/02 11:30:51 ikezoe Exp $ */ #include "kz-session.h" @@ -158,12 +158,24 @@ } static void +cb_window_notify (GObject *object, GParamSpec *spec, KzBookmark *session) +{ + save_session(session); +} + +static void cb_bookmark_notify (GObject *object, GParamSpec *spec, KzBookmark *session) { save_session(session); } static void +cb_tab_notify (GObject *object, GParamSpec *spec, KzBookmark *session) +{ + save_session(session); +} + +static void cb_insert_child (KzBookmark *folder, KzBookmark *child, KzBookmark *sibling, KzBookmark *session) { g_signal_connect_after(child, "notify", @@ -182,18 +194,12 @@ } static void -cb_tab_notify (GObject *object, GParamSpec *spec, KzBookmark *session) -{ - save_session(session); -} - -static void cb_tab_created (KzBookmark *folder, KzBookmark *child, KzBookmark *sibling, KzBookmark *session) { - g_signal_connect(child, "insert-child", + g_signal_connect_after(child, "insert-child", G_CALLBACK(cb_insert_child), session); - g_signal_connect(child, "remove-child", + g_signal_connect_after(child, "remove-child", G_CALLBACK(cb_remove_child), session); g_signal_connect_after(child, "notify", @@ -222,16 +228,22 @@ KzBookmark *child, KzBookmark *sibling) { + if (KZ_BOOKMARK_CLASS (kz_session_parent_class)->insert_child) + KZ_BOOKMARK_CLASS (kz_session_parent_class)->insert_child(bookmark, child, sibling); /* * This session folder contains each tab. * We have to watch each folder. */ - g_signal_connect(child, "insert-child", + g_signal_connect_after(child, "insert-child", G_CALLBACK(cb_tab_created), bookmark); - g_signal_connect(child, "remove-child", + g_signal_connect_after(child, "remove-child", G_CALLBACK(cb_tab_removed), bookmark); + g_signal_connect_after(child, "notify", + G_CALLBACK(cb_window_notify), + bookmark); + save_session(bookmark); } static void @@ -243,5 +255,11 @@ g_signal_handlers_disconnect_by_func (child, G_CALLBACK(cb_tab_removed), bookmark); + g_signal_handlers_disconnect_by_func + (child, + G_CALLBACK(cb_window_notify), bookmark); + + if (KZ_BOOKMARK_CLASS (kz_session_parent_class)->remove_child) + KZ_BOOKMARK_CLASS (kz_session_parent_class)->remove_child(bookmark, child); }