[folks] inspect: Remove conditional compilation in favour of ‘var’
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [folks] inspect: Remove conditional compilation in favour of ‘var’
- Date: Mon, 4 Jan 2016 22:47:22 +0000 (UTC)
commit 4e1d57e6fbc6ec0aa068fa30de1aa29e6514327f
Author: Philip Withnall <philip tecnocode co uk>
Date: Mon Jan 4 22:46:38 2016 +0000
inspect: Remove conditional compilation in favour of ‘var’
This copies the array but at least it compiles happily on all versions
of Vala.
https://bugzilla.gnome.org/show_bug.cgi?id=758741
tools/inspect/utils.vala | 27 ++++++---------------------
1 files changed, 6 insertions(+), 21 deletions(-)
---
diff --git a/tools/inspect/utils.vala b/tools/inspect/utils.vala
index b867850..eb34df3 100644
--- a/tools/inspect/utils.vala
+++ b/tools/inspect/utils.vala
@@ -123,15 +123,10 @@ private class Folks.Inspect.Utils
individual.id, individual.personas.size);
/* List the Individual's properties */
-#if VALA_0_32
- (unowned ParamSpec)[] properties =
-#else
- unowned ParamSpec[] properties =
-#endif
- individual.get_class ().list_properties ();
+ var properties = individual.get_class ().list_properties ();
Utils.indent ();
- foreach (unowned ParamSpec pspec in properties)
+ foreach (var pspec in properties)
{
Value prop_value;
string output_string;
@@ -167,15 +162,10 @@ private class Folks.Inspect.Utils
Utils.print_line ("Persona '%s':", persona.uid);
/* List the Persona's properties */
-#if VALA_0_32
- (unowned ParamSpec)[] properties =
-#else
- unowned ParamSpec[] properties =
-#endif
- persona.get_class ().list_properties ();
+ var properties = persona.get_class ().list_properties ();
Utils.indent ();
- foreach (unowned ParamSpec pspec in properties)
+ foreach (var pspec in properties)
{
Value prop_value;
string output_string;
@@ -208,15 +198,10 @@ private class Folks.Inspect.Utils
store.id, store.personas.size);
/* List the store's properties */
-#if VALA_0_32
- (unowned ParamSpec)[] properties =
-#else
- unowned ParamSpec[] properties =
-#endif
- store.get_class ().list_properties ();
+ var properties = store.get_class ().list_properties ();
Utils.indent ();
- foreach (unowned ParamSpec pspec in properties)
+ foreach (var pspec in properties)
{
Value prop_value;
string output_string;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]