[gnome-builder/gnome-builder-3-18] libide: rename ::loaded to ::context-loaded
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-3-18] libide: rename ::loaded to ::context-loaded
- Date: Tue, 13 Oct 2015 07:23:25 +0000 (UTC)
commit c544aff045b785e8ee3daf25dafd53cfa75a93d0
Author: Christian Hergert <christian hergert me>
Date: Tue Sep 22 01:31:46 2015 -0700
libide: rename ::loaded to ::context-loaded
::loaded was probably made a bit hasty and not very well named.
libide/ide-context.c | 2 +-
libide/ide-internal.h | 2 +-
libide/ide-service.c | 62 +++++++++---------------------------
libide/ide-service.h | 8 ++--
plugins/ctags/ide-ctags-service.c | 4 +-
5 files changed, 24 insertions(+), 54 deletions(-)
---
diff --git a/libide/ide-context.c b/libide/ide-context.c
index e5bbcb1..bdff676 100644
--- a/libide/ide-context.c
+++ b/libide/ide-context.c
@@ -491,7 +491,7 @@ ide_context_service_notify_loaded (PeasExtensionSet *set,
{
g_assert (IDE_IS_SERVICE (exten));
- _ide_service_emit_loaded (IDE_SERVICE (exten));
+ _ide_service_emit_context_loaded (IDE_SERVICE (exten));
}
static void
diff --git a/libide/ide-internal.h b/libide/ide-internal.h
index 79d61c3..dbaedcb 100644
--- a/libide/ide-internal.h
+++ b/libide/ide-internal.h
@@ -90,7 +90,7 @@ void _ide_project_set_name (IdeProject
void _ide_search_context_add_provider (IdeSearchContext *context,
IdeSearchProvider *provider,
gsize max_results);
-void _ide_service_emit_loaded (IdeService *service);
+void _ide_service_emit_context_loaded (IdeService *service);
IdeSettings *_ide_settings_new (IdeContext *context,
const gchar *schema_id,
const gchar *relative_path,
diff --git a/libide/ide-service.c b/libide/ide-service.c
index cfab1fb..6e419ed 100644
--- a/libide/ide-service.c
+++ b/libide/ide-service.c
@@ -24,9 +24,7 @@
G_DEFINE_INTERFACE (IdeService, ide_service, G_TYPE_OBJECT)
enum {
- LOADED,
- START,
- STOP,
+ CONTEXT_LOADED,
LAST_SIGNAL
};
@@ -45,7 +43,8 @@ ide_service_start (IdeService *service)
{
g_return_if_fail (IDE_IS_SERVICE (service));
- g_signal_emit (service, gSignals [START], 0);
+ if (IDE_SERVICE_GET_IFACE (service)->start)
+ IDE_SERVICE_GET_IFACE (service)->start (service);
}
void
@@ -53,25 +52,16 @@ ide_service_stop (IdeService *service)
{
g_return_if_fail (IDE_IS_SERVICE (service));
- g_signal_emit (service, gSignals [STOP], 0);
+ if (IDE_SERVICE_GET_IFACE (service)->stop)
+ IDE_SERVICE_GET_IFACE (service)->stop (service);
}
void
-_ide_service_emit_loaded (IdeService *service)
+_ide_service_emit_context_loaded (IdeService *service)
{
g_return_if_fail (IDE_IS_SERVICE (service));
- g_signal_emit (service, gSignals [LOADED], 0);
-}
-
-static void
-ide_service_real_start (IdeService *service)
-{
-}
-
-static void
-ide_service_real_stop (IdeService *service)
-{
+ g_signal_emit (service, gSignals [CONTEXT_LOADED], 0);
}
static const gchar *
@@ -83,40 +73,20 @@ ide_service_real_get_name (IdeService *service)
static void
ide_service_default_init (IdeServiceInterface *iface)
{
- iface->start = ide_service_real_start;
- iface->start = ide_service_real_stop;
iface->get_name = ide_service_real_get_name;
g_object_interface_install_property (iface,
- g_param_spec_object ("context",
- "Context",
- "Context",
- IDE_TYPE_CONTEXT,
- (G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS)));
-
- gSignals [LOADED] =
- g_signal_new ("loaded",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (IdeServiceInterface, loaded),
- NULL, NULL, NULL,
- G_TYPE_NONE,
- 0);
-
- gSignals [START] =
- g_signal_new ("start",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (IdeServiceInterface, start),
- NULL, NULL, NULL,
- G_TYPE_NONE,
- 0);
-
- gSignals [STOP] =
- g_signal_new ("stop",
+ g_param_spec_object ("context",
+ "Context",
+ "Context",
+ IDE_TYPE_CONTEXT,
+ (G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)));
+
+ gSignals [CONTEXT_LOADED] =
+ g_signal_new ("context-loaded",
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (IdeServiceInterface, stop),
+ G_STRUCT_OFFSET (IdeServiceInterface, context_loaded),
NULL, NULL, NULL,
G_TYPE_NONE,
0);
diff --git a/libide/ide-service.h b/libide/ide-service.h
index 1756b16..1b759a1 100644
--- a/libide/ide-service.h
+++ b/libide/ide-service.h
@@ -31,10 +31,10 @@ struct _IdeServiceInterface
{
GTypeInterface parent_interface;
- const gchar *(*get_name) (IdeService *service);
- void (*loaded) (IdeService *service);
- void (*start) (IdeService *service);
- void (*stop) (IdeService *service);
+ void (*context_loaded) (IdeService *service);
+ const gchar *(*get_name) (IdeService *service);
+ void (*start) (IdeService *service);
+ void (*stop) (IdeService *service);
};
const gchar *ide_service_get_name (IdeService *self);
diff --git a/plugins/ctags/ide-ctags-service.c b/plugins/ctags/ide-ctags-service.c
index ec3e38e..bd317c0 100644
--- a/plugins/ctags/ide-ctags-service.c
+++ b/plugins/ctags/ide-ctags-service.c
@@ -364,7 +364,7 @@ ide_ctags_service_tags_built_cb (IdeCtagsService *self,
}
static void
-ide_ctags_service_loaded (IdeService *service)
+ide_ctags_service_context_loaded (IdeService *service)
{
IdeCtagsService *self = (IdeCtagsService *)service;
@@ -434,7 +434,7 @@ ide_ctags_service_class_init (IdeCtagsServiceClass *klass)
static void
service_iface_init (IdeServiceInterface *iface)
{
- iface->loaded = ide_ctags_service_loaded;
+ iface->context_loaded = ide_ctags_service_context_loaded;
iface->start = ide_ctags_service_start;
iface->stop = ide_ctags_service_stop;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]