summaryrefslogtreecommitdiffstats
path: root/src/qdbus/qdbus/qdbus.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qdbus/qdbus/qdbus.cpp')
-rw-r--r--src/qdbus/qdbus/qdbus.cpp45
1 files changed, 10 insertions, 35 deletions
diff --git a/src/qdbus/qdbus/qdbus.cpp b/src/qdbus/qdbus/qdbus.cpp
index a5e7af95e..f18fdca3a 100644
--- a/src/qdbus/qdbus/qdbus.cpp
+++ b/src/qdbus/qdbus/qdbus.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 <stdio.h>
#include <stdlib.h>
@@ -134,7 +109,7 @@ static void listObjects(const QString &service, const QString &path)
}
QDomDocument doc;
- doc.setContent(xml);
+ doc.setContent(xml.value());
QDomElement node = doc.documentElement();
QDomElement child = node.firstChildElement();
while (!child.isNull()) {
@@ -189,7 +164,7 @@ static void listInterface(const QString &service, const QString &path, const QSt
QList<QByteArray> types = mm.parameterTypes();
QList<QByteArray> names = mm.parameterNames();
bool first = true;
- for (int i = 0; i < types.count(); ++i) {
+ for (int i = 0; i < types.size(); ++i) {
printf("%s%s",
first ? "" : ", ",
types.at(i).constData());
@@ -219,7 +194,7 @@ static void listAllInterfaces(const QString &service, const QString &path)
}
QDomDocument doc;
- doc.setContent(xml);
+ doc.setContent(xml.value());
QDomElement node = doc.documentElement();
QDomElement child = node.firstChildElement();
while (!child.isNull()) {
@@ -299,17 +274,17 @@ static int placeCall(const QString &service, const QString &path, const QString
QMetaMethod mm = mo->method(knownIds.takeFirst());
QList<QByteArray> types = mm.parameterTypes();
- for (int i = 0; i < types.count(); ++i) {
+ for (int i = 0; i < types.size(); ++i) {
if (types.at(i).endsWith('&')) {
// reference (and not a reference to const): output argument
// we're done with the inputs
- while (types.count() > i)
+ while (types.size() > i)
types.removeLast();
break;
}
}
- for (int i = 0; !args.isEmpty() && i < types.count(); ++i) {
+ for (int i = 0; !args.isEmpty() && i < types.size(); ++i) {
const QMetaType metaType = QMetaType::fromName(types.at(i));
if (!metaType.isValid()) {
fprintf(stderr, "Cannot call method '%s' because type '%s' is unknown to this tool\n",
@@ -363,7 +338,7 @@ static int placeCall(const QString &service, const QString &path, const QString
}
params += p;
}
- if (params.count() == types.count() && args.isEmpty())
+ if (params.size() == types.size() && args.isEmpty())
matchFound = true;
else if (knownIds.isEmpty()) {
fprintf(stderr, "Invalid number of parameters\n");
@@ -411,7 +386,7 @@ static bool globServices(QDBusConnectionInterface *bus, const QString &glob)
QStringList names = bus->registeredServiceNames();
names.sort();
- for (const QString &name : qAsConst(names))
+ for (const QString &name : std::as_const(names))
if (pattern.match(name).hasMatch())
printf("%s\n", qPrintable(name));