mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-07-18 13:04:28 -04:00
fix: Remove installing plugin from update dialog
This commit is contained in:
@ -159,9 +159,7 @@ void PluginUpdater::handleDownloadFinished()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString downloadPath = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)
|
QString downloadPath = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation);
|
||||||
+ QDir::separator() + "qodeassisttemp";
|
|
||||||
QDir().mkpath(downloadPath);
|
|
||||||
|
|
||||||
QString filePath = downloadPath + "/" + m_lastUpdateInfo.fileName;
|
QString filePath = downloadPath + "/" + m_lastUpdateInfo.fileName;
|
||||||
QFile file(filePath);
|
QFile file(filePath);
|
||||||
@ -175,16 +173,7 @@ void PluginUpdater::handleDownloadFinished()
|
|||||||
file.write(reply->readAll());
|
file.write(reply->readAll());
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
if (!Core::executePluginInstallWizard(Utils::FilePath::fromString(filePath))) {
|
|
||||||
emit downloadError(tr("Failed to install the update"));
|
|
||||||
} else {
|
|
||||||
emit downloadFinished(filePath);
|
emit downloadFinished(filePath);
|
||||||
}
|
|
||||||
|
|
||||||
auto tempDir = QDir(downloadPath);
|
|
||||||
if (tempDir.exists()) {
|
|
||||||
tempDir.removeRecursively();
|
|
||||||
}
|
|
||||||
|
|
||||||
reply->deleteLater();
|
reply->deleteLater();
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ UpdateDialog::UpdateDialog(QWidget *parent)
|
|||||||
m_layout->addWidget(m_progress);
|
m_layout->addWidget(m_progress);
|
||||||
|
|
||||||
auto *buttonLayout = new QHBoxLayout;
|
auto *buttonLayout = new QHBoxLayout;
|
||||||
m_downloadButton = new QPushButton(tr("Download and Install"), this);
|
m_downloadButton = new QPushButton(tr("Download"), this);
|
||||||
m_downloadButton->setEnabled(false);
|
m_downloadButton->setEnabled(false);
|
||||||
buttonLayout->addWidget(m_downloadButton);
|
buttonLayout->addWidget(m_downloadButton);
|
||||||
|
|
||||||
@ -166,11 +166,7 @@ void UpdateDialog::updateProgress(qint64 received, qint64 total)
|
|||||||
void UpdateDialog::handleDownloadFinished(const QString &path)
|
void UpdateDialog::handleDownloadFinished(const QString &path)
|
||||||
{
|
{
|
||||||
m_progress->setVisible(false);
|
m_progress->setVisible(false);
|
||||||
QMessageBox::information(
|
QMessageBox::information(this, tr("Update Successful"), tr("Update has been downloaded."));
|
||||||
this,
|
|
||||||
tr("Update Successful"),
|
|
||||||
tr("Update has been downloaded and installed. "
|
|
||||||
"Please restart Qt Creator to apply changes."));
|
|
||||||
accept();
|
accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user