UI: AutoUpdateManager: Simplify clearUpdateDir()

This commit is contained in:
Nodir Temirkhodjaev 2024-10-18 13:52:19 +05:00
parent 63cee5624c
commit c4cb2a3cb9

View File

@ -82,6 +82,9 @@ void AutoUpdateManager::setupManager()
{ {
setupConfManager(); setupConfManager();
setupTaskManager(); setupTaskManager();
// Wait Installer's exit
QTimer::singleShot(900, this, &AutoUpdateManager::clearUpdateDir);
} }
void AutoUpdateManager::setupConfManager() void AutoUpdateManager::setupConfManager()
@ -106,9 +109,6 @@ void AutoUpdateManager::setupTaskManager()
[=, this] { setupByTaskInfo(taskInfo); }); [=, this] { setupByTaskInfo(taskInfo); });
setupByTaskInfo(taskInfo); setupByTaskInfo(taskInfo);
// Wait Installer's exit
QTimer::singleShot(500, this, &AutoUpdateManager::clearUpdateDir);
} }
void AutoUpdateManager::setupRestart() void AutoUpdateManager::setupRestart()
@ -197,10 +197,7 @@ void AutoUpdateManager::onRestartClientsRequested(bool restarting)
void AutoUpdateManager::clearUpdateDir() void AutoUpdateManager::clearUpdateDir()
{ {
if (isDownloaded()) if (isDownloaded() || isDownloading())
return;
if (!IoC<FortSettings>()->isMaster())
return; return;
if (!FileUtil::pathExists(updatePath())) if (!FileUtil::pathExists(updatePath()))