[baobab/wip/vala: 25/53] Adjust to gio vapi changes



commit 861ed960a089aaae5c58547c865a047deeb468a1
Author: Ryan Lortie <desrt desrt ca>
Date:   Thu Jan 26 12:43:07 2012 -0500

    Adjust to gio vapi changes
    
    A bunch of stuff was deprecated.  Stop using it.

 src/baobab-application.vala      |    2 +-
 src/baobab-scanner.vala          |   22 +++++++++++-----------
 src/baobab-sync-scanner.vala     |   12 ++++++------
 src/baobab-threaded-scanner.vala |   12 ++++++------
 src/baobab-window.vala           |    2 +-
 5 files changed, 25 insertions(+), 25 deletions(-)
---
diff --git a/src/baobab-application.vala b/src/baobab-application.vala
index 849b687..274efa5 100644
--- a/src/baobab-application.vala
+++ b/src/baobab-application.vala
@@ -39,7 +39,7 @@ namespace Baobab {
 		public static HashTable<File, unowned File> get_excluded_locations () {
 			var app = baobab;
 
-			var excluded_locations = new HashTable<File, unowned File> (file_hash, file_equal);
+			var excluded_locations = new HashTable<File, unowned File> (File.hash, File.equal);
 			excluded_locations.add (File.new_for_path ("/proc"));
 			excluded_locations.add (File.new_for_path ("/sys"));
 			excluded_locations.add (File.new_for_path ("/selinux"));
diff --git a/src/baobab-scanner.vala b/src/baobab-scanner.vala
index d8b0859..702345e 100644
--- a/src/baobab-scanner.vala
+++ b/src/baobab-scanner.vala
@@ -43,8 +43,8 @@ namespace Baobab {
 			uint32 device;
 
 			public HardLink (FileInfo info) {
-				this.inode = info.get_attribute_uint64 (FILE_ATTRIBUTE_UNIX_INODE);
-				this.device = info.get_attribute_uint32 (FILE_ATTRIBUTE_UNIX_DEVICE);
+				this.inode = info.get_attribute_uint64 (FileAttribute.UNIX_INODE);
+				this.device = info.get_attribute_uint32 (FileAttribute.UNIX_DEVICE);
 			}
 		}
 
@@ -53,15 +53,15 @@ namespace Baobab {
 		protected HardLink[] hardlinks;
 
 		protected static const string ATTRIBUTES =
-			FILE_ATTRIBUTE_STANDARD_NAME + "," +
-			FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME + "," +
-			FILE_ATTRIBUTE_STANDARD_TYPE + "," +
-			FILE_ATTRIBUTE_STANDARD_SIZE +  "," +
-			FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE +  "," +
-			FILE_ATTRIBUTE_UNIX_NLINK + "," +
-			FILE_ATTRIBUTE_UNIX_INODE + "," +
-			FILE_ATTRIBUTE_UNIX_DEVICE + "," +
-			FILE_ATTRIBUTE_ACCESS_CAN_READ;
+			FileAttribute.STANDARD_NAME + "," +
+			FileAttribute.STANDARD_DISPLAY_NAME + "," +
+			FileAttribute.STANDARD_TYPE + "," +
+			FileAttribute.STANDARD_SIZE +  "," +
+			FileAttribute.STANDARD_ALLOCATED_SIZE +  "," +
+			FileAttribute.UNIX_NLINK + "," +
+			FileAttribute.UNIX_INODE + "," +
+			FileAttribute.UNIX_DEVICE + "," +
+			FileAttribute.ACCESS_CAN_READ;
 
 		public File directory { get; protected set; }
 
diff --git a/src/baobab-sync-scanner.vala b/src/baobab-sync-scanner.vala
index d506ad7..47b540b 100644
--- a/src/baobab-sync-scanner.vala
+++ b/src/baobab-sync-scanner.vala
@@ -44,8 +44,8 @@ namespace Baobab {
 			     Columns.PARSE_NAME,   parse_name);
 
 			results.size = info.get_size ();
-			if (info.has_attribute (FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE)) {
-				results.alloc_size = info.get_attribute_uint64 (FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE);
+			if (info.has_attribute (FileAttribute.STANDARD_ALLOCATED_SIZE)) {
+				results.alloc_size = info.get_attribute_uint64 (FileAttribute.STANDARD_ALLOCATED_SIZE);
 			}
 			results.elements = 1;
 
@@ -69,8 +69,8 @@ namespace Baobab {
 							break;
 
 						case FileType.REGULAR:
-							if (child_info.has_attribute (FILE_ATTRIBUTE_UNIX_NLINK)) {
-								if (child_info.get_attribute_uint32 (FILE_ATTRIBUTE_UNIX_NLINK) > 1) {
+							if (child_info.has_attribute (FileAttribute.UNIX_NLINK)) {
+								if (child_info.get_attribute_uint32 (FileAttribute.UNIX_NLINK) > 1) {
 									var hl = HardLink (child_info);
 
 									/* check if we've already encountered this file */
@@ -83,8 +83,8 @@ namespace Baobab {
 							}
 
 							results.size += child_info.get_size ();
-							if (child_info.has_attribute (FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE)) {
-								results.alloc_size += child_info.get_attribute_uint64 (FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE);
+							if (child_info.has_attribute (FileAttribute.STANDARD_ALLOCATED_SIZE)) {
+								results.alloc_size += child_info.get_attribute_uint64 (FileAttribute.STANDARD_ALLOCATED_SIZE);
 							}
 							results.elements++;
 							break;
diff --git a/src/baobab-threaded-scanner.vala b/src/baobab-threaded-scanner.vala
index c6806bc..7267d92 100644
--- a/src/baobab-threaded-scanner.vala
+++ b/src/baobab-threaded-scanner.vala
@@ -97,8 +97,8 @@ namespace Baobab {
 			results.parent = parent;
 
 			results.size = info.get_size ();
-			if (info.has_attribute (FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE)) {
-				results.alloc_size = info.get_attribute_uint64 (FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE);
+			if (info.has_attribute (FileAttribute.STANDARD_ALLOCATED_SIZE)) {
+				results.alloc_size = info.get_attribute_uint64 (FileAttribute.STANDARD_ALLOCATED_SIZE);
 			}
 			results.elements = 1;
 
@@ -125,8 +125,8 @@ namespace Baobab {
 							break;
 
 						case FileType.REGULAR:
-							if (child_info.has_attribute (FILE_ATTRIBUTE_UNIX_NLINK)) {
-								if (child_info.get_attribute_uint32 (FILE_ATTRIBUTE_UNIX_NLINK) > 1) {
+							if (child_info.has_attribute (FileAttribute.UNIX_NLINK)) {
+								if (child_info.get_attribute_uint32 (FileAttribute.UNIX_NLINK) > 1) {
 									var hl = HardLink (child_info);
 
 									// check if we've already encountered this file
@@ -139,8 +139,8 @@ namespace Baobab {
 							}
 
 							results.size += child_info.get_size ();
-							if (child_info.has_attribute (FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE)) {
-								results.alloc_size += child_info.get_attribute_uint64 (FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE);
+							if (child_info.has_attribute (FileAttribute.STANDARD_ALLOCATED_SIZE)) {
+								results.alloc_size += child_info.get_attribute_uint64 (FileAttribute.STANDARD_ALLOCATED_SIZE);
 							}
 							results.elements++;
 							break;
diff --git a/src/baobab-window.vala b/src/baobab-window.vala
index cdb9a4c..95581fa 100644
--- a/src/baobab-window.vala
+++ b/src/baobab-window.vala
@@ -201,7 +201,7 @@ namespace Baobab {
 			//}
 
 			try {
-				var info = directory.query_info (FILE_ATTRIBUTE_STANDARD_TYPE, FileQueryInfoFlags.NONE, null);
+				var info = directory.query_info (FileAttribute.STANDARD_TYPE, FileQueryInfoFlags.NONE, null);
 				if (info.get_file_type () != FileType.DIRECTORY/* || is_virtual_filesystem ()*/) {
 					var primary = _("\"%s\" is not a valid folder").printf (directory.get_parse_name ());
 					message (primary, _("Could not analyze disk usage."), Gtk.MessageType.ERROR);



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