[folks] Play nicely with new API in Vala 0.14
- From: Raul Gutierrez Segales <raulgs src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [folks] Play nicely with new API in Vala 0.14
- Date: Thu, 2 Jun 2011 19:03:16 +0000 (UTC)
commit ff841e27e776573de7ccdf886cf923cf202a77a9
Author: Raul Gutierrez Segales <raul gutierrez segales collabora co uk>
Date: Tue May 24 18:56:12 2011 +0100
Play nicely with new API in Vala 0.14
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=650997
backends/key-file/kf-persona-store.vala | 12 +++++++-----
folks/backend-store.vala | 13 +++++++------
folks/group-details.vala | 2 +-
folks/types.vala | 2 +-
tests/tracker/avatar-details-interface.vala | 6 +++---
5 files changed, 19 insertions(+), 16 deletions(-)
---
diff --git a/backends/key-file/kf-persona-store.vala b/backends/key-file/kf-persona-store.vala
index 32478f1..f495980 100644
--- a/backends/key-file/kf-persona-store.vala
+++ b/backends/key-file/kf-persona-store.vala
@@ -151,14 +151,16 @@ public class Folks.Backends.Kf.PersonaStore : Folks.PersonaStore
* below and try to create it instead. */
try
{
- string contents = null;
- size_t length = 0;
+ uint8 *contents = null;
yield this._file.load_contents_async (null, out contents,
- out length);
- if (length > 0)
+ null);
+ var contents_s = (string) contents;
+
+ if (contents_s.length > 0)
{
- this._key_file.load_from_data (contents, length,
+ this._key_file.load_from_data (contents_s,
+ contents_s.length,
KeyFileFlags.KEEP_COMMENTS);
}
break;
diff --git a/folks/backend-store.vala b/folks/backend-store.vala
index a594cc5..89d9821 100644
--- a/folks/backend-store.vala
+++ b/folks/backend-store.vala
@@ -695,14 +695,15 @@ public class Folks.BackendStore : Object {
this._backends_key_file = new GLib.KeyFile ();
try
{
- string contents = null;
- size_t length = 0;
+ uint8 *contents = null;
- yield file.load_contents_async (null, out contents, out length);
- if (length > 0)
+ yield file.load_contents_async (null, out contents, null);
+ var contents_s = (string) contents;
+
+ if (contents_s.length > 0)
{
- this._backends_key_file.load_from_data (contents, length,
- KeyFileFlags.KEEP_COMMENTS);
+ this._backends_key_file.load_from_data (contents_s,
+ contents_s.length, KeyFileFlags.KEEP_COMMENTS);
}
}
catch (Error e1)
diff --git a/folks/group-details.vala b/folks/group-details.vala
index 2755a3b..44c5aa2 100644
--- a/folks/group-details.vala
+++ b/folks/group-details.vala
@@ -34,7 +34,7 @@ public interface Folks.GroupDetails : Object
* [[http://telepathy.freedesktop.org/spec/Channel_Interface_Group.html#Channel_Group_Change_Reason|Channel_Group_Change_Reason]]
* interface in the Telepathy specification.
*/
- public static enum ChangeReason
+ public enum ChangeReason
{
/**
* No reason was provided for this change.
diff --git a/folks/types.vala b/folks/types.vala
index fb897cb..39a61e6 100644
--- a/folks/types.vala
+++ b/folks/types.vala
@@ -25,7 +25,7 @@ namespace Folks
/**
* A 'boolean' type that has a distinct 'unset' state.
*/
- public static enum MaybeBool
+ public enum MaybeBool
{
/**
* This value is explicitly unset.
diff --git a/tests/tracker/avatar-details-interface.vala b/tests/tracker/avatar-details-interface.vala
index c981f9f..77c92f5 100644
--- a/tests/tracker/avatar-details-interface.vala
+++ b/tests/tracker/avatar-details-interface.vala
@@ -131,8 +131,8 @@ public class AvatarDetailsInterfaceTests : Folks.TestCase
private bool _compare_files (File a, File b)
{
- string content_a = "a";
- string content_b = "b";
+ uint8 *content_a;
+ uint8 *content_b;
try
{
@@ -152,7 +152,7 @@ public class AvatarDetailsInterfaceTests : Folks.TestCase
GLib.warning ("couldn't load file b");
}
- return content_a == content_b;
+ return ((string) content_a) == ((string) content_b);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]