Skip to content

Commit

Permalink
Fix instance name not being set on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
srwi committed Feb 26, 2023
1 parent 9a1ba93 commit a8acf6e
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions EverythingToolbar/EverythingSearch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,15 @@ private void OnSettingChanged(object sender, PropertyChangedEventArgs e)

public bool Initialize()
{
SetInstanceName(Settings.Default.instanceName);

var major = Everything_GetMajorVersion();
var minor = Everything_GetMinorVersion();
var revision = Everything_GetRevision();

if (major > 1 || (major == 1 && minor > 4) || (major == 1 && minor == 4 && revision >= 1))
{
_logger.Info("Everything version: {major}.{minor}.{revision}", major, minor, revision);
SetInstanceName(Settings.Default.instanceName);
return true;
}

Expand All @@ -154,13 +155,9 @@ public bool Initialize()

public void SetInstanceName(string name)
{
if (name == "")
{
Everything_SetInstanceName("");
return;
}

_logger.Info("Setting Everything instance name: " + name);
if (name != string.Empty)
_logger.Info("Setting Everything instance name: " + name);

Everything_SetInstanceName(name);
}

Expand Down

0 comments on commit a8acf6e

Please sign in to comment.