Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Wed, 10 Dec 2014 23:07:41 UTC Commit: 87331093a93cd64bb47b8bdcc3c17459dcca9d7f https://github.com/geany/geany/commit/87331093a93cd64bb47b8bdcc3c17459dcca9d...
Log Message: ----------- Merge pull request #361 from techee/prj_write
Add project_write_config() to force project file rewrite
Modified Paths: -------------- plugins/geanyfunctions.h src/plugindata.h src/plugins.c src/project.c src/project.h
Modified: plugins/geanyfunctions.h 2 lines changed, 2 insertions(+), 0 deletions(-) =================================================================== @@ -438,5 +438,7 @@ geany_functions->p_build->build_set_menu_item #define build_get_group_count \ geany_functions->p_build->build_get_group_count +#define project_write_config \ + geany_functions->p_project->project_write_config
#endif
Modified: src/plugindata.h 8 lines changed, 8 insertions(+), 0 deletions(-) =================================================================== @@ -296,6 +296,7 @@ typedef struct GeanyFunctions struct StashFuncs *p_stash; /**< See stash.h */ struct SymbolsFuncs *p_symbols; /**< See symbols.h */ struct BuildFuncs *p_build; /**< See build.h */ + struct ProjectFuncs *p_project; /**< See project.h */ } GeanyFunctions;
@@ -746,6 +747,13 @@ typedef struct BuildFuncs } BuildFuncs;
+/* See project.h */ +typedef struct ProjectFuncs +{ + void (*project_write_config)(void); +} +ProjectFuncs; + /* Deprecated aliases */ #ifndef GEANY_DISABLE_DEPRECATED
Modified: src/plugins.c 7 lines changed, 6 insertions(+), 1 deletions(-) =================================================================== @@ -362,6 +362,10 @@ static BuildFuncs build_funcs = { &build_get_group_count };
+static ProjectFuncs project_funcs = { + &project_write_config +}; + static GeanyFunctions geany_functions = { &doc_funcs, &sci_funcs, @@ -385,7 +389,8 @@ static GeanyFunctions geany_functions = { &msgwin_funcs, &stash_funcs, &symbols_funcs, - &build_funcs + &build_funcs, + &project_funcs };
static GeanyData geany_data;
Modified: src/project.c 12 lines changed, 12 insertions(+), 0 deletions(-) =================================================================== @@ -1148,6 +1148,18 @@ static gboolean write_config(gboolean emit_signal) }
+/** Forces the project file rewrite and emission of the project-save signal. Plugins + * can use this function to save additional project data outside the project dialog. + * + * @since 1.25 + */ +void project_write_config(void) +{ + if (!write_config(TRUE)) + SHOW_ERR(_("Project file could not be written")); +} + + /* Constructs the project's base path which is used for "Make all" and "Execute". * The result is an absolute string in UTF-8 encoding which is either the same as * base path if it is absolute or it is built out of project file name's dir and base_path.
Modified: src/project.h 3 lines changed, 3 insertions(+), 0 deletions(-) =================================================================== @@ -47,6 +47,9 @@ typedef struct GeanyProject GeanyProject;
+void project_write_config(void); + + #ifdef GEANY_PRIVATE
typedef struct ProjectPrefs
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).