[gtksourceview] snippetmanager: only parse snippets once
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] snippetmanager: only parse snippets once
- Date: Thu, 1 Sep 2022 01:00:03 +0000 (UTC)
commit 630626a7b8588435c455047929dfa8ee4aedcb9a
Author: Christian Hergert <chergert redhat com>
Date: Wed Aug 31 17:11:04 2022 -0700
snippetmanager: only parse snippets once
The whole point of ensure_snippets() is that you only parse it once until
that value is cleared (which currently we do not do).
gtksourceview/gtksourcesnippetmanager.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/gtksourceview/gtksourcesnippetmanager.c b/gtksourceview/gtksourcesnippetmanager.c
index 1ac17353..0305023c 100644
--- a/gtksourceview/gtksourcesnippetmanager.c
+++ b/gtksourceview/gtksourcesnippetmanager.c
@@ -290,6 +290,11 @@ ensure_snippets (GtkSourceSnippetManager *self)
g_assert (GTK_SOURCE_IS_SNIPPET_MANAGER (self));
+ if (self->bundle != NULL)
+ {
+ return;
+ }
+
filenames = _gtk_source_utils_get_file_list (
(gchar **)gtk_source_snippet_manager_get_search_path (self),
SNIPPET_FILE_SUFFIX,
@@ -312,7 +317,6 @@ ensure_snippets (GtkSourceSnippetManager *self)
g_clear_object (&parsed);
}
- g_clear_object (&self->bundle);
self->bundle = g_steal_pointer (&bundle);
g_slist_free_full (filenames, g_free);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]