linux: Use ~/.config even when sandboxed

This commit is contained in:
Hylke Bons 2016-04-08 14:40:11 +01:00
parent 66f447c457
commit 741d31a5ef
2 changed files with 8 additions and 4 deletions

View file

@ -195,9 +195,12 @@ namespace SparkleShare {
public BaseController () public BaseController ()
{ {
string app_data_path = Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData); string app_data_path = Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData);
string config_path = Path.Combine (app_data_path, "sparkleshare");
if (InstallationInfo.Platform == PlatformID.Unix)
app_data_path = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), ".config");
string config_path = Path.Combine (app_data_path, "org.sparkleshare.SparkleShare");
Config = new Configuration (config_path, "config.xml"); Config = new Configuration (config_path, "config.xml");
Configuration.DefaultConfig = Config; Configuration.DefaultConfig = Config;
@ -390,8 +393,8 @@ namespace SparkleShare {
void AddRepository (string folder_path) void AddRepository (string folder_path)
{ {
BaseRepository repo = null; BaseRepository repo = null;
string folder_name = Path.GetFileName (folder_path); string folder_name = Path.GetFileName (folder_path);
string backend = Config.BackendByName (folder_name); string backend = Config.BackendByName (folder_name);
try { try {
repo = (BaseRepository) Activator.CreateInstance ( repo = (BaseRepository) Activator.CreateInstance (

View file

@ -14,6 +14,7 @@
</ReleaseVersion> </ReleaseVersion>
<SuppressXamMacMigration>True</SuppressXamMacMigration> <SuppressXamMacMigration>True</SuppressXamMacMigration>
<SuppressXamMacUpsell>True</SuppressXamMacUpsell> <SuppressXamMacUpsell>True</SuppressXamMacUpsell>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType> <DebugType>none</DebugType>