[gnome-online-miners/wip/rishi/insert-share: 20/20] gdata: Implement vfuncs
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-miners/wip/rishi/insert-share: 20/20] gdata: Implement vfuncs
- Date: Mon, 5 Sep 2016 13:13:28 +0000 (UTC)
commit 57c3eaab39859c4a93aebcc9d88b2918524c3cac
Author: Debarshi Ray <debarshir gnome org>
Date: Sat Sep 3 19:07:45 2016 +0200
gdata: Implement vfuncs
src/gom-gdata-miner.c | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/src/gom-gdata-miner.c b/src/gom-gdata-miner.c
index 16f6577..5a87081 100644
--- a/src/gom-gdata-miner.c
+++ b/src/gom-gdata-miner.c
@@ -955,6 +955,24 @@ query_gdata (GomAccountMinerJob *job,
error);
}
+static gpointer
+create_service (GomMiner *miner, GoaObject *object, const gchar *type)
+{
+ GDataGoaAuthorizer *authorizer;
+ gpointer service = NULL;
+
+ authorizer = gdata_goa_authorizer_new (object);
+
+ if (g_strcmp0 (type, "documents") == 0)
+ service = gdata_documents_service_new (GDATA_AUTHORIZER (authorizer));
+
+ if (g_strcmp0 (type, "photos") == 0)
+ service = gdata_picasaweb_service_new (GDATA_AUTHORIZER (authorizer));
+
+ g_object_unref (authorizer);
+ return service;
+}
+
static GHashTable *
create_services (GomMiner *self,
GoaObject *object)
@@ -989,6 +1007,12 @@ create_services (GomMiner *self,
}
static void
+destroy_service (GomMiner *miner, gpointer service)
+{
+ g_object_unref (service);
+}
+
+static void
gom_gdata_miner_init (GomGDataMiner *miner)
{
}
@@ -1002,6 +1026,8 @@ gom_gdata_miner_class_init (GomGDataMinerClass *klass)
miner_class->miner_identifier = MINER_IDENTIFIER;
miner_class->version = 5;
+ miner_class->create_service = create_service;
miner_class->create_services = create_services;
+ miner_class->destroy_service = destroy_service;
miner_class->query = query_gdata;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]