From 8d80688c9a8503b0ad8f464be0390691dfe2d47d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Techet?= <techet@gmail.com>
Date: Tue, 5 Mar 2024 18:36:37 +0100
Subject: [PATCH 1/4] projectorganizer: fix invalid string comparison

---
 projectorganizer/src/prjorg-sidebar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/projectorganizer/src/prjorg-sidebar.c b/projectorganizer/src/prjorg-sidebar.c
index b6422f09d..013947305 100644
--- a/projectorganizer/src/prjorg-sidebar.c
+++ b/projectorganizer/src/prjorg-sidebar.c
@@ -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;

From ec96512db966857596068959f5e39fe82ce8910d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Techet?= <techet@gmail.com>
Date: Tue, 5 Mar 2024 18:37:16 +0100
Subject: [PATCH 2/4] projectorganizer: Add missing includes to header files

Fixes warnings in clangd
---
 projectorganizer/src/prjorg-menu.h    | 2 ++
 projectorganizer/src/prjorg-project.h | 2 ++
 projectorganizer/src/prjorg-sidebar.h | 1 +
 projectorganizer/src/prjorg-utils.h   | 3 +++
 4 files changed, 8 insertions(+)

diff --git a/projectorganizer/src/prjorg-menu.h b/projectorganizer/src/prjorg-menu.h
index c5ae4a060..63f0c31f8 100644
--- a/projectorganizer/src/prjorg-menu.h
+++ b/projectorganizer/src/prjorg-menu.h
@@ -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);
diff --git a/projectorganizer/src/prjorg-project.h b/projectorganizer/src/prjorg-project.h
index 6b6f4a771..edc494d72 100644
--- a/projectorganizer/src/prjorg-project.h
+++ b/projectorganizer/src/prjorg-project.h
@@ -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"
diff --git a/projectorganizer/src/prjorg-sidebar.h b/projectorganizer/src/prjorg-sidebar.h
index e61ff9e70..e5a2fc91c 100644
--- a/projectorganizer/src/prjorg-sidebar.h
+++ b/projectorganizer/src/prjorg-sidebar.h
@@ -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);
diff --git a/projectorganizer/src/prjorg-utils.h b/projectorganizer/src/prjorg-utils.h
index c3719a92c..b753a84f0 100644
--- a/projectorganizer/src/prjorg-utils.h
+++ b/projectorganizer/src/prjorg-utils.h
@@ -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);

From 07f0fdc1ef2ccaf104b5f9591bfcf3a56f035c4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Techet?= <techet@gmail.com>
Date: Tue, 5 Mar 2024 18:40:10 +0100
Subject: [PATCH 3/4] projectorganizer: fix various warnings

---
 projectorganizer/src/prjorg-sidebar.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/projectorganizer/src/prjorg-sidebar.c b/projectorganizer/src/prjorg-sidebar.c
index 013947305..e67cce2a5 100644
--- a/projectorganizer/src/prjorg-sidebar.c
+++ b/projectorganizer/src/prjorg-sidebar.c
@@ -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);
@@ -1562,7 +1563,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 +1588,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();
 

From 00f0f07c40c72a024b7623197248ab6daca3242f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Techet?= <techet@gmail.com>
Date: Tue, 5 Mar 2024 22:42:46 +0100
Subject: [PATCH 4/4] projectorganizer: eliminate some depreciation warnings

---
 projectorganizer/src/prjorg-project.c | 77 +++++++++++++++++----------
 projectorganizer/src/prjorg-sidebar.c | 39 +++++++-------
 2 files changed, 68 insertions(+), 48 deletions(-)

diff --git a/projectorganizer/src/prjorg-project.c b/projectorganizer/src/prjorg-project.c
index 63c2a3a1b..2161925bd 100644
--- a/projectorganizer/src/prjorg-project.c
+++ b/projectorganizer/src/prjorg-project.c
@@ -655,23 +655,24 @@ 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. "
@@ -679,59 +680,75 @@ GtkWidget *prjorg_project_add_properties_tab(GtkWidget *notebook)
 	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);
diff --git a/projectorganizer/src/prjorg-sidebar.c b/projectorganizer/src/prjorg-sidebar.c
index e67cce2a5..43b48fcbe 100644
--- a/projectorganizer/src/prjorg-sidebar.c
+++ b/projectorganizer/src/prjorg-sidebar.c
@@ -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);
@@ -727,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();
@@ -739,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();
@@ -755,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 */
 
@@ -1086,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;
 	}
 
@@ -1208,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);
 		}
@@ -1655,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 ****/
 
