diff options
Diffstat (limited to 'src/designer/src/designer/assistantclient.cpp')
-rw-r--r-- | src/designer/src/designer/assistantclient.cpp | 54 |
1 files changed, 14 insertions, 40 deletions
diff --git a/src/designer/src/designer/assistantclient.cpp b/src/designer/src/designer/assistantclient.cpp index 45fee4393..43934c13e 100644 --- a/src/designer/src/designer/assistantclient.cpp +++ b/src/designer/src/designer/assistantclient.cpp @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Designer of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "assistantclient.h" @@ -40,6 +15,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + enum { debugAssistantClient = 0 }; AssistantClient::AssistantClient() = default; @@ -55,22 +32,19 @@ AssistantClient::~AssistantClient() bool AssistantClient::showPage(const QString &path, QString *errorMessage) { - QString cmd = QStringLiteral("SetSource "); - cmd += path; + const QString cmd = "SetSource "_L1 + path; return sendCommand(cmd, errorMessage); } bool AssistantClient::activateIdentifier(const QString &identifier, QString *errorMessage) { - QString cmd = QStringLiteral("ActivateIdentifier "); - cmd += identifier; + const QString cmd = "ActivateIdentifier "_L1 + identifier; return sendCommand(cmd, errorMessage); } bool AssistantClient::activateKeyword(const QString &keyword, QString *errorMessage) { - QString cmd = QStringLiteral("ActivateKeyword "); - cmd += keyword; + const QString cmd = "ActivateKeyword "_L1 + keyword; return sendCommand(cmd, errorMessage); } @@ -85,7 +59,7 @@ bool AssistantClient::sendCommand(const QString &cmd, QString *errorMessage) return false; } QTextStream str(m_process); - str << cmd << QLatin1Char('\n') << Qt::endl; + str << cmd << "\n\n"; return true; } @@ -98,13 +72,13 @@ QString AssistantClient::binary() { QString app = QLibraryInfo::path(QLibraryInfo::BinariesPath) + QDir::separator(); #if !defined(Q_OS_MACOS) - app += QStringLiteral("assistant"); + app += "assistant"_L1; #else - app += QStringLiteral("Assistant.app/Contents/MacOS/Assistant"); + app += "Assistant.app/Contents/MacOS/Assistant"_L1; #endif #if defined(Q_OS_WIN) - app += QStringLiteral(".exe"); + app += ".exe"_L1; #endif return app; @@ -147,7 +121,7 @@ bool AssistantClient::ensureRunning(QString *errorMessage) if (debugAssistantClient) qDebug() << "Running " << app; // run - QStringList args(QStringLiteral("-enableRemoteControl")); + QStringList args{u"-enableRemoteControl"_s}; m_process->start(app, args); if (!m_process->waitForStarted()) { *errorMessage = QCoreApplication::translate("AssistantClient", "Unable to launch assistant (%1).").arg(app); @@ -169,12 +143,12 @@ QString AssistantClient::documentUrl(const QString &module, int qtVersion) QString AssistantClient::designerManualUrl(int qtVersion) { - return documentUrl(QStringLiteral("qtdesigner"), qtVersion); + return documentUrl(u"qtdesigner"_s, qtVersion); } QString AssistantClient::qtReferenceManualUrl(int qtVersion) { - return documentUrl(QStringLiteral("qtdoc"), qtVersion); + return documentUrl(u"qtdoc"_s, qtVersion); } QT_END_NAMESPACE |