Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: GitHub noreply@github.com Date: Sun, 17 Mar 2024 21:34:00 UTC Commit: db2698cc869274aef353ba7af23d70921d944166 https://github.com/geany/geany-plugins/commit/db2698cc869274aef353ba7af23d70...
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).
plugins-commits@lists.geany.org