Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Thu, 18 Dec 2014 16:26:11 UTC Commit: a649d2d92869d72c2f4ff447beb9b10ad74f8bf3 https://github.com/geany/geany-plugins/commit/a649d2d92869d72c2f4ff447beb9b1...
Log Message: ----------- projectorganizer: Rename variables/functions/types referring to the previous plugin name
Modified Paths: -------------- projectorganizer/src/prjorg-main.c projectorganizer/src/prjorg-menu.c projectorganizer/src/prjorg-menu.h projectorganizer/src/prjorg-project.c projectorganizer/src/prjorg-project.h projectorganizer/src/prjorg-sidebar.c projectorganizer/src/prjorg-sidebar.h
Modified: projectorganizer/src/prjorg-main.c 66 lines changed, 33 insertions(+), 33 deletions(-) =================================================================== @@ -48,17 +48,17 @@ static void on_doc_open(G_GNUC_UNUSED GObject * obj, G_GNUC_UNUSED GeanyDocument { g_return_if_fail(doc != NULL && doc->file_name != NULL);
- if (gprj_project_is_in_project(doc->file_name)) - gprj_project_remove_single_tm_file(doc->file_name); + if (prjorg_project_is_in_project(doc->file_name)) + prjorg_project_remove_single_tm_file(doc->file_name);
- gprj_sidebar_update(FALSE); + prjorg_sidebar_update(FALSE); }
static void on_doc_activate(G_GNUC_UNUSED GObject * obj, G_GNUC_UNUSED GeanyDocument * doc, G_GNUC_UNUSED gpointer user_data) { - gprj_sidebar_update(FALSE); + prjorg_sidebar_update(FALSE); }
@@ -72,10 +72,10 @@ static void on_doc_close(G_GNUC_UNUSED GObject * obj, GeanyDocument * doc,
/* tags of open files managed by geany - when the file gets closed, * we should take care of it */ - if (gprj_project_is_in_project(doc->file_name)) - gprj_project_add_single_tm_file(doc->file_name); + if (prjorg_project_is_in_project(doc->file_name)) + prjorg_project_add_single_tm_file(doc->file_name);
- gprj_sidebar_update(FALSE); + prjorg_sidebar_update(FALSE); }
@@ -85,7 +85,7 @@ static void on_build_start(GObject *obj, gpointer user_data)
foreach_document(i) { - if (gprj_project_is_in_project(documents[i]->file_name)) + if (prjorg_project_is_in_project(documents[i]->file_name)) document_save_file(documents[i], FALSE); } } @@ -94,18 +94,18 @@ static void on_build_start(GObject *obj, gpointer user_data) static void on_project_dialog_open(G_GNUC_UNUSED GObject * obj, GtkWidget * notebook, G_GNUC_UNUSED gpointer user_data) { - if (g_prj && page_index == -1) - page_index = gprj_project_add_properties_tab(notebook); + if (prj_org && page_index == -1) + page_index = prjorg_project_add_properties_tab(notebook); }
static void on_project_dialog_confirmed(G_GNUC_UNUSED GObject * obj, GtkWidget * notebook, G_GNUC_UNUSED gpointer user_data) { - if (g_prj) + if (prj_org) { - gprj_project_read_properties_tab(); - gprj_sidebar_update(TRUE); + prjorg_project_read_properties_tab(); + prjorg_sidebar_update(TRUE); } }
@@ -124,36 +124,36 @@ static void on_project_dialog_close(G_GNUC_UNUSED GObject * obj, GtkWidget * not static void on_project_open(G_GNUC_UNUSED GObject * obj, GKeyFile * config, G_GNUC_UNUSED gpointer user_data) { - gprj_project_open(config); - gprj_sidebar_update(TRUE); - gprj_sidebar_activate(TRUE); - gprj_menu_activate_menu_items(TRUE); + prjorg_project_open(config); + prjorg_sidebar_update(TRUE); + prjorg_sidebar_activate(TRUE); + prjorg_menu_activate_menu_items(TRUE); }
static void on_project_close(G_GNUC_UNUSED GObject * obj, G_GNUC_UNUSED gpointer user_data) { - gprj_project_close(); - gprj_sidebar_update(TRUE); - gprj_sidebar_activate(FALSE); - gprj_menu_activate_menu_items(FALSE); + prjorg_project_close(); + prjorg_sidebar_update(TRUE); + prjorg_sidebar_activate(FALSE); + prjorg_menu_activate_menu_items(FALSE); }
static void on_project_save(G_GNUC_UNUSED GObject * obj, GKeyFile * config, G_GNUC_UNUSED gpointer user_data) { - if (!g_prj) + if (!prj_org) { /* happens when the project is created */ - gprj_project_open(config); - gprj_sidebar_update(TRUE); - gprj_sidebar_activate(TRUE); - gprj_menu_activate_menu_items(TRUE); + prjorg_project_open(config); + prjorg_sidebar_update(TRUE); + prjorg_sidebar_activate(TRUE); + prjorg_menu_activate_menu_items(TRUE); }
- gprj_project_save(config); + prjorg_project_save(config); }
@@ -174,8 +174,8 @@ PluginCallback plugin_callbacks[] = {
void plugin_init(G_GNUC_UNUSED GeanyData * data) { - gprj_menu_init(); - gprj_sidebar_init(); + prjorg_menu_init(); + prjorg_sidebar_init(); }
@@ -183,12 +183,12 @@ void plugin_cleanup(void) { if (geany_data->app->project) { - gprj_project_close(); - gprj_sidebar_update(TRUE); + prjorg_project_close(); + prjorg_sidebar_update(TRUE); }
- gprj_menu_cleanup(); - gprj_sidebar_cleanup(); + prjorg_menu_cleanup(); + prjorg_sidebar_cleanup(); }
Modified: projectorganizer/src/prjorg-menu.c 30 lines changed, 15 insertions(+), 15 deletions(-) =================================================================== @@ -70,7 +70,7 @@ static gboolean try_swap_header_source(gchar *file_name, gboolean is_header, GSL base_name = g_path_get_basename(full_name);
if (g_pattern_match_string(pattern, base_name) && - gprj_project_is_in_project(full_name)) + prjorg_project_is_in_project(full_name)) { if ((is_header && patterns_match(source_patterns, base_name)) || (!is_header && patterns_match(header_patterns, base_name))) @@ -97,11 +97,11 @@ static void on_swap_header_source(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_U gchar *doc_basename; doc = document_get_current();
- if (!g_prj || !geany_data->app->project || !doc || !doc->file_name) + if (!prj_org || !geany_data->app->project || !doc || !doc->file_name) return;
- header_patterns = get_precompiled_patterns(g_prj->header_patterns); - source_patterns = get_precompiled_patterns(g_prj->source_patterns); + header_patterns = get_precompiled_patterns(prj_org->header_patterns); + source_patterns = get_precompiled_patterns(prj_org->source_patterns);
doc_basename = g_path_get_basename(doc->file_name);
@@ -123,7 +123,7 @@ static void on_swap_header_source(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_U gchar *filename;
filename = document_index(i)->file_name; - if (gprj_project_is_in_project(filename)) + if (prjorg_project_is_in_project(filename)) list = g_slist_prepend(list, filename); } swapped = try_swap_header_source(doc->file_name, is_header, list, header_patterns, source_patterns); @@ -155,11 +155,11 @@ static void on_swap_header_source(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_U
if (!swapped) { - foreach_slist(elem, g_prj->roots) + foreach_slist(elem, prj_org->roots) { GHashTableIter iter; gpointer key, value; - GPrjRoot *root = elem->data; + PrjOrgRoot *root = elem->data; list = NULL; g_hash_table_iter_init(&iter, root->file_table); @@ -192,14 +192,14 @@ static void on_find_in_project(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUS static void on_find_file(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gpointer user_data) { if (geany_data->app->project) - gprj_sidebar_find_file_in_active(); + prjorg_sidebar_find_file_in_active(); }
static void on_find_tag(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gpointer user_data) { if (geany_data->app->project) - gprj_sidebar_find_tag_in_active(); + prjorg_sidebar_find_tag_in_active(); }
@@ -291,9 +291,9 @@ static void on_open_selected_file(GtkMenuItem *menuitem, gpointer user_data) GSList *elem; gchar *found_path = NULL;
- foreach_slist (elem, g_prj->roots) + foreach_slist (elem, prj_org->roots) { - GPrjRoot *root = elem->data; + PrjOrgRoot *root = elem->data; gpointer key, value; GHashTableIter iter; @@ -358,7 +358,7 @@ static void on_open_selected_file(GtkMenuItem *menuitem, gpointer user_data) }
-void gprj_menu_init(void) +void prjorg_menu_init(void) { GtkWidget *image; GeanyKeyGroup *key_group = plugin_set_key_group(geany_plugin, "ProjectOrganizer", KB_COUNT, kb_callback); @@ -413,11 +413,11 @@ void gprj_menu_init(void) gtk_menu_shell_prepend(GTK_MENU_SHELL(geany->main_widgets->editor_menu), s_context_osf_item); g_signal_connect((gpointer) s_context_osf_item, "activate", G_CALLBACK(on_open_selected_file), NULL);
- gprj_menu_activate_menu_items(FALSE); + prjorg_menu_activate_menu_items(FALSE); }
-void gprj_menu_activate_menu_items(gboolean activate) +void prjorg_menu_activate_menu_items(gboolean activate) { gtk_widget_set_sensitive(s_context_osf_item, activate); gtk_widget_set_sensitive(s_shs_item, activate); @@ -427,7 +427,7 @@ void gprj_menu_activate_menu_items(gboolean activate) }
-void gprj_menu_cleanup(void) +void prjorg_menu_cleanup(void) { gtk_widget_destroy(s_fif_item); gtk_widget_destroy(s_ff_item);
Modified: projectorganizer/src/prjorg-menu.h 6 lines changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -19,8 +19,8 @@ #ifndef __PRJORG_MENU_H__ #define __PRJORG_MENU_H__
-void gprj_menu_init(void); -void gprj_menu_activate_menu_items(gboolean activate); -void gprj_menu_cleanup(void); +void prjorg_menu_init(void); +void prjorg_menu_activate_menu_items(gboolean activate); +void prjorg_menu_cleanup(void);
#endif
Modified: projectorganizer/src/prjorg-project.c 184 lines changed, 92 insertions(+), 92 deletions(-) =================================================================== @@ -41,7 +41,7 @@ typedef struct GtkWidget *generate_tag_prefs; } PropertyDialogElements;
-GPrj *g_prj = NULL; +PrjOrg *prj_org = NULL;
static PropertyDialogElements *e;
@@ -120,7 +120,7 @@ static GSList *get_file_list(const gchar * path, GSList *patterns, GSList *ignor }
-static gint gprj_project_rescan_root(GPrjRoot *root) +static gint prjorg_project_rescan_root(PrjOrgRoot *root) { GPtrArray *source_files; GSList *pattern_list = NULL; @@ -145,8 +145,8 @@ static gint gprj_project_rescan_root(GPrjRoot *root) else pattern_list = get_precompiled_patterns(geany_data->app->project->file_patterns);
- ignored_dirs_list = get_precompiled_patterns(g_prj->ignored_dirs_patterns); - ignored_file_list = get_precompiled_patterns(g_prj->ignored_file_patterns); + ignored_dirs_list = get_precompiled_patterns(prj_org->ignored_dirs_patterns); + ignored_file_list = get_precompiled_patterns(prj_org->ignored_file_patterns);
lst = get_file_list(root->base_dir, pattern_list, ignored_dirs_list, ignored_file_list); @@ -238,7 +238,7 @@ static GeanyFiletype *filetypes_detect(const gchar *utf8_filename) }
-static void regenerate_tags(GPrjRoot *root, gpointer user_data) +static void regenerate_tags(PrjOrgRoot *root, gpointer user_data) { GHashTableIter iter; gpointer key, value; @@ -267,22 +267,22 @@ static void regenerate_tags(GPrjRoot *root, gpointer user_data) }
-void gprj_project_rescan(void) +void prjorg_project_rescan(void) { GSList *elem; gint filenum = 0; - if (!g_prj) + if (!prj_org) return;
clear_idle_queue(&s_idle_add_funcs); clear_idle_queue(&s_idle_remove_funcs); - foreach_slist(elem, g_prj->roots) - filenum += gprj_project_rescan_root(elem->data); + foreach_slist(elem, prj_org->roots) + filenum += prjorg_project_rescan_root(elem->data); - if (g_prj->generate_tag_prefs == GPrjTagYes || (g_prj->generate_tag_prefs == GPrjTagAuto && filenum < 500)) - g_slist_foreach(g_prj->roots, (GFunc)regenerate_tags, NULL); + if (prj_org->generate_tag_prefs == PrjOrgTagYes || (prj_org->generate_tag_prefs == PrjOrgTagAuto && filenum < 500)) + g_slist_foreach(prj_org->roots, (GFunc)regenerate_tags, NULL); }
@@ -291,53 +291,53 @@ static void update_project( gchar **header_patterns, gchar **ignored_dirs_patterns, gchar **ignored_file_patterns, - GPrjTagPrefs generate_tag_prefs) + PrjOrgTagPrefs generate_tag_prefs) { - if (g_prj->source_patterns) - g_strfreev(g_prj->source_patterns); - g_prj->source_patterns = g_strdupv(source_patterns); + if (prj_org->source_patterns) + g_strfreev(prj_org->source_patterns); + prj_org->source_patterns = g_strdupv(source_patterns);
- if (g_prj->header_patterns) - g_strfreev(g_prj->header_patterns); - g_prj->header_patterns = g_strdupv(header_patterns); + if (prj_org->header_patterns) + g_strfreev(prj_org->header_patterns); + prj_org->header_patterns = g_strdupv(header_patterns);
- if (g_prj->ignored_dirs_patterns) - g_strfreev(g_prj->ignored_dirs_patterns); - g_prj->ignored_dirs_patterns = g_strdupv(ignored_dirs_patterns); + if (prj_org->ignored_dirs_patterns) + g_strfreev(prj_org->ignored_dirs_patterns); + prj_org->ignored_dirs_patterns = g_strdupv(ignored_dirs_patterns);
- if (g_prj->ignored_file_patterns) - g_strfreev(g_prj->ignored_file_patterns); - g_prj->ignored_file_patterns = g_strdupv(ignored_file_patterns); + if (prj_org->ignored_file_patterns) + g_strfreev(prj_org->ignored_file_patterns); + prj_org->ignored_file_patterns = g_strdupv(ignored_file_patterns);
- g_prj->generate_tag_prefs = generate_tag_prefs; + prj_org->generate_tag_prefs = generate_tag_prefs;
- gprj_project_rescan(); + prjorg_project_rescan(); }
-void gprj_project_save(GKeyFile * key_file) +void prjorg_project_save(GKeyFile * key_file) { GPtrArray *array; GSList *elem, *lst; - if (!g_prj) + if (!prj_org) return;
g_key_file_set_string_list(key_file, "prjorg", "source_patterns", - (const gchar**) g_prj->source_patterns, g_strv_length(g_prj->source_patterns)); + (const gchar**) prj_org->source_patterns, g_strv_length(prj_org->source_patterns)); g_key_file_set_string_list(key_file, "prjorg", "header_patterns", - (const gchar**) g_prj->header_patterns, g_strv_length(g_prj->header_patterns)); + (const gchar**) prj_org->header_patterns, g_strv_length(prj_org->header_patterns)); g_key_file_set_string_list(key_file, "prjorg", "ignored_dirs_patterns", - (const gchar**) g_prj->ignored_dirs_patterns, g_strv_length(g_prj->ignored_dirs_patterns)); + (const gchar**) prj_org->ignored_dirs_patterns, g_strv_length(prj_org->ignored_dirs_patterns)); g_key_file_set_string_list(key_file, "prjorg", "ignored_file_patterns", - (const gchar**) g_prj->ignored_file_patterns, g_strv_length(g_prj->ignored_file_patterns)); - g_key_file_set_integer(key_file, "prjorg", "generate_tag_prefs", g_prj->generate_tag_prefs); + (const gchar**) prj_org->ignored_file_patterns, g_strv_length(prj_org->ignored_file_patterns)); + g_key_file_set_integer(key_file, "prjorg", "generate_tag_prefs", prj_org->generate_tag_prefs); array = g_ptr_array_new(); - lst = g_prj->roots->next; + lst = prj_org->roots->next; foreach_slist (elem, lst) { - GPrjRoot *root = elem->data; + PrjOrgRoot *root = elem->data; g_ptr_array_add(array, root->base_dir); } g_key_file_set_string_list(key_file, "prjorg", "external_dirs", (const gchar * const *)array->pdata, array->len); @@ -345,16 +345,16 @@ void gprj_project_save(GKeyFile * key_file) }
-static GPrjRoot *create_root(const gchar *base_dir) +static PrjOrgRoot *create_root(const gchar *base_dir) { - GPrjRoot *root = (GPrjRoot *) g_new0(GPrjRoot, 1); + PrjOrgRoot *root = (PrjOrgRoot *) g_new0(PrjOrgRoot, 1); root->base_dir = g_strdup(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(GPrjRoot *root, gpointer user_data) +static void close_root(PrjOrgRoot *root, gpointer user_data) { GPtrArray *source_files; @@ -369,62 +369,62 @@ static void close_root(GPrjRoot *root, gpointer user_data) }
-static gint root_comparator(GPrjRoot *a, GPrjRoot *b) +static gint root_comparator(PrjOrgRoot *a, PrjOrgRoot *b) { return g_strcmp0(a->base_dir, b->base_dir); }
-void gprj_project_add_external_dir(const gchar *dirname) +void prjorg_project_add_external_dir(const gchar *dirname) { - GPrjRoot *new_root = create_root(dirname); - if (g_slist_find_custom (g_prj->roots, new_root, (GCompareFunc)root_comparator) != NULL) + PrjOrgRoot *new_root = create_root(dirname); + if (g_slist_find_custom (prj_org->roots, new_root, (GCompareFunc)root_comparator) != NULL) { close_root(new_root, NULL); return; } - GSList *lst = g_prj->roots->next; + GSList *lst = prj_org->roots->next; lst = g_slist_prepend(lst, new_root); lst = g_slist_sort(lst, (GCompareFunc)root_comparator); - g_prj->roots->next = lst; + prj_org->roots->next = lst; - gprj_project_rescan(); + prjorg_project_rescan(); }
-void gprj_project_remove_external_dir(const gchar *dirname) +void prjorg_project_remove_external_dir(const gchar *dirname) { - GPrjRoot *test_root = create_root(dirname); - GSList *found = g_slist_find_custom (g_prj->roots, test_root, (GCompareFunc)root_comparator); + PrjOrgRoot *test_root = create_root(dirname); + GSList *found = g_slist_find_custom (prj_org->roots, test_root, (GCompareFunc)root_comparator); if (found != NULL) { - GPrjRoot *found_root = found->data; + PrjOrgRoot *found_root = found->data; - g_prj->roots = g_slist_remove(g_prj->roots, found_root); + prj_org->roots = g_slist_remove(prj_org->roots, found_root); close_root(found_root, NULL); - gprj_project_rescan(); + prjorg_project_rescan(); } close_root(test_root, NULL); }
-void gprj_project_open(GKeyFile * key_file) +void prjorg_project_open(GKeyFile * key_file) { gchar **source_patterns, **header_patterns, **ignored_dirs_patterns, **ignored_file_patterns, **external_dirs, **dir_ptr, *last_name; gint generate_tag_prefs; GSList *elem, *ext_list = NULL;
- if (g_prj != NULL) - gprj_project_close(); + if (prj_org != NULL) + prjorg_project_close();
- g_prj = (GPrj *) g_new0(GPrj, 1); + prj_org = (PrjOrg *) g_new0(PrjOrg, 1);
- g_prj->source_patterns = NULL; - g_prj->header_patterns = NULL; - g_prj->ignored_dirs_patterns = NULL; - g_prj->ignored_file_patterns = NULL; - g_prj->generate_tag_prefs = GPrjTagAuto; + prj_org->source_patterns = NULL; + prj_org->header_patterns = NULL; + prj_org->ignored_dirs_patterns = NULL; + prj_org->ignored_file_patterns = NULL; + prj_org->generate_tag_prefs = PrjOrgTagAuto;
source_patterns = g_key_file_get_string_list(key_file, "prjorg", "source_patterns", NULL, NULL); if (!source_patterns) @@ -438,7 +438,7 @@ void gprj_project_open(GKeyFile * key_file) ignored_file_patterns = g_key_file_get_string_list(key_file, "prjorg", "ignored_file_patterns", NULL, NULL); if (!ignored_file_patterns) ignored_file_patterns = g_strsplit("*.o *.obj *.a *.lib *.so *.dll *.lo *.la *.class *.jar *.pyc *.mo *.gmo", " ", -1); - generate_tag_prefs = utils_get_setting_integer(key_file, "prjorg", "generate_tag_prefs", GPrjTagAuto); + generate_tag_prefs = utils_get_setting_integer(key_file, "prjorg", "generate_tag_prefs", PrjOrgTagAuto);
external_dirs = g_key_file_get_string_list(key_file, "prjorg", "external_dirs", NULL, NULL); foreach_strv (dir_ptr, external_dirs) @@ -448,12 +448,12 @@ void gprj_project_open(GKeyFile * key_file) foreach_slist (elem, ext_list) { if (g_strcmp0(last_name, elem->data) != 0) - g_prj->roots = g_slist_append(g_prj->roots, create_root(elem->data)); + prj_org->roots = g_slist_append(prj_org->roots, create_root(elem->data)); last_name = elem->data; } g_slist_free(ext_list); /* the project directory is always first */ - g_prj->roots = g_slist_prepend(g_prj->roots, create_root(geany_data->app->project->base_path)); + prj_org->roots = g_slist_prepend(prj_org->roots, create_root(geany_data->app->project->base_path));
update_project( source_patterns, @@ -488,7 +488,7 @@ static gchar **split_patterns(const gchar *str) }
-void gprj_project_read_properties_tab(void) +void prjorg_project_read_properties_tab(void) { gchar **source_patterns, **header_patterns, **ignored_dirs_patterns, **ignored_file_patterns;
@@ -508,7 +508,7 @@ void gprj_project_read_properties_tab(void) }
-gint gprj_project_add_properties_tab(GtkWidget *notebook) +gint prjorg_project_add_properties_tab(GtkWidget *notebook) { GtkWidget *vbox, *hbox, *hbox1; GtkWidget *table; @@ -532,7 +532,7 @@ gint gprj_project_add_properties_tab(GtkWidget *notebook) ui_widget_set_tooltip_text(e->source_patterns, _("Space separated list of patterns that are used to identify source files. " "Used for header/source swapping.")); - str = g_strjoinv(" ", g_prj->source_patterns); + str = g_strjoinv(" ", prj_org->source_patterns); gtk_entry_set_text(GTK_ENTRY(e->source_patterns), str); g_free(str);
@@ -544,7 +544,7 @@ gint gprj_project_add_properties_tab(GtkWidget *notebook) ui_widget_set_tooltip_text(e->header_patterns, _("Space separated list of patterns that are used to identify headers. " "Used for header/source swapping.")); - str = g_strjoinv(" ", g_prj->header_patterns); + str = g_strjoinv(" ", prj_org->header_patterns); gtk_entry_set_text(GTK_ENTRY(e->header_patterns), str); g_free(str);
@@ -556,7 +556,7 @@ gint gprj_project_add_properties_tab(GtkWidget *notebook) ui_widget_set_tooltip_text(e->ignored_file_patterns, _("Space separated list of patterns that are used to identify files " "that are not displayed in the project tree.")); - str = g_strjoinv(" ", g_prj->ignored_file_patterns); + str = g_strjoinv(" ", prj_org->ignored_file_patterns); gtk_entry_set_text(GTK_ENTRY(e->ignored_file_patterns), str); g_free(str);
@@ -568,7 +568,7 @@ gint gprj_project_add_properties_tab(GtkWidget *notebook) ui_widget_set_tooltip_text(e->ignored_dirs_patterns, _("Space separated list of patterns that are used to identify directories " "that are not scanned for source files.")); - str = g_strjoinv(" ", g_prj->ignored_dirs_patterns); + str = g_strjoinv(" ", prj_org->ignored_dirs_patterns); gtk_entry_set_text(GTK_ENTRY(e->ignored_dirs_patterns), str); g_free(str);
@@ -578,7 +578,7 @@ gint gprj_project_add_properties_tab(GtkWidget *notebook) gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(e->generate_tag_prefs), _("Auto (generate if less than 500 files)")); gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(e->generate_tag_prefs), _("Yes")); gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(e->generate_tag_prefs), _("No")); - gtk_combo_box_set_active(GTK_COMBO_BOX_TEXT(e->generate_tag_prefs), g_prj->generate_tag_prefs); + gtk_combo_box_set_active(GTK_COMBO_BOX_TEXT(e->generate_tag_prefs), prj_org->generate_tag_prefs); ui_table_add_row(GTK_TABLE(table), 4, label, e->generate_tag_prefs, NULL); ui_widget_set_tooltip_text(e->generate_tag_prefs, _("Generate tag list for all project files instead of only for the currently opened files. " @@ -605,37 +605,37 @@ gint gprj_project_add_properties_tab(GtkWidget *notebook) }
-void gprj_project_close(void) +void prjorg_project_close(void) { - if (!g_prj) + if (!prj_org) return; /* can happen on plugin reload */
clear_idle_queue(&s_idle_add_funcs); clear_idle_queue(&s_idle_remove_funcs);
- g_slist_foreach(g_prj->roots, (GFunc)close_root, NULL); - g_slist_free(g_prj->roots); + g_slist_foreach(prj_org->roots, (GFunc)close_root, NULL); + g_slist_free(prj_org->roots);
- g_strfreev(g_prj->source_patterns); - g_strfreev(g_prj->header_patterns); - g_strfreev(g_prj->ignored_dirs_patterns); - g_strfreev(g_prj->ignored_file_patterns); + g_strfreev(prj_org->source_patterns); + g_strfreev(prj_org->header_patterns); + g_strfreev(prj_org->ignored_dirs_patterns); + g_strfreev(prj_org->ignored_file_patterns);
- g_free(g_prj); - g_prj = NULL; + g_free(prj_org); + prj_org = NULL; }
-gboolean gprj_project_is_in_project(const gchar * filename) +gboolean prjorg_project_is_in_project(const gchar * filename) { GSList *elem; - if (!filename || !g_prj || !geany_data->app->project || !g_prj->roots) + if (!filename || !prj_org || !geany_data->app->project || !prj_org->roots) return FALSE; - foreach_slist (elem, g_prj->roots) + foreach_slist (elem, prj_org->roots) { - GPrjRoot *root = elem->data; + PrjOrgRoot *root = elem->data; if (g_hash_table_lookup_extended (root->file_table, filename, NULL, NULL)) return TRUE; } @@ -648,7 +648,7 @@ static gboolean add_tm_idle(gpointer foo) { GSList *elem2; - if (!g_prj || !s_idle_add_funcs) + if (!prj_org || !s_idle_add_funcs) return FALSE;
foreach_slist (elem2, s_idle_add_funcs) @@ -656,9 +656,9 @@ static gboolean add_tm_idle(gpointer foo) GSList *elem; gchar *fname = elem2->data; - foreach_slist (elem, g_prj->roots) + foreach_slist (elem, prj_org->roots) { - GPrjRoot *root = elem->data; + PrjOrgRoot *root = elem->data; TMSourceFile *sf = g_hash_table_lookup(root->file_table, fname); if (sf != NULL && !document_find_by_filename(fname)) @@ -682,7 +682,7 @@ static gboolean add_tm_idle(gpointer foo) * Additional problem: The tag removal in Geany happens after this function is called. * To be sure, perform on idle after this happens (even though from my knowledge of TM * this shouldn't probably matter). */ -void gprj_project_add_single_tm_file(gchar *filename) +void prjorg_project_add_single_tm_file(gchar *filename) { if (s_idle_add_funcs == NULL) plugin_idle_add(geany_plugin, (GSourceFunc)add_tm_idle, NULL); @@ -695,7 +695,7 @@ static gboolean remove_tm_idle(gpointer foo) { GSList *elem2; - if (!g_prj || !s_idle_remove_funcs) + if (!prj_org || !s_idle_remove_funcs) return FALSE;
foreach_slist (elem2, s_idle_remove_funcs) @@ -703,9 +703,9 @@ static gboolean remove_tm_idle(gpointer foo) GSList *elem; gchar *fname = elem2->data;
- foreach_slist (elem, g_prj->roots) + foreach_slist (elem, prj_org->roots) { - GPrjRoot *root = elem->data; + PrjOrgRoot *root = elem->data; TMSourceFile *sf = g_hash_table_lookup(root->file_table, fname); if (sf != NULL) @@ -731,7 +731,7 @@ static gboolean remove_tm_idle(gpointer foo) * when this function is called and if we remove the TmSourceFile now, line * number for the searched tag won't be found. For this reason delay the tag * TmSourceFile removal until idle */ -void gprj_project_remove_single_tm_file(gchar *filename) +void prjorg_project_remove_single_tm_file(gchar *filename) { if (s_idle_remove_funcs == NULL) plugin_idle_add(geany_plugin, (GSourceFunc)remove_tm_idle, NULL);
Modified: projectorganizer/src/prjorg-project.h 40 lines changed, 20 insertions(+), 20 deletions(-) =================================================================== @@ -23,14 +23,14 @@ typedef struct { gchar *base_dir; GHashTable *file_table; /* contains all file names within base_dir, maps file_name->TMSourceFile */ -} GPrjRoot; +} PrjOrgRoot;
typedef enum { - GPrjTagAuto, - GPrjTagYes, - GPrjTagNo, -} GPrjTagPrefs; + PrjOrgTagAuto, + PrjOrgTagYes, + PrjOrgTagNo, +} PrjOrgTagPrefs;
typedef struct { @@ -38,29 +38,29 @@ typedef struct gchar **header_patterns; gchar **ignored_dirs_patterns; gchar **ignored_file_patterns; - GPrjTagPrefs generate_tag_prefs; + PrjOrgTagPrefs generate_tag_prefs; - GSList *roots; /* list of GPrjRoot; the project root is always the first followed by external dirs roots */ -} GPrj; + GSList *roots; /* list of PrjOrgRoot; the project root is always the first followed by external dirs roots */ +} PrjOrg;
-extern GPrj *g_prj; +extern PrjOrg *prj_org;
-void gprj_project_open(GKeyFile * key_file); +void prjorg_project_open(GKeyFile * key_file);
-gint gprj_project_add_properties_tab(GtkWidget *notebook); +gint prjorg_project_add_properties_tab(GtkWidget *notebook);
-void gprj_project_close(void); +void prjorg_project_close(void);
-void gprj_project_save(GKeyFile * key_file); -void gprj_project_read_properties_tab(void); -void gprj_project_rescan(void); +void prjorg_project_save(GKeyFile * key_file); +void prjorg_project_read_properties_tab(void); +void prjorg_project_rescan(void);
-void gprj_project_add_external_dir(const gchar *dirname); -void gprj_project_remove_external_dir(const gchar *dirname); +void prjorg_project_add_external_dir(const gchar *dirname); +void prjorg_project_remove_external_dir(const gchar *dirname);
-void gprj_project_add_single_tm_file(gchar *filename); -void gprj_project_remove_single_tm_file(gchar *filename); +void prjorg_project_add_single_tm_file(gchar *filename); +void prjorg_project_remove_single_tm_file(gchar *filename);
-gboolean gprj_project_is_in_project(const gchar * filename); +gboolean prjorg_project_is_in_project(const gchar * filename);
#endif
Modified: projectorganizer/src/prjorg-sidebar.c 46 lines changed, 23 insertions(+), 23 deletions(-) =================================================================== @@ -277,7 +277,7 @@ static void on_collapse_all(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED static void on_follow_active(GtkToggleToolButton *button, G_GNUC_UNUSED gpointer user_data) { s_follow_editor = gtk_toggle_tool_button_get_active(button); - gprj_sidebar_update(FALSE); + prjorg_sidebar_update(FALSE); }
@@ -294,8 +294,8 @@ static void on_add_external(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED { gchar *filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); - gprj_project_add_external_dir(filename); - gprj_sidebar_update(TRUE); + prjorg_project_add_external_dir(filename); + prjorg_sidebar_update(TRUE); project_write_config(); g_free (filename); @@ -320,8 +320,8 @@ static void on_remove_external_dir(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_U return; gtk_tree_model_get(model, &iter, FILEVIEW_COLUMN_NAME, &name, -1); - gprj_project_remove_external_dir(name); - gprj_sidebar_update(TRUE); + prjorg_project_remove_external_dir(name); + prjorg_sidebar_update(TRUE); project_write_config(); g_free(name); @@ -695,8 +695,8 @@ static void on_find_tag(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gpoin
static void on_reload_project(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gpointer user_data) { - gprj_project_rescan(); - gprj_sidebar_update(TRUE); + prjorg_project_rescan(); + prjorg_sidebar_update(TRUE); }
@@ -981,7 +981,7 @@ static void set_intro_message(const gchar *msg) }
-static void load_project_root(GPrjRoot *root, GtkTreeIter *parent, GSList *header_patterns, GSList *source_patterns, gboolean project) +static void load_project_root(PrjOrgRoot *root, GtkTreeIter *parent, GSList *header_patterns, GSList *source_patterns, gboolean project) { GSList *lst = NULL; GSList *path_list = NULL; @@ -1037,17 +1037,17 @@ static void load_project(void) gtk_tree_store_clear(s_file_store);
- if (!g_prj || !geany_data->app->project) + if (!prj_org || !geany_data->app->project) return;
icon_dir = g_icon_new_for_string("gtk-directory", NULL);
- header_patterns = get_precompiled_patterns(g_prj->header_patterns); - source_patterns = get_precompiled_patterns(g_prj->source_patterns); + header_patterns = get_precompiled_patterns(prj_org->header_patterns); + source_patterns = get_precompiled_patterns(prj_org->source_patterns); - foreach_slist (elem, g_prj->roots) + foreach_slist (elem, prj_org->roots) { - GPrjRoot *root = elem->data; + PrjOrgRoot *root = elem->data; gchar *name; if (first) @@ -1126,14 +1126,14 @@ static gboolean follow_editor_on_idle(gpointer foo)
doc = document_get_current();
- if (!doc || !doc->file_name || !geany_data->app->project || !g_prj) + if (!doc || !doc->file_name || !geany_data->app->project || !prj_org) return FALSE;
model = GTK_TREE_MODEL(s_file_store); gtk_tree_model_iter_children(model, &root_iter, NULL); - foreach_slist (elem, g_prj->roots) + foreach_slist (elem, prj_org->roots) { - GPrjRoot *root = elem->data; + PrjOrgRoot *root = elem->data; path = get_file_relative_path(root->base_dir, doc->file_name); if (path != NULL && !g_str_has_prefix(path, "..")) @@ -1172,7 +1172,7 @@ static gboolean follow_editor_on_idle(gpointer foo) }
-void gprj_sidebar_update(gboolean reload) +void prjorg_sidebar_update(gboolean reload) { if (reload) load_project(); @@ -1182,19 +1182,19 @@ void gprj_sidebar_update(gboolean reload) }
-void gprj_sidebar_find_file_in_active(void) +void prjorg_sidebar_find_file_in_active(void) { find_file(NULL); }
-void gprj_sidebar_find_tag_in_active(void) +void prjorg_sidebar_find_tag_in_active(void) { find_tag(NULL); }
-void gprj_sidebar_init(void) +void prjorg_sidebar_init(void) { GtkWidget *scrollwin, *toolbar, *item, *image; GtkCellRenderer *renderer; @@ -1299,7 +1299,7 @@ void gprj_sidebar_init(void) G_CALLBACK(on_key_press), NULL);
set_intro_message(_("(Re)open project to start using the plugin")); - gprj_sidebar_activate(FALSE); + prjorg_sidebar_activate(FALSE);
/**** popup menu ****/
@@ -1383,13 +1383,13 @@ void gprj_sidebar_init(void) }
-void gprj_sidebar_activate(gboolean activate) +void prjorg_sidebar_activate(gboolean activate) { gtk_widget_set_sensitive(s_file_view_vbox, activate); }
-void gprj_sidebar_cleanup(void) +void prjorg_sidebar_cleanup(void) { gtk_widget_destroy(s_file_view_vbox); }
Modified: projectorganizer/src/prjorg-sidebar.h 12 lines changed, 6 insertions(+), 6 deletions(-) =================================================================== @@ -20,14 +20,14 @@ #define __PRJORG_SIDEBAR_H__
-void gprj_sidebar_init(void); -void gprj_sidebar_cleanup(void); -void gprj_sidebar_activate(gboolean activate); +void prjorg_sidebar_init(void); +void prjorg_sidebar_cleanup(void); +void prjorg_sidebar_activate(gboolean activate);
-void gprj_sidebar_find_file_in_active(void); -void gprj_sidebar_find_tag_in_active(void); +void prjorg_sidebar_find_file_in_active(void); +void prjorg_sidebar_find_tag_in_active(void);
-void gprj_sidebar_update(gboolean reload); +void prjorg_sidebar_update(gboolean reload);
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).