diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2016-03-22 14:10:18 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2016-03-25 22:22:33 +0000 |
commit | a34db672a6dd30587b55a27927bdd85c3c4a89a7 (patch) | |
tree | e400fe14785b6979b657cc9c7e6f03a20d65065f | |
parent | 37547a91b10da7559ee03f9fe2c23f8f22cc1c27 (diff) |
QQmlEngineDebugService: Make translating the usage simpler.
Remove whitespace and formatting from the messages where possible
to reduce the chances of them being overlooked by the translators.
Change-Id: Ie0d0b29e03b13ae4f46dce1b57dd2a85d427c8c6
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
-rw-r--r-- | src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp | 80 |
1 files changed, 42 insertions, 38 deletions
diff --git a/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp b/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp index 7c18f0c38a..bc259afaa4 100644 --- a/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp +++ b/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp @@ -329,7 +329,6 @@ bool QQmlDebugServerImpl::open(const QVariantHash &configuration = QVariantHash( return true; } -#define qUsage qWarning().noquote().nospace void QQmlDebugServerImpl::parseArguments() { // format: qmljsdebugger=port:<port_from>[,port_to],host:<ip address>][,block] @@ -378,8 +377,9 @@ void QQmlDebugServerImpl::parseArguments() } else if (!services.isEmpty()) { services.append(strArgument); } else { - qUsage() << tr("QML Debugger: Invalid argument \"%1\" detected. Ignoring the same.") - .arg(strArgument); + const QString message = tr("QML Debugger: Invalid argument \"%1\" detected." + " Ignoring the same.").arg(strArgument); + qWarning("%s", qPrintable(message)); } } @@ -391,43 +391,47 @@ void QQmlDebugServerImpl::parseArguments() else m_thread.setPortRange(portFrom, portTo, hostAddress); } else { - qUsage() << tr("QML Debugger: Ignoring \"-qmljsdebugger=%1\".").arg(args); - qUsage() << tr("The format is \"-qmljsdebugger=[file:<file>|port:<port_from>][,<port_to>]" - "[,host:<ip address>][,block][,services:<service>][,<service>]*\"\n"); - qUsage() << tr("\"file:\" can be used to specify the name of a file the debugger will try " - "to connect to using a QLocalSocket. If \"file:\" is given any \"host:\" and" - "\"port:\" arguments will be ignored.\n"); - qUsage() << tr("\"host:\" and \"port:\" can be used to specify an address and a single " - "port or a range of ports the debugger will try to bind to with a " - "QTcpServer.\n"); - qUsage() << tr("\"block\" makes the debugger and some services wait for clients to be " - "connected and ready before the first QML engine starts.\n"); - qUsage() << tr("\"services:\" can be used to specify which debug services the debugger " - "should load. Some debug services interact badly with others. The V4 " - "debugger should not be loaded when using the QML profiler as it will force " - "any V4 engines to use the JavaScript interpreter rather than the JIT. The " - "following debug services are available by default:"); - qUsage() << QQmlEngineDebugService::s_key << tr("\t- The QML debugger"); - qUsage() << QV4DebugService::s_key << tr("\t- The V4 debugger"); - qUsage() << QQmlInspectorService::s_key << tr("\t- The QML inspector"); - qUsage() << QQmlProfilerService::s_key << tr("\t- The QML profiler"); - qUsage() << QQmlEngineControlService::s_key - << tr("\t- Allows the client to delay the starting and stopping of\n" - "\t\t QML engines until other services are ready. QtCreator\n" - "\t\t uses this service with the QML profiler in order to\n" - "\t\t profile multiple QML engines at the same time."); - qUsage() << QDebugMessageService::s_key - << tr("\t- Sends qDebug() and similar messages over the QML debug\n" - "\t\t connection. QtCreator uses this for showing debug\n" - "\t\t messages in the JavaScript console."); - qUsage() << tr("Other services offered by qmltooling plugins that implement " - "QQmlDebugServiceFactory and which can be found in the standard plugin " - "paths will also be available and can be specified. If no \"services\" " - "argument is given, all services found this way, including the default " - "ones, are loaded."); + QString usage; + QTextStream str(&usage); + str << tr("QML Debugger: Ignoring \"-qmljsdebugger=%1\".").arg(args) << '\n' + << tr("The format is \"-qmljsdebugger=[file:<file>|port:<port_from>][,<port_to>]" + "[,host:<ip address>][,block][,services:<service>][,<service>]*\"") << '\n' + << tr("\"file:\" can be used to specify the name of a file the debugger will try " + "to connect to using a QLocalSocket. If \"file:\" is given any \"host:\" and" + "\"port:\" arguments will be ignored.") << '\n' + << tr("\"host:\" and \"port:\" can be used to specify an address and a single " + "port or a range of ports the debugger will try to bind to with a " + "QTcpServer.") << '\n' + << tr("\"block\" makes the debugger and some services wait for clients to be " + "connected and ready before the first QML engine starts.") << '\n' + << tr("\"services:\" can be used to specify which debug services the debugger " + "should load. Some debug services interact badly with others. The V4 " + "debugger should not be loaded when using the QML profiler as it will force " + "any V4 engines to use the JavaScript interpreter rather than the JIT. The " + "following debug services are available by default:") << '\n' + << QQmlEngineDebugService::s_key << "\t- " << tr("The QML debugger") << '\n' + << QV4DebugService::s_key << "\t- " << tr("The V4 debugger") << '\n' + << QQmlInspectorService::s_key << "\t- " << tr("The QML inspector") << '\n' + << QQmlProfilerService::s_key << "\t- " << tr("The QML profiler") << '\n' + << QQmlEngineControlService::s_key << "\t- " + //: Please preserve the line breaks and formatting + << tr("Allows the client to delay the starting and stopping of\n" + "\t\t QML engines until other services are ready. QtCreator\n" + "\t\t uses this service with the QML profiler in order to\n" + "\t\t profile multiple QML engines at the same time.") + << '\n' << QDebugMessageService::s_key << "\t- " + //: Please preserve the line breaks and formatting + << tr("Sends qDebug() and similar messages over the QML debug\n" + "\t\t connection. QtCreator uses this for showing debug\n" + "\t\t messages in the JavaScript console.") << '\n' + << tr("Other services offered by qmltooling plugins that implement " + "QQmlDebugServiceFactory and which can be found in the standard plugin " + "paths will also be available and can be specified. If no \"services\" " + "argument is given, all services found this way, including the default " + "ones, are loaded."); + qWarning("%s", qPrintable(usage)); } } -#undef qUsage void QQmlDebugServerImpl::receiveMessage() { |