Skip to content

Commit 5890c0a

Browse files
committed
Fixes/tweaks
1 parent a9e81de commit 5890c0a

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

createprogress.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ void CreateProgress::on_CreateProgress_rejected()
306306
// TODO: look at using .terminate() for non-Windows
307307
parpar.kill();
308308
ended(tr("Cancelled"), false);
309+
parpar.waitForFinished(1000); // try to avoid warning of destroying QProcess whilst still active
309310
deleteOutput();
310311
}
311312
}
@@ -341,7 +342,7 @@ void CreateProgress::on_btnBackground_clicked()
341342
}
342343
}
343344
if(!SetPriorityClass(hPP, isBackground ? IDLE_PRIORITY_CLASS : normPrio)) {
344-
ui->btnBackground->setEnabled(!isBackground);
345+
ui->btnBackground->setChecked(!isBackground);
345346
}
346347
CloseHandle(hPP);
347348
#elif defined(Q_OS_UNIX)
@@ -365,7 +366,9 @@ void CreateProgress::on_btnBackground_clicked()
365366
}
366367

367368
if(setpriority(PRIO_PROCESS, parpar.processId(), isBackground ? 19 : normPrio)) {
368-
ui->btnBackground->setEnabled(!isBackground);
369+
ui->btnBackground->setChecked(!isBackground);
370+
// TODO: it seems like you can't increase priority back to normal on Linux
371+
// TODO: if failed, the settings change is still persisted
369372
}
370373
#endif
371374

mainwindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ void MainWindow::adjustExpansion(bool allowExpand) {
124124
ui->fraDestOpts->layout()->setContentsMargins(destOptsMargin);
125125

126126
auto destPolicy = ui->grpDest->sizePolicy();
127-
destPolicy.setVerticalPolicy(outExp ? QSizePolicy::Preferred : QSizePolicy::Maximum);
127+
destPolicy.setVerticalPolicy(outExp ? QSizePolicy::Expanding : QSizePolicy::Maximum);
128128
ui->grpDest->setSizePolicy(destPolicy);
129129
ui->grpDest->adjustSize();
130130

settings.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ QStringList Settings::parparBin(bool* isSystemExecutable) const
1616
if(!pathNode.isEmpty()) {
1717
if(pathNode != "node") // system executable - can't make absolute
1818
pathNode = pathConverter(pathNode);
19-
return {pathConverter(pathNode), pathConverter(pathParPar)};
19+
return {pathNode, pathConverter(pathParPar)};
2020
} else {
2121
if(pathParPar != "parpar")
2222
pathParPar = pathConverter(pathParPar);
@@ -70,17 +70,18 @@ static QString relPathConverter(const QString& file)
7070
QDir cd;
7171
QFileInfo info(file);
7272
if(info.isAbsolute()) {
73-
QString relPath = cd.relativeFilePath(file).replace("/", QDir::separator());
73+
QString relPath = cd.relativeFilePath(file);
7474
#ifdef Q_OS_WINDOWS
7575
// on Windows, can't use relative paths if on different drives (or drive <> UNC path)
7676
if(cd.absolutePath().left(2).compare(file.left(2), Qt::CaseInsensitive) == 0)
7777
#else
7878
// on *nix, path in current dir should have preceeding './'
7979
// (we don't really require it, because we're not executing over a shell, but it distinguishes a local binary vs system binary)
80-
if(!relPath.contains(QDir::separator()))
80+
if(!relPath.contains("/"))
8181
return QString(".") + QDir::separator() + relPath;
8282
#endif
83-
return relPath;
83+
if(!relPath.startsWith("../")) // only allow relative paths if in the same folder
84+
return relPath.replace("/", QDir::separator());
8485
}
8586
return file;
8687
}

0 commit comments

Comments
 (0)