[rygel] all: Adapt to new vapis
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] all: Adapt to new vapis
- Date: Mon, 26 Mar 2012 16:00:54 +0000 (UTC)
commit 5bdd3e9d7733b94257a6a270be1ee78de5d24a1a
Author: Jens Georg <mail jensge org>
Date: Fri Jan 20 17:42:33 2012 +0100
all: Adapt to new vapis
configure.ac | 2 +-
.../media-export/rygel-media-export-harvester.vala | 7 ++++---
.../rygel-media-export-harvesting-task.vala | 10 +++++-----
.../rygel-media-export-metadata-extractor.vala | 8 ++++----
.../rygel-media-export-recursive-file-monitor.vala | 6 +++---
src/rygel/rygel-media-art-store.vala | 6 +++---
src/rygel/rygel-media-object.vala | 4 ++--
src/rygel/rygel-plugin-loader.vala | 8 ++++----
src/rygel/rygel-root-device-factory.vala | 8 ++++----
src/rygel/rygel-subtitle-manager.vala | 8 ++++----
src/rygel/rygel-thumbnailer.vala | 8 ++++----
11 files changed, 38 insertions(+), 37 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index b8a6ae0..1b121a7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,7 +28,7 @@ LT_PREREQ([2.2.6])
LT_INIT([dlopen disable-static])
dnl Required versions of library packages
-VALA_REQUIRED=0.14.1
+VALA_REQUIRED=0.15.1
GSSDP_REQUIRED=0.11.0
GUPNP_REQUIRED=0.17.1
GUPNP_AV_REQUIRED=0.9.0
diff --git a/src/plugins/media-export/rygel-media-export-harvester.vala b/src/plugins/media-export/rygel-media-export-harvester.vala
index db9d80d..1cf0dba 100644
--- a/src/plugins/media-export/rygel-media-export-harvester.vala
+++ b/src/plugins/media-export/rygel-media-export-harvester.vala
@@ -56,9 +56,10 @@ internal class Rygel.MediaExport.Harvester : GLib.Object {
this.monitor = new RecursiveFileMonitor (cancellable);
this.monitor.changed.connect (this.on_file_changed);
- this.tasks = new HashMap<File, HarvestingTask> (file_hash, file_equal);
- this.extraction_grace_timers = new HashMap<File, uint> (file_hash,
- file_equal);
+ this.tasks = new HashMap<File, HarvestingTask> (File.hash,
+ (EqualFunc) File.equal);
+ this.extraction_grace_timers = new HashMap<File, uint> (File.hash,
+ (EqualFunc)File.equal);
this.create_file_filter ();
}
diff --git a/src/plugins/media-export/rygel-media-export-harvesting-task.vala b/src/plugins/media-export/rygel-media-export-harvesting-task.vala
index 6062182..8b2f496 100644
--- a/src/plugins/media-export/rygel-media-export-harvesting-task.vala
+++ b/src/plugins/media-export/rygel-media-export-harvesting-task.vala
@@ -37,10 +37,10 @@ public class Rygel.MediaExport.HarvestingTask : Rygel.StateMachine,
public Cancellable cancellable { get; set; }
private const string HARVESTER_ATTRIBUTES =
- FILE_ATTRIBUTE_STANDARD_NAME + "," +
- FILE_ATTRIBUTE_STANDARD_TYPE + "," +
- FILE_ATTRIBUTE_TIME_MODIFIED + "," +
- FILE_ATTRIBUTE_STANDARD_SIZE;
+ FileAttribute.STANDARD_NAME + "," +
+ FileAttribute.STANDARD_TYPE + "," +
+ FileAttribute.TIME_MODIFIED + "," +
+ FileAttribute.STANDARD_SIZE;
public HarvestingTask (MetadataExtractor extractor,
@@ -142,7 +142,7 @@ public class Rygel.MediaExport.HarvestingTask : Rygel.StateMachine,
try {
if (this.cache.exists (file, out timestamp, out size)) {
int64 mtime = (int64) info.get_attribute_uint64
- (FILE_ATTRIBUTE_TIME_MODIFIED);
+ (FileAttribute.TIME_MODIFIED);
if (mtime > timestamp ||
info.get_size () != size) {
diff --git a/src/plugins/media-export/rygel-media-export-metadata-extractor.vala b/src/plugins/media-export/rygel-media-export-metadata-extractor.vala
index 14b325a..ace1d51 100644
--- a/src/plugins/media-export/rygel-media-export-metadata-extractor.vala
+++ b/src/plugins/media-export/rygel-media-export-metadata-extractor.vala
@@ -128,10 +128,10 @@ public class Rygel.MediaExport.MetadataExtractor: GLib.Object {
try {
file_info = file.query_info
- (FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE
+ (FileAttribute.STANDARD_CONTENT_TYPE
+ "," +
- FILE_ATTRIBUTE_STANDARD_SIZE + "," +
- FILE_ATTRIBUTE_TIME_MODIFIED,
+ FileAttribute.STANDARD_SIZE + "," +
+ FileAttribute.TIME_MODIFIED,
FileQueryInfoFlags.NONE,
null);
} catch (Error error) {
@@ -148,7 +148,7 @@ public class Rygel.MediaExport.MetadataExtractor: GLib.Object {
var mime = ContentType.get_mime_type (content_type);
var size = file_info.get_size ();
var mtime = file_info.get_attribute_uint64
- (FILE_ATTRIBUTE_TIME_MODIFIED);
+ (FileAttribute.TIME_MODIFIED);
this.extraction_done (file,
dlna,
diff --git a/src/plugins/media-export/rygel-media-export-recursive-file-monitor.vala b/src/plugins/media-export/rygel-media-export-recursive-file-monitor.vala
index efd2cc4..d031cc3 100644
--- a/src/plugins/media-export/rygel-media-export-recursive-file-monitor.vala
+++ b/src/plugins/media-export/rygel-media-export-recursive-file-monitor.vala
@@ -41,8 +41,8 @@ public class Rygel.MediaExport.RecursiveFileMonitor : Object {
}
this.cancellable = cancellable;
- this.monitors = new HashMap<File, FileMonitor> (GLib.file_hash,
- GLib.file_equal);
+ this.monitors = new HashMap<File, FileMonitor> (File.hash,
+ (EqualFunc) File.equal);
if (cancellable != null) {
cancellable.cancelled.connect (this.cancel);
}
@@ -83,7 +83,7 @@ public class Rygel.MediaExport.RecursiveFileMonitor : Object {
try {
var info = yield file.query_info_async
- (FILE_ATTRIBUTE_STANDARD_TYPE,
+ (FileAttribute.STANDARD_TYPE,
FileQueryInfoFlags.NONE,
Priority.DEFAULT,
null);
diff --git a/src/rygel/rygel-media-art-store.vala b/src/rygel/rygel-media-art-store.vala
index 5ad2c27..7ba0487 100644
--- a/src/rygel/rygel-media-art-store.vala
+++ b/src/rygel/rygel-media-art-store.vala
@@ -72,11 +72,11 @@ public class Rygel.MediaArtStore : GLib.Object {
return null;
}
- var info = file.query_info (FILE_ATTRIBUTE_ACCESS_CAN_READ + "," +
- FILE_ATTRIBUTE_STANDARD_SIZE,
+ var info = file.query_info (FileAttribute.ACCESS_CAN_READ + "," +
+ FileAttribute.STANDARD_SIZE,
FileQueryInfoFlags.NONE,
null);
- if (!info.get_attribute_boolean (FILE_ATTRIBUTE_ACCESS_CAN_READ)) {
+ if (!info.get_attribute_boolean (FileAttribute.ACCESS_CAN_READ)) {
return null;
}
diff --git a/src/rygel/rygel-media-object.vala b/src/rygel/rygel-media-object.vala
index 1df14e1..b5ffcfe 100644
--- a/src/rygel/rygel-media-object.vala
+++ b/src/rygel/rygel-media-object.vala
@@ -190,12 +190,12 @@ public abstract class Rygel.MediaObject : GLib.Object {
try {
var info = yield file.query_info_async (
- FILE_ATTRIBUTE_ACCESS_CAN_WRITE,
+ FileAttribute.ACCESS_CAN_WRITE,
FileQueryInfoFlags.NONE,
Priority.DEFAULT,
cancellable);
- return info.get_attribute_boolean (FILE_ATTRIBUTE_ACCESS_CAN_WRITE);
+ return info.get_attribute_boolean (FileAttribute.ACCESS_CAN_WRITE);
} catch (IOError.NOT_FOUND error) {
return true;
}
diff --git a/src/rygel/rygel-plugin-loader.vala b/src/rygel/rygel-plugin-loader.vala
index f30e848..528cfd0 100644
--- a/src/rygel/rygel-plugin-loader.vala
+++ b/src/rygel/rygel-plugin-loader.vala
@@ -98,9 +98,9 @@ public class Rygel.PluginLoader : Object {
private async void load_modules_from_dir (File dir) {
debug ("Searching for modules in folder '%s'.", dir.get_path ());
- string attributes = FILE_ATTRIBUTE_STANDARD_NAME + "," +
- FILE_ATTRIBUTE_STANDARD_TYPE + "," +
- FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE;
+ string attributes = FileAttribute.STANDARD_NAME + "," +
+ FileAttribute.STANDARD_TYPE + "," +
+ FileAttribute.STANDARD_CONTENT_TYPE;
GLib.List<FileInfo> infos;
FileEnumerator enumerator;
@@ -187,7 +187,7 @@ public class Rygel.PluginLoader : Object {
FileInfo file_info;
try {
- file_info = file.query_info (FILE_ATTRIBUTE_STANDARD_TYPE,
+ file_info = file.query_info (FileAttribute.STANDARD_TYPE,
FileQueryInfoFlags.NONE,
null);
} catch (Error error) {
diff --git a/src/rygel/rygel-root-device-factory.vala b/src/rygel/rygel-root-device-factory.vala
index bb73ee6..200d36a 100644
--- a/src/rygel/rygel-root-device-factory.vala
+++ b/src/rygel/rygel-root-device-factory.vala
@@ -322,14 +322,14 @@ internal class Rygel.RootDeviceFactory {
return new XMLDoc.from_path (path2);
}
- var info = file.query_info (FILE_ATTRIBUTE_TIME_MODIFIED,
+ var info = file.query_info (FileAttribute.TIME_MODIFIED,
FileQueryInfoFlags.NONE);
- var mod1 = info.get_attribute_uint64 (FILE_ATTRIBUTE_TIME_MODIFIED);
+ var mod1 = info.get_attribute_uint64 (FileAttribute.TIME_MODIFIED);
file = File.new_for_path (path2);
- info = file.query_info (FILE_ATTRIBUTE_TIME_MODIFIED,
+ info = file.query_info (FileAttribute.TIME_MODIFIED,
FileQueryInfoFlags.NONE);
- var mod2 = info.get_attribute_uint64 (FILE_ATTRIBUTE_TIME_MODIFIED);
+ var mod2 = info.get_attribute_uint64 (FileAttribute.TIME_MODIFIED);
if (mod1 > mod2) {
return new XMLDoc.from_path (path1);
diff --git a/src/rygel/rygel-subtitle-manager.vala b/src/rygel/rygel-subtitle-manager.vala
index e4065eb..cb0cf09 100644
--- a/src/rygel/rygel-subtitle-manager.vala
+++ b/src/rygel/rygel-subtitle-manager.vala
@@ -55,12 +55,12 @@ internal class Rygel.SubtitleManager : GLib.Object {
var srt_file = directory.get_child (filename);
- var info = srt_file.query_info (FILE_ATTRIBUTE_ACCESS_CAN_READ + "," +
- FILE_ATTRIBUTE_STANDARD_SIZE,
+ var info = srt_file.query_info (FileAttribute.ACCESS_CAN_READ + "," +
+ FileAttribute.STANDARD_SIZE,
FileQueryInfoFlags.NONE,
null);
- if (!info.get_attribute_boolean (FILE_ATTRIBUTE_ACCESS_CAN_READ)) {
+ if (!info.get_attribute_boolean (FileAttribute.ACCESS_CAN_READ)) {
throw new SubtitleManagerError.NO_SUBTITLE
(_("No subtitle available"));
}
@@ -68,7 +68,7 @@ internal class Rygel.SubtitleManager : GLib.Object {
var subtitle = new Subtitle ();
subtitle.uri = srt_file.get_uri ();
subtitle.size = (int64) info.get_attribute_uint64
- (FILE_ATTRIBUTE_STANDARD_SIZE);
+ (FileAttribute.STANDARD_SIZE);
return subtitle;
}
diff --git a/src/rygel/rygel-thumbnailer.vala b/src/rygel/rygel-thumbnailer.vala
index 6e90771..35d5545 100644
--- a/src/rygel/rygel-thumbnailer.vala
+++ b/src/rygel/rygel-thumbnailer.vala
@@ -109,12 +109,12 @@ internal class Rygel.Thumbnailer : GLib.Object {
this.thumbler.queue_thumbnail_task (uri, mime_type);
}
- var info = file.query_info (FILE_ATTRIBUTE_ACCESS_CAN_READ + "," +
- FILE_ATTRIBUTE_STANDARD_SIZE,
+ var info = file.query_info (FileAttribute.ACCESS_CAN_READ + "," +
+ FileAttribute.STANDARD_SIZE,
FileQueryInfoFlags.NONE,
null);
- if (!info.get_attribute_boolean (FILE_ATTRIBUTE_ACCESS_CAN_READ)) {
+ if (!info.get_attribute_boolean (FileAttribute.ACCESS_CAN_READ)) {
throw new ThumbnailerError.NO_THUMBNAIL
(_("No thumbnail available"));
}
@@ -127,7 +127,7 @@ internal class Rygel.Thumbnailer : GLib.Object {
thumbnail.depth = this.template.depth;
thumbnail.uri = Filename.to_uri (full_path, null);
thumbnail.size = (int64) info.get_attribute_uint64
- (FILE_ATTRIBUTE_STANDARD_SIZE);
+ (FileAttribute.STANDARD_SIZE);
return thumbnail;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]