Skip to content

Commit

Permalink
[BUG] Fix get correct network path if it contains a space (#140), ver…
Browse files Browse the repository at this point in the history
…sion 1.0.17.6
  • Loading branch information
Hofknecht committed Oct 24, 2020
1 parent 4f74970 commit e85dcc3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 29 deletions.
4 changes: 2 additions & 2 deletions Business/Menus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,12 @@ static string[] GetDirectoriesInNetworkLocation(string networkLocationRootPath)
{
foreach (string line in lines.Skip(6).SkipLast(2))
{
int indexOfFirstSpace = line.TrimEnd().LastIndexOf(" ", StringComparison.InvariantCulture);
int indexOfFirstSpace = line.IndexOf(" ", StringComparison.InvariantCulture);
if (indexOfFirstSpace > 0)
{
string directory = Path.Combine(
networkLocationRootPath,
line.Substring(0, indexOfFirstSpace)).TrimEnd();
line.Substring(0, indexOfFirstSpace));

directories.Add(directory);
resolvedSomething = true;
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.17.5")]
[assembly: AssemblyFileVersion("1.0.17.5")]
[assembly: AssemblyVersion("1.0.17.6")]
[assembly: AssemblyFileVersion("1.0.17.6")]
12 changes: 6 additions & 6 deletions Utilities/Log.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ namespace SystemTrayMenu.Utilities
internal static class Log
{
private static readonly Logger LogValue = new Logger(string.Empty);
private static List<string> warnings = new List<string>();
private static List<string> infos = new List<string>();
private static readonly List<string> Warnings = new List<string>();
private static readonly List<string> Infos = new List<string>();

internal static void Initialize()
{
Expand All @@ -26,19 +26,19 @@ internal static void Initialize()

internal static void Info(string message)
{
if (!infos.Contains(message))
if (!Infos.Contains(message))
{
infos.Add(message);
Infos.Add(message);
LogValue.Info(message);
}
}

internal static void Warn(string message, Exception ex)
{
string warning = $"{message} {ex.ToString().Replace(Environment.NewLine, " ", StringComparison.InvariantCulture)}";
if (!warnings.Contains(warning))
if (!Warnings.Contains(warning))
{
warnings.Add(warning);
Warnings.Add(warning);
LogValue.Warn(warning);
}
}
Expand Down
19 changes: 0 additions & 19 deletions app.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,4 @@
<section name="SystemTrayMenu.Properties.Settings" type="System.Configuration.ClientSettingsSection, System.Configuration.ConfigurationManager, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<userSettings>
<SystemTrayMenu.Properties.Settings>
<setting name="CurrentCultureInfoName" serializeAs="String">
<value />
</setting>
<setting name="PathDirectory" serializeAs="String">
<value />
</setting>
<setting name="IsAutostartActivated" serializeAs="String">
<value>False</value>
</setting>
<setting name="HotKey" serializeAs="String">
<value>Ctrl+Alt+Apps</value>
</setting>
<setting name="IsUpgraded" serializeAs="String">
<value>False</value>
</setting>
</SystemTrayMenu.Properties.Settings>
</userSettings>
</configuration>

0 comments on commit e85dcc3

Please sign in to comment.