mirror of
https://github.com/tnodir/fort
synced 2024-11-15 04:05:50 +00:00
UI: AutoUpdateManager: Simplify clearUpdateDir()
This commit is contained in:
parent
63cee5624c
commit
c4cb2a3cb9
@ -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()))
|
||||||
|
Loading…
Reference in New Issue
Block a user