svnno****@sourc*****
svnno****@sourc*****
Thu Feb 7 09:14:11 JST 2008
Revision: 3357 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=kazehakase&view=rev&rev=3357 Author: ikezoe Date: 2008-02-07 09:14:11 +0900 (Thu, 07 Feb 2008) Log Message: ----------- 2008-02-07 Hiroyuki Ikezoe <poinc****@ikezo*****> * src/kz-prefs-win.c: Fix a crash when preference dialog is opened. Modified Paths: -------------- kazehakase/trunk/ChangeLog kazehakase/trunk/src/kz-prefs-win.c Modified: kazehakase/trunk/ChangeLog =================================================================== --- kazehakase/trunk/ChangeLog 2008-02-06 02:39:34 UTC (rev 3356) +++ kazehakase/trunk/ChangeLog 2008-02-07 00:14:11 UTC (rev 3357) @@ -1,3 +1,7 @@ +2008-02-07 Hiroyuki Ikezoe <poinc****@ikezo*****> + + * src/kz-prefs-win.c: Fix a crash when preference dialog is opened. + 2008-02-06 Hiroyuki Ikezoe <poinc****@ikezo*****> * module/embed/gecko/kz-mozwrapper.cpp: Use do_GetInterface() instead Modified: kazehakase/trunk/src/kz-prefs-win.c =================================================================== --- kazehakase/trunk/src/kz-prefs-win.c 2008-02-06 02:39:34 UTC (rev 3356) +++ kazehakase/trunk/src/kz-prefs-win.c 2008-02-07 00:14:11 UTC (rev 3357) @@ -718,19 +718,25 @@ g_return_if_fail(KZ_IS_PREFS_WIN(data)); - win = KZ_PREFS_WIN(data); + selection = gtk_tree_view_get_selection(treeview); + if (!selection) + return; + if (!gtk_tree_selection_get_selected(selection, &model, &iter)) + { + model = gtk_tree_view_get_model(treeview); + if (!gtk_tree_model_get_iter_first(model, &iter)) + return; + } + gtk_tree_model_get(model, &iter, + COLUMN_PRIV_DATA, &priv, + COLUMN_TERMINATOR); - selection = gtk_tree_view_get_selection (treeview); - gtk_tree_selection_get_selected (selection, &model, &iter); + g_return_if_fail(priv); + g_return_if_fail(priv->entry); - gtk_tree_model_get (model, &iter, - COLUMN_PRIV_DATA, &priv, - COLUMN_TERMINATOR); + win = KZ_PREFS_WIN(data); - g_return_if_fail (priv); - g_return_if_fail (priv->entry); - - kz_prefs_win_set_page (win, priv->entry->path); + kz_prefs_win_set_page(win, priv->entry->path); }