Skip to content

Commit

Permalink
Revert method name & unify var namings
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansjfw committed Feb 4, 2022
1 parent 3870e04 commit db6baf9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/runner/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,16 +386,16 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
apply_general_settings(general_settings, false);
int rvalue = 0;
const bool elevated = is_process_elevated();
const bool withDontElevateArg = cmdLine.find("--dont-elevate") != std::string::npos;
const bool runElevatedSetting = general_settings.GetNamedBoolean(L"run_elevated", false);
const bool with_dont_elevate_arg = cmdLine.find("--dont-elevate") != std::string::npos;
const bool run_elevated_setting = general_settings.GetNamedBoolean(L"run_elevated", false);

if (elevated && withDontElevateArg && !runElevatedSetting)
if (elevated && with_dont_elevate_arg && !run_elevated_setting)

{
schedule_restart_as_non_elevated();
result = 0;
}
else if (elevated || !runElevatedSetting || withDontElevateArg)
else if (elevated || !run_elevated_setting || with_dont_elevate_arg)

{
result = runner(elevated, open_settings, settings_window, openOobe);
Expand Down Expand Up @@ -429,7 +429,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine

{
Logger::warn("Scheduled restart failed. Trying restart as admin as fallback...");
restart_elevated();
restart_same_elevation();
}
}
stop_tray_icon();
Expand Down
2 changes: 1 addition & 1 deletion src/runner/restart_elevated.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ bool restart_if_scheduled()
}
}

bool restart_elevated()
bool restart_same_elevation()
{
constexpr DWORD exe_path_size = 0xFFFF;
auto exe_path = std::make_unique<wchar_t[]>(exe_path_size);
Expand Down
2 changes: 1 addition & 1 deletion src/runner/restart_elevated.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ void schedule_restart_as_elevated(bool openSettings);
void schedule_restart_as_non_elevated();
bool is_restart_scheduled();
bool restart_if_scheduled();
bool restart_elevated();
bool restart_same_elevation();

0 comments on commit db6baf9

Please sign in to comment.