[gnome-photos] application: Add photos_application_get_miner
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] application: Add photos_application_get_miner
- Date: Tue, 6 Sep 2016 05:43:21 +0000 (UTC)
commit 899fa6488334cc6ba48a94c574bf33d71ab99a77
Author: Debarshi Ray <debarshir gnome org>
Date: Mon Sep 5 20:26:44 2016 +0200
application: Add photos_application_get_miner
In a subsequent commit, we will use this to call the miner to insert
the shared item into the database.
https://bugzilla.gnome.org/show_bug.cgi?id=770267
src/photos-application.c | 24 +++++++++++++++++++++++-
src/photos-application.h | 4 ++++
2 files changed, 27 insertions(+), 1 deletions(-)
---
diff --git a/src/photos-application.c b/src/photos-application.c
index dacfd4c..793b213 100644
--- a/src/photos-application.c
+++ b/src/photos-application.c
@@ -43,7 +43,6 @@
#include "photos-export-dialog.h"
#include "photos-export-notification.h"
#include "photos-filterable.h"
-#include "photos-gom-miner.h"
#include "photos-item-manager.h"
#include "photos-main-window.h"
#include "photos-properties-dialog.h"
@@ -2019,6 +2018,29 @@ photos_application_new (void)
}
+GomMiner *
+photos_application_get_miner (PhotosApplication *self, const gchar *provider_type)
+{
+ GList *l;
+ GomMiner *ret_val = NULL;
+
+ for (l = self->miners; l != NULL; l = l->next)
+ {
+ GomMiner *miner = GOM_MINER (l->data);
+ const gchar *miner_provider_type;
+
+ miner_provider_type = g_object_get_data (G_OBJECT (miner), "provider-type");
+ if (g_strcmp0 (provider_type, miner_provider_type) == 0)
+ {
+ ret_val = miner;
+ break;
+ }
+ }
+
+ return ret_val;
+}
+
+
GList *
photos_application_get_miners_running (PhotosApplication *self)
{
diff --git a/src/photos-application.h b/src/photos-application.h
index f77a147..442f158 100644
--- a/src/photos-application.h
+++ b/src/photos-application.h
@@ -27,6 +27,8 @@
#include <gtk/gtk.h>
+#include "photos-gom-miner.h"
+
G_BEGIN_DECLS
#define PHOTOS_TYPE_APPLICATION (photos_application_get_type ())
@@ -46,6 +48,8 @@ GType photos_application_get_type (void) G_GNUC_C
GtkApplication *photos_application_new (void);
+GomMiner *photos_application_get_miner (PhotosApplication *self, const gchar
*provider_type);
+
GList *photos_application_get_miners_running (PhotosApplication *self);
gint photos_application_get_scale_factor (PhotosApplication *self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]