[anjuta/gsettings-migration: 53/65] symbol-db: Ported to GSettings
- From: Johannes Schmid <jhs src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta/gsettings-migration: 53/65] symbol-db: Ported to GSettings
- Date: Sun, 17 Oct 2010 09:37:12 +0000 (UTC)
commit c4b8889f6f184e5445a9b34a5838db16d5d5b95c
Author: Johannes Schmid <jhs gnome org>
Date: Tue Oct 12 18:09:20 2010 +0200
symbol-db: Ported to GSettings
plugins/symbol-db/Makefile.am | 4 +++-
plugins/symbol-db/plugin.c | 22 ++++++++++++++--------
plugins/symbol-db/plugin.h | 2 +-
plugins/symbol-db/symbol-db-prefs.c | 20 ++++++++++----------
plugins/symbol-db/symbol-db-prefs.h | 2 +-
5 files changed, 29 insertions(+), 21 deletions(-)
---
diff --git a/plugins/symbol-db/Makefile.am b/plugins/symbol-db/Makefile.am
index 2ee0e31..d358dd0 100644
--- a/plugins/symbol-db/Makefile.am
+++ b/plugins/symbol-db/Makefile.am
@@ -106,7 +106,9 @@ symbol-db-marshal.c: symbol-db-marshal.h symbol-db-marshal.list
&& rm -f xgenc-gmc
-
+prefs_ui_files = anjuta-symbol-db.ui
+prefs_name = org.gnome.anjuta.symbol-db
+include $(top_srcdir)/scripts/build-schemas.mk
EXTRA_DIST = \
$(plugin_in_files) \
diff --git a/plugins/symbol-db/plugin.c b/plugins/symbol-db/plugin.c
index 1cafd3b..5abca4b 100644
--- a/plugins/symbol-db/plugin.c
+++ b/plugins/symbol-db/plugin.c
@@ -62,6 +62,8 @@
#define ANJUTA_STOCK_GOTO_DECLARATION "element-interface"
#define ANJUTA_STOCK_GOTO_IMPLEMENTATION "element-method"
+#define PREF_SCHEMA "org.gnome.anjuta.symbol-db"
+
static gpointer parent_class;
/* signals */
@@ -504,7 +506,7 @@ on_editor_buffer_symbol_update_scan_end (SymbolDBEngine *dbe, gint process_id,
}
/* add a default timeout to the updating of buffer symbols */
- tags_update = anjuta_preferences_get_bool (sdb_plugin->prefs, BUFFER_AUTOSCAN);
+ tags_update = g_settings_get_boolean (sdb_plugin->settings, BUFFER_AUTOSCAN);
if (tags_update)
{
@@ -681,7 +683,7 @@ value_added_current_editor (AnjutaPlugin *plugin, const char *name,
g_object_set (sdb_plugin->file_model, "file-path", local_path, NULL);
/* add a default timeout to the updating of buffer symbols */
- tags_update = anjuta_preferences_get_bool (sdb_plugin->prefs, BUFFER_AUTOSCAN);
+ tags_update = g_settings_get_boolean (sdb_plugin->settings, BUFFER_AUTOSCAN);
if (tags_update)
{
@@ -1515,8 +1517,8 @@ on_session_load (AnjutaShell *shell, AnjutaSessionPhase phase,
if (sdb_plugin->session_packages == NULL)
{
/* hey, does user want to import system sources for this project? */
- gboolean automatic_scan = anjuta_preferences_get_bool (sdb_plugin->prefs,
- PROJECT_AUTOSCAN);
+ gboolean automatic_scan = g_settings_get_boolean (sdb_plugin->settings,
+ PROJECT_AUTOSCAN);
if (automatic_scan == TRUE)
{
@@ -1525,7 +1527,7 @@ on_session_load (AnjutaShell *shell, AnjutaSessionPhase phase,
}
/* get preferences about the parallel scan */
- gboolean parallel_scan = anjuta_preferences_get_bool (sdb_plugin->prefs,
+ gboolean parallel_scan = g_settings_get_boolean (sdb_plugin->settings,
PARALLEL_SCAN);
if (parallel_scan == TRUE &&
@@ -1823,7 +1825,7 @@ on_scan_end_manager (SymbolDBEngine *dbe, gint process_id,
sdb_plugin);
/* get preferences about the parallel scan */
- gboolean parallel_scan = anjuta_preferences_get_bool (sdb_plugin->prefs,
+ gboolean parallel_scan = g_settings_get_boolean (sdb_plugin->settings,
PARALLEL_SCAN);
/* check the system population has a parallel fashion or not. */
@@ -1932,7 +1934,6 @@ symbol_db_activate (AnjutaPlugin *plugin)
sdb_plugin = ANJUTA_PLUGIN_SYMBOL_DB (plugin);
sdb_plugin->ui = anjuta_shell_get_ui (plugin->shell, NULL);
- sdb_plugin->prefs = anjuta_shell_get_preferences (plugin->shell, NULL);
sdb_plugin->project_opened = NULL;
ctags_path = NULL;
@@ -2325,8 +2326,12 @@ symbol_db_finalize (GObject *obj)
static void
symbol_db_dispose (GObject *obj)
{
+ SymbolDBPlugin *plugin = (SymbolDBPlugin*)obj;
DEBUG_PRINT ("Symbol-DB dispose");
/* Disposition codes */
+ g_object_unref (plugin->settings);
+
+
G_OBJECT_CLASS (parent_class)->dispose (obj);
}
@@ -2341,6 +2346,7 @@ symbol_db_instance_init (GObject *obj)
plugin->files_count_system_done = 0;
plugin->files_count_system = 0;
plugin->current_scanned_package = NULL;
+ plugin->settings = g_settings_new (PREF_SCHEMA);
}
static void
@@ -2454,7 +2460,7 @@ ipreferences_merge(IAnjutaPreferences* ipref, AnjutaPreferences* prefs, GError**
sdb_plugin->sdbp = symbol_db_prefs_new (sdb_plugin->sdbs,
sdb_plugin->sdbe_project,
sdb_plugin->sdbe_globals,
- prefs,
+ sdb_plugin->settings,
sdb_plugin->session_packages);
/* connect the signals to retrieve package modifications */
diff --git a/plugins/symbol-db/plugin.h b/plugins/symbol-db/plugin.h
index 53fcae1..230858c 100644
--- a/plugins/symbol-db/plugin.h
+++ b/plugins/symbol-db/plugin.h
@@ -57,7 +57,7 @@ typedef struct _SymbolDBPluginClass SymbolDBPluginClass;
struct _SymbolDBPlugin {
AnjutaPlugin parent;
AnjutaUI *ui;
- AnjutaPreferences *prefs;
+ GSettings* settings;
/* project monitor */
guint root_watch_id;
diff --git a/plugins/symbol-db/symbol-db-prefs.c b/plugins/symbol-db/symbol-db-prefs.c
index 9e00e82..97889c2 100644
--- a/plugins/symbol-db/symbol-db-prefs.c
+++ b/plugins/symbol-db/symbol-db-prefs.c
@@ -57,7 +57,7 @@ struct _SymbolDBPrefsPriv {
GtkListStore *prefs_list_store;
GtkBuilder *prefs_bxml;
AnjutaLauncher *pkg_config_launcher;
- AnjutaPreferences *prefs;
+ GSettings* settings;
SymbolDBSystem *sdbs;
SymbolDBEngine *sdbe_project;
@@ -368,11 +368,12 @@ sdb_prefs_init1 (SymbolDBPrefs *sdbp)
/* we will reactivate it after the listall has been finished */
/*gtk_widget_set_sensitive (fchooser, FALSE);*/
- anjuta_preferences_add_from_builder (priv->prefs,
- priv->prefs_bxml,
- BUILDER_ROOT,
- _("Symbol Database"),
- ICON_FILE);
+ anjuta_preferences_add_from_builder (anjuta_preferences_default (),
+ priv->prefs_bxml,
+ priv->settings,
+ BUILDER_ROOT,
+ _("Symbol Database"),
+ ICON_FILE);
#if 0
ctags_value = anjuta_preferences_get (priv->prefs, CTAGS_PREFS_KEY);
@@ -518,8 +519,7 @@ sdb_prefs_finalize (GObject *object)
DEBUG_PRINT ("%s", "symbol_db_prefs_finalize ()");
- anjuta_preferences_notify_remove(priv->prefs, priv->prefs_notify_id);
- anjuta_preferences_remove_page(priv->prefs, _("Symbol Database"));
+ anjuta_preferences_remove_page(anjuta_preferences_default(), _("Symbol Database"));
if (priv->pkg_config_launcher != NULL)
g_object_unref (priv->pkg_config_launcher);
@@ -584,7 +584,7 @@ sdb_prefs_class_init (SymbolDBPrefsClass *klass)
SymbolDBPrefs *
symbol_db_prefs_new (SymbolDBSystem *sdbs, SymbolDBEngine *sdbe_project,
- SymbolDBEngine *sdbe_globals, AnjutaPreferences *prefs,
+ SymbolDBEngine *sdbe_globals, GSettings* settings,
GList *enabled_packages)
{
SymbolDBPrefs *sdbp;
@@ -595,7 +595,7 @@ symbol_db_prefs_new (SymbolDBSystem *sdbs, SymbolDBEngine *sdbe_project,
priv = sdbp->priv;
priv->sdbs = sdbs;
- priv->prefs = prefs;
+ priv->settings = settings;
priv->sdbe_project = sdbe_project;
priv->sdbe_globals = sdbe_globals;
priv->enabled_packages_hash = g_hash_table_new_full (g_str_hash, g_str_equal,
diff --git a/plugins/symbol-db/symbol-db-prefs.h b/plugins/symbol-db/symbol-db-prefs.h
index 1fddd69..876965e 100644
--- a/plugins/symbol-db/symbol-db-prefs.h
+++ b/plugins/symbol-db/symbol-db-prefs.h
@@ -68,7 +68,7 @@ GType sdb_prefs_get_type (void) G_GNUC_CONST;
SymbolDBPrefs *
symbol_db_prefs_new (SymbolDBSystem *sdbs, SymbolDBEngine *sdbe_project,
- SymbolDBEngine *sdbe_globals, AnjutaPreferences *prefs,
+ SymbolDBEngine *sdbe_globals, GSettings* settings,
GList *enabled_packages);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]