[kazehakase-svn] [3637] * src/bookmarks/kz-bookmark-folder.[ch]: Added

アーカイブの一覧に戻る

svnno****@sourc***** svnno****@sourc*****
Thu Feb 12 13:58:57 JST 2009


Revision: 3637
          http://svn.sourceforge.jp/view?root=kazehakase&view=rev&rev=3637
Author:   ikezoe
Date:     2009-02-12 13:58:57 +0900 (Thu, 12 Feb 2009)

Log Message:
-----------
	* src/bookmarks/kz-bookmark-folder.[ch]: Added
	kz_bookmark_folder_get_child_index.

Modified Paths:
--------------
    kazehakase/trunk/ChangeLog
    kazehakase/trunk/src/bookmarks/kz-bookmark-folder.c
    kazehakase/trunk/src/bookmarks/kz-bookmark-folder.h
    kazehakase/trunk/test/test-bookmark-folder.c

Modified: kazehakase/trunk/ChangeLog
===================================================================
--- kazehakase/trunk/ChangeLog	2009-02-12 04:49:53 UTC (rev 3636)
+++ kazehakase/trunk/ChangeLog	2009-02-12 04:58:57 UTC (rev 3637)
@@ -10,8 +10,10 @@
 	* src/bookmarks/kz-bookmark.[ch]: Remove KzBookmarkType.
 	* src/kz-window.c, src/kz-xbel.c, src/kz-thumbnails-view.c: Use
 	kz_bookmark_folder_foreach_child.
-	* src/kz-bookmarks/kz-proxy-folder.c: Use
+	* src/bookmarks/kz-proxy-folder.c: Use
 	kz_bookmark_folder_get_nth_child and kz_bookmark_folder_foreach_child.
+	* src/bookmarks/kz-bookmark-folder.[ch]: Added
+	kz_bookmark_folder_get_child_index.
 
 2009-02-11  Hiroyuki Ikezoe  <poinc****@ikezo*****>
 

Modified: kazehakase/trunk/src/bookmarks/kz-bookmark-folder.c
===================================================================
--- kazehakase/trunk/src/bookmarks/kz-bookmark-folder.c	2009-02-12 04:49:53 UTC (rev 3636)
+++ kazehakase/trunk/src/bookmarks/kz-bookmark-folder.c	2009-02-12 04:58:57 UTC (rev 3637)
@@ -564,3 +564,11 @@
 	return KZ_BOOKMARK(g_list_nth_data(priv->children, index));
 }
 
+gint
+kz_bookmark_folder_get_child_index (KzBookmarkFolder *folder, KzBookmark *child)
+{
+	KzBookmarkFolderPrivate *priv = KZ_BOOKMARK_FOLDER_GET_PRIVATE(folder);
+
+	return priv->children ? g_list_index(priv->children, child) : -1;
+}
+

Modified: kazehakase/trunk/src/bookmarks/kz-bookmark-folder.h
===================================================================
--- kazehakase/trunk/src/bookmarks/kz-bookmark-folder.h	2009-02-12 04:49:53 UTC (rev 3636)
+++ kazehakase/trunk/src/bookmarks/kz-bookmark-folder.h	2009-02-12 04:58:57 UTC (rev 3637)
@@ -111,6 +111,8 @@
 							 gpointer    user_data);
 KzBookmark     *kz_bookmark_folder_get_nth_child        (KzBookmarkFolder  *folder,
 							 gint index);
+gint 		kz_bookmark_folder_get_child_index	(KzBookmarkFolder  *folder,
+							 KzBookmark *child);
 G_END_DECLS
 
 #endif /* __KZ_BOOKMARK_FOLDER_H__ */

Modified: kazehakase/trunk/test/test-bookmark-folder.c
===================================================================
--- kazehakase/trunk/test/test-bookmark-folder.c	2009-02-12 04:49:53 UTC (rev 3636)
+++ kazehakase/trunk/test/test-bookmark-folder.c	2009-02-12 04:58:57 UTC (rev 3637)
@@ -18,6 +18,7 @@
 void test_get_parent (void);
 void test_get_current_bookmark (void);
 void test_find_bookmark_from_uri (void);
+void test_child_index (void);
 
 static KzBookmarkFolder *folder;
 static KzBookmark *child;
@@ -217,6 +218,15 @@
 
 }
 
+void
+test_child_index (void)
+{
+    cut_trace(test_prepend());
+
+    cut_assert_equal_pointer(0, kz_bookmark_folder_get_child_index(folder, another_child));
+    cut_assert_equal_pointer(1, kz_bookmark_folder_get_child_index(folder, child));
+}
+
 /*
 vi:ts=4:nowrap:ai:expandtab:sw=4
 */




More information about the Kazehakase-cvs mailing list
アーカイブの一覧に戻る