Branch: refs/heads/master Author: Frank Lanitz frank@frank.uvena.de Committer: GitHub noreply@github.com Date: Sun, 06 Oct 2019 08:31:02 UTC Commit: 14bb5bbc5ba446211a6c5f75698ce85620ff90df https://github.com/geany/geany-plugins/commit/14bb5bbc5ba446211a6c5f75698ce8...
Log Message: ----------- Merge pull request #921 from techee/po_reload_fix
projectorganizer: re-read base path when updating project
Modified Paths: -------------- projectorganizer/src/prjorg-project.c
Modified: projectorganizer/src/prjorg-project.c 27 lines changed, 18 insertions(+), 9 deletions(-) =================================================================== @@ -327,13 +327,24 @@ void prjorg_project_rescan(void) }
+static PrjOrgRoot *create_root(const gchar *utf8_base_dir) +{ + PrjOrgRoot *root = (PrjOrgRoot *) g_new0(PrjOrgRoot, 1); + root->base_dir = g_strdup(utf8_base_dir); + root->file_table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GFreeFunc)tm_source_file_free); + return root; +} + + static void update_project( gchar **source_patterns, gchar **header_patterns, gchar **ignored_dirs_patterns, gchar **ignored_file_patterns, PrjOrgTagPrefs generate_tag_prefs) { + gchar *utf8_base_path; + if (prj_org->source_patterns) g_strfreev(prj_org->source_patterns); prj_org->source_patterns = g_strdupv(source_patterns); @@ -352,6 +363,13 @@ static void update_project(
prj_org->generate_tag_prefs = generate_tag_prefs;
+ /* re-read the base path in case it was changed in project settings */ + g_free(prj_org->roots->data); + prj_org->roots = g_slist_delete_link(prj_org->roots, prj_org->roots); + utf8_base_path = get_project_base_path(); + prj_org->roots = g_slist_prepend(prj_org->roots, create_root(utf8_base_path)); + g_free(utf8_base_path); + prjorg_project_rescan(); }
@@ -386,15 +404,6 @@ void prjorg_project_save(GKeyFile * key_file) }
-static PrjOrgRoot *create_root(const gchar *utf8_base_dir) -{ - PrjOrgRoot *root = (PrjOrgRoot *) g_new0(PrjOrgRoot, 1); - root->base_dir = g_strdup(utf8_base_dir); - root->file_table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GFreeFunc)tm_source_file_free); - return root; -} - - static void close_root(PrjOrgRoot *root, gpointer user_data) { GPtrArray *source_files;
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
plugins-commits@lists.geany.org