lists.geany.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
List overview
Plugins-Commits
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
plugins-commits@lists.geany.org
5468 discussions
Start a n
N
ew thread
[geany/geany-plugins] ec9651: projectorganizer: Add missing includes to header files
by Jiřà Techet
17 Mar '24
17 Mar '24
Branch: refs/heads/master Author: Jiřà Techet <techet(a)gmail.com> Committer: Jiřà Techet <techet(a)gmail.com> Date: Tue, 05 Mar 2024 17:39:53 UTC Commit: ec96512db966857596068959f5e39fe82ce8910d
https://github.com/geany/geany-plugins/commit/ec96512db966857596068959f5e39…
Log Message: ----------- projectorganizer: Add missing includes to header files Fixes warnings in clangd Modified Paths: -------------- projectorganizer/src/prjorg-menu.h projectorganizer/src/prjorg-project.h projectorganizer/src/prjorg-sidebar.h projectorganizer/src/prjorg-utils.h Modified: projectorganizer/src/prjorg-menu.h 2 lines changed, 2 insertions(+), 0 deletions(-) =================================================================== @@ -19,6 +19,8 @@ #ifndef __PRJORG_MENU_H__ #define __PRJORG_MENU_H__ +#include <glib.h> + void prjorg_menu_init(void); void prjorg_menu_activate_menu_items(gboolean activate); void prjorg_menu_cleanup(void); Modified: projectorganizer/src/prjorg-project.h 2 lines changed, 2 insertions(+), 0 deletions(-) =================================================================== @@ -19,6 +19,8 @@ #ifndef __PRJORG_PROJECT_H__ #define __PRJORG_PROJECT_H__ +#include <gtk/gtk.h> + #define PRJORG_PATTERNS_SOURCE "*.c *.C *.cpp *.cxx *.c++ *.cc *.m" #define PRJORG_PATTERNS_HEADER "*.h *.H *.hpp *.hxx *.h++ *.hh" #define PRJORG_PATTERNS_IGNORED_DIRS ".* CVS" Modified: projectorganizer/src/prjorg-sidebar.h 1 lines changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -19,6 +19,7 @@ #ifndef __PRJORG_SIDEBAR_H__ #define __PRJORG_SIDEBAR_H__ +#include <gtk/gtk.h> void prjorg_sidebar_init(void); void prjorg_sidebar_cleanup(void); Modified: projectorganizer/src/prjorg-utils.h 3 lines changed, 3 insertions(+), 0 deletions(-) =================================================================== @@ -19,6 +19,9 @@ #ifndef __PRJORG_UTILS_H__ #define __PRJORG_UTILS_H__ +#include <gtk/gtk.h> +#include <geanyplugin.h> + gchar *get_relative_path(const gchar *utf8_parent, const gchar *utf8_descendant); gboolean patterns_match(GSList *patterns, const gchar *str); -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] db2698: Merge pull request #1315 from techee/prjorg-fixes
by Jiřà Techet
17 Mar '24
17 Mar '24
Branch: refs/heads/master Author: Jiřà Techet <techet(a)gmail.com> Committer: GitHub <noreply(a)github.com> Date: Sun, 17 Mar 2024 21:34:00 UTC Commit: db2698cc869274aef353ba7af23d70921d944166
https://github.com/geany/geany-plugins/commit/db2698cc869274aef353ba7af23d7…
Log Message: ----------- Merge pull request #1315 from techee/prjorg-fixes projectorganizer: Eliminate some compiler warnings Modified Paths: -------------- 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 projectorganizer/src/prjorg-utils.h Modified: projectorganizer/src/prjorg-menu.h 2 lines changed, 2 insertions(+), 0 deletions(-) =================================================================== @@ -19,6 +19,8 @@ #ifndef __PRJORG_MENU_H__ #define __PRJORG_MENU_H__ +#include <glib.h> + void prjorg_menu_init(void); void prjorg_menu_activate_menu_items(gboolean activate); void prjorg_menu_cleanup(void); Modified: projectorganizer/src/prjorg-project.c 77 lines changed, 49 insertions(+), 28 deletions(-) =================================================================== @@ -655,83 +655,100 @@ void prjorg_project_read_properties_tab(void) GtkWidget *prjorg_project_add_properties_tab(GtkWidget *notebook) { - GtkWidget *vbox, *hbox, *hbox1; - GtkWidget *table; + GtkWidget *vbox, *hbox, *hbox1, *ebox, *table_box; GtkWidget *label; gchar *str; + GtkSizeGroup *size_group; e = g_new0(PropertyDialogElements, 1); - vbox = gtk_vbox_new(FALSE, 0); + vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); - table = gtk_table_new(5, 2, FALSE); - gtk_table_set_row_spacings(GTK_TABLE(table), 6); - gtk_table_set_col_spacings(GTK_TABLE(table), 12); + table_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 12); + gtk_box_set_spacing(GTK_BOX(table_box), 6); + + size_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); label = gtk_label_new(_("Source patterns:")); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0); + gtk_label_set_xalign(GTK_LABEL(label), 0.0); + gtk_size_group_add_widget(size_group, label); e->source_patterns = gtk_entry_new(); - ui_table_add_row(GTK_TABLE(table), 0, label, e->source_patterns, NULL); ui_entry_add_clear_icon(GTK_ENTRY(e->source_patterns)); gtk_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(" ", prj_org->source_patterns); gtk_entry_set_text(GTK_ENTRY(e->source_patterns), str); g_free(str); + ebox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6); + gtk_box_pack_start(GTK_BOX(ebox), label, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(ebox), e->source_patterns, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(table_box), ebox, TRUE, FALSE, 0); label = gtk_label_new(_("Header patterns:")); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0); + gtk_label_set_xalign(GTK_LABEL(label), 0.0); + gtk_size_group_add_widget(size_group, label); e->header_patterns = gtk_entry_new(); ui_entry_add_clear_icon(GTK_ENTRY(e->header_patterns)); - ui_table_add_row(GTK_TABLE(table), 1, label, e->header_patterns, NULL); gtk_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(" ", prj_org->header_patterns); gtk_entry_set_text(GTK_ENTRY(e->header_patterns), str); g_free(str); + ebox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6); + gtk_box_pack_start(GTK_BOX(ebox), label, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(ebox), e->header_patterns, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(table_box), ebox, TRUE, FALSE, 0); label = gtk_label_new(_("Ignored file patterns:")); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0); + gtk_label_set_xalign(GTK_LABEL(label), 0.0); + gtk_size_group_add_widget(size_group, label); e->ignored_file_patterns = gtk_entry_new(); ui_entry_add_clear_icon(GTK_ENTRY(e->ignored_file_patterns)); - ui_table_add_row(GTK_TABLE(table), 2, label, e->ignored_file_patterns, NULL); gtk_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(" ", prj_org->ignored_file_patterns); gtk_entry_set_text(GTK_ENTRY(e->ignored_file_patterns), str); g_free(str); + ebox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6); + gtk_box_pack_start(GTK_BOX(ebox), label, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(ebox), e->ignored_file_patterns, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(table_box), ebox, TRUE, FALSE, 0); label = gtk_label_new(_("Ignored directory patterns:")); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0); + gtk_label_set_xalign(GTK_LABEL(label), 0.0); + gtk_size_group_add_widget(size_group, label); e->ignored_dirs_patterns = gtk_entry_new(); ui_entry_add_clear_icon(GTK_ENTRY(e->ignored_dirs_patterns)); - ui_table_add_row(GTK_TABLE(table), 3, label, e->ignored_dirs_patterns, NULL); gtk_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(" ", prj_org->ignored_dirs_patterns); gtk_entry_set_text(GTK_ENTRY(e->ignored_dirs_patterns), str); g_free(str); + ebox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6); + gtk_box_pack_start(GTK_BOX(ebox), label, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(ebox), e->ignored_dirs_patterns, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(table_box), ebox, TRUE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 6); + gtk_box_pack_start(GTK_BOX(vbox), table_box, FALSE, FALSE, 6); - hbox1 = gtk_hbox_new(FALSE, 0); + hbox1 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); label = gtk_label_new(_("The patterns above affect only sidebar and indexing and are not used in the Find in Files\n" "dialog. You can further restrict the files belonging to the project by setting the\n" "File Patterns under the Project tab (these are also used for the Find in Files dialog).")); gtk_box_pack_start(GTK_BOX(hbox1), label, FALSE, FALSE, 12); gtk_box_pack_start(GTK_BOX(vbox), hbox1, FALSE, FALSE, 0); - hbox1 = gtk_hbox_new(FALSE, 0); + hbox1 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); label = gtk_label_new(NULL); gtk_label_set_markup(GTK_LABEL(label), _("<b>Various</b>")); gtk_box_pack_start(GTK_BOX(hbox1), label, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox1, FALSE, FALSE, 12); - hbox1 = gtk_hbox_new(FALSE, 0); + hbox1 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); e->show_empty_dirs = gtk_check_button_new_with_label(_("Show empty directories in sidebar")); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(e->show_empty_dirs), prj_org->show_empty_dirs); gtk_widget_set_tooltip_text(e->show_empty_dirs, @@ -741,12 +758,14 @@ GtkWidget *prjorg_project_add_properties_tab(GtkWidget *notebook) gtk_box_pack_start(GTK_BOX(hbox1), e->show_empty_dirs, FALSE, FALSE, 12); gtk_box_pack_start(GTK_BOX(vbox), hbox1, FALSE, FALSE, 0); - table = gtk_table_new(1, 2, FALSE); - gtk_table_set_row_spacings(GTK_TABLE(table), 6); - gtk_table_set_col_spacings(GTK_TABLE(table), 12); + table_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 12); + gtk_box_set_spacing(GTK_BOX(table_box), 6); + + size_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); label = gtk_label_new(_("Index all project files:")); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0); + gtk_label_set_xalign(GTK_LABEL(label), 0.0); + gtk_size_group_add_widget(size_group, label); e->generate_tag_prefs = gtk_combo_box_text_new(); gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(e->generate_tag_prefs), _("Auto (index if less than 1000 files)")); gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(e->generate_tag_prefs), _("Yes")); @@ -755,16 +774,18 @@ GtkWidget *prjorg_project_add_properties_tab(GtkWidget *notebook) gtk_widget_set_tooltip_text(e->generate_tag_prefs, _("Generate symbol list for all project files instead of only for the currently opened files. " "Might be slow for big projects.")); + ebox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6); + gtk_box_pack_start(GTK_BOX(ebox), label, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(ebox), e->generate_tag_prefs, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(table_box), ebox, TRUE, FALSE, 0); - ui_table_add_row(GTK_TABLE(table), 1, label, e->generate_tag_prefs, NULL); - - hbox1 = gtk_hbox_new(FALSE, 0); - gtk_box_pack_start(GTK_BOX(hbox1), table, FALSE, FALSE, 12); - gtk_box_pack_start(GTK_BOX(vbox), hbox1, FALSE, FALSE, 0); + hbox1 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); + gtk_box_pack_start(GTK_BOX(hbox1), table_box, FALSE, FALSE, 12); + gtk_box_pack_start(GTK_BOX(vbox), hbox1, FALSE, FALSE, 6); label = gtk_label_new("Project Organizer"); - hbox = gtk_hbox_new(FALSE, 0); + hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 6); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), hbox, label); Modified: projectorganizer/src/prjorg-project.h 2 lines changed, 2 insertions(+), 0 deletions(-) =================================================================== @@ -19,6 +19,8 @@ #ifndef __PRJORG_PROJECT_H__ #define __PRJORG_PROJECT_H__ +#include <gtk/gtk.h> + #define PRJORG_PATTERNS_SOURCE "*.c *.C *.cpp *.cxx *.c++ *.cc *.m" #define PRJORG_PATTERNS_HEADER "*.h *.H *.hpp *.hxx *.h++ *.hh" #define PRJORG_PATTERNS_IGNORED_DIRS ".* CVS" Modified: projectorganizer/src/prjorg-sidebar.c 50 lines changed, 23 insertions(+), 27 deletions(-) =================================================================== @@ -138,7 +138,7 @@ static gint show_dialog_find_file(gchar *utf8_path, gchar **pattern, gboolean *c size_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); label = gtk_label_new(_("Search for:")); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + gtk_label_set_xalign(GTK_LABEL(label), 0.0); gtk_size_group_add_widget(size_group, label); s_fif_dialog.combo = gtk_combo_box_text_new_with_entry(); entry = gtk_bin_get_child(GTK_BIN(s_fif_dialog.combo)); @@ -147,29 +147,29 @@ static gint show_dialog_find_file(gchar *utf8_path, gchar **pattern, gboolean *c ui_entry_add_clear_icon(GTK_ENTRY(entry)); gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE); - ebox = gtk_hbox_new(FALSE, 6); + ebox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6); gtk_box_pack_start(GTK_BOX(ebox), label, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(ebox), s_fif_dialog.combo, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(vbox), ebox, TRUE, FALSE, 0); label = gtk_label_new(_("Search inside:")); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + gtk_label_set_xalign(GTK_LABEL(label), 0.0); gtk_size_group_add_widget(size_group, label); s_fif_dialog.dir_label = gtk_label_new(""); - gtk_misc_set_alignment(GTK_MISC(s_fif_dialog.dir_label), 0, 0.5); + gtk_label_set_xalign(GTK_LABEL(s_fif_dialog.dir_label), 0.0); - ebox = gtk_hbox_new(FALSE, 6); + ebox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6); gtk_box_pack_start(GTK_BOX(ebox), label, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(ebox), s_fif_dialog.dir_label, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(vbox), ebox, TRUE, FALSE, 0); s_fif_dialog.case_sensitive = gtk_check_button_new_with_mnemonic(_("C_ase sensitive")); - gtk_button_set_focus_on_click(GTK_BUTTON(s_fif_dialog.case_sensitive), FALSE); + gtk_widget_set_focus_on_click(s_fif_dialog.case_sensitive, FALSE); s_fif_dialog.full_path = gtk_check_button_new_with_mnemonic(_("Search in full path")); - gtk_button_set_focus_on_click(GTK_BUTTON(s_fif_dialog.full_path), FALSE); + gtk_widget_set_focus_on_click(s_fif_dialog.full_path, FALSE); gtk_box_pack_start(GTK_BOX(vbox), s_fif_dialog.case_sensitive, TRUE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), s_fif_dialog.full_path, TRUE, FALSE, 0); @@ -346,7 +346,7 @@ static gchar *get_fallback_dir_of_selection(void) { locale_path = g_path_get_dirname(doc->real_path); - if (locale_path && locale_path == '.') + if (locale_path && *locale_path == '.') { g_free(locale_path); locale_path = NULL; @@ -382,7 +382,8 @@ void on_open_file_manager(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gp if (locale_path) { - gchar *command, *open_command; + const gchar *open_command; + gchar *command; open_command = PRJORG_COMMAND_OPEN; command = g_strconcat (open_command, " \"", locale_path, "\"", NULL); @@ -726,7 +727,7 @@ static void create_dialog_find_tag(void) size_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); label = gtk_label_new(_("Search for:")); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + gtk_label_set_xalign(GTK_LABEL(label), 0.0); gtk_size_group_add_widget(size_group, label); s_ft_dialog.combo = gtk_combo_box_text_new_with_entry(); @@ -738,13 +739,13 @@ static void create_dialog_find_tag(void) ui_entry_add_clear_icon(GTK_ENTRY(entry)); gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE); - ebox = gtk_hbox_new(FALSE, 6); + ebox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6); gtk_box_pack_start(GTK_BOX(ebox), label, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(ebox), s_ft_dialog.combo, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(vbox), ebox, TRUE, FALSE, 0); label = gtk_label_new(_("Match type:")); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + gtk_label_set_xalign(GTK_LABEL(label), 0.0); gtk_size_group_add_widget(size_group, label); s_ft_dialog.combo_match = gtk_combo_box_text_new(); @@ -754,28 +755,28 @@ static void create_dialog_find_tag(void) gtk_combo_box_set_active(GTK_COMBO_BOX(s_ft_dialog.combo_match), 1); gtk_label_set_mnemonic_widget(GTK_LABEL(label), s_ft_dialog.combo_match); - ebox = gtk_hbox_new(FALSE, 6); + ebox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6); gtk_box_pack_start(GTK_BOX(ebox), label, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(ebox), s_ft_dialog.combo_match, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(vbox), ebox, TRUE, FALSE, 0); label = gtk_label_new(_("Search inside:")); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + gtk_label_set_xalign(GTK_LABEL(label), 0.0); gtk_size_group_add_widget(size_group, label); s_ft_dialog.dir_label = gtk_label_new(""); - gtk_misc_set_alignment(GTK_MISC(s_ft_dialog.dir_label), 0, 0.5); + gtk_label_set_xalign(GTK_LABEL(s_ft_dialog.dir_label), 0.0); - ebox = gtk_hbox_new(FALSE, 6); + ebox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6); gtk_box_pack_start(GTK_BOX(ebox), label, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(ebox), s_ft_dialog.dir_label, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(vbox), ebox, TRUE, FALSE, 0); s_ft_dialog.case_sensitive = gtk_check_button_new_with_mnemonic(_("C_ase sensitive")); - gtk_button_set_focus_on_click(GTK_BUTTON(s_ft_dialog.case_sensitive), FALSE); + gtk_widget_set_focus_on_click(s_ft_dialog.case_sensitive, FALSE); s_ft_dialog.declaration = gtk_check_button_new_with_mnemonic(_("_Declaration")); - gtk_button_set_focus_on_click(GTK_BUTTON(s_ft_dialog.declaration), FALSE); + gtk_widget_set_focus_on_click(s_ft_dialog.declaration, FALSE); g_object_unref(G_OBJECT(size_group)); /* auto destroy the size group */ @@ -1085,8 +1086,7 @@ static gboolean on_button_release(G_GNUC_UNUSED GtkWidget * widget, GdkEventButt gtk_widget_set_sensitive(s_popup_menu.delete, delete_enabled); - gtk_menu_popup(GTK_MENU(s_popup_menu.widget), NULL, NULL, NULL, NULL, - event->button, event->time); + gtk_menu_popup_at_pointer(GTK_MENU(s_popup_menu.widget), (GdkEvent *)event); return TRUE; } @@ -1207,7 +1207,7 @@ static void create_branch(gint level, GSList *leaf_list, GtkTreeIter *parent, icon = NULL; } else - gtk_icon_info_free(icon_info); + g_object_unref(icon_info); } g_free(content_type); } @@ -1562,7 +1562,7 @@ gchar **prjorg_sidebar_get_expanded_paths(void) (GtkTreeViewMappingFunc)on_map_expanded, expanded_paths); g_ptr_array_add(expanded_paths, NULL); - return g_ptr_array_free(expanded_paths, FALSE); + return (gchar **)g_ptr_array_free(expanded_paths, FALSE); } @@ -1587,10 +1587,6 @@ void prjorg_sidebar_update_full(gboolean reload, gchar **expanded_paths) if (reload) { - GtkTreeSelection *treesel; - GtkTreeIter iter; - GtkTreeModel *model; - expand_data->expanded_paths = expanded_paths != NULL ? expanded_paths : prjorg_sidebar_get_expanded_paths(); expand_data->selected_path = get_selected_path(); @@ -1658,7 +1654,7 @@ void prjorg_sidebar_init(void) PangoFontDescription *pfd; GList *focus_chain = NULL; - s_file_view_vbox = gtk_vbox_new(FALSE, 0); + s_file_view_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); /**** toolbar ****/ Modified: projectorganizer/src/prjorg-sidebar.h 1 lines changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -19,6 +19,7 @@ #ifndef __PRJORG_SIDEBAR_H__ #define __PRJORG_SIDEBAR_H__ +#include <gtk/gtk.h> void prjorg_sidebar_init(void); void prjorg_sidebar_cleanup(void); Modified: projectorganizer/src/prjorg-utils.h 3 lines changed, 3 insertions(+), 0 deletions(-) =================================================================== @@ -19,6 +19,9 @@ #ifndef __PRJORG_UTILS_H__ #define __PRJORG_UTILS_H__ +#include <gtk/gtk.h> +#include <geanyplugin.h> + gchar *get_relative_path(const gchar *utf8_parent, const gchar *utf8_descendant); gboolean patterns_match(GSList *patterns, const gchar *str); -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] cfbe00: vimode: eliminate warning
by Jiřà Techet
17 Mar '24
17 Mar '24
Branch: refs/heads/master Author: Jiřà Techet <techet(a)gmail.com> Committer: Jiřà Techet <techet(a)gmail.com> Date: Tue, 05 Mar 2024 21:50:35 UTC Commit: cfbe000271b21846df228943cb19768084146fb1
https://github.com/geany/geany-plugins/commit/cfbe000271b21846df228943cb197…
Log Message: ----------- vimode: eliminate warning Modified Paths: -------------- vimode/src/backends/backend-viw.c Modified: vimode/src/backends/backend-viw.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -221,7 +221,7 @@ int main(int argc, char **argv) open_file(argv[1]); statusbar = gtk_statusbar_new(); - vbox = gtk_vbox_new(FALSE, 0); + vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); gtk_box_pack_start(GTK_BOX(vbox), editor, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(vbox), statusbar, FALSE, FALSE, 0); gtk_container_add(GTK_CONTAINER(window), vbox); -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] ee7aac: Merge pull request #1316 from techee/vimode-fixes
by Enrico Tröger
17 Mar '24
17 Mar '24
Branch: refs/heads/master Author: Enrico Tröger <enrico.troeger(a)uvena.de> Committer: GitHub <noreply(a)github.com> Date: Sun, 17 Mar 2024 16:54:45 UTC Commit: ee7aac3ded21b6c4a9d3b375502538e463351c35
https://github.com/geany/geany-plugins/commit/ee7aac3ded21b6c4a9d3b37550253…
Log Message: ----------- Merge pull request #1316 from techee/vimode-fixes vimode: eliminate a warning Modified Paths: -------------- vimode/src/backends/backend-viw.c Modified: vimode/src/backends/backend-viw.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -221,7 +221,7 @@ int main(int argc, char **argv) open_file(argv[1]); statusbar = gtk_statusbar_new(); - vbox = gtk_vbox_new(FALSE, 0); + vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); gtk_box_pack_start(GTK_BOX(vbox), editor, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(vbox), statusbar, FALSE, FALSE, 0); gtk_container_add(GTK_CONTAINER(window), vbox); -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] 146abc: Add more custom macro definitions for recent cppcheck versions
by Enrico Tröger
03 Mar '24
03 Mar '24
Branch: refs/heads/master Author: Enrico Tröger <enrico.troeger(a)uvena.de> Committer: Enrico Tröger <enrico.troeger(a)uvena.de> Date: Sat, 17 Feb 2024 10:24:52 UTC Commit: 146abc696b2d40ba6178328df4184794e40ce106
https://github.com/geany/geany-plugins/commit/146abc696b2d40ba6178328df4184…
Log Message: ----------- Add more custom macro definitions for recent cppcheck versions Modified Paths: -------------- build/cppcheck-geany-plugins.cfg Modified: build/cppcheck-geany-plugins.cfg 6 lines changed, 6 insertions(+), 0 deletions(-) =================================================================== @@ -1,5 +1,11 @@ <?xml version="1.0"?> <def format="2"> + <!-- Geany-Plugins macros --> + <define name="PLUGIN" value=""foo""/> + <!-- GLib macros --> + <define name="G_GSSIZE_FORMAT" value=""li""/> + <define name="G_GINT64_MODIFIER" value=""l""/> + <define name="G_DIR_SEPARATOR_S" value=""/""/> <define name="G_DEFINE_TYPE(TN, t_n, T_P)" value=""/> <define name="G_DEFINE_BOXED_TYPE(TypeName,type_name,copy_func,free_func)" value=""/> </def> -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] fa2975: Add missing sign for cppcheck --template argument
by Lex Trotman
03 Mar '24
03 Mar '24
Branch: refs/heads/master Author: Lex Trotman <elextr(a)gmail.com> Committer: Enrico Tröger <enrico.troeger(a)uvena.de> Date: Tue, 13 Feb 2024 22:25:40 UTC Commit: fa2975229932c9b4eadbf0c7a249d4d8d541cdbb
https://github.com/geany/geany-plugins/commit/fa2975229932c9b4eadbf0c7a249d…
Log Message: ----------- Add missing sign for cppcheck --template argument Closes #1304. Modified Paths: -------------- build/cppcheck.mk Modified: build/cppcheck.mk 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -3,7 +3,7 @@ if HAVE_CPPCHECK check-cppcheck: $(srcdir) $(CPPCHECK) \ - -q --template gcc --error-exitcode=2 \ + -q --template=gcc --error-exitcode=2 \ --library=$(top_srcdir)/build/cppcheck-geany-plugins.cfg \ -I$(GEANY_INCLUDEDIR)/geany \ $(AM_CPPCHECKFLAGS) $(CPPCHECKFLAGS) \ -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] c8da14: Merge pull request #1309 from eht16/issue1304_fix_cppcheck_argument_syntax
by Enrico Tröger
03 Mar '24
03 Mar '24
Branch: refs/heads/master Author: Enrico Tröger <enrico.troeger(a)uvena.de> Committer: GitHub <noreply(a)github.com> Date: Sun, 03 Mar 2024 13:36:48 UTC Commit: c8da14ac4dda4c911fb109eb95e25eccfe270308
https://github.com/geany/geany-plugins/commit/c8da14ac4dda4c911fb109eb95e25…
Log Message: ----------- Merge pull request #1309 from eht16/issue1304_fix_cppcheck_argument_syntax Add missing sign for cppcheck --template argument Modified Paths: -------------- build/cppcheck-geany-plugins.cfg build/cppcheck.mk Modified: build/cppcheck-geany-plugins.cfg 6 lines changed, 6 insertions(+), 0 deletions(-) =================================================================== @@ -1,5 +1,11 @@ <?xml version="1.0"?> <def format="2"> + <!-- Geany-Plugins macros --> + <define name="PLUGIN" value=""foo""/> + <!-- GLib macros --> + <define name="G_GSSIZE_FORMAT" value=""li""/> + <define name="G_GINT64_MODIFIER" value=""l""/> + <define name="G_DIR_SEPARATOR_S" value=""/""/> <define name="G_DEFINE_TYPE(TN, t_n, T_P)" value=""/> <define name="G_DEFINE_BOXED_TYPE(TypeName,type_name,copy_func,free_func)" value=""/> </def> Modified: build/cppcheck.mk 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -3,7 +3,7 @@ if HAVE_CPPCHECK check-cppcheck: $(srcdir) $(CPPCHECK) \ - -q --template gcc --error-exitcode=2 \ + -q --template=gcc --error-exitcode=2 \ --library=$(top_srcdir)/build/cppcheck-geany-plugins.cfg \ -I$(GEANY_INCLUDEDIR)/geany \ $(AM_CPPCHECKFLAGS) $(CPPCHECKFLAGS) \ -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] 74637c: Add dependabot.yml for Github Actions updates
by Enrico Tröger
12 Feb '24
12 Feb '24
Branch: refs/heads/master Author: Enrico Tröger <enrico.troeger(a)uvena.de> Committer: Enrico Tröger <enrico.troeger(a)uvena.de> Date: Mon, 12 Feb 2024 22:53:07 UTC Commit: 74637c1407fdcfdee12fdb9bfe05a9073e440f9c
https://github.com/geany/geany-plugins/commit/74637c1407fdcfdee12fdb9bfe05a…
Log Message: ----------- Add dependabot.yml for Github Actions updates And save it some work and update Actions to latest versions. Modified Paths: -------------- .github/dependabot.yml .github/workflows/build.yml Modified: .github/dependabot.yml 10 lines changed, 10 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,10 @@ +version: 2 +# Before applying suggested PRs, make sure that the new versions of any +# updated actions are allowed in +#
https://github.com/organizations/geany/settings/actions
+# Versions are pinned and restricted for security reasons. +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" Modified: .github/workflows/build.yml 20 lines changed, 10 insertions(+), 10 deletions(-) =================================================================== @@ -44,10 +44,10 @@ jobs: steps: - name: Checkout Geany-Plugins - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Checkout Geany - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: geany/geany path: ${{ env.GEANY_SOURCE_PATH }} @@ -62,7 +62,7 @@ jobs: run: echo "timestamp=$(date +%Y-%m-%d-%H-%M)" >> $GITHUB_OUTPUT - name: Configure ccache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ env.CCACHE_DIR }} key: ${{ runner.os }}-${{ github.job }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }} @@ -75,7 +75,7 @@ jobs: - name: Configure Geany Cache id: geany_cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ env.GEANY_CACHE_PATH }} key: ${{ runner.os }}-${{ github.job }}-geany-cache-${{ steps.prepare_geany_cache_key.outputs.commit_hash }} @@ -181,17 +181,17 @@ jobs: steps: - name: Checkout Geany-Plugins - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Checkout Geany - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: geany/geany path: ${{ env.GEANY_SOURCE_PATH }} token: ${{ github.token }} - name: Checkout Build Scripts - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: master repository: geany/infrastructure @@ -218,7 +218,7 @@ jobs: - name: Configure Geany Cache id: geany_cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ env.GEANY_CACHE_PATH }} key: ${{ runner.os }}-${{ github.job }}-geany-mingw64-cache-${{ steps.prepare_geany_cache_key.outputs.commit_hash }} @@ -229,7 +229,7 @@ jobs: env | sort - name: Log in to the Container registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ${{ env.DOCKER_REGISTRY }} username: ${{ github.actor }} @@ -272,7 +272,7 @@ jobs: bash start_build.sh --log-to-stdout --mingw64 --geany-plugins --geany-plugins-source "${{ github.workspace }}" - name: Archive Geany-Plugins Installer - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: geany-plugins-installer-ci-${{ env.SHORT_SHA }}-pr${{ env.GITHUB_PULL_REQUEST_OR_REF }} retention-days: 30 -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] a8c8ca: avoid parsing opened files when loading project #1289
by Jan Dolinar
15 Nov '23
15 Nov '23
Branch: refs/heads/master Author: Jan Dolinar <jan.dolinar(a)firma.seznam.cz> Committer: Jan Dolinar <jan.dolinar(a)firma.seznam.cz> Date: Tue, 14 Nov 2023 18:20:57 UTC Commit: a8c8ca2a83672291136117fbab53ed0ceae23776
https://github.com/geany/geany-plugins/commit/a8c8ca2a83672291136117fbab53e…
Log Message: ----------- avoid parsing opened files when loading project #1289 Modified Paths: -------------- projectorganizer/src/prjorg-project.c Modified: projectorganizer/src/prjorg-project.c 58 lines changed, 53 insertions(+), 5 deletions(-) =================================================================== @@ -282,7 +282,9 @@ static void regenerate_tags(PrjOrgRoot *root, gpointer user_data) gpointer key, value; GPtrArray *source_files; GHashTable *file_table; + const gchar **session_files; + session_files = (const gchar **) user_data; source_files = g_ptr_array_new(); file_table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GFreeFunc)tm_source_file_free); g_hash_table_iter_init(&iter, root->file_table); @@ -292,10 +294,11 @@ static void regenerate_tags(PrjOrgRoot *root, gpointer user_data) gchar *utf8_path = key; gchar *locale_path = utils_get_locale_from_utf8(utf8_path); gchar *basename = g_path_get_basename(locale_path); + gboolean will_open = session_files && g_strv_contains(session_files, utf8_path); if (g_strcmp0(PROJORG_DIR_ENTRY, basename) != 0) sf = tm_source_file_new(locale_path, filetypes_detect(utf8_path)->name); - if (sf && !document_find_by_filename(utf8_path) ) + if (sf && !will_open && !document_find_by_filename(utf8_path)) g_ptr_array_add(source_files, sf); g_hash_table_insert(file_table, g_strdup(utf8_path), sf); @@ -310,7 +313,7 @@ static void regenerate_tags(PrjOrgRoot *root, gpointer user_data) } -void prjorg_project_rescan(void) +void rescan_project(gchar **session_files) { GSList *elem; gint filenum = 0; @@ -325,10 +328,14 @@ void prjorg_project_rescan(void) filenum += prjorg_project_rescan_root(elem->data); if (prj_org->generate_tag_prefs == PrjOrgTagYes || (prj_org->generate_tag_prefs == PrjOrgTagAuto && filenum < 1000)) - g_slist_foreach(prj_org->roots, (GFunc)regenerate_tags, NULL); + g_slist_foreach(prj_org->roots, (GFunc)regenerate_tags, session_files); } +void prjorg_project_rescan() { + rescan_project(NULL); +} + static PrjOrgRoot *create_root(const gchar *utf8_base_dir) { PrjOrgRoot *root = (PrjOrgRoot *) g_new0(PrjOrgRoot, 1); @@ -343,6 +350,7 @@ static void update_project( gchar **header_patterns, gchar **ignored_dirs_patterns, gchar **ignored_file_patterns, + gchar **session_files, PrjOrgTagPrefs generate_tag_prefs, gboolean show_empty_dirs) { @@ -374,7 +382,7 @@ static void update_project( prj_org->roots = g_slist_prepend(prj_org->roots, create_root(utf8_base_path)); g_free(utf8_base_path); - prjorg_project_rescan(); + rescan_project(session_files); } @@ -497,13 +505,49 @@ gchar **prjorg_project_load_expanded_paths(GKeyFile * key_file) } +static gchar **get_session_files(GKeyFile *config) +{ + guint i; + gboolean have_session_files; + gchar entry[16]; + gchar **tmp_array; + GError *error = NULL; + GPtrArray *files; + gchar *unescaped_filename; + + files = g_ptr_array_new(); + have_session_files = TRUE; + i = 0; + while (have_session_files) + { + g_snprintf(entry, sizeof(entry), "FILE_NAME_%d", i); + tmp_array = g_key_file_get_string_list(config, "files", entry, NULL, &error); + if (! tmp_array || error) + { + g_error_free(error); + error = NULL; + have_session_files = FALSE; + } else { + unescaped_filename = g_uri_unescape_string(tmp_array[7], NULL); + g_ptr_array_add(files, g_strdup(unescaped_filename)); + g_free(unescaped_filename); + } + i++; + } + g_ptr_array_add(files, NULL); + + return (gchar **) g_ptr_array_free(files, FALSE); +} + + 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; gboolean show_empty_dirs; GSList *elem = NULL, *ext_list = NULL; gchar *utf8_base_path; + gchar **session_files; if (prj_org != NULL) prjorg_project_close(); @@ -532,6 +576,8 @@ void prjorg_project_open(GKeyFile * key_file) generate_tag_prefs = utils_get_setting_integer(key_file, "prjorg", "generate_tag_prefs", PrjOrgTagAuto); show_empty_dirs = utils_get_setting_boolean(key_file, "prjorg", "show_empty_dirs", TRUE); + /* we need to know which files will be opened and parsed by Geany, to avoid parsing them twice */ + session_files = get_session_files(key_file); external_dirs = g_key_file_get_string_list(key_file, "prjorg", "external_dirs", NULL, NULL); foreach_strv (dir_ptr, external_dirs) ext_list = g_slist_prepend(ext_list, *dir_ptr); @@ -555,6 +601,7 @@ void prjorg_project_open(GKeyFile * key_file) header_patterns, ignored_dirs_patterns, ignored_file_patterns, + session_files, generate_tag_prefs, show_empty_dirs); @@ -563,6 +610,7 @@ void prjorg_project_open(GKeyFile * key_file) g_strfreev(ignored_dirs_patterns); g_strfreev(ignored_file_patterns); g_strfreev(external_dirs); + g_strfreev(session_files); } @@ -594,7 +642,7 @@ void prjorg_project_read_properties_tab(void) ignored_file_patterns = split_patterns(gtk_entry_get_text(GTK_ENTRY(e->ignored_file_patterns))); update_project( - source_patterns, header_patterns, ignored_dirs_patterns, ignored_file_patterns, + source_patterns, header_patterns, ignored_dirs_patterns, ignored_file_patterns, NULL, gtk_combo_box_get_active(GTK_COMBO_BOX(e->generate_tag_prefs)), gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(e->show_empty_dirs))); -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] 6227d2: Merge pull request #1290 from dolik-rce/prjorg-do-not-parse-open-files
by Jiřà Techet
15 Nov '23
15 Nov '23
Branch: refs/heads/master Author: Jiřà Techet <techet(a)gmail.com> Committer: GitHub <noreply(a)github.com> Date: Wed, 15 Nov 2023 20:19:38 UTC Commit: 6227d2bebb980b908261f4c9bc470d2de011351c
https://github.com/geany/geany-plugins/commit/6227d2bebb980b908261f4c9bc470…
Log Message: ----------- Merge pull request #1290 from dolik-rce/prjorg-do-not-parse-open-files avoid parsing opened files when loading project #1289 Modified Paths: -------------- projectorganizer/src/prjorg-project.c Modified: projectorganizer/src/prjorg-project.c 58 lines changed, 53 insertions(+), 5 deletions(-) =================================================================== @@ -282,7 +282,9 @@ static void regenerate_tags(PrjOrgRoot *root, gpointer user_data) gpointer key, value; GPtrArray *source_files; GHashTable *file_table; + const gchar **session_files; + session_files = (const gchar **) user_data; source_files = g_ptr_array_new(); file_table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GFreeFunc)tm_source_file_free); g_hash_table_iter_init(&iter, root->file_table); @@ -292,10 +294,11 @@ static void regenerate_tags(PrjOrgRoot *root, gpointer user_data) gchar *utf8_path = key; gchar *locale_path = utils_get_locale_from_utf8(utf8_path); gchar *basename = g_path_get_basename(locale_path); + gboolean will_open = session_files && g_strv_contains(session_files, utf8_path); if (g_strcmp0(PROJORG_DIR_ENTRY, basename) != 0) sf = tm_source_file_new(locale_path, filetypes_detect(utf8_path)->name); - if (sf && !document_find_by_filename(utf8_path) ) + if (sf && !will_open && !document_find_by_filename(utf8_path)) g_ptr_array_add(source_files, sf); g_hash_table_insert(file_table, g_strdup(utf8_path), sf); @@ -310,7 +313,7 @@ static void regenerate_tags(PrjOrgRoot *root, gpointer user_data) } -void prjorg_project_rescan(void) +void rescan_project(gchar **session_files) { GSList *elem; gint filenum = 0; @@ -325,10 +328,14 @@ void prjorg_project_rescan(void) filenum += prjorg_project_rescan_root(elem->data); if (prj_org->generate_tag_prefs == PrjOrgTagYes || (prj_org->generate_tag_prefs == PrjOrgTagAuto && filenum < 1000)) - g_slist_foreach(prj_org->roots, (GFunc)regenerate_tags, NULL); + g_slist_foreach(prj_org->roots, (GFunc)regenerate_tags, session_files); } +void prjorg_project_rescan() { + rescan_project(NULL); +} + static PrjOrgRoot *create_root(const gchar *utf8_base_dir) { PrjOrgRoot *root = (PrjOrgRoot *) g_new0(PrjOrgRoot, 1); @@ -343,6 +350,7 @@ static void update_project( gchar **header_patterns, gchar **ignored_dirs_patterns, gchar **ignored_file_patterns, + gchar **session_files, PrjOrgTagPrefs generate_tag_prefs, gboolean show_empty_dirs) { @@ -374,7 +382,7 @@ static void update_project( prj_org->roots = g_slist_prepend(prj_org->roots, create_root(utf8_base_path)); g_free(utf8_base_path); - prjorg_project_rescan(); + rescan_project(session_files); } @@ -497,13 +505,49 @@ gchar **prjorg_project_load_expanded_paths(GKeyFile * key_file) } +static gchar **get_session_files(GKeyFile *config) +{ + guint i; + gboolean have_session_files; + gchar entry[16]; + gchar **tmp_array; + GError *error = NULL; + GPtrArray *files; + gchar *unescaped_filename; + + files = g_ptr_array_new(); + have_session_files = TRUE; + i = 0; + while (have_session_files) + { + g_snprintf(entry, sizeof(entry), "FILE_NAME_%d", i); + tmp_array = g_key_file_get_string_list(config, "files", entry, NULL, &error); + if (! tmp_array || error) + { + g_error_free(error); + error = NULL; + have_session_files = FALSE; + } else { + unescaped_filename = g_uri_unescape_string(tmp_array[7], NULL); + g_ptr_array_add(files, g_strdup(unescaped_filename)); + g_free(unescaped_filename); + } + i++; + } + g_ptr_array_add(files, NULL); + + return (gchar **) g_ptr_array_free(files, FALSE); +} + + 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; gboolean show_empty_dirs; GSList *elem = NULL, *ext_list = NULL; gchar *utf8_base_path; + gchar **session_files; if (prj_org != NULL) prjorg_project_close(); @@ -532,6 +576,8 @@ void prjorg_project_open(GKeyFile * key_file) generate_tag_prefs = utils_get_setting_integer(key_file, "prjorg", "generate_tag_prefs", PrjOrgTagAuto); show_empty_dirs = utils_get_setting_boolean(key_file, "prjorg", "show_empty_dirs", TRUE); + /* we need to know which files will be opened and parsed by Geany, to avoid parsing them twice */ + session_files = get_session_files(key_file); external_dirs = g_key_file_get_string_list(key_file, "prjorg", "external_dirs", NULL, NULL); foreach_strv (dir_ptr, external_dirs) ext_list = g_slist_prepend(ext_list, *dir_ptr); @@ -555,6 +601,7 @@ void prjorg_project_open(GKeyFile * key_file) header_patterns, ignored_dirs_patterns, ignored_file_patterns, + session_files, generate_tag_prefs, show_empty_dirs); @@ -563,6 +610,7 @@ void prjorg_project_open(GKeyFile * key_file) g_strfreev(ignored_dirs_patterns); g_strfreev(ignored_file_patterns); g_strfreev(external_dirs); + g_strfreev(session_files); } @@ -594,7 +642,7 @@ void prjorg_project_read_properties_tab(void) ignored_file_patterns = split_patterns(gtk_entry_get_text(GTK_ENTRY(e->ignored_file_patterns))); update_project( - source_patterns, header_patterns, ignored_dirs_patterns, ignored_file_patterns, + source_patterns, header_patterns, ignored_dirs_patterns, ignored_file_patterns, NULL, gtk_combo_box_get_active(GTK_COMBO_BOX(e->generate_tag_prefs)), gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(e->show_empty_dirs))); -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
← Newer
1
...
10
11
12
13
14
15
16
...
547
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
Results per page:
10
25
50
100
200