[simple-scan/wip/ricotz/issue79: 2/2] Correctly copy device list
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [simple-scan/wip/ricotz/issue79: 2/2] Correctly copy device list
- Date: Thu, 7 Feb 2019 20:10:57 +0000 (UTC)
commit ea5ad5341a317cf79b1500fa7c36967db91a4e62
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Thu Feb 7 14:52:29 2019 +0100
Correctly copy device list
Use GLib.Object.ref is not possible while ScanDevice is simple GType class.
Fixes https://gitlab.gnome.org/GNOME/simple-scan/issues/79
src/simple-scan.vala | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/simple-scan.vala b/src/simple-scan.vala
index 0c263f0..7c0bcf2 100644
--- a/src/simple-scan.vala
+++ b/src/simple-scan.vala
@@ -105,7 +105,12 @@ public class SimpleScan : Gtk.Application
private void update_scan_devices_cb (Scanner scanner, List<ScanDevice> devices)
{
- var devices_copy = devices.copy_deep ((CopyFunc) Object.ref);
+ List<ScanDevice> devices_copy = new List<ScanDevice> ();
+ foreach (var device in devices)
+ {
+ devices_copy.prepend (device);
+ }
+ devices_copy.reverse ();
/* If the default device is not detected add it to the list */
if (default_device != null)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]