Don't ask the user questions in nox build when in non-interactive mode. Closes #3875.

This commit is contained in:
sledgehammer999
2015-11-17 22:39:59 +02:00
parent 9718b7d9ba
commit 00fae05507
2 changed files with 16 additions and 2 deletions

View File

@@ -104,7 +104,7 @@ bool upgradeResumeFile(const QString &filepath)
return false;
}
bool upgrade()
bool upgrade(bool ask = true)
{
QString backupFolderPath = Utils::Fs::expandPathAbs(Utils::Fs::QDesktopServicesDataLocation() + "BT_backup");
QDir backupFolderDir(backupFolderPath);
@@ -112,7 +112,7 @@ bool upgrade()
QStringList backupFiles = backupFolderDir.entryList(QStringList() << QLatin1String("*.fastresume"), QDir::Files, QDir::Unsorted);
if (!backupFiles.isEmpty()) {
if (!userAcceptsUpgrade()) return false;
if (ask && !userAcceptsUpgrade()) return false;
QRegExp rx(QLatin1String("^([A-Fa-f0-9]{40})\\.fastresume$"));
foreach (QString backupFile, backupFiles) {