[banshee] [XmlConfigurationClient] load /etc/skel config
- From: Gabriel Burt <gburt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee] [XmlConfigurationClient] load /etc/skel config
- Date: Wed, 5 May 2010 20:07:12 +0000 (UTC)
commit 6fab2936fd688071d3664754d68894b56e12d512
Author: Aaron Bockover <abockover novell com>
Date: Mon May 3 23:16:37 2010 -0400
[XmlConfigurationClient] load /etc/skel config
If there's no existing user config.xml, and one exists in /etc/skel,
then load that one instead of a blank configuration.
.../XmlConfigurationClient.cs | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/Core/Banshee.Core/Banshee.Configuration/XmlConfigurationClient.cs b/src/Core/Banshee.Core/Banshee.Configuration/XmlConfigurationClient.cs
index 0f0e5d1..4eb6b04 100644
--- a/src/Core/Banshee.Core/Banshee.Configuration/XmlConfigurationClient.cs
+++ b/src/Core/Banshee.Core/Banshee.Configuration/XmlConfigurationClient.cs
@@ -44,6 +44,7 @@ namespace Banshee.Configuration
private const string namespace_tag_name = "namespace";
private const string value_tag_name = "value";
private const string tag_identifier_attribute_name = "name";
+ private const string skel_path = "/etc/skel/.config/banshee-1/config.xml";
private static string file_path {
get {
@@ -64,9 +65,18 @@ namespace Banshee.Configuration
xml_document = new XmlDocument();
bool make_new_xml = true;
- if(File.Exists(file_path)) {
+
+ string load_path = null;
+ if (File.Exists (file_path)) {
+ load_path = file_path;
+ } else if (File.Exists (skel_path)) {
+ Hyena.Log.InformationFormat ("Restoring config.xml from {0}", skel_path);
+ load_path = skel_path;
+ }
+
+ if (load_path != null && File.Exists (load_path)) {
try {
- xml_document.Load(file_path);
+ xml_document.Load (load_path);
make_new_xml = false;
} catch { // TODO try recovery?
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]