[dconf] client: clean up some Vala issues
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf] client: clean up some Vala issues
- Date: Sun, 5 Feb 2012 20:52:21 +0000 (UTC)
commit 543ce2ba293eb732b95ddbcab2dbd601d5d5b9ed
Author: Ryan Lortie <desrt desrt ca>
Date: Sun Feb 5 15:51:07 2012 -0500
client: clean up some Vala issues
We had a workaround for a Vala bug that has been fixed, so remove that.
Add another workaround because Vala cannot be certain that a particular
value has been set or not (so just set it to null to stop the warning).
client/dconf-client.vala | 20 +++++++-------------
1 files changed, 7 insertions(+), 13 deletions(-)
---
diff --git a/client/dconf-client.vala b/client/dconf-client.vala
index 472e544..fea10d7 100644
--- a/client/dconf-client.vala
+++ b/client/dconf-client.vala
@@ -35,6 +35,8 @@ namespace DConf {
void call_sync (EngineMessage dcem, out string tag, Cancellable? cancellable) throws Error {
DBusConnection connection;
+ tag = null;
+
if (dcem.bus_types[0] == 'e') {
if (session == null) {
session = Bus.get_sync (BusType.SESSION, cancellable);
@@ -66,6 +68,8 @@ namespace DConf {
async void call_async (EngineMessage dcem, out string tag, Cancellable? cancellable) throws Error {
DBusConnection connection;
+ tag = null;
+
if (dcem.bus_types[0] == 'e') {
if (session == null) {
session = yield Bus.get (BusType.SESSION, cancellable);
@@ -123,12 +127,7 @@ namespace DConf {
* tag that appears in change notifications.
**/
public bool write (string key, Variant? value, out string tag = null, Cancellable? cancellable = null) throws Error {
- if (&tag == null) { /* bgo #591673 */
- string junk;
- call_sync (engine.write (key, value), out junk, cancellable);
- } else {
- call_sync (engine.write (key, value), out tag, cancellable);
- }
+ call_sync (engine.write (key, value), out tag, cancellable);
return true;
}
@@ -173,12 +172,7 @@ namespace DConf {
* tag that appears in change notifications.
**/
public bool write_many (string dir, [CCode (array_length = false, array_null_terminated = true)] string[] rels, Variant?[] values, out string? tag = null, Cancellable? cancellable = null) throws Error {
- if (&tag == null) { /* bgo #591673 */
- string junk;
- call_sync (engine.write_many (dir, rels, values), out junk, cancellable);
- } else {
- call_sync (engine.write_many (dir, rels, values), out tag, cancellable);
- }
+ call_sync (engine.write_many (dir, rels, values), out tag, cancellable);
return true;
}
@@ -359,7 +353,7 @@ namespace DConf {
**/
public Client (string? profile = null, owned WatchFunc? watch_func = null) {
engine = new Engine (profile);
- this.watch_func = watch_func;
+ this.watch_func = (owned) watch_func;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]