[bijiben] noteBook: remove unused func
- From: Pierre-Yves Luyten <pyluyten src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [bijiben] noteBook: remove unused func
- Date: Sat, 8 Dec 2012 00:35:07 +0000 (UTC)
commit d14a1539a455a0a84bf7f943bb85e162c9168e24
Author: Pierre-Yves Luyten <py luyten fr>
Date: Sat Dec 8 01:32:34 2012 +0100
noteBook: remove unused func
src/libbiji/biji-note-book.c | 52 +++--------------------------------------
src/libbiji/biji-note-book.h | 42 +++++++++++----------------------
2 files changed, 18 insertions(+), 76 deletions(-)
---
diff --git a/src/libbiji/biji-note-book.c b/src/libbiji/biji-note-book.c
index c0c9e3e..b99032c 100644
--- a/src/libbiji/biji-note-book.c
+++ b/src/libbiji/biji-note-book.c
@@ -455,12 +455,6 @@ _note_book_remove_one_note(BijiNoteBook *book,BijiNoteObj *note)
return FALSE;
}
-GList *
-_biji_note_book_get_notes (BijiNoteBook *book)
-{
- return g_hash_table_get_values (book->priv->notes);
-}
-
static void
add_note_to_list_if_tag_prefix(BijiNoteObj *note,TagBook *booklet)
{
@@ -513,17 +507,6 @@ _biji_note_book_get_no_tag_notes(BijiNoteBook *book)
return result;
}
-/* TODO : remove this & see what needs to be updated */
-BijiNoteObj *
-_biji_book_get_nth(BijiNoteBook *book,int i)
-{
- GList *notes = g_hash_table_get_values (book->priv->notes);
- BijiNoteObj *result = g_list_nth_data (notes, i);
- g_list_free (notes);
-
- return result;
-}
-
/* Notes collection */
void note_book_append_new_note(BijiNoteBook *book,BijiNoteObj *note)
{
@@ -539,20 +522,11 @@ biji_note_book_remove_note(BijiNoteBook *book,BijiNoteObj *note)
return _note_book_remove_one_note(book,note);
}
-
-/* TODO REMOVE THIS!!! */
-BijiNoteObj * note_book_get_nth_data(BijiNoteBook *book,int nth)
-{
- if (BIJI_IS_NOTE_BOOK(book))
- {
- return _biji_book_get_nth(book,nth);
- }
- else return NULL ;
-}
-
-GList * biji_note_book_get_notes(BijiNoteBook *book)
+
+GList *
+biji_note_book_get_notes(BijiNoteBook *book)
{
- return _biji_note_book_get_notes(book);
+ return g_hash_table_get_values (book->priv->notes);
}
BijiNoteObj *
@@ -561,24 +535,6 @@ note_book_get_note_at_path (BijiNoteBook *book, gchar *path)
return g_hash_table_lookup (book->priv->notes, path);
}
-/* No hash table key, still TODO = better than biji_book_get_nth */
-BijiNoteObj *
-note_book_get_note(BijiNoteBook *book,gchar *title)
-{
- gint i;
-
- for (i=0 ; i < g_hash_table_size (book->priv->notes); i++)
- {
- BijiNoteObj *o = _biji_book_get_nth(book,i);
- gchar *current = biji_note_obj_get_title (o);
-
- if ( g_strcmp0 (current,title) == 0 )
- return o ;
- }
-
- return NULL ;
-}
-
GList *
biji_note_book_get_notes_with_tag(BijiNoteBook *book,gchar* tag)
{
diff --git a/src/libbiji/biji-note-book.h b/src/libbiji/biji-note-book.h
index d0d07c0..36ab4aa 100644
--- a/src/libbiji/biji-note-book.h
+++ b/src/libbiji/biji-note-book.h
@@ -23,13 +23,13 @@ typedef struct _BijiNoteBookPrivate BijiNoteBookPrivate;
struct _BijiNoteBookClass
{
- GObjectClass parent_class;
+ GObjectClass parent_class;
};
struct _BijiNoteBook
{
- GObject parent_instance;
- BijiNoteBookPrivate *priv ;
+ GObject parent_instance;
+ BijiNoteBookPrivate *priv ;
};
GType biji_note_book_get_type (void) G_GNUC_CONST;
@@ -39,48 +39,34 @@ BijiNoteBook * biji_note_book_new (GFile *location);
gchar * biji_note_book_get_unique_title (BijiNoteBook *book, gchar *title);
gboolean _note_book_remove_one_note(BijiNoteBook *book,BijiNoteObj *note);
-void _biji_note_book_add_note_to_tag_book(BijiNoteBook *book,BijiNoteObj *note,gchar *tag);
-// This GLIST should be free but not the notes
-GList *_biji_note_book_get_notes(BijiNoteBook *book);
+void _biji_note_book_add_note_to_tag_book(BijiNoteBook *book,BijiNoteObj *note,gchar *tag);
-// This GLIST should be free but not the notes
-GList * _biji_note_book_get_notes_with_tag(BijiNoteBook *book,gchar *tag);
+void note_book_append_new_note(BijiNoteBook *book,BijiNoteObj *note);
-GList * _biji_note_book_get_no_tag_notes(BijiNoteBook *book);
+gboolean biji_note_book_remove_note(BijiNoteBook *book,BijiNoteObj *note);
-// This GLIST should be free but not the notes
-GList * _biji_note_book_get_notes_with_tag_prefix(BijiNoteBook *book,gchar *tag);
+BijiNoteObj * note_book_get_note_at_path(BijiNoteBook *book,gchar *path);
-// This func should be erased later on.
-BijiNoteObj * _biji_book_get_nth(BijiNoteBook *book,int i);
+void biji_note_book_remove_tag(BijiNoteBook *book,gchar *tag);
-// Collection accessors & signals
-void note_book_append_new_note(BijiNoteBook *book,BijiNoteObj *note);
-gboolean biji_note_book_remove_note(BijiNoteBook *book,BijiNoteObj *note);
+BijiNoteObj * biji_note_book_get_tag_template(BijiNoteBook *book, gchar *tag);
-// Return the list of notes. Free this list. Do not free the note.
-GList * biji_note_book_get_notes(BijiNoteBook *book);
+/* All GLIST return values should be freed, and never the content */
+GList * _biji_note_book_get_notes_with_tag(BijiNoteBook *book,gchar *tag);
-BijiNoteObj * note_book_get_note_at_path(BijiNoteBook *book,gchar *path);
+GList * _biji_note_book_get_no_tag_notes(BijiNoteBook *book);
-BijiNoteObj * note_book_get_nth_data(BijiNoteBook *book,int nth);
+GList * _biji_note_book_get_notes_with_tag_prefix(BijiNoteBook *book,gchar *tag);
-BijiNoteObj * note_book_get_note(BijiNoteBook *book,gchar *title);
+GList * biji_note_book_get_notes (BijiNoteBook *book);
-// Return the list of notes. Free this list. Do not free the note.
GList * biji_note_book_get_notes_with_tag(BijiNoteBook *book,gchar* tag);
-// Return the list of notes. Free this list. Do not free the note.
GList * biji_note_book_get_notes_with_tag_prefix(BijiNoteBook *book,gchar* tag);
-// Return the list of notes. Free this list. Do not free the note.
GList * biji_note_book_get_no_tag_notes(BijiNoteBook *book);
-void biji_note_book_remove_tag(BijiNoteBook *book,gchar *tag);
-
-BijiNoteObj * biji_note_book_get_tag_template(BijiNoteBook *book, gchar *tag);
-
/* Get a collection of notes from tomboy format files */
BijiNoteBook *biji_book_new_from_dir(gchar *tomboy_format_folder);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]