[rygel] media-export: Small refactor
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] media-export: Small refactor
- Date: Sun, 28 Mar 2010 19:08:07 +0000 (UTC)
commit 8124327e38e3085a9d83c507a57c06139f6103d8
Author: Jens Georg <mail jensge org>
Date: Sun Mar 28 14:33:28 2010 +0200
media-export: Small refactor
.../rygel-media-export-root-container.vala | 21 +++++++------------
1 files changed, 8 insertions(+), 13 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-root-container.vala b/src/plugins/media-export/rygel-media-export-root-container.vala
index fdf8fd9..bc218a8 100644
--- a/src/plugins/media-export/rygel-media-export-root-container.vala
+++ b/src/plugins/media-export/rygel-media-export-root-container.vala
@@ -48,19 +48,14 @@ public class Rygel.MediaExportRootContainer : Rygel.MediaDBContainer {
// either an error occured or the gconf key is not set
if (uris.size == 0) {
debug("Nothing configured, using XDG special directories");
- var uri = Environment.get_user_special_dir (UserDirectory.MUSIC);
- if (uri != null) {
- uris.add (uri);
- }
-
- uri = Environment.get_user_special_dir (UserDirectory.PICTURES);
- if (uri != null) {
- uris.add (uri);
- }
-
- uri = Environment.get_user_special_dir (UserDirectory.VIDEOS);
- if (uri != null) {
- uris.add (uri);
+ UserDirectory[] xdg_directories = { UserDirectory.MUSIC,
+ UserDirectory.PICTURES,
+ UserDirectory.VIDEOS };
+ foreach (var directory in xdg_directories) {
+ var uri = Environment.get_user_special_dir (directory);
+ if (uri != null) {
+ uris.add (uri);
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]