diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-07 03:53:07 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-07 03:53:07 (GMT) |
commit | 1bf5e9b3c328a80e71e7deed3419ff9d442db3cb (patch) | |
tree | 7f5eba92e388fc22ddbe6bfb2ecb7cc00af96425 /tools | |
parent | e56ae7fb7b269afe36a3bd2f4de0c10f8c2a6924 (diff) | |
parent | 670b1cfccd68a69e03544adff5dea1a21dc2b339 (diff) | |
download | Qt-1bf5e9b3c328a80e71e7deed3419ff9d442db3cb.zip Qt-1bf5e9b3c328a80e71e7deed3419ff9d442db3cb.tar.gz Qt-1bf5e9b3c328a80e71e7deed3419ff9d442db3cb.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (57 commits)
fix corewlan detection error when building for 10.5 when 10.6 is also
fixed treatment of zlib on Mac when crossbuilding
Partial overloading support for qdbus cli tool.
Allow empty authority in QUrl::setAuthority as per docs.
Added test for QTBUG-6962: Empty authority ignored by QUrl::setAuthority.
fixed case of GL include directory
check in MAC_APPLICATION_MENU translations
Re-generate the Unicode tables after updates to the program that generates them
Fix the code after merge: DerivedNormalizationProps has two or more columns
add some usefull definitions to qunicodetables_p.h
qchar.cpp: fix identation
finish last commit
prefer DerivedNormalizationProps.txt over CompositionExclusions.txt
improve error reporting a bit more
improve error reporting
fix incorect condition
check if string to int conversions were done w/o errors
improve error reporting for unassigned grapheme/word/sentence break classes
avoid using of qunicodetables_p.h in generator
use QHash for line break map
...
Diffstat (limited to 'tools')
-rw-r--r-- | tools/assistant/tools/assistant/helpviewer_qwv.cpp | 2 | ||||
-rw-r--r-- | tools/assistant/tools/assistant/mainwindow.cpp | 4 | ||||
-rw-r--r-- | tools/assistant/tools/assistant/mainwindow.h | 2 | ||||
-rw-r--r-- | tools/qdbus/qdbus/qdbus.cpp | 175 |
4 files changed, 95 insertions, 88 deletions
diff --git a/tools/assistant/tools/assistant/helpviewer_qwv.cpp b/tools/assistant/tools/assistant/helpviewer_qwv.cpp index 9bb66e1..a656416 100644 --- a/tools/assistant/tools/assistant/helpviewer_qwv.cpp +++ b/tools/assistant/tools/assistant/helpviewer_qwv.cpp @@ -223,7 +223,7 @@ bool HelpPage::acceptNavigationRequest(QWebFrame *, if (type == QWebPage::NavigationTypeLinkClicked && (m_keyboardModifiers & Qt::ControlModifier || m_pressedButtons == Qt::MidButton)) { - if (HelpViewer* viewer = centralWidget->newEmptyTab()) + if (centralWidget->newEmptyTab()) centralWidget->setSource(url); m_pressedButtons = Qt::NoButton; m_keyboardModifiers = Qt::NoModifier; diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index 8096218..687e6bc 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -341,7 +341,7 @@ void MainWindow::lookForNewQtDocumentation() m_qtDocInstaller = new QtDocInstaller(qtDocInfos); connect(m_qtDocInstaller, SIGNAL(docsInstalled(bool)), this, - SLOT(qtDocumentationInstalled(bool))); + SLOT(qtDocumentationInstalled())); connect(m_qtDocInstaller, SIGNAL(qchFileNotFound(QString)), this, SLOT(resetQtDocInfo(QString))); connect(m_qtDocInstaller, SIGNAL(registerDocumentation(QString, QString)), @@ -351,7 +351,7 @@ void MainWindow::lookForNewQtDocumentation() m_qtDocInstaller->installDocs(); } -void MainWindow::qtDocumentationInstalled(bool newDocsInstalled) +void MainWindow::qtDocumentationInstalled() { TRACE_OBJ statusBar()->clearMessage(); diff --git a/tools/assistant/tools/assistant/mainwindow.h b/tools/assistant/tools/assistant/mainwindow.h index 40ca624..8e4276d 100644 --- a/tools/assistant/tools/assistant/mainwindow.h +++ b/tools/assistant/tools/assistant/mainwindow.h @@ -112,7 +112,7 @@ private slots: void lookForNewQtDocumentation(); void indexingStarted(); void indexingFinished(); - void qtDocumentationInstalled(bool newDocsInstalled); + void qtDocumentationInstalled(); void registerDocumentation(const QString &component, const QString &absFileName); void resetQtDocInfo(const QString &component); diff --git a/tools/qdbus/qdbus/qdbus.cpp b/tools/qdbus/qdbus/qdbus.cpp index b08910a..ce18cb9 100644 --- a/tools/qdbus/qdbus/qdbus.cpp +++ b/tools/qdbus/qdbus/qdbus.cpp @@ -249,116 +249,123 @@ static QStringList readList(QStringList &args) } static int placeCall(const QString &service, const QString &path, const QString &interface, - const QString &member, QStringList args, bool try_prop=true) + const QString &member, const QStringList& arguments, bool try_prop=true) { QDBusInterface iface(service, path, interface, connection); // Don't check whether the interface is valid to allow DBus try to // activate the service if possible. + QList<int> knownIds; + bool matchFound = false; + QStringList args = arguments; QVariantList params; if (!args.isEmpty()) { const QMetaObject *mo = iface.metaObject(); QByteArray match = member.toLatin1(); match += '('; - int midx = -1; for (int i = mo->methodOffset(); i < mo->methodCount(); ++i) { QMetaMethod mm = mo->method(i); QByteArray signature = mm.signature(); - if (signature.startsWith(match)) { - midx = i; - break; - } + if (signature.startsWith(match)) + knownIds += i; } - if (midx == -1) { - // Failed to set property after falling back? - // Bail out without displaying an error - if (!try_prop) + + while (!matchFound) { + args = arguments; // reset + params.clear(); + if (knownIds.isEmpty()) { + // Failed to set property after falling back? + // Bail out without displaying an error + if (!try_prop) + return 1; + if (try_prop && args.size() == 1) { + QStringList proparg; + proparg += interface; + proparg += member; + proparg += args.first(); + if (!placeCall(service, path, "org.freedesktop.DBus.Properties", "Set", proparg, false)) + return 0; + } + fprintf(stderr, "Cannot find '%s.%s' in object %s at %s\n", + qPrintable(interface), qPrintable(member), qPrintable(path), + qPrintable(service)); return 1; - if (try_prop && args.size() == 1) { - QStringList proparg; - proparg += interface; - proparg += member; - proparg += args.first(); - if (!placeCall(service, path, "org.freedesktop.DBus.Properties", "Set", proparg, false)) - return 0; } - fprintf(stderr, "Cannot find '%s.%s' in object %s at %s\n", - qPrintable(interface), qPrintable(member), qPrintable(path), - qPrintable(service)); - return 1; - } - QMetaMethod mm = mo->method(midx); - QList<QByteArray> types = mm.parameterTypes(); - for (int i = 0; i < types.count(); ++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) - types.removeLast(); - break; + QMetaMethod mm = mo->method(knownIds.takeFirst()); + QList<QByteArray> types = mm.parameterTypes(); + for (int i = 0; i < types.count(); ++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) + types.removeLast(); + break; + } } - } - for (int i = 0; !args.isEmpty() && i < types.count(); ++i) { - int id = QVariant::nameToType(types.at(i)); - if (id == QVariant::UserType) - id = QMetaType::type(types.at(i)); - Q_ASSERT(id); - - QVariant p; - QString argument; - if ((id == QVariant::List || id == QVariant::StringList) - && args.at(0) == QLatin1String("(")) - p = readList(args); - else - p = argument = args.takeFirst(); - - if (id == int(QMetaType::UChar)) { - // special case: QVariant::convert doesn't convert to/from - // UChar because it can't decide if it's a character or a number - p = qVariantFromValue<uchar>(p.toUInt()); - } else if (id < int(QMetaType::User) && id != int(QVariant::Map)) { - p.convert(QVariant::Type(id)); - if (p.type() == QVariant::Invalid) { - fprintf(stderr, "Could not convert '%s' to type '%s'.\n", - qPrintable(argument), types.at(i).constData()); - return 1 ; - } - } else if (id == qMetaTypeId<QDBusVariant>()) { - QDBusVariant tmp(p); - p = qVariantFromValue(tmp); - } else if (id == qMetaTypeId<QDBusObjectPath>()) { - QDBusObjectPath path(argument); - if (path.path().isNull()) { - fprintf(stderr, "Cannot pass argument '%s' because it is not a valid object path.\n", - qPrintable(argument)); + for (int i = 0; !args.isEmpty() && i < types.count(); ++i) { + int id = QVariant::nameToType(types.at(i)); + if (id == QVariant::UserType) + id = QMetaType::type(types.at(i)); + Q_ASSERT(id); + + QVariant p; + QString argument; + if ((id == QVariant::List || id == QVariant::StringList) + && args.at(0) == QLatin1String("(")) + p = readList(args); + else + p = argument = args.takeFirst(); + + if (id == int(QMetaType::UChar)) { + // special case: QVariant::convert doesn't convert to/from + // UChar because it can't decide if it's a character or a number + p = qVariantFromValue<uchar>(p.toUInt()); + } else if (id < int(QMetaType::User) && id != int(QVariant::Map)) { + p.convert(QVariant::Type(id)); + if (p.type() == QVariant::Invalid) { + fprintf(stderr, "Could not convert '%s' to type '%s'.\n", + qPrintable(argument), types.at(i).constData()); + return 1 ; + } + } else if (id == qMetaTypeId<QDBusVariant>()) { + QDBusVariant tmp(p); + p = qVariantFromValue(tmp); + } else if (id == qMetaTypeId<QDBusObjectPath>()) { + QDBusObjectPath path(argument); + if (path.path().isNull()) { + fprintf(stderr, "Cannot pass argument '%s' because it is not a valid object path.\n", + qPrintable(argument)); + return 1; + } + p = qVariantFromValue(path); + } else if (id == qMetaTypeId<QDBusSignature>()) { + QDBusSignature sig(argument); + if (sig.signature().isNull()) { + fprintf(stderr, "Cannot pass argument '%s' because it is not a valid signature.\n", + qPrintable(argument)); + return 1; + } + p = qVariantFromValue(sig); + } else { + fprintf(stderr, "Sorry, can't pass arg of type '%s'.\n", + types.at(i).constData()); return 1; } - p = qVariantFromValue(path); - } else if (id == qMetaTypeId<QDBusSignature>()) { - QDBusSignature sig(argument); - if (sig.signature().isNull()) { - fprintf(stderr, "Cannot pass argument '%s' because it is not a valid signature.\n", - qPrintable(argument)); - return 1; - } - p = qVariantFromValue(sig); - } else { - fprintf(stderr, "Sorry, can't pass arg of type '%s'.\n", - types.at(i).constData()); + params += p; + } + if (params.count() == types.count() && args.isEmpty()) + matchFound = true; + else if (knownIds.isEmpty()) { + fprintf(stderr, "Invalid number of parameters\n"); return 1; } - params += p; - } - if (params.count() != types.count() || !args.isEmpty()) { - fprintf(stderr, "Invalid number of parameters\n"); - return 1; - } - } + } // while (!matchFound) + } // if (!args.isEmpty() QDBusMessage reply = iface.callWithArgumentList(QDBus::Block, member, params); if (reply.type() == QDBusMessage::ErrorMessage) { |