[rygel] core,plugins: Require & adapt to Vala 0.11.6
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] core,plugins: Require & adapt to Vala 0.11.6
- Date: Wed, 16 Feb 2011 13:16:57 +0000 (UTC)
commit 990daff5851ad6c94ffb13a938f3a5d1438582db
Author: Jens Georg <mail jensge org>
Date: Tue Feb 8 12:25:33 2011 +0100
core,plugins: Require & adapt to Vala 0.11.6
We need 0.11.6 due to fix for bgo#641715 which leads to crashes in
MPRIS plugin on track change.
configure.ac | 2 +-
.../rygel-media-export-media-cache-upgrader.vala | 4 ++--
.../rygel-media-export-media-cache.vala | 2 +-
.../tracker/rygel-tracker-item-factory.vala | 2 +-
.../tracker/rygel-tracker-music-item-factory.vala | 13 +++++++------
.../rygel-tracker-picture-item-factory.vala | 4 ++--
.../tracker/rygel-tracker-search-container.vala | 2 +-
.../tracker/rygel-tracker-video-item-factory.vala | 6 +++---
src/plugins/tracker/rygel-tracker-years.vala | 2 +-
src/rygel/rygel-cmdline-config.vala | 6 +++---
src/rygel/rygel-environment-config.vala | 4 ++--
src/rygel/rygel-http-byte-seek.vala | 4 ++--
src/rygel/rygel-http-item-uri.vala | 4 ++--
src/rygel/rygel-http-time-seek.vala | 4 ++--
src/rygel/rygel-log-handler.vala | 4 ++--
src/rygel/rygel-relational-expression.vala | 2 +-
16 files changed, 33 insertions(+), 32 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 5dde8de..a686f9a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,7 +19,7 @@ AC_STDC_HEADERS
AC_PROG_LIBTOOL
AC_FUNC_MMAP
-VALA_REQUIRED=0.11.2
+VALA_REQUIRED=0.11.6
GSSDP_REQUIRED=0.9.2
GUPNP_REQUIRED=0.13.4
GUPNP_AV_REQUIRED=0.7.0
diff --git a/src/plugins/media-export/rygel-media-export-media-cache-upgrader.vala b/src/plugins/media-export/rygel-media-export-media-cache-upgrader.vala
index 28e6c3b..c997230 100644
--- a/src/plugins/media-export/rygel-media-export-media-cache-upgrader.vala
+++ b/src/plugins/media-export/rygel-media-export-media-cache-upgrader.vala
@@ -53,7 +53,7 @@ internal class Rygel.MediaExport.MediaCacheUpgrader {
});
current_version = current_version_temp;
- return current_version < SQLFactory.schema_version.to_int ();
+ return current_version < int.parse (SQLFactory.schema_version);
}
public void fix_schema () throws Error {
@@ -97,7 +97,7 @@ internal class Rygel.MediaExport.MediaCacheUpgrader {
public void upgrade (int old_version) {
debug ("Older schema detected. Upgrading...");
- int current_version = SQLFactory.schema_version.to_int ();
+ int current_version = int.parse (SQLFactory.schema_version);
while (old_version < current_version) {
if (this.database != null) {
switch (old_version) {
diff --git a/src/plugins/media-export/rygel-media-export-media-cache.vala b/src/plugins/media-export/rygel-media-export-media-cache.vala
index 7c4b9ba..3fa02d2 100644
--- a/src/plugins/media-export/rygel-media-export-media-cache.vala
+++ b/src/plugins/media-export/rygel-media-export-media-cache.vala
@@ -362,7 +362,7 @@ public class Rygel.MediaExport.MediaCache : Object {
private void open_db (string name) throws Error {
this.db = new Database (name);
int old_version = -1;
- int current_version = SQLFactory.schema_version.to_int ();
+ int current_version = int.parse (SQLFactory.schema_version);
try {
var upgrader = new MediaCacheUpgrader (this.db, this.sql);
diff --git a/src/plugins/tracker/rygel-tracker-item-factory.vala b/src/plugins/tracker/rygel-tracker-item-factory.vala
index d1f03e9..afe9f29 100644
--- a/src/plugins/tracker/rygel-tracker-item-factory.vala
+++ b/src/plugins/tracker/rygel-tracker-item-factory.vala
@@ -82,7 +82,7 @@ public abstract class Rygel.Tracker.ItemFactory {
item.title = metadata[Metadata.FILE_NAME];
if (metadata[Metadata.SIZE] != "")
- item.size = metadata[Metadata.SIZE].to_int64 ();
+ item.size = int64.parse (metadata[Metadata.SIZE]);
else
// If its in tracker store and size is unknown, it most probably
// means the size is 0 (i-e a place-holder empty item that we
diff --git a/src/plugins/tracker/rygel-tracker-music-item-factory.vala b/src/plugins/tracker/rygel-tracker-music-item-factory.vala
index 4d74efb..47a7f92 100644
--- a/src/plugins/tracker/rygel-tracker-music-item-factory.vala
+++ b/src/plugins/tracker/rygel-tracker-music-item-factory.vala
@@ -84,29 +84,30 @@ public class Rygel.Tracker.MusicItemFactory : ItemFactory {
if (metadata[MusicMetadata.DURATION] != "" &&
metadata[MusicMetadata.DURATION] != "0") {
- music.duration = metadata[MusicMetadata.DURATION].to_int ();
+ music.duration = int.parse (metadata[MusicMetadata.DURATION]);
}
if (metadata[MusicMetadata.SAMPLE_RATE] != "") {
- music.sample_freq = metadata[MusicMetadata.SAMPLE_RATE].to_int ();
+ music.sample_freq = int.parse
+ (metadata[MusicMetadata.SAMPLE_RATE]);
}
if (metadata[MusicMetadata.CHANNELS] != "") {
- music.channels = metadata[MusicMetadata.CHANNELS].to_int ();
+ music.channels = int.parse (metadata[MusicMetadata.CHANNELS]);
}
if (metadata[MusicMetadata.BITS_PER_SAMPLE] != "") {
var bits_per_sample = metadata[MusicMetadata.BITS_PER_SAMPLE];
- music.bits_per_sample = bits_per_sample.to_int ();
+ music.bits_per_sample = int.parse (bits_per_sample);
}
if (metadata[MusicMetadata.BITRATE] != "") {
- music.bitrate = metadata[MusicMetadata.BITRATE].to_int () / 8;
+ music.bitrate = int.parse (metadata[MusicMetadata.BITRATE]) / 8;
}
if (metadata[MusicMetadata.AUDIO_TRACK_NUM] != "") {
var track_number = metadata[MusicMetadata.AUDIO_TRACK_NUM];
- music.track_number = track_number.to_int ();
+ music.track_number = int.parse (track_number);
}
music.artist = metadata[MusicMetadata.AUDIO_ARTIST];
diff --git a/src/plugins/tracker/rygel-tracker-picture-item-factory.vala b/src/plugins/tracker/rygel-tracker-picture-item-factory.vala
index 54737f4..737e641 100644
--- a/src/plugins/tracker/rygel-tracker-picture-item-factory.vala
+++ b/src/plugins/tracker/rygel-tracker-picture-item-factory.vala
@@ -69,11 +69,11 @@ public class Rygel.Tracker.PictureItemFactory : ItemFactory {
var photo = item as PhotoItem;
if (metadata[PictureMetadata.WIDTH] != "") {
- photo.width = metadata[PictureMetadata.WIDTH].to_int ();
+ photo.width = int.parse (metadata[PictureMetadata.WIDTH]);
}
if (metadata[PictureMetadata.HEIGHT] != "") {
- photo.height = metadata[PictureMetadata.HEIGHT].to_int ();
+ photo.height = int.parse (metadata[PictureMetadata.HEIGHT]);
}
}
}
diff --git a/src/plugins/tracker/rygel-tracker-search-container.vala b/src/plugins/tracker/rygel-tracker-search-container.vala
index e40947f..cc9c600 100644
--- a/src/plugins/tracker/rygel-tracker-search-container.vala
+++ b/src/plugins/tracker/rygel-tracker-search-container.vala
@@ -197,7 +197,7 @@ public class Rygel.Tracker.SearchContainer : Rygel.MediaContainer {
yield query.execute (this.resources);
- this.child_count = query.result[0,0].to_int ();
+ this.child_count = int.parse (query.result[0,0]);
this.updated ();
} catch (GLib.Error error) {
critical (_("Error getting item count under category '%s': %s"),
diff --git a/src/plugins/tracker/rygel-tracker-video-item-factory.vala b/src/plugins/tracker/rygel-tracker-video-item-factory.vala
index 1397657..05399fb 100644
--- a/src/plugins/tracker/rygel-tracker-video-item-factory.vala
+++ b/src/plugins/tracker/rygel-tracker-video-item-factory.vala
@@ -71,13 +71,13 @@ public class Rygel.Tracker.VideoItemFactory : ItemFactory {
var video = item as VideoItem;
if (metadata[VideoMetadata.WIDTH] != "")
- video.width = metadata[VideoMetadata.WIDTH].to_int ();
+ video.width = int.parse (metadata[VideoMetadata.WIDTH]);
if (metadata[VideoMetadata.HEIGHT] != "")
- video.height = metadata[VideoMetadata.HEIGHT].to_int ();
+ video.height = int.parse (metadata[VideoMetadata.HEIGHT]);
if (metadata[VideoMetadata.DURATION] != "")
- video.duration = metadata[VideoMetadata.DURATION].to_int ();
+ video.duration = int.parse (metadata[VideoMetadata.DURATION]);
}
}
diff --git a/src/plugins/tracker/rygel-tracker-years.vala b/src/plugins/tracker/rygel-tracker-years.vala
index 9ec7798..1b6c8f5 100644
--- a/src/plugins/tracker/rygel-tracker-years.vala
+++ b/src/plugins/tracker/rygel-tracker-years.vala
@@ -43,7 +43,7 @@ public class Rygel.Tracker.Years : MetadataValues {
protected override string create_filter (string variable, string value) {
var year = this.create_title_for_value (value);
- var next_year = (year.to_int () + 1).to_string ();
+ var next_year = (int.parse (year) + 1).to_string ();
year += "-01-01T00:00:00Z";
next_year += "-01-01T00:00:00Z";
diff --git a/src/rygel/rygel-cmdline-config.vala b/src/rygel/rygel-cmdline-config.vala
index 71b9819..5066a54 100644
--- a/src/rygel/rygel-cmdline-config.vala
+++ b/src/rygel/rygel-cmdline-config.vala
@@ -327,7 +327,7 @@ internal class Rygel.CmdlineConfig : GLib.Object, Configuration {
tokens[2] != null &&
tokens[0] == section &&
tokens[1] == key) {
- value = tokens[2].to_int ();
+ value = int.parse (tokens[2]);
if (value >= min && value <= max) {
value_set = true;
}
@@ -355,7 +355,7 @@ internal class Rygel.CmdlineConfig : GLib.Object, Configuration {
tokens[1] == key) {
value = new ArrayList<int> ();
foreach (var val_token in tokens[2].split (",", -1)) {
- value.add (val_token.to_int ());
+ value.add (int.parse (val_token));
}
break;
}
@@ -380,7 +380,7 @@ internal class Rygel.CmdlineConfig : GLib.Object, Configuration {
tokens[2] != null &&
tokens[0] == section &&
tokens[1] == key) {
- value = tokens[2].to_bool ();
+ value = bool.parse (tokens[2]);
value_set = true;
break;
}
diff --git a/src/rygel/rygel-environment-config.vala b/src/rygel/rygel-environment-config.vala
index 332adb1..5d59de7 100644
--- a/src/rygel/rygel-environment-config.vala
+++ b/src/rygel/rygel-environment-config.vala
@@ -149,7 +149,7 @@ internal class Rygel.EnvironmentConfig : GLib.Object, Configuration {
var str = this.get_string (section, key);
var value = new ArrayList<int> ();
foreach (var token in str.split (",", -1)) {
- value.add (token.to_int ());
+ value.add (int.parse (token));
}
return value;
@@ -180,7 +180,7 @@ internal class Rygel.EnvironmentConfig : GLib.Object, Configuration {
throw new ConfigurationError.NO_VALUE_SET ("No value available");
}
- return val.to_int ().clamp (min, max);
+ return int.parse (val).clamp (min, max);
}
private bool get_bool_variable (string variable) throws GLib.Error {
diff --git a/src/rygel/rygel-http-byte-seek.vala b/src/rygel/rygel-http-byte-seek.vala
index f83eb98..5687d13 100644
--- a/src/rygel/rygel-http-byte-seek.vala
+++ b/src/rygel/rygel-http-byte-seek.vala
@@ -53,7 +53,7 @@ internal class Rygel.HTTPByteSeek : Rygel.HTTPSeek {
// Get first byte position
pos = range_tokens[0];
if (pos[0].isdigit ()) {
- start = pos.to_int64 ();
+ start = int64.parse (pos);
} else if (pos != "") {
throw new HTTPSeekError.INVALID_RANGE (_("Invalid Range '%s'"),
range);
@@ -62,7 +62,7 @@ internal class Rygel.HTTPByteSeek : Rygel.HTTPSeek {
// Get last byte position if specified
pos = range_tokens[1];
if (pos[0].isdigit ()) {
- stop = pos.to_int64 ();
+ stop = int64.parse (pos);
if (stop < start) {
throw new HTTPSeekError.INVALID_RANGE
(_("Invalid Range '%s'"), range);
diff --git a/src/rygel/rygel-http-item-uri.vala b/src/rygel/rygel-http-item-uri.vala
index b72884c..f565928 100644
--- a/src/rygel/rygel-http-item-uri.vala
+++ b/src/rygel/rygel-http-item-uri.vala
@@ -73,11 +73,11 @@ internal class Rygel.HTTPItemURI : Object {
break;
case "th":
- this.thumbnail_index = parts[i + 1].to_int ();
+ this.thumbnail_index = int.parse (parts[i + 1]);
break;
case "sub":
- this.subtitle_index = parts[i + 1].to_int ();
+ this.subtitle_index = int.parse (parts[i + 1]);
break;
default:
diff --git a/src/rygel/rygel-http-time-seek.vala b/src/rygel/rygel-http-time-seek.vala
index 2a1f5d8..7650a1e 100644
--- a/src/rygel/rygel-http-time-seek.vala
+++ b/src/rygel/rygel-http-time-seek.vala
@@ -54,7 +54,7 @@ internal class Rygel.HTTPTimeSeek : Rygel.HTTPSeek {
// Get start time
time = range_tokens[0];
if (time[0].isdigit ()) {
- start = (int64) (time.to_double () * SECOND);
+ start = (int64) (double.parse (time) * SECOND);
} else if (time != "") {
throw new HTTPSeekError.INVALID_RANGE (_("Invalid Range '%s'"),
range);
@@ -63,7 +63,7 @@ internal class Rygel.HTTPTimeSeek : Rygel.HTTPSeek {
// Get end time
time = range_tokens[1];
if (time[0].isdigit()) {
- stop = (int64) (time.to_double () * SECOND);
+ stop = (int64) (double.parse (time) * SECOND);
if (stop < start) {
throw new HTTPSeekError.INVALID_RANGE
(_("Invalid Range '%s'"), range);
diff --git a/src/rygel/rygel-log-handler.vala b/src/rygel/rygel-log-handler.vala
index 3fc963f..33e6324 100644
--- a/src/rygel/rygel-log-handler.vala
+++ b/src/rygel/rygel-log-handler.vala
@@ -79,11 +79,11 @@ public class Rygel.LogHandler : GLib.Object {
LogLevel level;
if (tokens.length == 1) {
- level = (LogLevel) tokens[0].to_int ();
+ level = (LogLevel) int.parse (tokens[0]);
domain = "*";
} else {
domain = tokens[0];
- level = (LogLevel) tokens[1].to_int ();
+ level = (LogLevel) int.parse (tokens[1]);
}
var flags = this.log_level_to_flags (level);
diff --git a/src/rygel/rygel-relational-expression.vala b/src/rygel/rygel-relational-expression.vala
index a835008..5422e07 100644
--- a/src/rygel/rygel-relational-expression.vala
+++ b/src/rygel/rygel-relational-expression.vala
@@ -120,7 +120,7 @@ public class Rygel.RelationalExpression :
}
public bool compare_int (int integer) {
- var operand2 = this.operand2.to_int ();
+ var operand2 = int.parse (this.operand2);
switch (this.op) {
case SearchCriteriaOp.EQ:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]