Skip to content

Commit

Permalink
[BUG] IndexOutOfRangeException when BrowserSelector as Standard brows…
Browse files Browse the repository at this point in the history
…er (#237), version 1.1.1.3
  • Loading branch information
Hofknecht committed Nov 28, 2021
1 parent b7a7364 commit b1226d1
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 171 deletions.
7 changes: 1 addition & 6 deletions Business/Menus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -642,13 +642,8 @@ internal void MainPreload()
{
IconReader.MainPreload = true;

if (FileUrl.GetDefaultBrowserPath(out string browserPath))
{
IconReader.GetFileIconWithCache(browserPath, true, true, true, out _);
}

timerShowProcessStartedAsLoadingIcon.Tick += Tick;
timerShowProcessStartedAsLoadingIcon.Interval = 50;
timerShowProcessStartedAsLoadingIcon.Interval = 5;
timerShowProcessStartedAsLoadingIcon.Start();
void Tick(object sender, EventArgs e)
{
Expand Down
5 changes: 1 addition & 4 deletions Config/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,7 @@ public static void SetFolderByUser(bool save = true)

internal static void ShowHelpFAQ()
{
if (FileUrl.GetDefaultBrowserPath(out string browserPath))
{
Process.Start(browserPath, "https://github.com/Hofknecht/SystemTrayMenu#FAQ");
}
Log.ProcessStart("https://github.com/Hofknecht/SystemTrayMenu#FAQ");
}

/// <summary>
Expand Down
42 changes: 1 addition & 41 deletions DataClasses/RowData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ internal bool ReadIcon(bool isDirectory, ref string resolvedLnkPath, int level)
}
else if (fileExtension == ".url")
{
handled = SetUrl(level);
SetText($"{FileInfo.Name[0..^4]}");
showOverlay = true;
}
else if (fileExtension == ".sln")
Expand Down Expand Up @@ -290,46 +290,6 @@ private bool SetLnk(int level, ref bool isLnkDirectory, ref string resolvedLnkPa
return handled;
}

private bool SetUrl(int level)
{
bool handled = false;
string iconFile = string.Empty;
try
{
FileIni file = new(TargetFilePath);
iconFile = file.Value("IconFile", string.Empty);
if (string.IsNullOrEmpty(iconFile))
{
if (FileUrl.GetDefaultBrowserPath(out string browserPath))
{
FilePathIcon = browserPath;
icon = IconReader.GetFileIconWithCache(FilePathIcon, true, true, level == 0, out bool loading);
IconLoading = loading;
handled = true;
}
}
else if (File.Exists(iconFile))
{
FilePathIcon = iconFile;
icon = IconReader.GetFileIconWithCache(FilePathIcon, true, true, level == 0, out bool loading);
IconLoading = loading;
handled = true;
}
else
{
Log.Info($"Resolve *.URL '{TargetFilePath}' has no icon");
}
}
catch (Exception ex)
{
Log.Warn($"path:'{TargetFilePath}', iconFile:'{iconFile}'", ex);
}

SetText($"{FileInfo.Name[0..^4]}");

return handled;
}

private bool SetSln(int level)
{
bool handled = false;
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.1.1.2")]
[assembly: AssemblyFileVersion("1.1.1.2")]
[assembly: AssemblyVersion("1.1.1.3")]
[assembly: AssemblyFileVersion("1.1.1.3")]
35 changes: 0 additions & 35 deletions Utilities/File/FileIni.cs

This file was deleted.

83 changes: 0 additions & 83 deletions Utilities/File/FileUrl.cs

This file was deleted.

0 comments on commit b1226d1

Please sign in to comment.