From a8acf6ee3c6dec8664cb9d1c6001c9f1a6683e22 Mon Sep 17 00:00:00 2001 From: stnkl <17520641+srwi@users.noreply.github.com> Date: Sun, 26 Feb 2023 15:50:33 +0100 Subject: [PATCH] Fix instance name not being set on startup --- EverythingToolbar/EverythingSearch.cs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/EverythingToolbar/EverythingSearch.cs b/EverythingToolbar/EverythingSearch.cs index 320e6ca00..5cdf6efd3 100644 --- a/EverythingToolbar/EverythingSearch.cs +++ b/EverythingToolbar/EverythingSearch.cs @@ -128,6 +128,8 @@ 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(); @@ -135,7 +137,6 @@ public bool Initialize() 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; } @@ -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); }