[gnome-builder] snippets: cleanup snippet loading to use SNIPPETS_DIRECTORY.
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] snippets: cleanup snippet loading to use SNIPPETS_DIRECTORY.
- Date: Mon, 8 Sep 2014 20:18:49 +0000 (UTC)
commit 7b2f5e0f54cdbd873a520471e59d2e390b0f2ce6
Author: Christian Hergert <christian hergert me>
Date: Mon Sep 8 13:18:30 2014 -0700
snippets: cleanup snippet loading to use SNIPPETS_DIRECTORY.
src/editor/gb-source-snippets-manager.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/editor/gb-source-snippets-manager.c b/src/editor/gb-source-snippets-manager.c
index ccbe280..4f3fb86 100644
--- a/src/editor/gb-source-snippets-manager.c
+++ b/src/editor/gb-source-snippets-manager.c
@@ -17,6 +17,7 @@
*/
#define G_LOG_DOMAIN "snippets"
+#define SNIPPETS_DIRECTORY "/org/gnome/builder/snippets/"
#include <glib/gi18n.h>
@@ -196,10 +197,9 @@ gb_source_snippets_manager_init (GbSourceSnippetsManager *manager)
g_free,
g_object_unref);
- names = g_resources_enumerate_children (
- "/org/gnome/builder/snippets/",
- G_RESOURCE_LOOKUP_FLAGS_NONE,
- &error);
+ names = g_resources_enumerate_children (SNIPPETS_DIRECTORY,
+ G_RESOURCE_LOOKUP_FLAGS_NONE,
+ &error);
if (!names)
{
@@ -210,7 +210,7 @@ gb_source_snippets_manager_init (GbSourceSnippetsManager *manager)
for (i = 0; names[i]; i++)
{
- path = g_strdup_printf ("resource:///org/gnome/builder/snippets/%s", names[i]);
+ path = g_strdup_printf ("resource://"SNIPPETS_DIRECTORY"%s", names[i]);
file = g_file_new_for_uri (path);
if (!gb_source_snippets_manager_load_file (manager, file, &error))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]