[gnome-builder] libide: return successfully if we came across a .editorconfig file
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libide: return successfully if we came across a .editorconfig file
- Date: Mon, 23 Mar 2015 23:32:01 +0000 (UTC)
commit aa6af496e0a24fb6084763c4e5daab194a83026a
Author: Christian Hergert <christian hergert me>
Date: Sat Feb 14 18:26:50 2015 -0800
libide: return successfully if we came across a .editorconfig file
libide/editorconfig/editorconfig.c | 9 +++++++++
.../editorconfig/ide-editorconfig-file-settings.c | 8 +-------
2 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/libide/editorconfig/editorconfig.c b/libide/editorconfig/editorconfig.c
index 4e298b2..d787e92 100644
--- a/libide/editorconfig/editorconfig.c
+++ b/libide/editorconfig/editorconfig.c
@@ -322,6 +322,15 @@ editorconfig_read (GFile *file,
g_clear_object (&iter);
+ if (!queue->length)
+ {
+ g_set_error (error,
+ G_IO_ERROR,
+ G_IO_ERROR_NOT_FOUND,
+ _("No .editorconfig files could be found."));
+ goto cleanup;
+ }
+
hashtable = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, vfree);
while ((iter = g_queue_pop_head (queue)))
diff --git a/libide/editorconfig/ide-editorconfig-file-settings.c
b/libide/editorconfig/ide-editorconfig-file-settings.c
index aaf998a..0ec4d26 100644
--- a/libide/editorconfig/ide-editorconfig-file-settings.c
+++ b/libide/editorconfig/ide-editorconfig-file-settings.c
@@ -114,13 +114,7 @@ ide_editorconfig_file_settings_init_worker (GTask *task,
}
}
- if (g_hash_table_size (ht) == 0)
- g_task_return_new_error (task,
- G_IO_ERROR,
- G_IO_ERROR_NOT_FOUND,
- _("No editorconfig options were found."));
- else
- g_task_return_boolean (task, TRUE);
+ g_task_return_boolean (task, TRUE);
g_hash_table_unref (ht);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]