diff options
author | Kai Köhne <kai.koehne@qt.io> | 2021-06-13 14:28:53 +0200 |
---|---|---|
committer | Kai Köhne <kai.koehne@qt.io> | 2021-06-21 13:39:50 +0200 |
commit | 0fd4f2a8def276aab0cb6465ba7b9ce75beb3a86 (patch) | |
tree | 8b487cfa1f4186b4e86f1305a83a66186b30c654 /examples/assistant/remotecontrol | |
parent | 6db694453636a0f7b8c4f51048f352da80d912d2 (diff) |
Examples: Don't use QDir::separator() in internal paths
Documentation says:
You do not need to use this function to build file paths.
If you always use "/", Qt will translate your paths to conform
to the underlying operating system.
Change-Id: Iba62a197821b9abc819c3d333e44c9f1ed989898
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 8329ec476b3dc9bb7ffd17ee724b6b21c17e90ec)
Diffstat (limited to 'examples/assistant/remotecontrol')
-rw-r--r-- | examples/assistant/remotecontrol/remotecontrol.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/examples/assistant/remotecontrol/remotecontrol.cpp b/examples/assistant/remotecontrol/remotecontrol.cpp index 916a08efd..8b39aa6ff 100644 --- a/examples/assistant/remotecontrol/remotecontrol.cpp +++ b/examples/assistant/remotecontrol/remotecontrol.cpp @@ -98,11 +98,11 @@ void RemoteControl::on_launchButton_clicked() if (process->state() == QProcess::Running) return; - QString app = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QDir::separator(); + QString app = QLibraryInfo::location(QLibraryInfo::BinariesPath); #if !defined(Q_OS_MAC) - app += QLatin1String("assistant"); + app += QLatin1String("/assistant"); #else - app += QLatin1String("Assistant.app/Contents/MacOS/Assistant"); + app += QLatin1String("/Assistant.app/Contents/MacOS/Assistant"); #endif ui.contentsCheckBox->setChecked(true); @@ -113,8 +113,9 @@ void RemoteControl::on_launchButton_clicked() args << QLatin1String("-enableRemoteControl"); process->start(app, args); if (!process->waitForStarted()) { - QMessageBox::critical(this, tr("Remote Control"), - tr("Could not start Qt Assistant from %1.").arg(app)); + QMessageBox::critical( + this, tr("Remote Control"), + tr("Could not start Qt Assistant from %1.").arg(QDir::toNativeSeparators(app))); return; } |