Remove enable property from model

This commit is contained in:
bao-qian
2016-08-19 19:16:06 +01:00
parent d09c42366a
commit fb68f6eb60
4 changed files with 9 additions and 22 deletions

View File

@@ -57,7 +57,6 @@ namespace Wox.Plugin.Program
Location = Directory.Text,
MaxDepth = max,
Suffixes = Suffixes.Text.Split(ProgramSource.SuffixSeperator),
Enabled = true
};
_settings.ProgramSources.Add(source);
}

View File

@@ -150,27 +150,17 @@ namespace Wox.Plugin.Program
private static List<ProgramSource> ProgramSources()
{
var sources = new List<ProgramSource>
var sources = new List<ProgramSource>();
if (_settings.EnableStartMenuSource)
{
new CommonStartMenuProgramSource
{
Enabled = _settings.EnableStartMenuSource,
},
new UserStartMenuProgramSource
{
Enabled = _settings.EnableStartMenuSource,
},
new AppPathsProgramSource
{
Enabled = _settings.EnableRegistrySource,
}
};
if (_settings.ProgramSources.Count(o => o.Enabled) > 0)
{
sources.AddRange(_settings.ProgramSources);
sources.Add(new CommonStartMenuProgramSource());
sources.Add(new UserStartMenuProgramSource());
}
if (_settings.EnableRegistrySource)
{
sources.Add(new AppPathsProgramSource());
}
sources.AddRange(_settings.ProgramSources);
return sources;
}

View File

@@ -123,7 +123,6 @@ namespace Wox.Plugin.Program
_settings.ProgramSources.Add(new FileSystemProgramSource
{
Location = s,
Enabled = true
});
ReIndexing();

View File

@@ -10,7 +10,6 @@ namespace Wox.Plugin.Program.ProgramSources
{
public const char SuffixSeperator = ';';
public bool Enabled { get; set; } = true;
// happlebao todo: temp hack for program suffixes
public string[] Suffixes { get; set; } = {"bat", "appref-ms", "exe", "lnk"};
public int MaxDepth { get; set; } = -1;