[gnome-games/wip/ricotz/issue102: 5/5] Follow some binding and syntax changes in vala 0.42
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/ricotz/issue102: 5/5] Follow some binding and syntax changes in vala 0.42
- Date: Wed, 22 Aug 2018 12:20:08 +0000 (UTC)
commit 61aff248f184f28851233e3abeb7e8897400bd26
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Wed Aug 22 08:39:22 2018 +0200
Follow some binding and syntax changes in vala 0.42
Fixes https://gitlab.gnome.org/GNOME/gnome-games/issues/102
plugins/love/src/love-package.vala | 14 +++++++++++---
src/ui/game-icon-view.vala | 2 +-
src/ui/konami-code.vala | 8 ++++++++
3 files changed, 20 insertions(+), 4 deletions(-)
---
diff --git a/plugins/love/src/love-package.vala b/plugins/love/src/love-package.vala
index 44c8308f..d4f9dfd1 100644
--- a/plugins/love/src/love-package.vala
+++ b/plugins/love/src/love-package.vala
@@ -120,7 +120,11 @@ private class Games.LovePackage : Object {
private InputStream read_file_to_input_stream (Archive.Read archive, int64 size) {
uint8[] content = new uint8[size];
- archive.read_data (content, (size_t) size);
+#if VALA_0_42
+ archive.read_data (content);
+#else
+ archive.read_data (content, content.length);
+#endif
return new MemoryInputStream.from_data (content);
}
@@ -128,8 +132,12 @@ private class Games.LovePackage : Object {
private string read_file_to_string (Archive.Read archive) {
string content = "";
- char buffer[BLOCK_SIZE];
- while (archive.read_data (buffer, BLOCK_SIZE) != 0)
+ uint8[] buffer = new uint8[BLOCK_SIZE];
+#if VALA_0_42
+ while (archive.read_data (buffer) != 0)
+#else
+ while (archive.read_data (buffer, buffer.length) != 0)
+#endif
content += (string) buffer;
return content;
diff --git a/src/ui/game-icon-view.vala b/src/ui/game-icon-view.vala
index 57f0f981..d138f1b4 100644
--- a/src/ui/game-icon-view.vala
+++ b/src/ui/game-icon-view.vala
@@ -27,7 +27,6 @@ private class Games.GameIconView : Gtk.Box {
title.width_request = value;
subtitle.width_request = value;
}
- default = 256;
}
[GtkChild]
@@ -39,5 +38,6 @@ private class Games.GameIconView : Gtk.Box {
public GameIconView (Game game) {
this.game = game;
+ this.size = 256;
}
}
diff --git a/src/ui/konami-code.vala b/src/ui/konami-code.vala
index 25b0be28..0f76471b 100644
--- a/src/ui/konami-code.vala
+++ b/src/ui/konami-code.vala
@@ -1,7 +1,11 @@
// This file is part of GNOME Games. License: GPLv3
private class Games.KonamiCode : Object {
+#if VALA_0_42
+ private const uint[] CODE_LOWER_KEYS = {
+#else
private const int[] CODE_LOWER_KEYS = {
+#endif
Gdk.Key.Up,
Gdk.Key.Up,
Gdk.Key.Down,
@@ -14,7 +18,11 @@ private class Games.KonamiCode : Object {
Gdk.Key.a,
};
+#if VALA_0_42
+ private const uint[] CODE_UPPER_KEYS = {
+#else
private const int[] CODE_UPPER_KEYS = {
+#endif
Gdk.Key.Up,
Gdk.Key.Up,
Gdk.Key.Down,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]