Commit c9fc6ee1 authored by Christian Hergert's avatar Christian Hergert

git: wire up reloading of change monitors when repository reloads

Related #1248
parent 110421c4
......@@ -30,7 +30,8 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (IpcGitChangeMonitorImpl, ipc_git_change_monitor_impl, IPC, GIT_CHANGE_MONITOR_IMPL, IpcGitChangeMonitorSkeleton)
IpcGitChangeMonitor *ipc_git_change_monitor_impl_new (GgitRepository *repository,
const gchar *path);
IpcGitChangeMonitor *ipc_git_change_monitor_impl_new (GgitRepository *repository,
const gchar *path);
void ipc_git_change_monitor_impl_reset (IpcGitChangeMonitorImpl *self);
G_END_DECLS
......@@ -64,9 +64,20 @@ static void
ipc_git_repository_impl_monitor_changed_cb (IpcGitRepositoryImpl *self,
IpcGitIndexMonitor *monitor)
{
GHashTableIter iter;
gpointer key;
g_assert (IPC_IS_GIT_REPOSITORY_IMPL (self));
g_assert (IPC_IS_GIT_INDEX_MONITOR (monitor));
g_hash_table_iter_init (&iter, self->change_monitors);
while (g_hash_table_iter_next (&iter, (gpointer *)&key, NULL))
{
IpcGitChangeMonitorImpl *change_monitor = key;
g_assert (IPC_IS_GIT_CHANGE_MONITOR_IMPL (change_monitor));
ipc_git_change_monitor_impl_reset (change_monitor);
}
ipc_git_repository_emit_changed (IPC_GIT_REPOSITORY (self));
}
......
......@@ -129,10 +129,14 @@ gbp_git_buffer_change_monitor_reload (IdeBufferChangeMonitor *monitor)
{
GbpGitBufferChangeMonitor *self = (GbpGitBufferChangeMonitor *)monitor;
IDE_ENTRY;
g_assert (IDE_IS_MAIN_THREAD ());
g_assert (GBP_IS_GIT_BUFFER_CHANGE_MONITOR (self));
gbp_git_buffer_change_monitor_queue_update (self, FAST);
IDE_EXIT;
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment