[gnome-todo] manager: Add function to inject GtdProviders



commit 8daa5ce03ebff2c3140ce3175da1281449b47f12
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Mon Sep 10 22:01:05 2018 -0300

    manager: Add function to inject GtdProviders
    
    Will be used to inject DummyProviders into GtdManager.

 src/engine/gtd-manager-protected.h |  3 ++-
 src/engine/gtd-manager.c           | 11 +++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)
---
diff --git a/src/engine/gtd-manager-protected.h b/src/engine/gtd-manager-protected.h
index d1ee773..6d2bb6b 100644
--- a/src/engine/gtd-manager-protected.h
+++ b/src/engine/gtd-manager-protected.h
@@ -26,6 +26,7 @@ void                 gtd_manager_load_plugins                    (GtdManager
 
 GtdPluginManager*    gtd_manager_get_plugin_manager              (GtdManager         *manager);
 
-G_END_DECLS
+void                 _gtd_manager_inject_provider                (GtdManager         *self,
+                                                                  GtdProvider        *provider);
 
 G_END_DECLS
diff --git a/src/engine/gtd-manager.c b/src/engine/gtd-manager.c
index 57d31e8..4fa635c 100644
--- a/src/engine/gtd-manager.c
+++ b/src/engine/gtd-manager.c
@@ -968,3 +968,14 @@ gtd_manager_get_plugin_manager (GtdManager *self)
 
   return self->plugin_manager;
 }
+
+void
+_gtd_manager_inject_provider (GtdManager  *self,
+                              GtdProvider *provider)
+{
+  g_return_if_fail (GTD_IS_MANAGER (self));
+
+  g_debug ("Injecting provider '%s'", gtd_provider_get_name (provider));
+
+  on_provider_added_cb (NULL, provider, self);
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]