[dconf] dconf update: vala deprecation fixups



commit 40f72540b817043bc3fca2f53c796857a93033ad
Author: Ryan Lortie <desrt desrt ca>
Date:   Thu May 5 14:22:37 2011 +0200

    dconf update: vala deprecation fixups

 bin/dconf-update.vala |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/bin/dconf-update.vala b/bin/dconf-update.vala
index 575bf80..911b8aa 100644
--- a/bin/dconf-update.vala
+++ b/bin/dconf-update.vala
@@ -30,7 +30,7 @@ unowned Gvdb.Item get_parent (Gvdb.HashTable table, string name) {
 		}
 	}
 
-	var parent_name = name.ndup (end);
+	var parent_name = name.substring (0, end);
 	parent = table.lookup (parent_name);
 
 	if (parent == null) {
@@ -61,13 +61,13 @@ Gvdb.HashTable read_directory (string dirname) throws GLib.Error {
 		}
 
 		foreach (var group in kf.get_groups ()) {
-			if (group.has_prefix ("/") || group.has_suffix ("/") || group.str ("//") != null) {
+			if (group.has_prefix ("/") || group.has_suffix ("/") || "//" in group) {
 				stderr.printf ("%s: ignoring invalid group name: %s\n", filename, group);
 				continue;
 			}
 
 			foreach (var key in kf.get_keys (group)) {
-				if (key.str ("/") != null) {
+				if ("/" in key) {
 					stderr.printf ("%s: [%s]: ignoring invalid key name: %s\n", filename, group, key);
 					continue;
 				}
@@ -104,7 +104,7 @@ void maybe_update_from_directory (string dirname) throws GLib.Error {
 	if (Posix.stat (dirname, out dir_buf) == 0 && Posix.S_ISDIR (dir_buf.st_mode)) {
 		Posix.Stat file_buf;
 
-		var filename = dirname.ndup (dirname.length - 2);
+		var filename = dirname.substring (0, dirname.length - 2);
 
 		if (Posix.stat (filename, out file_buf) == 0 && file_buf.st_mtime > dir_buf.st_mtime) {
 			return;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]