[rygel/gnome-2-32] core: Don't assume user config dir to be present everywhere
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel/gnome-2-32] core: Don't assume user config dir to be present everywhere
- Date: Mon, 18 Oct 2010 20:58:41 +0000 (UTC)
commit e5964155561beab125355453589ebacbd910280f
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Mon Oct 18 16:56:35 2010 +0300
core: Don't assume user config dir to be present everywhere
This assumption is only true for modern (free)desktops.
src/rygel/rygel-root-device-factory.vala | 5 +++--
src/rygel/rygel-user-config.vala | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/rygel/rygel-root-device-factory.vala b/src/rygel/rygel-root-device-factory.vala
index 3eb1ad4..2f7541a 100644
--- a/src/rygel/rygel-root-device-factory.vala
+++ b/src/rygel/rygel-root-device-factory.vala
@@ -55,8 +55,9 @@ internal class Rygel.RootDeviceFactory {
this.context = context;
/* We store the modified descriptions in the user's config dir */
- this.desc_dir = Path.build_filename (Environment.get_user_config_dir (),
- "Rygel");
+ var config_dir = Environment.get_user_config_dir ();
+ this.ensure_dir_exists (config_dir);
+ this.desc_dir = Path.build_filename (config_dir, "Rygel");
this.ensure_dir_exists (this.desc_dir);
}
diff --git a/src/rygel/rygel-user-config.vala b/src/rygel/rygel-user-config.vala
index c634701..54daf19 100644
--- a/src/rygel/rygel-user-config.vala
+++ b/src/rygel/rygel-user-config.vala
@@ -304,9 +304,10 @@ public class Rygel.UserConfig : GLib.Object, Configuration {
}
private void enable_upnp (bool enable) {
- var dest_dir = Path.build_filename (Environment.get_user_config_dir (),
- "autostart");
try {
+ var config_dir = Environment.get_user_config_dir ();
+ this.ensure_dir_exists (config_dir);
+ var dest_dir = Path.build_filename (config_dir, "autostart");
this.ensure_dir_exists (dest_dir);
var dest_path = Path.build_filename (dest_dir, "rygel.desktop");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]