2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 22:55:11 +00:00

fixed update downloader destroy, select message outside message rect from context menu

This commit is contained in:
John Preston
2014-11-27 21:58:51 +03:00
parent 5aecf2d3a3
commit 9d0f1c4e43
4 changed files with 13 additions and 5 deletions

View File

@@ -179,6 +179,7 @@ void Application::onAppUpdate(const MTPhelp_AppUpdate &response) {
startUpdateCheck();
} else {
updateThread = new QThread();
connect(updateThread, SIGNAL(finished()), updateThread, SLOT(deleteLater()));
updateDownloader = new PsUpdateDownloader(updateThread, response.c_help_appUpdate());
updateThread->start();
}
@@ -201,6 +202,7 @@ void Application::updateGotCurrent() {
int32 currentVersion = m.captured(1).toInt();
if (currentVersion > AppVersion) {
updateThread = new QThread();
connect(updateThread, SIGNAL(finished()), updateThread, SLOT(deleteLater()));
updateDownloader = new PsUpdateDownloader(updateThread, m.captured(2));
updateThread->start();
}
@@ -247,7 +249,7 @@ void Application::onUpdateFailed() {
if (updateDownloader) {
updateDownloader->deleteLater();
updateDownloader = 0;
if (updateThread) updateThread->deleteLater();
if (updateThread) updateThread->quit();
updateThread = 0;
}
@@ -477,7 +479,7 @@ void Application::stopUpdate() {
if (updateDownloader) {
updateDownloader->deleteLater();
updateDownloader = 0;
if (updateThread) updateThread->deleteLater();
if (updateThread) updateThread->quit();
updateThread = 0;
}
}
@@ -775,9 +777,9 @@ Application::~Application() {
delete updateReply;
delete ::uploader;
updateReply = 0;
delete updateDownloader;
if (updateDownloader) updateDownloader->deleteLater();
updateDownloader = 0;
delete updateThread;
if (updateThread) updateThread->quit();
updateThread = 0;
delete window;