[gnome-builder] buffer-manager: do error tracking when loading buffer
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] buffer-manager: do error tracking when loading buffer
- Date: Wed, 13 Dec 2017 09:35:20 +0000 (UTC)
commit 392ff118f0bdb2f31a40c566dbf9f669552c1eb1
Author: Christian Hergert <chergert redhat com>
Date: Wed Dec 13 01:25:17 2017 -0800
buffer-manager: do error tracking when loading buffer
Now that we can set an error the buffer, make sure we propagate
that while loading.
src/libide/buffers/ide-buffer-manager.c | 12 +++++++-----
src/libide/buffers/ide-buffer-private.h | 2 ++
2 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/src/libide/buffers/ide-buffer-manager.c b/src/libide/buffers/ide-buffer-manager.c
index e7db555..6e67417 100644
--- a/src/libide/buffers/ide-buffer-manager.c
+++ b/src/libide/buffers/ide-buffer-manager.c
@@ -583,6 +583,7 @@ ide_buffer_manager_load_file__load_cb (GObject *object,
*/
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
{
+ _ide_buffer_set_failure (state->buffer, error);
g_task_return_error (task, g_steal_pointer (&error));
IDE_EXIT;
}
@@ -666,6 +667,7 @@ ide_buffer_manager__load_file_query_info_cb (GObject *object,
{
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
{
+ _ide_buffer_set_failure (state->buffer, error);
g_task_return_error (task, g_steal_pointer (&error));
IDE_EXIT;
}
@@ -1075,18 +1077,18 @@ ide_buffer_manager_save_file__load_settings_cb (GObject *object,
g_assert (IDE_IS_FILE (file));
g_assert (G_IS_TASK (task));
+ source_file = _ide_file_get_source_file (file);
+ state = g_task_get_task_data (task);
+
file_settings = ide_file_load_settings_finish (file, result, &error);
- if (!file_settings)
+ if (file_settings == NULL)
{
+ _ide_buffer_set_failure (state->buffer, error);
g_task_return_error (task, g_steal_pointer (&error));
IDE_EXIT;
}
- source_file = _ide_file_get_source_file (file);
-
- state = g_task_get_task_data (task);
-
g_assert (GTK_SOURCE_IS_FILE (source_file));
g_assert (IDE_IS_BUFFER (state->buffer));
g_assert (IDE_IS_FILE (state->file));
diff --git a/src/libide/buffers/ide-buffer-private.h b/src/libide/buffers/ide-buffer-private.h
index 328bcd4..148ed9f 100644
--- a/src/libide/buffers/ide-buffer-private.h
+++ b/src/libide/buffers/ide-buffer-private.h
@@ -38,6 +38,8 @@ void _ide_buffer_set_mtime (IdeBuffer *self,
const GTimeVal *mtime);
void _ide_buffer_set_read_only (IdeBuffer *buffer,
gboolean read_only);
+void _ide_buffer_set_failure (IdeBuffer *self,
+ const GError *error);
void _ide_buffer_manager_reclaim (IdeBufferManager *self,
IdeBuffer *buffer);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]