Use more FileUtils based file dialogs

Change-Id: I1e7ec0493c26afe58e17afb8923a2b1023f6dcd4
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2021-08-17 16:36:42 +02:00
parent 6e8c4aa835
commit 584217a52f
33 changed files with 226 additions and 226 deletions

View File

@@ -49,6 +49,8 @@
#include <memory>
using namespace Utils;
namespace ProjectExplorer {
namespace Internal {
@@ -73,14 +75,14 @@ ParseIssuesDialog::ParseIssuesDialog(QWidget *parent) : QDialog(parent), d(new P
const auto loadFileButton = new QPushButton(tr("Load from File..."));
connect(loadFileButton, &QPushButton::clicked, this, [this] {
const QString filePath = QFileDialog::getOpenFileName(this, tr("Choose File"));
const FilePath filePath = FileUtils::getOpenFilePath(this, tr("Choose File"));
if (filePath.isEmpty())
return;
QFile file(filePath);
QFile file(filePath.toString());
if (!file.open(QIODevice::ReadOnly)) {
QMessageBox::critical(this, tr("Could Not Open File"),
tr("Could not open file: \"%1\": %2")
.arg(filePath, file.errorString()));
.arg(filePath.toUserOutput(), file.errorString()));
return;
}
d->compileOutputEdit.setPlainText(QString::fromLocal8Bit(file.readAll()));