[gnome-builder/editor-layout] change-monitor: add reload() helper for change monitor
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/editor-layout] change-monitor: add reload() helper for change monitor
- Date: Mon, 1 Dec 2014 07:01:09 +0000 (UTC)
commit 7b998502e4bf7d2b1cee1768886b21a850cbcb40
Author: Christian Hergert <christian hergert me>
Date: Sun Nov 30 22:58:00 2014 -0800
change-monitor: add reload() helper for change monitor
src/editor/gb-source-change-monitor.c | 22 ++++++++++++++++++----
src/editor/gb-source-change-monitor.h | 1 +
2 files changed, 19 insertions(+), 4 deletions(-)
---
diff --git a/src/editor/gb-source-change-monitor.c b/src/editor/gb-source-change-monitor.c
index b5bd111..7b68bcb 100644
--- a/src/editor/gb-source-change-monitor.c
+++ b/src/editor/gb-source-change-monitor.c
@@ -524,6 +524,23 @@ gb_source_change_monitor_get_file (GbSourceChangeMonitor *monitor)
}
void
+gb_source_change_monitor_reload (GbSourceChangeMonitor *monitor)
+{
+ ENTRY;
+
+ g_return_if_fail (GB_IS_SOURCE_CHANGE_MONITOR (monitor));
+
+ if (monitor->priv->file)
+ {
+ gb_source_change_monitor_discover_repository (monitor);
+ gb_source_change_monitor_load_blob (monitor);
+ gb_source_change_monitor_queue_parse (monitor);
+ }
+
+ EXIT;
+}
+
+void
gb_source_change_monitor_set_file (GbSourceChangeMonitor *monitor,
GFile *file)
{
@@ -546,14 +563,11 @@ gb_source_change_monitor_set_file (GbSourceChangeMonitor *monitor,
if (file)
{
priv->file = g_object_ref (file);
- gb_source_change_monitor_discover_repository (monitor);
- gb_source_change_monitor_load_blob (monitor);
+ gb_source_change_monitor_reload (monitor);
}
g_object_notify_by_pspec (G_OBJECT (monitor), gParamSpecs [PROP_FILE]);
- gb_source_change_monitor_queue_parse (monitor);
-
EXIT;
}
diff --git a/src/editor/gb-source-change-monitor.h b/src/editor/gb-source-change-monitor.h
index 24b483a..d107849 100644
--- a/src/editor/gb-source-change-monitor.h
+++ b/src/editor/gb-source-change-monitor.h
@@ -64,6 +64,7 @@ void gb_source_change_monitor_set_file (GbSourceChangeMonitor
GFile *file);
GbSourceChangeFlags gb_source_change_monitor_get_line (GbSourceChangeMonitor *monitor,
guint lineno);
+void gb_source_change_monitor_reload (GbSourceChangeMonitor *monitor);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]