[bijiben] note: implement is_trashed
- From: Pierre-Yves Luyten <pyluyten src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [bijiben] note: implement is_trashed
- Date: Sun, 16 Mar 2014 23:05:42 +0000 (UTC)
commit 6d4f88d45d4de31b10241672463c032c2e687680
Author: Pierre-Yves Luyten <py luyten fr>
Date: Sun Mar 16 23:08:10 2014 +0100
note: implement is_trashed
src/libbiji/biji-local-note.c | 8 ++++++++
src/libbiji/biji-note-obj.c | 8 ++++++++
src/libbiji/biji-note-obj.h | 7 +++++++
src/libbiji/provider/biji-own-cloud-note.c | 11 +++++++++--
4 files changed, 32 insertions(+), 2 deletions(-)
---
diff --git a/src/libbiji/biji-local-note.c b/src/libbiji/biji-local-note.c
index 3274a51..8c0415d 100644
--- a/src/libbiji/biji-local-note.c
+++ b/src/libbiji/biji-local-note.c
@@ -206,6 +206,13 @@ local_note_archive (BijiNoteObj *note)
static gboolean
+local_note_is_trashed (BijiNoteObj *self)
+{
+ return BIJI_LOCAL_NOTE (self)->priv->trashed;
+}
+
+
+static gboolean
local_note_restore (BijiItem *item, gchar **old_uuid)
{
BijiLocalNote *self;
@@ -330,6 +337,7 @@ biji_local_note_class_init (BijiLocalNoteClass *klass)
note_class->save_note = local_note_save;
note_class->can_format = note_yes;
note_class->archive = local_note_archive;
+ note_class->is_trashed = local_note_is_trashed;
g_type_class_add_private ((gpointer)klass, sizeof (BijiLocalNotePrivate));
}
diff --git a/src/libbiji/biji-note-obj.c b/src/libbiji/biji-note-obj.c
index f23e5ca..6e8dcec 100644
--- a/src/libbiji/biji-note-obj.c
+++ b/src/libbiji/biji-note-obj.c
@@ -272,6 +272,14 @@ biji_note_obj_trash (BijiItem *item)
}
+
+gboolean
+note_obj_is_trashed (BijiNoteObj *self)
+{
+ return BIJI_NOTE_OBJ_GET_CLASS (self)->is_trashed (self);
+}
+
+
static const gchar *
biji_note_obj_get_path (BijiItem *item)
{
diff --git a/src/libbiji/biji-note-obj.h b/src/libbiji/biji-note-obj.h
index ea44a64..6df6059 100644
--- a/src/libbiji/biji-note-obj.h
+++ b/src/libbiji/biji-note-obj.h
@@ -61,6 +61,7 @@ struct _BijiNoteObjClass
void (*set_html) (BijiNoteObj *note, gchar *html);
void (*save_note) (BijiNoteObj *note);
gboolean (*archive) (BijiNoteObj *note);
+ gboolean (*is_trashed) (BijiNoteObj *note);
gboolean (*can_format) (BijiNoteObj *note);
};
@@ -120,6 +121,9 @@ void note_obj_set_is_template (BijiNoteObj *n,
gboolean is_template);
+gboolean biji_note_obj_is_trashed (BijiNoteObj *self);
+
+
void biji_note_obj_save_note (BijiNoteObj *self);
@@ -144,6 +148,9 @@ gboolean biji_note_obj_set_title (BijiNoteObj* note_
gboolean biji_note_obj_is_template (BijiNoteObj *note);
+gboolean biji_note_obj_is_trashed (BijiNoteObj *note);
+
+
GtkWidget *biji_note_obj_open (BijiNoteObj *note);
diff --git a/src/libbiji/provider/biji-own-cloud-note.c b/src/libbiji/provider/biji-own-cloud-note.c
index 5cd5ff8..0eb5d04 100644
--- a/src/libbiji/provider/biji-own-cloud-note.c
+++ b/src/libbiji/provider/biji-own-cloud-note.c
@@ -15,6 +15,12 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+
+/*
+ * Trash bin is not implemented.
+ * Markdown is not implemented.
+ */
+
#include <uuid/uuid.h>
#include "biji-info-set.h"
@@ -103,7 +109,7 @@ static void
ocloud_note_set_html (BijiNoteObj *note,
gchar *html)
{
-
+
}
@@ -187,7 +193,7 @@ ocloud_note_save (BijiNoteObj *note)
str = g_string_new (biji_note_obj_get_raw_text (note));
- /* backup would fail for some reason.
+ /* backup would fail for some reason.
* gfilemove for workaround? */
g_file_replace_contents_async (
self->priv->location,
@@ -366,6 +372,7 @@ biji_own_cloud_note_class_init (BijiOwnCloudNoteClass *klass)
note_class->save_note = ocloud_note_save;
note_class->can_format = note_no;
note_class->archive = ocloud_note_delete;
+ note_class->is_trashed = note_no;
g_type_class_add_private ((gpointer)klass, sizeof (BijiOwnCloudNotePrivate));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]