[anjuta] language-support-js: Use central header for GSettings keys
- From: Johannes Schmid <jhs src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta] language-support-js: Use central header for GSettings keys
- Date: Mon, 8 Nov 2010 11:02:19 +0000 (UTC)
commit 4fdecc1fd43934f0b56a7afe2a55c5b2f1f8c2a1
Author: Jens Georg <mail jensge org>
Date: Sun Oct 31 21:23:28 2010 +0200
language-support-js: Use central header for GSettings keys
plugins/language-support-js/plugin.c | 7 ++-----
plugins/language-support-js/plugin.h | 2 --
plugins/language-support-js/prefs.h | 30 ++++++++++++++++++++++++++++++
plugins/language-support-js/util.c | 7 ++-----
4 files changed, 34 insertions(+), 12 deletions(-)
---
diff --git a/plugins/language-support-js/plugin.c b/plugins/language-support-js/plugin.c
index 3f235f3..f0331e8 100644
--- a/plugins/language-support-js/plugin.c
+++ b/plugins/language-support-js/plugin.c
@@ -32,6 +32,7 @@
#include <glib.h>
#include "util.h"
#include "plugin.h"
+#include "prefs.h"
#include "code-completion.h"
#include "gi-symbol.h"
@@ -40,10 +41,6 @@
#define ICON_FILE "anjuta-language-cpp-java-plugin.png"
#define UI_FILE ANJUTA_UI_DIR"/anjuta-language-javascript.xml"
-#define MIN_CODECOMPLETE "javascript-min-codecomplete"
-#define ADD_BRACE_AFTER_FUNCCALL "javascript-add-brace-after-func"
-#define SHOW_CALLTIPS "javascript-show-calltips"
-
#define JSDIRS_LISTSTORE "jsdirs_liststore"
#define JSDIRS_TREEVIEW "jsdirs_treeview"
@@ -75,7 +72,7 @@ js_support_plugin_activate (AnjutaPlugin *plugin)
on_value_removed_current_editor,
plugin);
- js_support_plugin->prefs = g_settings_new (JAVASCRIPT_SUPPORT_SCHEMA);
+ js_support_plugin->prefs = g_settings_new (JS_SUPPORT_SCHEMA);
return TRUE;
}
diff --git a/plugins/language-support-js/plugin.h b/plugins/language-support-js/plugin.h
index bb593c6..af6195d 100644
--- a/plugins/language-support-js/plugin.h
+++ b/plugins/language-support-js/plugin.h
@@ -24,8 +24,6 @@
#include "database-symbol.h"
-#define JAVASCRIPT_SUPPORT_SCHEMA "org.gnome.anjuta.js"
-
typedef struct _JSLang JSLang;
typedef struct _JSLangClass JSLangClass;
diff --git a/plugins/language-support-js/prefs.h b/plugins/language-support-js/prefs.h
new file mode 100644
index 0000000..de2d61a
--- /dev/null
+++ b/plugins/language-support-js/prefs.h
@@ -0,0 +1,30 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ Copyright (C) 2010 Jens Georg <mail jensge org>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+#ifndef _JS_SUPPORT_PREFS_H_
+#define _JS_SUPPORT_PREFS_H_
+
+#define JS_SUPPORT_SCHEMA "org.gnome.anjuta.js"
+#define MIN_CODECOMPLETE "javascript-min-codecomplete"
+#define ADD_BRACE_AFTER_FUNCCALL "javascript-add-brace-after-func"
+#define SHOW_CALLTIPS "javascript-show-calltips"
+#define HIGHLIGHT_MISSEDSEMICOLON "javascript-missed"
+#define GIR_DIR_KEY "javascript-girdir"
+#define GJS_DIR_KEY "javascript-gjsdir"
+
+#endif /* _JS_SUPPORT_PREFS_H_ */
diff --git a/plugins/language-support-js/util.c b/plugins/language-support-js/util.c
index 60ae161..9bd8668 100644
--- a/plugins/language-support-js/util.c
+++ b/plugins/language-support-js/util.c
@@ -24,10 +24,7 @@
#include "plugin.h"
#include "util.h"
-
-#define HIGHLIGHT_MISSEDSEMICOLON "javascript-missed"
-#define GIR_DIR_KEY "javascript-girdir"
-#define GJS_DIR_KEY "javascript-gjsdir"
+#include "prefs.h"
static gchar*
get_gjs_path ()
@@ -35,7 +32,7 @@ get_gjs_path ()
JSLang* plugin = (JSLang*)getPlugin ();
if (!plugin->prefs)
- plugin->prefs = g_settings_new (JAVASCRIPT_SUPPORT_SCHEMA);
+ plugin->prefs = g_settings_new (JS_SUPPORT_SCHEMA);
gchar *path = g_settings_get_string (plugin->prefs, GJS_DIR_KEY);
if (!path || strlen (path) < 1)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]