summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Reitter <travis.reitter@collabora.co.uk>2011-10-21 00:11:45 (GMT)
committerTravis Reitter <travis.reitter@collabora.co.uk>2011-10-24 18:39:23 (GMT)
commit99e18f7bc15a793768b8a32b4bdb769a2c68ca04 (patch)
tree32bae7b2b521df338b05b037c4e444df122a25c7
parent35e99dc1a1d2f1f5d60e14b321ba8ed10b829a1b (diff)
downloadfolks-99e18f7bc15a793768b8a32b4bdb769a2c68ca04.tar.gz
folks-99e18f7bc15a793768b8a32b4bdb769a2c68ca04.tar.xz
Guarantee all Role members are non-null.
Helps: bgo#662433 - AbstractFieldDetails.equal() is ambiguous about checking parameters.
-rw-r--r--folks/role-details.vala42
1 files changed, 23 insertions, 19 deletions
diff --git a/folks/role-details.vala b/folks/role-details.vala
index 1590c4a..890acfc 100644
--- a/folks/role-details.vala
+++ b/folks/role-details.vala
@@ -32,18 +32,29 @@ using GLib;
*/
public class Folks.Role : Object
{
+ private string _organisation_name;
/**
* The name of the organisation in which the role is held.
*/
- public string organisation_name { get; set; }
+ public string organisation_name
+ {
+ get { return this._organisation_name; }
+ set { this._organisation_name = (value != null ? value : ""); }
+ }
+ private string _title;
/**
* The title of the position held.
*
* For example: “Director, Ministry of Silly Walks”
*/
- public string title { get; set; }
+ public string title
+ {
+ get { return this._title; }
+ set { this._title = (value != null ? value : ""); }
+ }
+ private string _role;
/**
* The role of the position.
*
@@ -51,12 +62,20 @@ public class Folks.Role : Object
*
* @since 0.6.0
*/
- public string role { get; set; }
+ public string role
+ {
+ get { return this._role; }
+ set { this._role = (value != null ? value : ""); }
+ }
/**
* The UID that distinguishes this role.
*/
- public string uid { get; set; }
+ public string uid
+ {
+ get { return _uid; }
+ set { _uid = (value != null ? value : ""); }
+ }
/**
* Default constructor.
@@ -71,21 +90,6 @@ public class Folks.Role : Object
public Role (string? title = null,
string? organisation_name = null, string? uid = null)
{
- if (title == null)
- {
- title = "";
- }
-
- if (organisation_name == null)
- {
- organisation_name = "";
- }
-
- if (uid == null)
- {
- uid = "";
- }
-
Object (uid: uid,
title: title,
organisation_name: organisation_name);