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