[bijiben/gnome-3-10] ownCloud: add a bit for import
- From: Pierre-Yves Luyten <pyluyten src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [bijiben/gnome-3-10] ownCloud: add a bit for import
- Date: Sun, 13 Oct 2013 20:43:54 +0000 (UTC)
commit 3bc57f63b2b5a30a4de03a87516c69c491ed686e
Author: Pierre-Yves Luyten <py luyten fr>
Date: Thu Oct 3 22:08:07 2013 +0200
ownCloud: add a bit for import
src/libbiji/provider/biji-import-provider.c | 8 +++--
src/libbiji/provider/biji-own-cloud-provider.c | 34 ++++++++++++++++++++++++
2 files changed, 39 insertions(+), 3 deletions(-)
---
diff --git a/src/libbiji/provider/biji-import-provider.c b/src/libbiji/provider/biji-import-provider.c
index c4ee275..8d61d81 100644
--- a/src/libbiji/provider/biji-import-provider.c
+++ b/src/libbiji/provider/biji-import-provider.c
@@ -65,15 +65,17 @@ G_DEFINE_TYPE (BijiImportProvider, biji_import_provider, BIJI_TYPE_PROVIDER)
static BijiNoteObj *
-instanciate_note (BijiNoteBook *book, GFileInfo *info, GFile *container)
+instanciate_note (BijiImportProvider *self, GFileInfo *info, GFile *container)
{
BijiNoteObj *retval = NULL;
const gchar *name;
gchar *path;
GdkRGBA *color;
+ BijiNoteBook *book;
retval = NULL;
+ book = biji_provider_get_book (BIJI_PROVIDER (self));
/* First make sure it's a note */
name = g_file_info_get_name (info);
@@ -114,7 +116,7 @@ instanciate_note (BijiNoteBook *book, GFileInfo *info, GFile *container)
color = g_new0 (GdkRGBA, 1);
biji_note_book_get_default_color (book, color);
retval = biji_note_book_note_new_full (book,
- "local",
+ self->priv->target,
g_strdup (g_file_info_get_name (info)),
set,
html,
@@ -165,7 +167,7 @@ go_through_notes_cb (GObject *object, GAsyncResult *res, gpointer data)
info = G_FILE_INFO (l->data);
iter = instanciate_note (
- biji_provider_get_book (BIJI_PROVIDER (self)),
+ self,
info,
container);
diff --git a/src/libbiji/provider/biji-own-cloud-provider.c b/src/libbiji/provider/biji-own-cloud-provider.c
index eebfdb6..002f333 100644
--- a/src/libbiji/provider/biji-own-cloud-provider.c
+++ b/src/libbiji/provider/biji-own-cloud-provider.c
@@ -746,6 +746,39 @@ own_cloud_create_note (BijiProvider *provider,
}
+
+/* This is a dummy func. we can create a note with extra args
+ * but can't use path, nor color, nor html. */
+
+BijiNoteObj *
+own_cloud_create_full (BijiProvider *provider,
+ gchar *suggested_path,
+ BijiInfoSet *info,
+ gchar *html,
+ GdkRGBA *color)
+{
+ BijiOwnCloudProvider *self;
+ BijiNoteObj *retval;
+ GdkRGBA override_color;
+ BijiNoteBook *book;
+
+ self = BIJI_OWN_CLOUD_PROVIDER (provider);
+ book = biji_provider_get_book (provider);
+
+ retval = biji_own_cloud_note_new_from_info (self, book, info);
+ biji_note_obj_set_html (retval, html);
+
+ /* We do not use suggested color.
+ * Rather use ook default */
+
+ biji_note_book_get_default_color (book, &override_color);
+ biji_note_obj_set_rgba (retval, &override_color);
+
+ return retval;
+}
+
+
+
GFile *
biji_own_cloud_provider_get_folder (BijiOwnCloudProvider *provider)
{
@@ -769,6 +802,7 @@ biji_own_cloud_provider_class_init (BijiOwnCloudProviderClass *klass)
provider_class->get_info = own_cloud_get_info;
provider_class->create_new_note = own_cloud_create_note;
+ provider_class->create_note_full = own_cloud_create_full;
properties[PROP_GOA_OBJECT] =
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]