Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

Commit

Permalink
Fixed regex parsing issue with some systems
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabisonfire committed Oct 9, 2016
1 parent 86076bb commit df7097f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
15 changes: 11 additions & 4 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,7 @@ private void LoadSettings()
tbIconSpacingLeft.Text = spacing[0];
tbIconSpacingTop.Text = spacing[1];
tbIconSpacingRight.Text = spacing[2];
tbIconSpacingBottom.Text = spacing[3];

tbIconSpacingBottom.Text = spacing[3];
}
}

Expand Down Expand Up @@ -221,10 +220,18 @@ private void LoadSettings()
shortcutModifier = tbModifier.Text;

// Hidden apps
io.hiddenList = new List<string>(io.GetSetting("Main", "hide").Split(','));
string hidden = io.GetSetting("Main", "hide");
if (!string.IsNullOrWhiteSpace(hidden))
{
io.hiddenList = new List<string>(hidden.Split(','));
}
else
{
io.hiddenList = new List<string>();
}
lbHidden.ItemsSource = io.hiddenList;

// Random button
// Random button
cbHideRandom.IsChecked = io.GetSetting("Main", "hide_random") == "True" ? true : false;

}
Expand Down
18 changes: 13 additions & 5 deletions io.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ public static void ParseGameNames()
string manifest = File.ReadAllText(man);
Regex regexName = new Regex(regexNamePattern);
Regex regexID = new Regex(regexIDPattern);
Regex regexInstallDir = new Regex(regexInstallPattern);
Regex regexInstallDir = new Regex(regexInstallPattern);
Match matchName = regexName.Match(manifest);
Match matchID = regexID.Match(manifest);
Match matchID = regexID.Match(manifest.ToLower()); // Setting it to lower because some steam installation use "appID" instead of "appid"
Match matchInstall = regexInstallDir.Match(manifest);
bool Visible = true;
if(matchName.Success && matchID.Success && matchInstall.Success)
Expand All @@ -76,10 +76,18 @@ public static void ParseGameNames()
}
gamesList.Add(new Game(matchName.Value, matchID.Value, matchInstall.Value, Visible));
}
else
else if(!matchName.Success)
{
LogToFile("One of the regex patterns did not generate any results for manifest: " + man);
}
LogToFile("Regex patterns did not generate any results for manifest: " + man + Environment.NewLine + regexNamePattern);
}
else if (!matchID.Success)
{
LogToFile("Regex patterns did not generate any results for manifest: " + man + Environment.NewLine + regexIDPattern);
}
else if (!matchInstall.Success)
{
LogToFile("Regex patterns did not generate any results for manifest: " + man + Environment.NewLine + regexInstallPattern);
}
}
catch(Exception e)
{
Expand Down

0 comments on commit df7097f

Please sign in to comment.