Utils: Avoid some FilePath::toString() uses

Change-Id: I7d6ee7739e14a25787ca661e10cc24fa6c536780
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
hjk
2023-07-20 14:47:49 +02:00
parent 934eb86d77
commit 2f11a1d32b
2 changed files with 5 additions and 5 deletions

View File

@@ -181,7 +181,7 @@ void DropMimeData::addFile(const FilePath &filePath, int line, int column)
{ {
// standard mime data // standard mime data
QList<QUrl> currentUrls = urls(); QList<QUrl> currentUrls = urls();
currentUrls.append(QUrl::fromLocalFile(filePath.toString())); currentUrls.append(filePath.toUrl());
setUrls(currentUrls); setUrls(currentUrls);
// special mime data // special mime data
m_files.append(DropSupport::FileSpec(filePath, line, column)); m_files.append(DropSupport::FileSpec(filePath, line, column));

View File

@@ -45,12 +45,12 @@ static QString msgUnexpectedOutput(const QByteArray &what)
static QString msgCannotChangeToWorkDir(const FilePath &dir, const QString &why) static QString msgCannotChangeToWorkDir(const FilePath &dir, const QString &why)
{ {
return Tr::tr("Cannot change to working directory \"%1\": %2").arg(dir.toString(), why); return Tr::tr("Cannot change to working directory \"%1\": %2").arg(dir.toUserOutput(), why);
} }
static QString msgCannotExecute(const QString &p, const QString &why) static QString msgCannotExecute(const FilePath &p, const QString &why)
{ {
return Tr::tr("Cannot execute \"%1\": %2").arg(p, why); return Tr::tr("Cannot execute \"%1\": %2").arg(p.toUserOutput(), why);
} }
static QString msgPromptToClose() static QString msgPromptToClose()
@@ -169,7 +169,7 @@ void TerminalInterface::onStubReadyRead()
errnoToString(out.mid(10).toInt()))); errnoToString(out.mid(10).toInt())));
} else if (out.startsWith("err:exec ")) { } else if (out.startsWith("err:exec ")) {
emitError(QProcess::FailedToStart, emitError(QProcess::FailedToStart,
msgCannotExecute(m_setup.m_commandLine.executable().toString(), msgCannotExecute(m_setup.m_commandLine.executable(),
errnoToString(out.mid(9).toInt()))); errnoToString(out.mid(9).toInt())));
} else if (out.startsWith("spid ")) { } else if (out.startsWith("spid ")) {
d->envListFile.reset(); d->envListFile.reset();