Skip to content

Commit

Permalink
Move if statements
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew committed Jan 24, 2016
1 parent b6c08c5 commit a28e4ba
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions SteamCleaner/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,8 @@ public string Statistics

public event PropertyChangedEventHandler PropertyChanged;

private void RunRefresh()
private void AddPaths(ObservableCollection<string> pathsInternal)
{
//needs to be called to ensure we aren't loading a previously stored object.
CleanerUtilities.updateRedistributables = true;
_pathsInternal.Clear();
var steamPaths = Steam.SteamPaths();
_pathsInternal.AddRange(steamPaths.Select(steamPath => Steam.FixPath(steamPath)).Where(path => Directory.Exists(path)).ToList());
if (Gog.Exisit())
{
_pathsInternal.Add("GoG Games Detected");
Expand All @@ -85,6 +80,16 @@ private void RunRefresh()
{
_pathsInternal.Add("Custom Game Paths Detected");
}
}
private void RunRefresh()
{
//needs to be called to ensure we aren't loading a previously stored object.
CleanerUtilities.updateRedistributables = true;
_pathsInternal.Clear();
var steamPaths = Steam.SteamPaths();
AddPaths(_pathsInternal);
_pathsInternal.AddRange(
steamPaths.Select(Steam.FixPath).Where(Directory.Exists).ToList());
_filesInternal.Clear();
foreach (
var fileViewModel in
Expand Down

0 comments on commit a28e4ba

Please sign in to comment.