Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Tue, 30 Jun 2015 11:18:16 UTC Commit: 153775585a4161522dddcdad71e5b944735576f0 https://github.com/geany/geany-plugins/commit/153775585a4161522dddcdad71e5b9...
Log Message: ----------- projectorganizer: remove trailing spaces
Modified Paths: -------------- projectorganizer/src/prjorg-main.c projectorganizer/src/prjorg-menu.c projectorganizer/src/prjorg-project.c projectorganizer/src/prjorg-project.h projectorganizer/src/prjorg-sidebar.c projectorganizer/src/prjorg-utils.c
Modified: projectorganizer/src/prjorg-main.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -73,7 +73,7 @@ static void on_doc_close(G_GNUC_UNUSED GObject * obj, GeanyDocument * doc, if (doc->file_name == NULL) return;
- /* tags of open files managed by geany - when the file gets closed, + /* tags of open files managed by geany - when the file gets closed, * we should take care of it */ if (prjorg_project_is_in_project(doc->file_name)) prjorg_project_add_single_tm_file(doc->file_name);
Modified: projectorganizer/src/prjorg-menu.c 8 lines changed, 4 insertions(+), 4 deletions(-) =================================================================== @@ -162,7 +162,7 @@ static void on_swap_header_source(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_U GHashTableIter iter; gpointer key, value; PrjOrgRoot *root = elem->data; - + list = NULL; g_hash_table_iter_init(&iter, root->file_table); while (g_hash_table_iter_next(&iter, &key, &value)) @@ -305,20 +305,20 @@ static void on_open_selected_file(GtkMenuItem *menuitem, gpointer user_data) PrjOrgRoot *root = elem->data; gpointer key, value; GHashTableIter iter; - + g_hash_table_iter_init(&iter, root->file_table); while (g_hash_table_iter_next(&iter, &key, &value)) { gchar *file_name = key; gchar *pos = g_strrstr(file_name, utf8_path); - + if (pos && (pos - file_name + strlen(utf8_path) == strlen(file_name))) { found_path = file_name; break; } } - + if (found_path) break; }
Modified: projectorganizer/src/prjorg-project.c 58 lines changed, 29 insertions(+), 29 deletions(-) =================================================================== @@ -63,7 +63,7 @@ static void clear_idle_queue(GSList **queue) static void collect_source_files(gchar *filename, TMSourceFile *sf, gpointer user_data) { GPtrArray *array = user_data; - + if (sf != NULL) g_ptr_array_add(array, sf); } @@ -174,7 +174,7 @@ static gint prjorg_project_rescan_root(PrjOrgRoot *root) 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); - + foreach_slist(elem, lst) { char *path = elem->data; @@ -194,7 +194,7 @@ static gint prjorg_project_rescan_root(PrjOrgRoot *root)
g_slist_foreach(ignored_dirs_list, (GFunc) g_pattern_spec_free, NULL); g_slist_free(ignored_dirs_list); - + return filenum; }
@@ -288,11 +288,11 @@ static void regenerate_tags(PrjOrgRoot *root, gpointer user_data) TMSourceFile *sf; gchar *utf8_path = key; gchar *locale_path = utils_get_locale_from_utf8(utf8_path); - + sf = tm_source_file_new(locale_path, filetypes_detect(utf8_path)->name); if (sf && !document_find_by_filename(utf8_path)) g_ptr_array_add(source_files, sf); - + g_hash_table_insert(file_table, g_strdup(utf8_path), sf); g_free(locale_path); } @@ -308,16 +308,16 @@ void prjorg_project_rescan(void) { GSList *elem; gint filenum = 0; - + if (!prj_org) return;
clear_idle_queue(&s_idle_add_funcs); clear_idle_queue(&s_idle_remove_funcs); - + foreach_slist(elem, prj_org->roots) filenum += prjorg_project_rescan_root(elem->data); - + if (prj_org->generate_tag_prefs == PrjOrgTagYes || (prj_org->generate_tag_prefs == PrjOrgTagAuto && filenum < 300)) g_slist_foreach(prj_org->roots, (GFunc)regenerate_tags, NULL); } @@ -356,7 +356,7 @@ void prjorg_project_save(GKeyFile * key_file) { GPtrArray *array; GSList *elem, *lst; - + if (!prj_org) return;
@@ -369,7 +369,7 @@ void prjorg_project_save(GKeyFile * key_file) g_key_file_set_string_list(key_file, "prjorg", "ignored_file_patterns", (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 = prj_org->roots->next; foreach_slist (elem, lst) @@ -394,12 +394,12 @@ static PrjOrgRoot *create_root(const gchar *utf8_base_dir) static void close_root(PrjOrgRoot *root, gpointer user_data) { GPtrArray *source_files; - + source_files = g_ptr_array_new(); g_hash_table_foreach(root->file_table, (GHFunc)collect_source_files, source_files); tm_workspace_remove_source_files(source_files); g_ptr_array_free(source_files, TRUE); - + g_hash_table_destroy(root->file_table); g_free(root->base_dir); g_free(root); @@ -435,12 +435,12 @@ void prjorg_project_add_external_dir(const gchar *utf8_dirname) close_root(new_root, NULL); return; } - + GSList *lst = prj_org->roots->next; lst = g_slist_prepend(lst, new_root); lst = g_slist_sort(lst, (GCompareFunc)root_comparator); prj_org->roots->next = lst; - + prjorg_project_rescan(); }
@@ -452,7 +452,7 @@ void prjorg_project_remove_external_dir(const gchar *utf8_dirname) if (found != NULL) { PrjOrgRoot *found_root = found->data; - + prj_org->roots = g_slist_remove(prj_org->roots, found_root); close_root(found_root, NULL); prjorg_project_rescan(); @@ -685,10 +685,10 @@ void prjorg_project_close(void) gboolean prjorg_project_is_in_project(const gchar *utf8_filename) { GSList *elem; - + if (!utf8_filename || !prj_org || !geany_data->app->project || !prj_org->roots) return FALSE; - + foreach_slist (elem, prj_org->roots) { PrjOrgRoot *root = elem->data; @@ -703,7 +703,7 @@ gboolean prjorg_project_is_in_project(const gchar *utf8_filename) static gboolean add_tm_idle(gpointer foo) { GSList *elem2; - + if (!prj_org || !s_idle_add_funcs) return FALSE;
@@ -711,12 +711,12 @@ static gboolean add_tm_idle(gpointer foo) { GSList *elem; gchar *utf8_fname = elem2->data; - + foreach_slist (elem, prj_org->roots) { PrjOrgRoot *root = elem->data; TMSourceFile *sf = g_hash_table_lookup(root->file_table, utf8_fname); - + if (sf != NULL && !document_find_by_filename(utf8_fname)) { tm_workspace_add_source_file(sf); @@ -724,7 +724,7 @@ static gboolean add_tm_idle(gpointer foo) } } } - + clear_idle_queue(&s_idle_add_funcs);
return FALSE; @@ -734,15 +734,15 @@ static gboolean add_tm_idle(gpointer foo) /* This function gets called when document is being closed by Geany and we need * to add the TMSourceFile from the tag manager because Geany removes it on * document close. - * - * Additional problem: The tag removal in Geany happens after this function is called. + * + * 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 prjorg_project_add_single_tm_file(gchar *utf8_filename) { if (s_idle_add_funcs == NULL) plugin_idle_add(geany_plugin, (GSourceFunc)add_tm_idle, NULL); - + s_idle_add_funcs = g_slist_prepend(s_idle_add_funcs, g_strdup(utf8_filename)); }
@@ -750,7 +750,7 @@ void prjorg_project_add_single_tm_file(gchar *utf8_filename) static gboolean remove_tm_idle(gpointer foo) { GSList *elem2; - + if (!prj_org || !s_idle_remove_funcs) return FALSE;
@@ -763,12 +763,12 @@ static gboolean remove_tm_idle(gpointer foo) { PrjOrgRoot *root = elem->data; TMSourceFile *sf = g_hash_table_lookup(root->file_table, utf8_fname); - + if (sf != NULL) tm_workspace_remove_source_file(sf); } } - + clear_idle_queue(&s_idle_remove_funcs);
return FALSE; @@ -781,7 +781,7 @@ static gboolean remove_tm_idle(gpointer foo) * files, the file inserted by the plugin isn't updated automatically in TM * so any changes wouldn't be reflected in the tags array (e.g. removed function * from source file would still be found in TM) - * + * * Additional problem: The document being opened may be caused * by going to tag definition/declaration - tag processing is in progress * when this function is called and if we remove the TmSourceFile now, line @@ -791,6 +791,6 @@ void prjorg_project_remove_single_tm_file(gchar *utf8_filename) { if (s_idle_remove_funcs == NULL) plugin_idle_add(geany_plugin, (GSourceFunc)remove_tm_idle, NULL); - + s_idle_remove_funcs = g_slist_prepend(s_idle_remove_funcs, g_strdup(utf8_filename)); }
Modified: projectorganizer/src/prjorg-project.h 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -39,7 +39,7 @@ typedef struct gchar **ignored_dirs_patterns; gchar **ignored_file_patterns; PrjOrgTagPrefs generate_tag_prefs; - + GSList *roots; /* list of PrjOrgRoot; the project root is always the first followed by external dirs roots */ } PrjOrg;
Modified: projectorganizer/src/prjorg-sidebar.c 78 lines changed, 39 insertions(+), 39 deletions(-) =================================================================== @@ -198,10 +198,10 @@ static gboolean topmost_selected(GtkTreeModel *model, GtkTreeIter *iter, gboolea { GtkTreePath *path, *first_path; gboolean ret, is_first; - + first_path = gtk_tree_path_new_first(); path = gtk_tree_model_get_path(model, iter); - + is_first = gtk_tree_path_compare(first_path, path) == 0; ret = gtk_tree_path_get_depth(path) == 1 && ((is_first && first) || (!is_first && !first)); gtk_tree_path_free(first_path); @@ -265,9 +265,9 @@ static void collapse(void) GtkTreeIter iter; GtkTreePath *tree_path; GtkTreeModel *model = GTK_TREE_MODEL(s_file_store); - + gtk_tree_view_collapse_all(GTK_TREE_VIEW(s_file_view)); - + /* expand the project folder */ gtk_tree_model_iter_children(model, &iter, NULL); tree_path = gtk_tree_model_get_path (model, &iter); @@ -305,11 +305,11 @@ static void on_add_external(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED { gchar *locale_filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); gchar *utf8_filename = utils_get_utf8_from_locale(locale_filename); - + prjorg_project_add_external_dir(utf8_filename); prjorg_sidebar_update(TRUE); project_write_config(); - + g_free(utf8_filename); g_free(locale_filename); } @@ -327,19 +327,19 @@ static void on_remove_external_dir(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_U GtkTreeModel *model; GtkTreeIter iter, parent; gchar *name; - + treesel = gtk_tree_view_get_selection(GTK_TREE_VIEW(s_file_view)); if (!gtk_tree_selection_get_selected(treesel, &model, &iter)) return;
if (gtk_tree_model_iter_parent(model, &parent, &iter)) return; - + gtk_tree_model_get(model, &iter, FILEVIEW_COLUMN_NAME, &name, -1); prjorg_project_remove_external_dir(name); prjorg_sidebar_update(TRUE); project_write_config(); - + g_free(name); }
@@ -539,20 +539,20 @@ static const char *tm_tag_type_name(const TMTag *tag) }
-static gboolean match(TMTag *tag, const gchar *name, gboolean declaration, gboolean case_sensitive, +static gboolean match(TMTag *tag, const gchar *name, gboolean declaration, gboolean case_sensitive, MatchType match_type, GPatternSpec *pspec, gchar *utf8_path) { const gint forward_types = tm_tag_prototype_t | tm_tag_externvar_t; gboolean matches = FALSE; gint type; - + type = declaration ? forward_types : tm_tag_max_t - forward_types; matches = tag->type & type; - + if (matches) { gchar *name_case; - + if (case_sensitive) name_case = g_strdup(tag->name); else @@ -560,7 +560,7 @@ static gboolean match(TMTag *tag, const gchar *name, gboolean declaration, gbool
switch (match_type) { - case MATCH_FULL: + case MATCH_FULL: matches = g_strcmp0(name_case, name) == 0; break; case MATCH_PATTERN: @@ -572,18 +572,18 @@ static gboolean match(TMTag *tag, const gchar *name, gboolean declaration, gbool } g_free(name_case); } - + if (matches && utf8_path) { gchar *utf8_file_name = utils_get_utf8_from_locale(tag->file->file_name); gchar *relpath; - + relpath = get_relative_path(utf8_path, utf8_file_name); matches = relpath != NULL; g_free(relpath); g_free(utf8_file_name); } - + return matches; }
@@ -596,12 +596,12 @@ static void find_tags(const gchar *name, gboolean declaration, gboolean case_sen guint i; gchar *name_case; GPatternSpec *pspec; - + if (case_sensitive) name_case = g_strdup(name); else name_case = g_utf8_strdown(name, -1); - + pspec = g_pattern_spec_new(name_case);
msgwin_set_messages_dir(locale_base_path); @@ -615,7 +615,7 @@ static void find_tags(const gchar *name, gboolean declaration, gboolean case_sen gchar *scopestr = tag->scope ? g_strconcat(tag->scope, "::", NULL) : g_strdup(""); gchar *utf8_fname = utils_get_utf8_from_locale(tag->file->file_name); gchar *relpath; - + relpath = get_relative_path(utf8_base_path, utf8_fname); msgwin_msg_add(COLOR_BLACK, -1, NULL, "%s:%lu:\n\t[%s]\t %s%s%s", relpath, tag->line, tm_tag_type_name(tag), scopestr, tag->name, tag->arglist ? tag->arglist : ""); @@ -625,7 +625,7 @@ static void find_tags(const gchar *name, gboolean declaration, gboolean case_sen } } msgwin_switch_tab(MSG_MESSAGE, TRUE); - + g_free(name_case); g_free(pspec); g_free(utf8_base_path); @@ -671,7 +671,7 @@ static void find_tag(GtkTreeIter *iter)
find_tags(name, declaration, case_sensitive, match_type, iter ? utf8_path : NULL); } - + g_free(utf8_path); gtk_widget_hide(s_ft_dialog.widget); } @@ -803,7 +803,7 @@ static gboolean on_button_release(G_GNUC_UNUSED GtkWidget * widget, GdkEventButt static gboolean on_button_press(G_GNUC_UNUSED GtkWidget * widget, GdkEventButton * event, G_GNUC_UNUSED gpointer user_data) { - if (event->button == 1 && event->type == GDK_2BUTTON_PRESS) + if (event->button == 1 && event->type == GDK_2BUTTON_PRESS) { on_open_clicked(); return TRUE; @@ -898,7 +898,7 @@ static void create_branch(gint level, GSList *leaf_list, GtkTreeIter *parent, if (content_type) { icon = g_content_type_get_icon(content_type); - if (icon) + if (icon) { GtkIconInfo *icon_info;
@@ -1060,7 +1060,7 @@ static void load_project_root(PrjOrgRoot *root, GtkTreeIter *parent, GSList *hea else set_intro_message(_("Set file patterns under Project->Properties")); } - + g_slist_foreach(lst, (GFunc) g_free, NULL); g_slist_free(lst); g_slist_foreach(path_list, (GFunc) g_strfreev, NULL); @@ -1074,7 +1074,7 @@ static void load_project(void) GtkTreeIter iter; gboolean first = TRUE; GIcon *icon_dir; - + gtk_tree_store_clear(s_file_store);
if (!prj_org || !geany_data->app->project) @@ -1084,15 +1084,15 @@ static void load_project(void)
header_patterns = get_precompiled_patterns(prj_org->header_patterns); source_patterns = get_precompiled_patterns(prj_org->source_patterns); - + /* reload on every refresh to update the color e.g. when the theme changes */ s_external_color = gtk_widget_get_style(s_toolbar)->bg[GTK_STATE_NORMAL]; - + foreach_slist (elem, prj_org->roots) { PrjOrgRoot *root = elem->data; gchar *name; - + if (first) name = g_strconcat("<b>", geany_data->app->project->name, "</b>", NULL); else @@ -1108,7 +1108,7 @@ static void load_project(void) first = FALSE; g_free(name); } - + collapse();
g_slist_foreach(header_patterns, (GFunc) g_pattern_spec_free, NULL); @@ -1175,17 +1175,17 @@ static gboolean follow_editor_on_idle(gpointer foo) foreach_slist (elem, prj_org->roots) { PrjOrgRoot *root = elem->data; - + utf8_path = get_relative_path(root->base_dir, doc->file_name); if (utf8_path) break; - + g_free(utf8_path); utf8_path = NULL; if (!gtk_tree_model_iter_next(model, &root_iter)) break; } - + if (!utf8_path) return FALSE;
@@ -1201,15 +1201,15 @@ static gboolean follow_editor_on_idle(gpointer foo) gtk_tree_view_expand_to_path(GTK_TREE_VIEW(s_file_view), tree_path); gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(s_file_view), tree_path, NULL, FALSE, 0.0, 0.0); - + treesel = gtk_tree_view_get_selection(GTK_TREE_VIEW(s_file_view)); gtk_tree_selection_select_iter(treesel, &found_iter); gtk_tree_path_free(tree_path); } - + g_free(utf8_path); g_strfreev(path_split); - + return FALSE; }
@@ -1218,14 +1218,14 @@ void prjorg_sidebar_update(gboolean reload) { if (reload) { - /* we get color information only after the sidebar is realized - + /* we get color information only after the sidebar is realized - * postpone reload if this is not the case yet */ if (gtk_widget_get_realized(s_toolbar)) load_project(); else s_pending_reload = TRUE; } - if (s_follow_editor) + if (s_follow_editor) /* perform on idle - avoids unnecessary jumps on project load */ plugin_idle_add(geany_plugin, (GSourceFunc)follow_editor_on_idle, NULL); } @@ -1326,7 +1326,7 @@ void prjorg_sidebar_init(void) gtk_tree_view_column_pack_start(column, renderer, FALSE); gtk_tree_view_column_add_attribute(column, renderer, "gicon", FILEVIEW_COLUMN_ICON); gtk_tree_view_column_add_attribute(column, renderer, "cell-background-gdk", FILEVIEW_COLUMN_COLOR); - + renderer = gtk_cell_renderer_text_new(); gtk_tree_view_column_pack_start(column, renderer, TRUE); gtk_tree_view_column_add_attribute(column, renderer, "markup", FILEVIEW_COLUMN_NAME);
Modified: projectorganizer/src/prjorg-utils.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -97,7 +97,7 @@ void open_file(gchar *utf8_name) gtk_notebook_set_current_page(GTK_NOTEBOOK(geany->main_widgets->notebook), document_get_notebook_page(doc)); } - + if (doc) gtk_widget_grab_focus(GTK_WIDGET(doc->editor->sci));
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).