On 19/04/2012 16:43, Matthew Brush wrote:
> An explanation would be useful.
> 
> For MultiTerm, presumably it's to avoid a clash with 
> GLib.Menu/MenuItem? Is GIO stuff part of the implicit namespace for 
> GLib?

Yes, and yes.


> If the answer to those is yes, it looks fine to apply as is. Even if 
> the answer is no, the patch shouldn't harm anything besides 
> cluttering up the code a little bit.

Attached a new patch with a better commit message.


Please note that the debugger patch is not necessary any more. cppcheck
probably understands this syntax now.

-- 

Quentin "Sardem FF7" Glidic


>From dccc0f8f276907858cda69fde97ff06c1aa874ff Mon Sep 17 00:00:00 2001
From: Quentin Glidic <sardemff7+...@sardemff7.net>
Date: Sun, 8 Apr 2012 16:16:58 +0200
Subject: [PATCH] multiterm: Fix compatibility with newer Vala

GLib.Menu was introduced in GLib/GIO 2.32 (Vala 0.16)
We explicit Gtk namespacee here to avoid collision
---
 multiterm/src/context-menu.vala |   26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/multiterm/src/context-menu.vala b/multiterm/src/context-menu.vala
index d51331f..be6275c 100644
--- a/multiterm/src/context-menu.vala
+++ b/multiterm/src/context-menu.vala
@@ -2,7 +2,7 @@ using Gtk;
 
 namespace MultiTerm
 {
-	public class ContextMenu : Menu
+	public class ContextMenu : Gtk.Menu
 	{
 		public signal void new_shell_activate(ShellConfig sh);
 		public signal void new_window_activate();
@@ -19,12 +19,12 @@ namespace MultiTerm
 			show_tabs_activate(item.active);
 		}
 
-		private void on_next_previous_tab_activate(MenuItem item, bool next)
+		private void on_next_previous_tab_activate(Gtk.MenuItem item, bool next)
 		{
 			item.sensitive = next ? next_tab_activate() : previous_tab_activate();
 		}
 
-		private void on_move_to_location(MenuItem item)
+		private void on_move_to_location(Gtk.MenuItem item)
 		{
 			if (item.get_data<bool>("location_is_msgwin"))
 			{
@@ -49,15 +49,15 @@ namespace MultiTerm
 
 		public ContextMenu(Config? cfg)
 		{
-			Menu menu;
-			MenuItem item;
+			Gtk.Menu menu;
+			Gtk.MenuItem item;
 			ImageMenuItem image_item;
 			CheckMenuItem check_item;
 
-			menu = new Menu();
+			menu = new Gtk.Menu();
 			menu.show();
 
-			item = new MenuItem.with_label("Open Tab");
+			item = new Gtk.MenuItem.with_label("Open Tab");
 			item.set_submenu(menu);
 			item.show();
 			this.append(item);
@@ -66,25 +66,25 @@ namespace MultiTerm
 			for (uint i = 0; i < len; i++)
 			{
 				ShellConfig sh = cfg.shell_configs.nth_data(i);
-				item = new MenuItem.with_label(sh.name);
+				item = new Gtk.MenuItem.with_label(sh.name);
 				item.activate.connect(() => new_shell_activate(sh));
 				menu.append(item);
 				item.show();
 			}
 
-			item = new MenuItem.with_label("Open Window");
+			item = new Gtk.MenuItem.with_label("Open Window");
 			item.activate.connect(() => new_window_activate());
 			this.append(item);
 			item.show();
 
 			add_separator();
 
-			item = new MenuItem.with_label("Next tab");
+			item = new Gtk.MenuItem.with_label("Next tab");
 			item.activate.connect(() => on_next_previous_tab_activate(item, true));
 			//this.append(item);
 			//item.show();
 
-			item = new MenuItem.with_label("Previous tab");
+			item = new Gtk.MenuItem.with_label("Previous tab");
 			item.activate.connect(() => on_next_previous_tab_activate(item, false));
 			//this.append(item);
 			//item.show();
@@ -111,12 +111,12 @@ namespace MultiTerm
 
 			if (cfg.location == "msgwin")
 			{
-				item = new MenuItem.with_label("Move to sidebar");
+				item = new Gtk.MenuItem.with_label("Move to sidebar");
 				item.set_data<bool>("location_is_msgwin", true);
 			}
 			else
 			{
-				item = new MenuItem.with_label("Move to message window");
+				item = new Gtk.MenuItem.with_label("Move to message window");
 				item.set_data<bool>("location_is_msgwin", false);
 			}
 			item.activate.connect(() => on_move_to_location(item));
-- 
1.7.9.6

_______________________________________________
Geany-devel mailing list
Geany-devel@uvena.de
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel

Reply via email to