svnno****@sourc*****
svnno****@sourc*****
Tue Mar 27 16:34:30 JST 2007
Revision: 3053 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=kazehakase&view=rev&rev=3053 Author: kous Date: 2007-03-27 16:34:30 +0900 (Tue, 27 Mar 2007) Log Message: ----------- * src/bookmarks/kz-session.c: added type checks. Modified Paths: -------------- kazehakase/trunk/ChangeLog kazehakase/trunk/src/bookmarks/kz-session.c Modified: kazehakase/trunk/ChangeLog =================================================================== --- kazehakase/trunk/ChangeLog 2007-03-27 06:27:23 UTC (rev 3052) +++ kazehakase/trunk/ChangeLog 2007-03-27 07:34:30 UTC (rev 3053) @@ -1,5 +1,7 @@ 2007-03-27 Kouhei Sutou <kou****@cozmi*****> + * src/bookmarks/kz-session.c: added type checks. + * src/kz-module.c: fixed a bug. * module/embed/gecko/kz-gecko-embed.cpp: used KZ_GET_HISTORY_DIR Modified: kazehakase/trunk/src/bookmarks/kz-session.c =================================================================== --- kazehakase/trunk/src/bookmarks/kz-session.c 2007-03-27 06:27:23 UTC (rev 3052) +++ kazehakase/trunk/src/bookmarks/kz-session.c 2007-03-27 07:34:30 UTC (rev 3053) @@ -89,38 +89,41 @@ void kz_session_set_auto_save (KzSession *session, gboolean auto_save) { - KzSessionPrivate *priv = KZ_SESSION_GET_PRIVATE(session); + g_return_if_fail(KZ_IS_SESSION(session)); - priv->auto_save = auto_save; + KZ_SESSION_GET_PRIVATE(session)->auto_save = auto_save;; } void kz_session_freeze (KzSession *session) { - KzSessionPrivate *priv = KZ_SESSION_GET_PRIVATE(session); + g_return_if_fail(KZ_IS_SESSION(session)); - priv->frozen = TRUE; + KZ_SESSION_GET_PRIVATE(session)->frozen = TRUE; } void kz_session_thaw (KzSession *session) { - KzSessionPrivate *priv = KZ_SESSION_GET_PRIVATE(session); + g_return_if_fail(KZ_IS_SESSION(session)); - priv->frozen = FALSE; + KZ_SESSION_GET_PRIVATE(session)->frozen = FALSE; } void kz_session_set_profile (KzSession *session, KzProfile *profile) { gboolean auto_save; - KzSessionPrivate *priv = KZ_SESSION_GET_PRIVATE(session); + KzSessionPrivate *priv; + g_return_if_fail(KZ_IS_SESSION(session)); + + priv = KZ_SESSION_GET_PRIVATE(session); kz_profile_get_value(profile, "Session", "save", - &auto_save, sizeof(gboolean), KZ_PROFILE_VALUE_TYPE_BOOL); + &auto_save, sizeof(gboolean), + KZ_PROFILE_VALUE_TYPE_BOOL); priv->auto_save = auto_save; - g_signal_connect(profile, - "changed::Session", + g_signal_connect(profile, "changed::Session", G_CALLBACK(cb_profile_changed), session); }