[gnome-boxes] Put VM images in XDG_DATA_DIR, not XDG_CONFIG_DIR
- From: Christophe Fergeau <teuf src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] Put VM images in XDG_DATA_DIR, not XDG_CONFIG_DIR
- Date: Mon, 16 Jan 2012 17:21:38 +0000 (UTC)
commit 8d7ae893c6cf025968aee416bbc12e3b48cbe2fe
Author: Christophe Fergeau <cfergeau redhat com>
Date: Mon Jan 16 17:57:31 2012 +0100
Put VM images in XDG_DATA_DIR, not XDG_CONFIG_DIR
This fixes bug #665812
src/util.vala | 8 ++++++++
src/vm-configurator.vala | 3 +--
2 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/util.vala b/src/util.vala
index 2495745..e3311ce 100644
--- a/src/util.vala
+++ b/src/util.vala
@@ -61,6 +61,14 @@ namespace Boxes {
return Path.build_filename (dir, file_name);
}
+ public string get_user_pkgdata (string? file_name = null) {
+ var dir = Path.build_filename (Environment.get_user_data_dir (), Config.PACKAGE_TARNAME);
+
+ ensure_directory (dir);
+
+ return Path.build_filename (dir, file_name);
+ }
+
public bool has_pkgconfig_sources () {
return FileUtils.test (Path.build_filename (get_pkgconfig (), "sources"), FileTest.IS_DIR);
}
diff --git a/src/vm-configurator.vala b/src/vm-configurator.vala
index 5aa10d3..6e25f44 100644
--- a/src/vm-configurator.vala
+++ b/src/vm-configurator.vala
@@ -76,8 +76,7 @@ private class Boxes.VMConfigurator {
}
public StoragePool get_pool_config () throws GLib.Error {
- var pool_path = get_pkgconfig ("images");
- ensure_directory (pool_path);
+ var pool_path = get_user_pkgdata ("images");
var pool = new StoragePool ();
pool.set_pool_type (StoragePoolType.DIR);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]