feat: Update dialog offer open plugin folder

This commit is contained in:
Petr Mironychev
2025-01-27 00:54:49 +01:00
parent 5b99e68e53
commit 4bf955462f
2 changed files with 42 additions and 5 deletions

View File

@ -159,11 +159,19 @@ void PluginUpdater::handleDownloadFinished()
return;
}
QString downloadPath = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation);
QString downloadPath = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)
+ QDir::separator() + "QodeAssist_v" + m_lastUpdateInfo.version;
QDir().mkpath(downloadPath);
QString filePath = downloadPath + QDir::separator() + m_lastUpdateInfo.fileName;
if (QFile::exists(filePath)) {
emit downloadError(tr("Update file already exists: %1").arg(filePath));
reply->deleteLater();
return;
}
QString filePath = downloadPath + "/" + m_lastUpdateInfo.fileName;
QFile file(filePath);
if (!file.open(QIODevice::WriteOnly)) {
emit downloadError(tr("Could not save the update file"));
reply->deleteLater();
@ -174,7 +182,6 @@ void PluginUpdater::handleDownloadFinished()
file.close();
emit downloadFinished(filePath);
reply->deleteLater();
}