diff --git a/src/app/lrcinstance.h b/src/app/lrcinstance.h index f9c3fd4020a77539944662662fb9c7348e122381..19ee68903acd4b6c2f05a15b7f27518cd4796a50 100644 --- a/src/app/lrcinstance.h +++ b/src/app/lrcinstance.h @@ -138,7 +138,6 @@ Q_SIGNALS: void selectedConvUidChanged(); void restoreAppRequested(); void notificationClicked(); - void quitEngineRequested(); void conversationUpdated(const QString& convId, const QString& accountId); void draftSaved(const QString& convId); void base64SwarmAvatarChanged(); diff --git a/src/app/mainapplication.cpp b/src/app/mainapplication.cpp index 526bd269233f7bf8089bed02f40a7a4ffa9a9b58..a98bd4607135b28d4b85b57d75c2998042942c13 100644 --- a/src/app/mainapplication.cpp +++ b/src/app/mainapplication.cpp @@ -177,13 +177,6 @@ MainApplication::init() screenInfo_.setCurrentFocusWindow(this->focusWindow()); }); - QObject::connect( - lrcInstance_.get(), - &LRCInstance::quitEngineRequested, - this, - [this] { Q_EMIT engine_->quit(); }, - Qt::DirectConnection); - auto downloadPath = settingsManager_->getValue(Settings::Key::DownloadPath); auto screenshotPath = settingsManager_->getValue(Settings::Key::ScreenshotPath); auto allowTransferFromTrusted = settingsManager_->getValue(Settings::Key::AutoAcceptFiles) diff --git a/src/app/settingsview/components/UpdateDownloadDialog.qml b/src/app/settingsview/components/UpdateDownloadDialog.qml index e0bab64a715af78cb88d99f5640375dad0090e3e..d4827c223dd6885438e8e120ff51a4b09919026c 100644 --- a/src/app/settingsview/components/UpdateDownloadDialog.qml +++ b/src/app/settingsview/components/UpdateDownloadDialog.qml @@ -36,12 +36,12 @@ SimpleMessageDialog { Connections { target: UpdateManager - function onDownloadProgressChanged(bytesRead, totalBytes) { - downloadDialog.setDownloadProgress(bytesRead, totalBytes); + function onUpdateErrorOccurred(error) { + downloadDialog.close(); } - function onUpdateDownloadErrorOccurred(error) { - downloadDialog.close(); + function onDownloadProgressChanged(bytesRead, totalBytes) { + downloadDialog.setDownloadProgress(bytesRead, totalBytes); } function onUpdateDownloadFinished() { diff --git a/src/app/updatemanager.cpp b/src/app/updatemanager.cpp index 180cd2b3f624aac1a065a86f1e4cd293e30e00fb..ca300d336b1d69ad8f5e392123978240292ead10 100644 --- a/src/app/updatemanager.cpp +++ b/src/app/updatemanager.cpp @@ -95,12 +95,12 @@ struct UpdateManager::Impl : public QObject &NetworkManager::errorOccured, &parent_, &UpdateManager::updateErrorOccurred); - connect(&parent_, &UpdateManager::statusChanged, this, [this](GetStatus status) { + connect(&parent_, &UpdateManager::statusChanged, this, [this](Status status) { switch (status) { - case GetStatus::STARTED: + case Status::STARTED: Q_EMIT parent_.updateDownloadStarted(); break; - case GetStatus::FINISHED: + case Status::FINISHED: Q_EMIT parent_.updateDownloadFinished(); break; default: @@ -116,14 +116,15 @@ struct UpdateManager::Impl : public QObject [this, downloadUrl](bool success, const QString& errorMessage) { Q_UNUSED(success) Q_UNUSED(errorMessage) - lrcInstance_->finish(); - Q_EMIT lrcInstance_->quitEngineRequested(); - auto args = QString(" /passive /norestart WIXNONUILAUNCH=1"); QProcess process; - process.start("powershell ", - QStringList() << tempPath_ + "\\" + downloadUrl.fileName() << "/L*V" - << tempPath_ + "\\jami_x64_install.log" + args); - process.waitForFinished(); + auto basePath = tempPath_ + QDir::separator(); + auto msiPath = QDir::toNativeSeparators(basePath + downloadUrl.fileName()); + auto logPath = QDir::toNativeSeparators(basePath + "jami_x64_install.log"); + process.startDetached("msiexec", + QStringList() << "/i" << msiPath << "/passive" + << "/norestart" + << "WIXNONUILAUNCH=1" + << "/L*V" << logPath); }, tempPath_); }; @@ -313,10 +314,10 @@ UpdateManager::downloadFile(const QUrl& url, resetDownload(); } onDoneCallback(success, errorMessage); - Q_EMIT statusChanged(GetStatus::FINISHED); + Q_EMIT statusChanged(Status::FINISHED); }); - Q_EMIT statusChanged(GetStatus::STARTED); + Q_EMIT statusChanged(Status::STARTED); } void diff --git a/src/app/updatemanager.h b/src/app/updatemanager.h index c28fe75a918f79eccf22365c6743f05f8985794d..373c97fceb97feac2f899af1ae1685e0d156ff85 100644 --- a/src/app/updatemanager.h +++ b/src/app/updatemanager.h @@ -36,8 +36,8 @@ public: QObject* parent = nullptr); ~UpdateManager(); - enum GetStatus { STARTED, FINISHED }; - Q_ENUM(GetStatus) + enum Status { STARTED, FINISHED }; + Q_ENUM(Status) Q_INVOKABLE void checkForUpdates(bool quiet = false); Q_INVOKABLE void applyUpdates(bool beta = false); @@ -53,7 +53,7 @@ public: const QString& filePath); Q_SIGNALS: - void statusChanged(GetStatus status); + void statusChanged(UpdateManager::Status status); void downloadProgressChanged(qint64 bytesRead, qint64 totalBytes); void updateCheckReplyReceived(bool ok, bool found = false);