[gnome-builder] libide: allow opening non-existant files
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libide: allow opening non-existant files
- Date: Mon, 23 Mar 2015 23:39:16 +0000 (UTC)
commit 6dd9d63ec8564a7cecd87f64d31b0f41c0e47a87
Author: Christian Hergert <christian hergert me>
Date: Tue Feb 24 11:54:30 2015 -0800
libide: allow opening non-existant files
libide/ide-buffer-manager.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/libide/ide-buffer-manager.c b/libide/ide-buffer-manager.c
index b3c1857..da98e7e 100644
--- a/libide/ide-buffer-manager.c
+++ b/libide/ide-buffer-manager.c
@@ -385,8 +385,16 @@ ide_buffer_manager_load_file__load_cb (GObject *object,
if (!gtk_source_file_loader_load_finish (loader, result, &error))
{
- g_task_return_error (task, error);
- return;
+ /*
+ * It's okay if we fail because the file does not exist yet.
+ */
+ if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
+ {
+ g_task_return_error (task, error);
+ return;
+ }
+
+ g_clear_error (&error);
}
for (i = 0; i < self->buffers->len; i++)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]