[gnome-builder/wip/libide] libide: only add the buffer once
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/libide] libide: only add the buffer once
- Date: Tue, 3 Mar 2015 09:15:41 +0000 (UTC)
commit bcf9156fc1c7bce7a6fe41637d1447717cf00b4b
Author: Christian Hergert <christian hergert me>
Date: Tue Mar 3 01:15:24 2015 -0800
libide: only add the buffer once
libide/ide-buffer-manager.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/libide/ide-buffer-manager.c b/libide/ide-buffer-manager.c
index 53d02b2..f6a0d06 100644
--- a/libide/ide-buffer-manager.c
+++ b/libide/ide-buffer-manager.c
@@ -55,6 +55,7 @@ typedef struct
IdeBuffer *buffer;
IdeFile *file;
IdeProgress *progress;
+ guint is_new;
} LoadState;
typedef struct
@@ -407,7 +408,8 @@ ide_buffer_manager_load_file__load_cb (GObject *object,
goto emit_signal;
}
- ide_buffer_manager_add_buffer (self, state->buffer);
+ if (state->is_new)
+ ide_buffer_manager_add_buffer (self, state->buffer);
emit_signal:
g_signal_emit (self, gSignals [BUFFER_LOADED], 0, state->buffer);
@@ -467,6 +469,7 @@ ide_buffer_manager_load_file_async (IdeBufferManager *self,
}
state = g_slice_new0 (LoadState);
+ state->is_new = (buffer == NULL);
state->file = g_object_ref (file);
state->progress = g_object_new (IDE_TYPE_PROGRESS,
"context", context,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]