[Kazehakase-cvs] CVS update: kazehakase/src/bookmarks

Zurück zum Archiv-Index

Hiroyuki Ikezoe ikezo****@users*****
Mon Jan 1 19:35:14 JST 2007


Index: kazehakase/src/bookmarks/kz-bookmark-file.c
diff -u kazehakase/src/bookmarks/kz-bookmark-file.c:1.22 kazehakase/src/bookmarks/kz-bookmark-file.c:1.23
--- kazehakase/src/bookmarks/kz-bookmark-file.c:1.22	Sat Dec  2 18:58:44 2006
+++ kazehakase/src/bookmarks/kz-bookmark-file.c	Mon Jan  1 19:35:14 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-bookmark-file.c,v 1.22 2006/12/02 09:58:44 ikezoe Exp $
+ *  $Id: kz-bookmark-file.c,v 1.23 2007/01/01 10:35:14 ikezoe Exp $
  */
 
 #include "kz-bookmark-file.h"
@@ -1136,3 +1136,18 @@
 	return last_time < time ? TRUE : FALSE;
 }
 
+void
+kz_bookmark_file_initialize (KzBookmarkFile *bookmark_file)
+{
+	KzBookmarkFileType *type;
+
+	type = kz_bookmark_file_detect_file_type(bookmark_file, NULL);
+	if (type && type->from_string)
+	{
+		if (!kz_bookmark_file_get_file_type(bookmark_file))
+			kz_bookmark_file_set_file_type(bookmark_file, type->file_type);
+		type->from_string(bookmark_file, NULL, 0, NULL);
+	}
+
+}
+
Index: kazehakase/src/bookmarks/kz-bookmark-file.h
diff -u kazehakase/src/bookmarks/kz-bookmark-file.h:1.8 kazehakase/src/bookmarks/kz-bookmark-file.h:1.9
--- kazehakase/src/bookmarks/kz-bookmark-file.h:1.8	Tue Jul 12 10:55:11 2005
+++ kazehakase/src/bookmarks/kz-bookmark-file.h	Mon Jan  1 19:35:14 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-bookmark-file.h,v 1.8 2005/07/12 01:55:11 ikezoe Exp $
+ *  $Id: kz-bookmark-file.h,v 1.9 2007/01/01 10:35:14 ikezoe Exp $
  */
 
 #ifndef __KZ_BOOKMARK_FILE_H__
@@ -137,6 +137,8 @@
 
 KzBookmarkFileState kz_bookmark_file_get_state	 (KzBookmarkFile *bookmark_file);
 
+void		kz_bookmark_file_initialize      (KzBookmarkFile *bookmark_file);
+
 gboolean	kz_bookmark_file_has_xmlrpc	 (KzBookmarkFile *bookmark_file);
 void		kz_bookmark_file_xmlrpc_insert   (KzBookmarkFile *file, 
 						  KzBookmark *folder,
Index: kazehakase/src/bookmarks/kz-root-bookmark.c
diff -u kazehakase/src/bookmarks/kz-root-bookmark.c:1.16 kazehakase/src/bookmarks/kz-root-bookmark.c:1.17
--- kazehakase/src/bookmarks/kz-root-bookmark.c:1.16	Mon Jan  1 10:24:42 2007
+++ kazehakase/src/bookmarks/kz-root-bookmark.c	Mon Jan  1 19:35:14 2007
@@ -17,7 +17,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-root-bookmark.c,v 1.16 2007/01/01 01:24:42 ikezoe Exp $
+ *  $Id: kz-root-bookmark.c,v 1.17 2007/01/01 10:35:14 ikezoe Exp $
  */
 
 #include "kz-root-bookmark.h"
@@ -26,10 +26,6 @@
 #include "kz-bookmark-file.h"
 #include "kz-session.h"
 
-
-static GObject *constructor (GType           type,
-		             guint           n_props,
-		             GObjectConstructParam *props);
 static void     dispose     (GObject *object);
 
 G_DEFINE_TYPE(KzRootBookmark, kz_root_bookmark, KZ_TYPE_BOOKMARK)
@@ -41,7 +37,6 @@
 
 	object_class = (GObjectClass *) klass;
 
-	object_class->constructor = constructor;
 	object_class->dispose     = dispose;
 }
 
@@ -65,23 +60,6 @@
 }
 
 
-static GObject *
-constructor (GType type, guint n_props,
-             GObjectConstructParam *props)
-{
-	KzRootBookmark *root;
-
-	GObject *object;
-	GObjectClass *klass = G_OBJECT_CLASS(kz_root_bookmark_parent_class);
-
-	object = klass->constructor(type, n_props, props);
-
-	root = KZ_ROOT_BOOKMARK(object);
-
-	return object;
-}
-
-
 static void
 dispose (GObject *object)
 {
@@ -323,16 +301,8 @@
 kz_root_bookmark_add_current_session_file (KzRootBookmark *root,
 					   const gchar *file)
 {
-	KzBookmark *current_session;
-
 	g_return_if_fail(KZ_IS_ROOT_BOOKMARK(root));
 	g_return_if_fail(file && *file);
-	g_return_if_fail(root->current_session);
-
-	/* FIXME! Check permission */
-	current_session = kz_session_new(file,
-					 _("Current Session"),
-					 "XBEL");
 
 	if (root->current_session)
 	{
@@ -340,10 +310,7 @@
 		root->current_session = NULL;
 	}
 
-	if (current_session)
-	{
-		root->current_session = current_session;
-	}
+	root->current_session = kz_session_new(file, _("Current Session"));
 }
 
 
Index: kazehakase/src/bookmarks/kz-session.c
diff -u kazehakase/src/bookmarks/kz-session.c:1.1 kazehakase/src/bookmarks/kz-session.c:1.2
--- kazehakase/src/bookmarks/kz-session.c:1.1	Mon Jan  1 10:24:42 2007
+++ kazehakase/src/bookmarks/kz-session.c	Mon Jan  1 19:35:14 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.1 2007/01/01 01:24:42 ikezoe Exp $
+ *  $Id: kz-session.c,v 1.2 2007/01/01 10:35:14 ikezoe Exp $
  */
 
 #include "kz-session.h"
@@ -109,13 +109,17 @@
 
 
 KzBookmark *
-kz_session_new (const gchar *location,
-	        const gchar *title,
-	        const gchar *file_type)
+kz_session_new (const gchar *location, const gchar *title)
 {
 	KzBookmark *session;
 
-	session = KZ_BOOKMARK(kz_bookmark_file_create_new(location, title, file_type));
+	session = g_object_new(KZ_TYPE_SESSION,
+			     "location",               location,
+			     "title",                  title,
+			     "file-type",              "XBEL",
+			     NULL);
+
+	kz_bookmark_file_initialize(KZ_BOOKMARK_FILE(session));
 
 	return session;
 }
Index: kazehakase/src/bookmarks/kz-session.h
diff -u kazehakase/src/bookmarks/kz-session.h:1.1 kazehakase/src/bookmarks/kz-session.h:1.2
--- kazehakase/src/bookmarks/kz-session.h:1.1	Mon Jan  1 10:24:42 2007
+++ kazehakase/src/bookmarks/kz-session.h	Mon Jan  1 19:35:14 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.h,v 1.1 2007/01/01 01:24:42 ikezoe Exp $
+ *  $Id: kz-session.h,v 1.2 2007/01/01 10:35:14 ikezoe Exp $
  */
 
 #ifndef __KZ_SESSION_H__
@@ -54,9 +54,7 @@
 GType		kz_session_get_type	(void) G_GNUC_CONST;
 
 /* boomark item creating functions */
-KzBookmark     *kz_session_new	(const gchar *location,
-				 const gchar *title,
-				 const gchar *file_type);
+KzBookmark     *kz_session_new	(const gchar *location, const gchar *title);
 
 void		kz_session_set_auto_save (KzSession *session, gboolean auto_save);
 


More information about the Kazehakase-cvs mailing list
Zurück zum Archiv-Index