SF.net SVN: geany:[2803] trunk
ntrel at users.sourceforge.net
ntrel at xxxxx
Wed Jul 23 11:46:02 UTC 2008
Revision: 2803
http://geany.svn.sourceforge.net/geany/?rev=2803&view=rev
Author: ntrel
Date: 2008-07-23 11:46:02 +0000 (Wed, 23 Jul 2008)
Log Message:
-----------
Move utils_reload_configuration() to main.c.
Modified Paths:
--------------
trunk/ChangeLog
trunk/plugins/pluginmacros.h
trunk/src/callbacks.c
trunk/src/main.c
trunk/src/main.h
trunk/src/plugindata.h
trunk/src/plugins.c
trunk/src/utils.c
trunk/src/utils.h
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-07-22 16:54:02 UTC (rev 2802)
+++ trunk/ChangeLog 2008-07-23 11:46:02 UTC (rev 2803)
@@ -1,3 +1,10 @@
+2008-07-23 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/utils.c, src/utils.h, src/plugindata.h, src/callbacks.c,
+ src/plugins.c, src/main.c, src/main.h, plugins/pluginmacros.h:
+ Move utils_reload_configuration() to main.c.
+
+
2008-07-22 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* scintilla/LexHTML.cxx:
Modified: trunk/plugins/pluginmacros.h
===================================================================
--- trunk/plugins/pluginmacros.h 2008-07-22 16:54:02 UTC (rev 2802)
+++ trunk/plugins/pluginmacros.h 2008-07-23 11:46:02 UTC (rev 2803)
@@ -49,6 +49,7 @@
#define p_filetypes geany_functions->p_filetypes /**< See filetypes.h */
#define p_highlighting geany_functions->p_highlighting /**< See highlighting.h */
#define p_keybindings geany_functions->p_keybindings /**< See keybindings.h */
+#define p_main geany_functions->p_main /**< See main.h */
#define p_msgwindow geany_functions->p_msgwindow /**< See msgwindow.h */
#define p_navqueue geany_functions->p_navqueue /**< See navqueue.h */
#define p_sci geany_functions->p_sci /**< See sciwrappers.h */
Modified: trunk/src/callbacks.c
===================================================================
--- trunk/src/callbacks.c 2008-07-22 16:54:02 UTC (rev 2802)
+++ trunk/src/callbacks.c 2008-07-23 11:46:02 UTC (rev 2803)
@@ -2222,6 +2222,6 @@
on_menu_reload_configuration1_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
- utils_reload_configuration();
+ main_reload_configuration();
}
Modified: trunk/src/main.c
===================================================================
--- trunk/src/main.c 2008-07-22 16:54:02 UTC (rev 2802)
+++ trunk/src/main.c 2008-07-23 11:46:02 UTC (rev 2803)
@@ -1021,3 +1021,42 @@
n = 1;
return malloc(n);
}
+
+
+/**
+ * Reloads most of Geany's configuration files without restarting. Currently the following
+ * files are reloaded: all template files, also new file templates and the 'New (with template)'
+ * menus will be updated, Snippets (snippets.conf), filetype extensions (filetype_extensions.conf),
+ * and 'settings' and 'build_settings' sections of the filetype definition files.
+ *
+ * Plugins may call this function if they changed any of these files (e.g. a configuration file
+ * editor plugin).
+ *
+ **/
+void main_reload_configuration(void)
+{
+ guint i;
+
+ /* reload templates */
+ templates_free_templates();
+ templates_init();
+
+ /* reload snippets */
+ editor_snippets_free();
+ editor_snippets_init();
+
+ /* reload filetype extensions */
+ configuration_read_filetype_extensions();
+
+ /* save possibly changed commands before re-reading them */
+ filetypes_save_commands();
+
+ /* reload filetype configs */
+ for (i = 0; i < filetypes_array->len; i++)
+ {
+ /* filetypes_load_config() will skip not loaded filetypes */
+ filetypes_load_config(i, TRUE);
+ }
+
+ ui_set_statusbar(TRUE, _("Configuration files reloaded."));
+}
Modified: trunk/src/main.h
===================================================================
--- trunk/src/main.h 2008-07-22 16:54:02 UTC (rev 2802)
+++ trunk/src/main.h 2008-07-23 11:46:02 UTC (rev 2803)
@@ -55,4 +55,6 @@
gboolean main_handle_filename(gchar *locale_filename);
+void main_reload_configuration(void);
+
#endif
Modified: trunk/src/plugindata.h
===================================================================
--- trunk/src/plugindata.h 2008-07-22 16:54:02 UTC (rev 2802)
+++ trunk/src/plugindata.h 2008-07-23 11:46:02 UTC (rev 2803)
@@ -36,12 +36,12 @@
/* The API version should be incremented whenever any plugin data types below are
* modified or appended to. */
-static const gint api_version = 79;
+static const gint api_version = 80;
/* The ABI version should be incremented whenever existing fields in the plugin
* data types below have to be changed or reordered. It should stay the same if fields
* are only appended, as this doesn't affect existing fields. */
-static const gint abi_version = 42;
+static const gint abi_version = 43;
/** Check the plugin can be loaded by Geany.
* This performs runtime checks that try to ensure:
@@ -190,6 +190,7 @@
struct FiletypeFuncs *p_filetypes; /**< See filetypes.h */
struct NavQueueFuncs *p_navqueue; /**< See navqueue.h */
struct EditorFuncs *p_editor; /**< See editor.h */
+ struct MainFuncs *p_main; /**< See main.h */
}
GeanyFunctions;
@@ -300,11 +301,18 @@
gboolean (*spawn_async) (const gchar *dir, gchar **argv, gchar **env, GSpawnFlags flags,
GSpawnChildSetupFunc child_setup, gpointer user_data, GPid *child_pid,
GError **error);
- void (*reload_configuration) (void);
}
UtilsFuncs;
+/* See main.h */
+typedef struct MainFuncs
+{
+ void (*reload_configuration) (void);
+}
+MainFuncs;
+
+
/* See ui_utils.h */
typedef struct UIUtilsFuncs
{
Modified: trunk/src/plugins.c
===================================================================
--- trunk/src/plugins.c 2008-07-22 16:54:02 UTC (rev 2802)
+++ trunk/src/plugins.c 2008-07-23 11:46:02 UTC (rev 2803)
@@ -55,6 +55,7 @@
#include "highlighting.h"
#include "keybindings.h"
#include "navqueue.h"
+#include "main.h"
#ifdef G_OS_WIN32
@@ -171,7 +172,6 @@
&utils_get_setting_string,
&utils_spawn_sync,
&utils_spawn_async,
- &utils_reload_configuration
};
static UIUtilsFuncs uiutils_funcs = {
@@ -239,6 +239,10 @@
&navqueue_goto_line
};
+static MainFuncs main_funcs = {
+ &main_reload_configuration
+};
+
static GeanyFunctions geany_functions = {
&doc_funcs,
&sci_funcs,
@@ -255,7 +259,8 @@
&highlighting_funcs,
&filetype_funcs,
&navqueue_funcs,
- &editor_funcs
+ &editor_funcs,
+ &main_funcs
};
static GeanyData geany_data;
Modified: trunk/src/utils.c
===================================================================
--- trunk/src/utils.c 2008-07-22 16:54:02 UTC (rev 2802)
+++ trunk/src/utils.c 2008-07-23 11:46:02 UTC (rev 2803)
@@ -1523,42 +1523,3 @@
#endif
return result;
}
-
-
-/**
- * Reloads most of Geany's configuration files without restarting. Currently the following
- * files are reloaded: all template files, also new file templates and the 'New (with template)'
- * menus will be updated, Snippets (snippets.conf), filetype extensions (filetype_extensions.conf),
- * and 'settings' and 'build_settings' sections of the filetype definition files.
- *
- * Plugins may call this function if they changed any of these files (e.g. a configuration file
- * editor plugin).
- *
- **/
-void utils_reload_configuration(void)
-{
- guint i;
-
- /* reload templates */
- templates_free_templates();
- templates_init();
-
- /* reload snippets */
- editor_snippets_free();
- editor_snippets_init();
-
- /* reload filetype extensions */
- configuration_read_filetype_extensions();
-
- /* save possibly changed commands before re-reading them */
- filetypes_save_commands();
-
- /* reload filetype configs */
- for (i = 0; i < filetypes_array->len; i++)
- {
- /* filetypes_load_config() will skip not loaded filetypes */
- filetypes_load_config(i, TRUE);
- }
-
- ui_set_statusbar(TRUE, _("Configuration files reloaded."));
-}
Modified: trunk/src/utils.h
===================================================================
--- trunk/src/utils.h 2008-07-22 16:54:02 UTC (rev 2802)
+++ trunk/src/utils.h 2008-07-23 11:46:02 UTC (rev 2803)
@@ -141,6 +141,4 @@
GSpawnChildSetupFunc child_setup, gpointer user_data, GPid *child_pid,
GError **error);
-void utils_reload_configuration(void);
-
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list