Fix added websearch twice issue.

This commit is contained in:
qianlifeng 2014-03-23 18:14:46 +08:00
parent 1a5bc2ddfe
commit d8536c20b0
3 changed files with 19 additions and 14 deletions

View File

@ -36,6 +36,8 @@ namespace Wox.Infrastructure.Storage
}
}
protected virtual void LoadDefaultConfig() { }
private void Load()
{
string configPath = Path.Combine(configFolder, ConfigName + fileSuffix);
@ -55,8 +57,13 @@ namespace Wox.Infrastructure.Storage
catch (Exception)
{
//no-op
LoadDefaultConfig();
}
}
else
{
LoadDefaultConfig();
}
}
public void Save()

View File

@ -39,18 +39,6 @@ namespace Wox.Infrastructure.Storage.UserSettings
[JsonProperty]
public bool EnablePythonPlugins { get; set; }
public UserSettingStorage()
{
EnablePythonPlugins = true;
Theme = "Dark";
ReplaceWinR = true;
WebSearches = LoadDefaultWebSearches();
ProgramSources = LoadDefaultProgramSources();
Hotkey = "Alt + Space";
QueryBoxFont = FontFamily.GenericSansSerif.Name;
ResultItemFont = FontFamily.GenericSansSerif.Name;
}
public List<WebSearch> LoadDefaultWebSearches()
{
List<WebSearch> webSearches = new List<WebSearch>();
@ -107,5 +95,17 @@ namespace Wox.Infrastructure.Storage.UserSettings
{
get { return "config"; }
}
protected override void LoadDefaultConfig()
{
EnablePythonPlugins = true;
Theme = "Dark";
ReplaceWinR = true;
WebSearches = LoadDefaultWebSearches();
ProgramSources = LoadDefaultProgramSources();
Hotkey = "Alt + Space";
QueryBoxFont = FontFamily.GenericSansSerif.Name;
ResultItemFont = FontFamily.GenericSansSerif.Name;
}
}
}

View File

@ -93,8 +93,6 @@ namespace Wox
//DwmDropShadow.DropShadowToWindow(this);
WindowIntelopHelper.DisableControlBox(this);
throw new Exception();
}
private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)