Changeset 561 for trunk/tools/qdbus
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/tools/qdbus/qdbus/qdbus.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the tools applications of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 109 109 static void listObjects(const QString &service, const QString &path) 110 110 { 111 QDBusInterface iface(service, path.isEmpty() ? QLatin1String("/") : path, 112 QLatin1String("org.freedesktop.DBus.Introspectable"), connection); 113 if (!iface.isValid()) { 114 QDBusError err(iface.lastError()); 115 fprintf(stderr, "Cannot introspect object %s at %s:\n%s (%s)\n", 116 qPrintable(path.isEmpty() ? QString(QLatin1String("/")) : path), qPrintable(service), 117 qPrintable(err.name()), qPrintable(err.message())); 118 exit(1); 119 } 120 QDBusReply<QString> xml = iface.call(QLatin1String("Introspect")); 121 122 if (!xml.isValid()) 123 return; // silently 111 // make a low-level call, to avoid introspecting the Introspectable interface 112 QDBusMessage call = QDBusMessage::createMethodCall(service, path.isEmpty() ? QLatin1String("/") : path, 113 QLatin1String("org.freedesktop.DBus.Introspectable"), 114 QLatin1String("Introspect")); 115 QDBusReply<QString> xml = connection.call(call); 116 117 if (path.isEmpty()) { 118 // top-level 119 if (xml.isValid()) { 120 printf("/\n"); 121 } else { 122 QDBusError err = xml.error(); 123 if (err.type() == QDBusError::ServiceUnknown) 124 fprintf(stderr, "Service '%s' does not exist.\n", qPrintable(service)); 125 else 126 printf("Error: %s\n%s\n", qPrintable(err.name()), qPrintable(err.message())); 127 exit(2); 128 } 129 } else if (!xml.isValid()) { 130 // this is not the first object, just fail silently 131 return; 132 } 124 133 125 134 QDomDocument doc; … … 193 202 static void listAllInterfaces(const QString &service, const QString &path) 194 203 { 195 QDBusInterface iface(service, path, QLatin1String("org.freedesktop.DBus.Introspectable"), connection); 196 if (!iface.isValid()) { 197 QDBusError err(iface.lastError()); 198 fprintf(stderr, "Cannot introspect object %s at %s:\n%s (%s)\n", 199 qPrintable(path), qPrintable(service), 200 qPrintable(err.name()), qPrintable(err.message())); 201 exit(1); 202 } 203 QDBusReply<QString> xml = iface.call(QLatin1String("Introspect")); 204 205 if (!xml.isValid()) 206 return; // silently 204 // make a low-level call, to avoid introspecting the Introspectable interface 205 QDBusMessage call = QDBusMessage::createMethodCall(service, path.isEmpty() ? QLatin1String("/") : path, 206 QLatin1String("org.freedesktop.DBus.Introspectable"), 207 QLatin1String("Introspect")); 208 QDBusReply<QString> xml = connection.call(call); 209 210 if (!xml.isValid()) { 211 QDBusError err = xml.error(); 212 if (err.type() == QDBusError::ServiceUnknown) 213 fprintf(stderr, "Service '%s' does not exist.\n", qPrintable(service)); 214 else 215 printf("Error: %s\n%s\n", qPrintable(err.name()), qPrintable(err.message())); 216 exit(2); 217 } 207 218 208 219 QDomDocument doc; … … 242 253 { 243 254 QDBusInterface iface(service, path, interface, connection); 244 if (!iface.isValid()) { 245 QDBusError err(iface.lastError()); 246 fprintf(stderr, "Interface '%s' not available in object %s at %s:\n%s (%s)\n", 247 qPrintable(interface), qPrintable(path), qPrintable(service), 248 qPrintable(err.name()), qPrintable(err.message())); 249 exit(1); 250 } 255 256 // Don't check whether the interface is valid to allow DBus try to 257 // activate the service if possible. 251 258 252 259 QVariantList params; … … 345 352 if (reply.type() == QDBusMessage::ErrorMessage) { 346 353 QDBusError err = reply; 347 printf("Error: %s\n%s\n", qPrintable(err.name()), qPrintable(err.message())); 354 if (err.type() == QDBusError::ServiceUnknown) 355 fprintf(stderr, "Service '%s' does not exist.\n", qPrintable(service)); 356 else 357 printf("Error: %s\n%s\n", qPrintable(err.name()), qPrintable(err.message())); 348 358 exit(2); 349 359 } else if (reply.type() != QDBusMessage::ReplyMessage) { … … 439 449 exit(1); 440 450 } 441 if (!bus->isServiceRegistered(service)) {442 fprintf(stderr, "Service '%s' does not exist.\n", qPrintable(service));443 exit(1);444 }445 451 446 452 if (args.isEmpty()) { 447 printf("/\n");448 453 listObjects(service, QString()); 449 454 exit(0); -
trunk/tools/qdbus/qdbuscpp2xml/qdbuscpp2xml.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the tools applications of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/tools/qdbus/qdbusviewer/main.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the tools applications of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/tools/qdbus/qdbusviewer/propertydialog.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the tools applications of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/tools/qdbus/qdbusviewer/propertydialog.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the tools applications of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/tools/qdbus/qdbusviewer/qdbusmodel.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the tools applications of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/tools/qdbus/qdbusviewer/qdbusmodel.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the tools applications of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/tools/qdbus/qdbusviewer/qdbusviewer.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the tools applications of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 77 77 tree->setContextMenuPolicy(Qt::CustomContextMenu); 78 78 79 connect(tree, SIGNAL(activated( const QModelIndex&)), this, SLOT(activate(const QModelIndex&)));79 connect(tree, SIGNAL(activated(QModelIndex)), this, SLOT(activate(QModelIndex))); 80 80 81 81 refreshAction = new QAction(tr("&Refresh"), tree); … … 442 442 QMessageBox box(this); 443 443 444 // TODO: Remove these variables for 4.6.0. Must keep this way for 4.5.x due to string freeze.445 QString edition;446 QString info;447 QString moreInfo;448 449 444 box.setText(QString::fromLatin1("<center><img src=\":/trolltech/qdbusviewer/images/qdbusviewer-128.png\">" 450 445 "<h3>%1</h3>" 451 "<p>Version %2 %3</p></center>" 452 "<p>%4</p>" 453 "<p>%5</p>" 454 "<p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</p>" 455 "<p>The program is provided AS IS with NO WARRANTY OF ANY KIND," 456 " INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A" 457 " PARTICULAR PURPOSE.<p/>") 458 .arg(tr("D-Bus Viewer")).arg(QLatin1String(QT_VERSION_STR)).arg(edition).arg(info).arg(moreInfo)); 446 "<p>Version %2</p></center>" 447 "<p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</p>") 448 .arg(tr("D-Bus Viewer")).arg(QLatin1String(QT_VERSION_STR))); 459 449 box.setWindowTitle(tr("D-Bus Viewer")); 460 450 box.exec(); -
trunk/tools/qdbus/qdbusviewer/qdbusviewer.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the tools applications of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/tools/qdbus/qdbusxml2cpp/qdbusxml2cpp.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the tools applications of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 83 83 "Usage: " PROGRAMNAME " [options...] [xml-or-xml-file] [interfaces...]\n" 84 84 "Produces the C++ code to implement the interfaces defined in the input file.\n" 85 "If no options are given, the code is written to the standard output.\n"86 85 "\n" 87 86 "Options:\n" … … 100 99 "program will automatically append the suffixes and produce both files.\n" 101 100 "You can also use a colon (:) to separate the header name from the source file\n" 102 "name, as in '-a filename_p.h:filename.cpp'.\n"; 101 "name, as in '-a filename_p.h:filename.cpp'.\n" 102 "\n" 103 "If you pass a dash (-) as the argument to either -p or -a, the output is written\n" 104 "to the standard output\n"; 103 105 104 106 static const char includeList[] = … … 612 614 // getter: 613 615 if (property.access != QDBusIntrospection::Property::Write) { 614 hs << " inline " << type << " " << getter << "() const" << endl; 615 if (type != "QVariant") 616 hs << " { return qvariant_cast< " << type << " >(internalPropGet(\"" 617 << property.name << "\")); }" << endl; 618 else 619 hs << " { return internalPropGet(\"" << property.name << "\"); }" << endl; 616 hs << " inline " << type << " " << getter << "() const" << endl 617 << " { return qvariant_cast< " << type << " >(property(\"" 618 << property.name << "\")); }" << endl; 620 619 } 621 620 … … 623 622 if (property.access != QDBusIntrospection::Property::Read) { 624 623 hs << " inline void " << setter << "(" << constRefArg(type) << "value)" << endl 625 << " { internalPropSet(\"" << property.name624 << " { setProperty(\"" << property.name 626 625 << "\", qVariantFromValue(value)); }" << endl; 627 626 }
Note:
See TracChangeset
for help on using the changeset viewer.