Skip to content

Commit d08ee30

Browse files
committed
Refactor plugin actions to simplify logic
Removed logoff operation logic and associated return statement. Eliminated return statement after recycle bin error handling. Removed async plugin data reload and success message logic. Simplified theme selector query handling by removing `return false`. These changes streamline the code and improve maintainability.
1 parent 1675705 commit d08ee30

File tree

1 file changed

+0
-6
lines changed
  • Plugins/Flow.Launcher.Plugin.Sys

1 file changed

+0
-6
lines changed

Plugins/Flow.Launcher.Plugin.Sys/Main.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,8 @@ private static List<Result> Commands(Query query)
282282
Localize.flowlauncher_plugin_sys_dlgtext_logoff_computer(),
283283
Localize.flowlauncher_plugin_sys_log_off(),
284284
MessageBoxButton.YesNo, MessageBoxImage.Warning);
285-
286285
if (result == MessageBoxResult.Yes)
287286
PInvoke.ExitWindowsEx(EXIT_WINDOWS_FLAGS.EWX_LOGOFF, REASON);
288-
289287
return true;
290288
}
291289
},
@@ -351,7 +349,6 @@ private static List<Result> Commands(Query query)
351349
Localize.flowlauncher_plugin_sys_dlgtitle_error(),
352350
MessageBoxButton.OK, MessageBoxImage.Error);
353351
}
354-
355352
return true;
356353
}
357354
},
@@ -425,13 +422,11 @@ private static List<Result> Commands(Query query)
425422
{
426423
// Hide the window first then show msg after done because sometimes the reload could take a while, so not to make user think it's frozen.
427424
Context.API.HideMainWindow();
428-
429425
_ = Context.API.ReloadAllPluginData().ContinueWith(_ =>
430426
Context.API.ShowMsg(
431427
Localize.flowlauncher_plugin_sys_dlgtitle_success(),
432428
Localize.flowlauncher_plugin_sys_dlgtext_all_applicableplugins_reloaded()),
433429
TaskScheduler.Current);
434-
435430
return true;
436431
}
437432
},
@@ -511,7 +506,6 @@ private static List<Result> Commands(Query query)
511506
else
512507
{
513508
Context.API.ChangeQuery($"{query.ActionKeyword}{Plugin.Query.ActionKeywordSeparator}{ThemeSelector.Keyword}{Plugin.Query.ActionKeywordSeparator}");
514-
515509
}
516510
return false;
517511
}

0 commit comments

Comments
 (0)