summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Grasch <grasch@simon-listens.org>2011-08-31 09:31:59 (GMT)
committerFrederik Gladhorn <frederik.gladhorn@nokia.com>2011-08-31 09:31:59 (GMT)
commit75170711a3486384ca3d66563c4b011a2505af39 (patch)
treef6f7ca9766a700d97a706f6ef5ab8f2fca9b7150
parent9689751ddabd402abd89803c995c14dfd600b263 (diff)
downloadQt-75170711a3486384ca3d66563c4b011a2505af39.zip
Qt-75170711a3486384ca3d66563c4b011a2505af39.tar.gz
Qt-75170711a3486384ca3d66563c4b011a2505af39.tar.bz2
Introducing --address <bus> parameter to qdbus
Merge-request: 1363 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
-rw-r--r--tools/qdbus/qdbus/qdbus.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/qdbus/qdbus/qdbus.cpp b/tools/qdbus/qdbus/qdbus.cpp
index 14b4b9e..4e90418 100644
--- a/tools/qdbus/qdbus/qdbus.cpp
+++ b/tools/qdbus/qdbus/qdbus.cpp
@@ -59,7 +59,7 @@ static bool printArgumentsLiterally = false;
static void showUsage()
{
- printf("Usage: qdbus [--system] [--literal] [servicename] [path] [method] [args]\n"
+ printf("Usage: qdbus [--system | --address ADDRESS] [--literal] [servicename] [path] [method] [args]\n"
"\n"
" servicename the service to connect to (e.g., org.freedesktop.DBus)\n"
" path the path to the object (e.g., /)\n"
@@ -71,6 +71,7 @@ static void showUsage()
"\n"
"Options:\n"
" --system connect to the system bus\n"
+ " --address ADDRESS connect to the given bus\n"
" --literal print replies literally\n");
}
@@ -454,6 +455,10 @@ int main(int argc, char **argv)
if (arg == QLatin1String("--system")) {
connection = QDBusConnection::systemBus();
connectionOpened = true;
+ } else
+ if (arg == QLatin1String("--address")) {
+ connection = QDBusConnection::connectToBus(args.takeFirst(), "bus");
+ connectionOpened = true;
} else if (arg == QLatin1String("--literal")) {
printArgumentsLiterally = true;
} else if (arg == QLatin1String("--help")) {