[gnome-scan] Make gnome-scan compile with vala 0.9.1



commit a7091d279979b355c2b967d9ec649d00c840d5ad
Author: Philipp Sadleder <philipp sadleder de>
Date:   Fri Jun 18 08:10:44 2010 +0200

    Make gnome-scan compile with vala 0.9.1
    
    Fix type inference, use 'unowned' instead of weak, update to new signal syntax (replace += by .connect()).

 lib/gnome-scan-dialog.vala                  |   16 ++++++++--------
 lib/gnome-scan-job.vala                     |    4 ++--
 lib/gnome-scan-option-box.vala              |   12 ++++++------
 lib/gnome-scan-option-page.vala             |   16 ++++++++--------
 lib/gnome-scan-page-orientation-widget.vala |   12 ++++++------
 lib/gnome-scan-scanner-selector.vala        |   10 +++++-----
 src/flegita-option-widgets.vala             |    8 ++++----
 src/flegita-options.vala                    |    4 ++--
 8 files changed, 41 insertions(+), 41 deletions(-)
---
diff --git a/lib/gnome-scan-dialog.vala b/lib/gnome-scan-dialog.vala
index 2334498..17abab2 100644
--- a/lib/gnome-scan-dialog.vala
+++ b/lib/gnome-scan-dialog.vala
@@ -74,7 +74,7 @@ namespace Gnome.Scan {
 			this.icon_name		= "scanner";
 			this.title			= _("Scan");
 			this.window_position= WindowPosition.CENTER;
-			this.delete_event  += this.on_window_delete_event;
+			this.delete_event.connect(this.on_window_delete_event);
 			this.type_hint		= Gdk.WindowTypeHint.DIALOG;
 
 			this.job.notify["scanner"]	+= this.on_scanner_selected;
@@ -134,16 +134,16 @@ namespace Gnome.Scan {
 			container.pack_start(button_box, false, true, 0);
 
 			this.bclose	= this.add_button(button_box, Gtk.STOCK_CLOSE);
-			this.bclose.clicked+= this.on_button_close_clicked;
+			this.bclose.clicked.connect(this.on_button_close_clicked);
 			// TODO: register stock item "scan".
 			this.bscan	= this.add_button(button_box, Gtk.STOCK_APPLY);
-			this.bscan.clicked+= this.on_button_scan_clicked;
+			this.bscan.clicked.connect(this.on_button_scan_clicked);
 			this.bback	= this.add_button(button_box, Gtk.STOCK_EDIT);
-			this.bback.clicked+= this.on_button_back_clicked;
+			this.bback.clicked.connect(this.on_button_back_clicked);
 			this.bcancel = this.add_button(button_box, Gtk.STOCK_CANCEL);
-			this.bcancel.clicked+= this.on_button_cancel_clicked;
+			this.bcancel.clicked.connect(this.on_button_cancel_clicked);
 			this.bnext	= this.add_button(button_box, Gtk.STOCK_GO_FORWARD);
-			this.bnext.clicked+= this.on_button_next_clicked;
+			this.bnext.clicked.connect(this.on_button_next_clicked);
 		}
 
 		private Button add_button(Box button_box, string stock_id)
@@ -190,7 +190,7 @@ namespace Gnome.Scan {
 			var paned = new VPaned();
 			selector = new ScannerSelector(this.job);
 			selector.border_width = 6;
-			selector.probe_done += this.on_probe_done;
+			selector.probe_done.connect(this.on_probe_done);
 			paned.pack1(this.selector, true, false);
 			paned.border_width = 6;
 
@@ -470,7 +470,7 @@ namespace Gnome.Scan {
 			this.close();
 		}
 
-		private bool on_window_delete_event(Gnome.Scan.Dialog window, Event evt)
+		private bool on_window_delete_event(Widget window, Event evt)
 		{
 			this.close();
 			return false;
diff --git a/lib/gnome-scan-job.vala b/lib/gnome-scan-job.vala
index b816615..0f57141 100644
--- a/lib/gnome-scan-job.vala
+++ b/lib/gnome-scan-job.vala
@@ -168,7 +168,7 @@ namespace Gnome.Scan {
 				else if (node is Sink)
 					this.nodes.append(node);
 				else {
-					weak SList last = this.nodes.last();
+					weak SList<Node> last = this.nodes.last();
 					if (last.data is Sink)
 						this.nodes.insert_before(last, node);
 					else
@@ -255,4 +255,4 @@ namespace Gnome.Scan {
 			}
 		}
 	}
-}
\ No newline at end of file
+}
diff --git a/lib/gnome-scan-option-box.vala b/lib/gnome-scan-option-box.vala
index a194199..f2efa09 100644
--- a/lib/gnome-scan-option-box.vala
+++ b/lib/gnome-scan-option-box.vala
@@ -65,8 +65,8 @@ namespace Gnome.Scan {
 			}
 
 			OptionWidget widget = (OptionWidget) new Gtk.Widget(wtype, "option", option);
-			widget.hide += this.on_option_widget_visibility_changed;
-			widget.show += this.on_option_widget_visibility_changed;
+			widget.hide.connect(this.on_option_widget_visibility_changed);
+			widget.show.connect(this.on_option_widget_visibility_changed);
 
 			this.child_count++;
 			// compute attach option
@@ -128,13 +128,13 @@ namespace Gnome.Scan {
 			return this.table.get_children().length() == 0;
 		}
 
-		private void on_option_widget_visibility_changed(OptionWidget widget)
+		private void on_option_widget_visibility_changed(Widget widget)
 		{
 			// ignore no_show_all widget.
 			if (widget.no_show_all)
 				return;
 
-			var label = this.labels.lookup(widget);
+			var label = this.labels.lookup((OptionWidget)widget);
 			if (label != null) {
 				label.no_show_all = widget.no_show_all;
 				if (widget.visible) {
@@ -145,7 +145,7 @@ namespace Gnome.Scan {
 				}
 			}
 
-			if (widget.expand) {
+			if (((OptionWidget)widget).expand) {
 				this.child_expanding_count += widget.visible ? +1 : -1;
 				var parent = (Container) this.parent;
 				this.expand = this.child_expanding_count > 0;
@@ -163,4 +163,4 @@ namespace Gnome.Scan {
 			}
 		}
     }
-}
\ No newline at end of file
+}
diff --git a/lib/gnome-scan-option-page.vala b/lib/gnome-scan-option-page.vala
index c9c3e35..4e7837e 100644
--- a/lib/gnome-scan-option-page.vala
+++ b/lib/gnome-scan-option-page.vala
@@ -63,8 +63,8 @@ namespace Gnome.Scan {
 				this.viewport = new Viewport(scrowin.hadjustment, scrowin.vadjustment);
 				viewport.shadow_type = ShadowType.NONE;
 				scrowin.add(viewport);
-				scrowin.size_allocate += this.on_size_allocate;
-				viewport.size_allocate += this.on_viewport_size_allocate;
+				scrowin.size_allocate.connect(this.on_size_allocate);
+				viewport.size_allocate.connect(this.on_viewport_size_allocate);
 			}
 		}
 
@@ -73,8 +73,8 @@ namespace Gnome.Scan {
 			OptionBox box = this.boxes.lookup(option.group);
 			if (box == null) {
 				box = new OptionBox(option.group);
-				box.hide += this.on_box_visibility_changed;
-				box.show += this.on_box_visibility_changed;
+				box.hide.connect(this.on_box_visibility_changed);
+				box.show.connect(this.on_box_visibility_changed);
 				this.box_visible_count++;
 				this.container.pack_start(box, box.expand, true, 0);
 				this.boxes.insert(option.group, box);
@@ -92,9 +92,9 @@ namespace Gnome.Scan {
 			}
 		}
 
-		private void on_box_visibility_changed(OptionBox box)
+		private void on_box_visibility_changed(Widget box)
 		{
-			if (box.expand) {
+			if (((OptionBox)box).expand) {
 				this.box_expanding_count+= box.visible ? +1 : -1;
 				var parent = (Container) this.parent;
 				parent.child_set(this, "expand", this.box_expanding_count > 0);
@@ -123,14 +123,14 @@ namespace Gnome.Scan {
 			}
 		}
 
-		private void on_size_allocate(ScrolledWindow scrowin, Gdk.Rectangle alloc)
+		private void on_size_allocate(Widget widget, Gdk.Rectangle alloc)
 		{
 			this.scroll_height = alloc.height;
 			this.scroll_width = alloc.width;
 			this.update_shadow_type();
 		}
 
-		private void on_viewport_size_allocate(Viewport vp, Gdk.Rectangle alloc)
+		private void on_viewport_size_allocate(Widget widget, Gdk.Rectangle alloc)
 		{
 			this.update_shadow_type();
 		}
diff --git a/lib/gnome-scan-page-orientation-widget.vala b/lib/gnome-scan-page-orientation-widget.vala
index 5846762..fc9dbb2 100644
--- a/lib/gnome-scan-page-orientation-widget.vala
+++ b/lib/gnome-scan-page-orientation-widget.vala
@@ -39,8 +39,8 @@ namespace Gnome.Scan {
 			HBox box;
 			weak StockItem item;
 			weak SList group = null;
-			foreach (weak Gnome.Scan.EnumValue? value in option.values) {
-				box = new HBox(false, 4);
+                        foreach (weak Gnome.Scan.EnumValue? value in option.values) {
+                                box = new HBox(false, 4);
 				// icon
 				icon = new Image.from_stock(value.label, IconSize.BUTTON);
 				box.pack_start(icon, false, false, 0);
@@ -51,21 +51,21 @@ namespace Gnome.Scan {
 				// radio
 				radio = new RadioButton(group);
 				radio.add(box);
-				radio.toggled += this.on_radio_toggled;
+				radio.toggled.connect(this.on_radio_toggled);
 				group = radio.get_group();
 				parent.pack_start(radio, false, true, 0);
 				this.radio_map.insert(radio, value);
 			}
 		}
 
-		private void on_radio_toggled(RadioButton button)
+		private void on_radio_toggled(ToggleButton button)
 		{
 			if (!button.active)
 				return;
 
 			var option = this.option as OptionEnum;
-			weak Gnome.Scan.EnumValue? value = this.radio_map.lookup(button);
+			weak Gnome.Scan.EnumValue? value = this.radio_map.lookup((RadioButton)button);
 			option.value = value;
 		}
 	}
-}
\ No newline at end of file
+}
diff --git a/lib/gnome-scan-scanner-selector.vala b/lib/gnome-scan-scanner-selector.vala
index c1e6a68..2c5a911 100644
--- a/lib/gnome-scan-scanner-selector.vala
+++ b/lib/gnome-scan-scanner-selector.vala
@@ -37,7 +37,7 @@ namespace Gnome.Scan {
 		SList<Backend> backends;
 		int backends_probing_count;
 
-		signal void probe_done();
+		public signal void probe_done();
 
 		public Job job {get; set construct; }
 
@@ -59,7 +59,7 @@ namespace Gnome.Scan {
 
 			selection = this.view.get_selection();
 			selection.set_mode(SelectionMode.SINGLE);
-			selection.changed += this.on_selection_changed;
+			selection.changed.connect(this.on_selection_changed);
 
 			// columns;
 			renderer = new CellRendererPixbuf();
@@ -106,8 +106,8 @@ namespace Gnome.Scan {
 			foreach(GLib.Type type in backend_types) {
 				backend = (Backend)GLib.Object.new(type);
 				this.backends.append(backend);
-				backend.scanner_added += this.on_scanner_added;
-				backend.probe_done += this.on_probe_done;
+				backend.scanner_added.connect(this.on_scanner_added);
+				backend.probe_done.connect(this.on_probe_done);
 			}
 		}
 
@@ -186,7 +186,7 @@ namespace Gnome.Scan {
 		{
 			TreeIter iter;
 			this.scanners.get_iter_from_string(out iter,
-											   (string)scanner.get_data("path"));
+											   ((GLib.Object)scanner).get_data("path"));
 			if (!this.scanners.iter_is_valid(iter))
 				warning("Unable to update '%s' status in scanner selector!", scanner.name);
 
diff --git a/src/flegita-option-widgets.vala b/src/flegita-option-widgets.vala
index c01094c..3a74076 100644
--- a/src/flegita-option-widgets.vala
+++ b/src/flegita-option-widgets.vala
@@ -83,9 +83,9 @@ namespace Flegita {
 			this.combobox.pack_start(renderer, true);
 			this.combobox.set_attributes(renderer, "text", FormatColumns.SUFFIX);
 
-			this.filechooser.selection_changed += this.update_filename;
-			this.entry.changed += this.update_filename;
-			this.combobox.changed+= this.update_filename;
+			this.filechooser.selection_changed.connect(this.update_filename);
+			this.entry.changed.connect(this.update_filename);
+			this.combobox.changed.connect(this.update_filename);
 			this.parse_filename();
 		}
 
@@ -146,4 +146,4 @@ namespace Flegita {
 			this.inhibit = false;
 		}
 	}
-}
\ No newline at end of file
+}
diff --git a/src/flegita-options.vala b/src/flegita-options.vala
index e35b8ca..04502d6 100644
--- a/src/flegita-options.vala
+++ b/src/flegita-options.vala
@@ -29,7 +29,7 @@ namespace Flegita {
 		private string filename;
 		private Gnome.Scan.Format? format = null;
 
-		private SList<weak Gnome.Scan.Format> formats;
+		private SList<unowned Gnome.Scan.Format> formats;
 
 		public OptionOutputFilename(string name, string title, string desc, string domain, string group, OptionHint hint)
 		{
@@ -50,7 +50,7 @@ namespace Flegita {
 			}
 		}
 
-		public weak SList<Gnome.Scan.Format> list_formats()
+		public unowned SList<Gnome.Scan.Format> list_formats()
 		{
 			return this.formats;
 		}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]