[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 303/473: Fix undefined behavior in slot parameter counts.

noreply at xfce.org noreply at xfce.org
Mon Feb 16 23:57:53 CET 2015


This is an automated email from the git hooks/post-receive script.

gottcode pushed a commit to branch master
in repository panel-plugins/xfce4-whiskermenu-plugin.

commit 443d4ab50ae475f750f8d985902d16b5cf3bcd98
Author: Graeme Gott <graeme at gottcode.org>
Date:   Sat Dec 14 14:40:49 2013 -0500

    Fix undefined behavior in slot parameter counts.
---
 panel-plugin/applications-page.cpp    |    2 +-
 panel-plugin/command-edit.cpp         |    6 +-
 panel-plugin/command.cpp              |    4 +-
 panel-plugin/configuration-dialog.cpp |    2 +-
 panel-plugin/favorites-page.cpp       |    4 +-
 panel-plugin/page.cpp                 |    8 +-
 panel-plugin/plugin.cpp               |    8 +-
 panel-plugin/recent-page.cpp          |    2 +-
 panel-plugin/slot.h                   |  187 ++++++++++++++++++++++++++++++++-
 panel-plugin/window.cpp               |   12 +--
 10 files changed, 210 insertions(+), 25 deletions(-)

diff --git a/panel-plugin/applications-page.cpp b/panel-plugin/applications-page.cpp
index 27503eb..f25ab7e 100644
--- a/panel-plugin/applications-page.cpp
+++ b/panel-plugin/applications-page.cpp
@@ -333,7 +333,7 @@ void ApplicationsPage::load_menu(GarconMenu* menu, Category* parent_category)
 	}
 
 	// Listen for menu changes
-	g_signal_connect_slot(menu, "directory-changed", &ApplicationsPage::invalidate_applications, this);
+	g_signal_connect_slot<GObject*,GObject*>(menu, "directory-changed", &ApplicationsPage::invalidate_applications, this);
 }
 
 //-----------------------------------------------------------------------------
diff --git a/panel-plugin/command-edit.cpp b/panel-plugin/command-edit.cpp
index 414deb3..fbfb94c 100644
--- a/panel-plugin/command-edit.cpp
+++ b/panel-plugin/command-edit.cpp
@@ -35,12 +35,12 @@ CommandEdit::CommandEdit(Command* command, GtkSizeGroup* label_size_group) :
 	gtk_toggle_button_set_active(m_shown, m_command->get_shown());
 	gtk_box_pack_start(GTK_BOX(m_widget), GTK_WIDGET(m_shown), false, false, 0);
 	gtk_size_group_add_widget(label_size_group, GTK_WIDGET(m_shown));
-	g_signal_connect_slot(m_shown, "toggled", &CommandEdit::shown_toggled, this);
+	g_signal_connect_slot<GtkToggleButton*>(m_shown, "toggled", &CommandEdit::shown_toggled, this);
 
 	m_entry = GTK_ENTRY(gtk_entry_new());
 	gtk_entry_set_text(m_entry, m_command->get());
 	gtk_box_pack_start(GTK_BOX(m_widget), GTK_WIDGET(m_entry), true, true, 0);
-	g_signal_connect_slot(m_entry, "changed", &CommandEdit::command_changed, this);
+	g_signal_connect_slot<GtkEditable*>(m_entry, "changed", &CommandEdit::command_changed, this);
 
 	m_browse_button = gtk_button_new();
 	gtk_widget_set_tooltip_text(m_browse_button, _("Browse the file system to choose a custom command."));
@@ -50,7 +50,7 @@ CommandEdit::CommandEdit(Command* command, GtkSizeGroup* label_size_group) :
 	GtkWidget* image = gtk_image_new_from_stock(GTK_STOCK_OPEN, GTK_ICON_SIZE_BUTTON);
 	gtk_container_add(GTK_CONTAINER(m_browse_button), image);
 	gtk_widget_show(image);
-	g_signal_connect_slot(m_browse_button, "clicked", &CommandEdit::browse_clicked, this);
+	g_signal_connect_slot<GtkButton*>(m_browse_button, "clicked", &CommandEdit::browse_clicked, this);
 }
 
 //-----------------------------------------------------------------------------
diff --git a/panel-plugin/command.cpp b/panel-plugin/command.cpp
index 4ee246b..1d686ee 100644
--- a/panel-plugin/command.cpp
+++ b/panel-plugin/command.cpp
@@ -92,7 +92,7 @@ GtkWidget* Command::get_button()
 	m_button = gtk_button_new();
 	gtk_button_set_relief(GTK_BUTTON(m_button), GTK_RELIEF_NONE);
 	gtk_widget_set_tooltip_text(m_button, tooltip.c_str());
-	g_signal_connect_slot(m_button, "clicked", &Command::activated, this);
+	g_signal_connect_slot<GtkButton*>(m_button, "clicked", &Command::activated, this);
 
 	GtkWidget* image = gtk_image_new_from_icon_name(m_icon, GTK_ICON_SIZE_LARGE_TOOLBAR);
 	gtk_container_add(GTK_CONTAINER(m_button), GTK_WIDGET(image));
@@ -117,7 +117,7 @@ GtkWidget* Command::get_menuitem()
 	m_menuitem = gtk_image_menu_item_new_with_mnemonic(m_text);
 	GtkWidget* image = gtk_image_new_from_icon_name(m_icon, GTK_ICON_SIZE_MENU);
 	gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(m_menuitem), image);
-	g_signal_connect_slot(m_menuitem, "activate", &Command::activated, this);
+	g_signal_connect_slot<GtkMenuItem*>(m_menuitem, "activate", &Command::activated, this);
 
 	gtk_widget_set_visible(m_menuitem, m_shown);
 	gtk_widget_set_sensitive(m_menuitem, m_status == WHISKERMENU_COMMAND_VALID);
diff --git a/panel-plugin/configuration-dialog.cpp b/panel-plugin/configuration-dialog.cpp
index a4fa259..3edf4f9 100644
--- a/panel-plugin/configuration-dialog.cpp
+++ b/panel-plugin/configuration-dialog.cpp
@@ -492,7 +492,7 @@ GtkWidget* ConfigurationDialog::init_appearance_tab()
 	m_icon_button = gtk_button_new();
 	gtk_box_pack_start(hbox, m_icon_button, false, false, 0);
 	gtk_label_set_mnemonic_widget(GTK_LABEL(label), m_icon_button);
-	g_signal_connect_slot(m_icon_button, "clicked", &ConfigurationDialog::choose_icon, this);
+	g_signal_connect_slot<GtkButton*>(m_icon_button, "clicked", &ConfigurationDialog::choose_icon, this);
 
 	m_icon = xfce_panel_image_new_from_source(m_plugin->get_button_icon_name().c_str());
 	xfce_panel_image_set_size(XFCE_PANEL_IMAGE(m_icon), 48);
diff --git a/panel-plugin/favorites-page.cpp b/panel-plugin/favorites-page.cpp
index b72e5fc..d5cdbd8 100644
--- a/panel-plugin/favorites-page.cpp
+++ b/panel-plugin/favorites-page.cpp
@@ -67,13 +67,13 @@ void FavoritesPage::extend_context_menu(GtkWidget* menu)
 	menuitem = gtk_image_menu_item_new_with_label(_("Sort Alphabetically A-Z"));
 	GtkWidget* image = gtk_image_new_from_stock(GTK_STOCK_SORT_ASCENDING, GTK_ICON_SIZE_MENU);
 	gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), image);
-	g_signal_connect_slot(menuitem, "activate", &FavoritesPage::sort_ascending, this);
+	g_signal_connect_slot<GtkMenuItem*>(menuitem, "activate", &FavoritesPage::sort_ascending, this);
 	gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
 
 	menuitem = gtk_image_menu_item_new_with_label(_("Sort Alphabetically Z-A"));
 	image = gtk_image_new_from_stock(GTK_STOCK_SORT_DESCENDING, GTK_ICON_SIZE_MENU);
 	gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), image);
-	g_signal_connect_slot(menuitem, "activate", &FavoritesPage::sort_descending, this);
+	g_signal_connect_slot<GtkMenuItem*>(menuitem, "activate", &FavoritesPage::sort_descending, this);
 	gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
 }
 
diff --git a/panel-plugin/page.cpp b/panel-plugin/page.cpp
index 1a83c18..ff35a3d 100644
--- a/panel-plugin/page.cpp
+++ b/panel-plugin/page.cpp
@@ -195,7 +195,7 @@ void Page::create_context_menu(GtkTreeIter* iter, GdkEventButton* event)
 		menuitem = gtk_image_menu_item_new_with_label(_("Add to Favorites"));
 		GtkWidget* image = gtk_image_new_from_icon_name("stock_add-bookmark", GTK_ICON_SIZE_MENU);
 		gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), image);
-		g_signal_connect_slot(menuitem, "activate", &Page::add_selected_to_favorites, this);
+		g_signal_connect_slot<GtkMenuItem*>(menuitem, "activate", &Page::add_selected_to_favorites, this);
 		gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
 	}
 	else
@@ -203,16 +203,16 @@ void Page::create_context_menu(GtkTreeIter* iter, GdkEventButton* event)
 		menuitem = gtk_image_menu_item_new_with_label(_("Remove From Favorites"));
 		GtkWidget* image = gtk_image_new_from_stock(GTK_STOCK_REMOVE, GTK_ICON_SIZE_MENU);
 		gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), image);
-		g_signal_connect_slot(menuitem, "activate", &Page::remove_selected_from_favorites, this);
+		g_signal_connect_slot<GtkMenuItem*>(menuitem, "activate", &Page::remove_selected_from_favorites, this);
 		gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
 	}
 
 	menuitem = gtk_menu_item_new_with_label(_("Add to Desktop"));
-	g_signal_connect_slot(menuitem, "activate", &Page::add_selected_to_desktop, this);
+	g_signal_connect_slot<GtkMenuItem*>(menuitem, "activate", &Page::add_selected_to_desktop, this);
 	gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
 
 	menuitem = gtk_menu_item_new_with_label(_("Add to Panel"));
-	g_signal_connect_slot(menuitem, "activate", &Page::add_selected_to_panel, this);
+	g_signal_connect_slot<GtkMenuItem*>(menuitem, "activate", &Page::add_selected_to_panel, this);
 	gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
 
 	extend_context_menu(menu);
diff --git a/panel-plugin/plugin.cpp b/panel-plugin/plugin.cpp
index 6008fc5..0bab215 100644
--- a/panel-plugin/plugin.cpp
+++ b/panel-plugin/plugin.cpp
@@ -72,7 +72,7 @@ Plugin::Plugin(XfcePanelPlugin* plugin) :
 
 	// Create menu window
 	m_window = new Window;
-	g_signal_connect_slot(m_window->get_widget(), "unmap", &Plugin::menu_hidden, this);
+	g_signal_connect_slot<GtkWidget*>(m_window->get_widget(), "unmap", &Plugin::menu_hidden, this);
 
 	// Create toggle button
 	m_button = xfce_create_panel_toggle_button();
@@ -105,14 +105,14 @@ Plugin::Plugin(XfcePanelPlugin* plugin) :
 
 	// Connect plugin signals to functions
 	g_signal_connect(plugin, "free-data", G_CALLBACK(whiskermenu_free), this);
-	g_signal_connect_slot(plugin, "configure-plugin", &Plugin::configure, this);
+	g_signal_connect_slot<XfcePanelPlugin*>(plugin, "configure-plugin", &Plugin::configure, this);
 #if (LIBXFCE4PANEL_CHECK_VERSION(4,9,0))
 	g_signal_connect_slot(plugin, "mode-changed", &Plugin::mode_changed, this);
 #else
 	g_signal_connect_slot(plugin, "orientation-changed", &Plugin::orientation_changed, this);
 #endif
 	g_signal_connect_slot(plugin, "remote-event", &Plugin::remote_event, this);
-	g_signal_connect_slot(plugin, "save", &Plugin::save, this);
+	g_signal_connect_slot<XfcePanelPlugin*>(plugin, "save", &Plugin::save, this);
 	g_signal_connect_slot(plugin, "size-changed", &Plugin::size_changed, this);
 
 	xfce_panel_plugin_menu_show_configure(plugin);
@@ -274,7 +274,7 @@ void Plugin::menu_hidden()
 void Plugin::configure()
 {
 	ConfigurationDialog* dialog = new ConfigurationDialog(this);
-	g_signal_connect_slot(dialog->get_widget(), "destroy", &Plugin::save, this);
+	g_signal_connect_slot<GtkObject*>(dialog->get_widget(), "destroy", &Plugin::save, this);
 }
 
 //-----------------------------------------------------------------------------
diff --git a/panel-plugin/recent-page.cpp b/panel-plugin/recent-page.cpp
index a4af3b6..48c6566 100644
--- a/panel-plugin/recent-page.cpp
+++ b/panel-plugin/recent-page.cpp
@@ -88,7 +88,7 @@ void RecentPage::extend_context_menu(GtkWidget* menu)
 	menuitem = gtk_image_menu_item_new_with_label(_("Clear Recently Used"));
 	GtkWidget* image = gtk_image_new_from_stock(GTK_STOCK_CLEAR, GTK_ICON_SIZE_MENU);
 	gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), image);
-	g_signal_connect_slot(menuitem, "activate", &RecentPage::clear_menu, this);
+	g_signal_connect_slot<GtkMenuItem*>(menuitem, "activate", &RecentPage::clear_menu, this);
 	gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
 }
 
diff --git a/panel-plugin/slot.h b/panel-plugin/slot.h
index cdc6203..f678c18 100644
--- a/panel-plugin/slot.h
+++ b/panel-plugin/slot.h
@@ -57,7 +57,7 @@ gulong g_signal_connect_slot(gpointer instance, const gchar* detailed_signal, R(
 			reinterpret_cast<GCallback>(invoke_slot),
 			new Slot(obj, member),
 			destroy_slot,
-			after ? GConnectFlags(G_CONNECT_AFTER | G_CONNECT_SWAPPED) : G_CONNECT_SWAPPED);
+			after ? G_CONNECT_AFTER : GConnectFlags(0));
 }
 
 // Member function with 1 parameter
@@ -97,6 +97,43 @@ gulong g_signal_connect_slot(gpointer instance, const gchar* detailed_signal, R(
 			after ? G_CONNECT_AFTER : GConnectFlags(0));
 }
 
+// Member function with 1 ignored parameter
+template<typename A1, typename T, typename R>
+gulong g_signal_connect_slot(gpointer instance, const gchar* detailed_signal, R(T::*member)(), T* obj, bool after = false)
+{
+	class Slot
+	{
+		T* m_instance;
+		R (T::*m_member)();
+
+	public:
+		Slot(T* instance, R (T::*member)()) :
+			m_instance(instance),
+			m_member(member)
+		{
+		}
+
+		static R invoke(A1, gpointer user_data)
+		{
+			Slot* slot = reinterpret_cast<Slot*>(user_data);
+			return (slot->m_instance->*slot->m_member)();
+		}
+
+		static void destroy(gpointer data, GClosure*)
+		{
+			delete reinterpret_cast<Slot*>(data);
+		}
+	};
+	R (*invoke_slot)(A1,gpointer) = &Slot::invoke;
+	void (*destroy_slot)(gpointer, GClosure*) = &Slot::destroy;
+
+	return g_signal_connect_data(instance, detailed_signal,
+			reinterpret_cast<GCallback>(invoke_slot),
+			new Slot(obj, member),
+			destroy_slot,
+			after ? G_CONNECT_AFTER : GConnectFlags(0));
+}
+
 // Member function with 2 parameters
 template<typename T, typename R, typename A1, typename A2>
 gulong g_signal_connect_slot(gpointer instance, const gchar* detailed_signal, R(T::*member)(A1,A2), T* obj, bool after = false)
@@ -134,6 +171,43 @@ gulong g_signal_connect_slot(gpointer instance, const gchar* detailed_signal, R(
 			after ? G_CONNECT_AFTER : GConnectFlags(0));
 }
 
+// Member function with 2 ignored parameters
+template<typename A1, typename A2, typename T, typename R>
+gulong g_signal_connect_slot(gpointer instance, const gchar* detailed_signal, R(T::*member)(), T* obj, bool after = false)
+{
+	class Slot
+	{
+		T* m_instance;
+		R (T::*m_member)();
+
+	public:
+		Slot(T* instance, R (T::*member)()) :
+			m_instance(instance),
+			m_member(member)
+		{
+		}
+
+		static R invoke(A1, A2, gpointer user_data)
+		{
+			Slot* slot = reinterpret_cast<Slot*>(user_data);
+			return (slot->m_instance->*slot->m_member)();
+		}
+
+		static void destroy(gpointer data, GClosure*)
+		{
+			delete reinterpret_cast<Slot*>(data);
+		}
+	};
+	R (*invoke_slot)(A1,A2,gpointer) = &Slot::invoke;
+	void (*destroy_slot)(gpointer, GClosure*) = &Slot::destroy;
+
+	return g_signal_connect_data(instance, detailed_signal,
+			reinterpret_cast<GCallback>(invoke_slot),
+			new Slot(obj, member),
+			destroy_slot,
+			after ? G_CONNECT_AFTER : GConnectFlags(0));
+}
+
 // Member function with 3 parameters
 template<typename T, typename R, typename A1, typename A2, typename A3>
 gulong g_signal_connect_slot(gpointer instance, const gchar* detailed_signal, R(T::*member)(A1,A2,A3), T* obj, bool after = false)
@@ -171,6 +245,43 @@ gulong g_signal_connect_slot(gpointer instance, const gchar* detailed_signal, R(
 			after ? G_CONNECT_AFTER : GConnectFlags(0));
 }
 
+// Member function with 3 ignored parameters
+template<typename A1, typename A2, typename A3, typename T, typename R>
+gulong g_signal_connect_slot(gpointer instance, const gchar* detailed_signal, R(T::*member)(), T* obj, bool after = false)
+{
+	class Slot
+	{
+		T* m_instance;
+		R (T::*m_member)();
+
+	public:
+		Slot(T* instance, R (T::*member)()) :
+			m_instance(instance),
+			m_member(member)
+		{
+		}
+
+		static R invoke(A1, A2, A3, gpointer user_data)
+		{
+			Slot* slot = reinterpret_cast<Slot*>(user_data);
+			return (slot->m_instance->*slot->m_member)();
+		}
+
+		static void destroy(gpointer data, GClosure*)
+		{
+			delete reinterpret_cast<Slot*>(data);
+		}
+	};
+	R (*invoke_slot)(A1,A2,A3,gpointer) = &Slot::invoke;
+	void (*destroy_slot)(gpointer, GClosure*) = &Slot::destroy;
+
+	return g_signal_connect_data(instance, detailed_signal,
+			reinterpret_cast<GCallback>(invoke_slot),
+			new Slot(obj, member),
+			destroy_slot,
+			after ? G_CONNECT_AFTER : GConnectFlags(0));
+}
+
 // Member function with 4 parameters
 template<typename T, typename R, typename A1, typename A2, typename A3, typename A4>
 gulong g_signal_connect_slot(gpointer instance, const gchar* detailed_signal, R(T::*member)(A1,A2,A3,A4), T* obj, bool after = false)
@@ -208,6 +319,43 @@ gulong g_signal_connect_slot(gpointer instance, const gchar* detailed_signal, R(
 			after ? G_CONNECT_AFTER : GConnectFlags(0));
 }
 
+// Member function with 4 ignored parameters
+template<typename A1, typename A2, typename A3, typename A4, typename T, typename R>
+gulong g_signal_connect_slot(gpointer instance, const gchar* detailed_signal, R(T::*member)(), T* obj, bool after = false)
+{
+	class Slot
+	{
+		T* m_instance;
+		R (T::*m_member)();
+
+	public:
+		Slot(T* instance, R (T::*member)()) :
+			m_instance(instance),
+			m_member(member)
+		{
+		}
+
+		static R invoke(A1, A2, A3, A4, gpointer user_data)
+		{
+			Slot* slot = reinterpret_cast<Slot*>(user_data);
+			return (slot->m_instance->*slot->m_member)();
+		}
+
+		static void destroy(gpointer data, GClosure*)
+		{
+			delete reinterpret_cast<Slot*>(data);
+		}
+	};
+	R (*invoke_slot)(A1,A2,A3,A4,gpointer) = &Slot::invoke;
+	void (*destroy_slot)(gpointer, GClosure*) = &Slot::destroy;
+
+	return g_signal_connect_data(instance, detailed_signal,
+			reinterpret_cast<GCallback>(invoke_slot),
+			new Slot(obj, member),
+			destroy_slot,
+			after ? G_CONNECT_AFTER : GConnectFlags(0));
+}
+
 // Member function with 5 parameters
 template<typename T, typename R, typename A1, typename A2, typename A3, typename A4, typename A5>
 gulong g_signal_connect_slot(gpointer instance, const gchar* detailed_signal, R(T::*member)(A1,A2,A3,A4,A5), T* obj, bool after = false)
@@ -245,6 +393,43 @@ gulong g_signal_connect_slot(gpointer instance, const gchar* detailed_signal, R(
 			after ? G_CONNECT_AFTER : GConnectFlags(0));
 }
 
+// Member function with 5 ignored parameters
+template<typename A1, typename A2, typename A3, typename A4, typename A5, typename T, typename R>
+gulong g_signal_connect_slot(gpointer instance, const gchar* detailed_signal, R(T::*member)(), T* obj, bool after = false)
+{
+	class Slot
+	{
+		T* m_instance;
+		R (T::*m_member)();
+
+	public:
+		Slot(T* instance, R (T::*member)()) :
+			m_instance(instance),
+			m_member(member)
+		{
+		}
+
+		static R invoke(A1, A2, A3, A4, A5, gpointer user_data)
+		{
+			Slot* slot = reinterpret_cast<Slot*>(user_data);
+			return (slot->m_instance->*slot->m_member)();
+		}
+
+		static void destroy(gpointer data, GClosure*)
+		{
+			delete reinterpret_cast<Slot*>(data);
+		}
+	};
+	R (*invoke_slot)(A1,A2,A3,A4,A5,gpointer) = &Slot::invoke;
+	void (*destroy_slot)(gpointer, GClosure*) = &Slot::destroy;
+
+	return g_signal_connect_data(instance, detailed_signal,
+			reinterpret_cast<GCallback>(invoke_slot),
+			new Slot(obj, member),
+			destroy_slot,
+			after ? G_CONNECT_AFTER : GConnectFlags(0));
+}
+
 }
 
 #endif // WHISKERMENU_SLOT_H
diff --git a/panel-plugin/window.cpp b/panel-plugin/window.cpp
index 6632c65..51714fd 100644
--- a/panel-plugin/window.cpp
+++ b/panel-plugin/window.cpp
@@ -109,7 +109,7 @@ Window::Window() :
 	m_commands_button[3] = wm_settings->command[Settings::CommandLogOut]->get_button();
 	for (int i = 0; i < 4; ++i)
 	{
-		g_signal_connect_slot(m_commands_button[i], "clicked", &Window::hide, this);
+		g_signal_connect_slot<GtkButton*>(m_commands_button[i], "clicked", &Window::hide, this);
 	}
 
 	m_resizer = new ResizerWidget(m_window);
@@ -118,20 +118,20 @@ Window::Window() :
 	m_search_entry = GTK_ENTRY(gtk_entry_new());
 	gtk_entry_set_icon_from_stock(m_search_entry, GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_FIND);
 	gtk_entry_set_icon_activatable(m_search_entry, GTK_ENTRY_ICON_SECONDARY, false);
-	g_signal_connect_slot(m_search_entry, "changed", &Window::search, this);
+	g_signal_connect_slot<GtkEditable*>(m_search_entry, "changed", &Window::search, this);
 
 	// Create favorites
 	m_favorites = new FavoritesPage(this);
 
 	m_favorites_button = new SectionButton("user-bookmarks", _("Favorites"));
-	g_signal_connect_slot(m_favorites_button->get_button(), "toggled", &Window::favorites_toggled, this);
+	g_signal_connect_slot<GtkToggleButton*>(m_favorites_button->get_button(), "toggled", &Window::favorites_toggled, this);
 
 	// Create recent
 	m_recent = new RecentPage(this);
 
 	m_recent_button = new SectionButton("document-open-recent", _("Recently Used"));
 	m_recent_button->set_group(m_favorites_button->get_group());
-	g_signal_connect_slot(m_recent_button->get_button(), "toggled", &Window::recent_toggled, this);
+	g_signal_connect_slot<GtkToggleButton*>(m_recent_button->get_button(), "toggled", &Window::recent_toggled, this);
 
 	// Create applications
 	m_applications = new ApplicationsPage(this);
@@ -572,7 +572,7 @@ void Window::set_categories(const std::vector<SectionButton*>& categories)
 	{
 		(*i)->set_group(m_recent_button->get_group());
 		gtk_box_pack_start(m_sidebar_box, GTK_WIDGET((*i)->get_button()), false, false, 0);
-		g_signal_connect_slot((*i)->get_button(), "toggled", &Window::category_toggled, this);
+		g_signal_connect_slot<GtkToggleButton*>((*i)->get_button(), "toggled", &Window::category_toggled, this);
 	}
 	gtk_widget_show_all(GTK_WIDGET(m_sidebar_box));
 
@@ -589,7 +589,7 @@ void Window::set_items()
 
 	// Handle switching to favorites are added
 	GtkTreeModel* favorites_model = m_favorites->get_view()->get_model();
-	g_signal_connect_slot(favorites_model, "row-inserted", &Window::show_favorites, this);
+	g_signal_connect_slot<GtkTreeModel*, GtkTreePath*, GtkTreeIter*>(favorites_model, "row-inserted", &Window::show_favorites, this);
 }
 
 //-----------------------------------------------------------------------------

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list