From 744db77f203b4a0c234b32a3f56edf1901b35b3a Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 22 Apr 2010 20:51:42 +0200 Subject: Doc: Fixed the Declarative documentation set. Tweaked the others. Reviewed-by: Trust Me --- tools/qdoc3/test/assistant.qdocconf | 3 +- tools/qdoc3/test/designer.qdocconf | 3 +- tools/qdoc3/test/linguist.qdocconf | 3 +- tools/qdoc3/test/qdeclarative.qdocconf | 58 +++++++++++++++++++++++----------- tools/qdoc3/test/qmake.qdocconf | 3 +- 5 files changed, 44 insertions(+), 26 deletions(-) diff --git a/tools/qdoc3/test/assistant.qdocconf b/tools/qdoc3/test/assistant.qdocconf index 65137f5..1deefce 100644 --- a/tools/qdoc3/test/assistant.qdocconf +++ b/tools/qdoc3/test/assistant.qdocconf @@ -16,8 +16,7 @@ qhp.Assistant.file = assistant.qhp qhp.Assistant.namespace = com.trolltech.assistant.470 qhp.Assistant.virtualFolder = qdoc qhp.Assistant.indexTitle = Qt Assistant Manual -qhp.Assistant.extraFiles = index.html \ - images/api_examples.png \ +qhp.Assistant.extraFiles = images/api_examples.png \ images/api_lookup.png \ images/api_topics.png \ images/bg_l_blank.png \ diff --git a/tools/qdoc3/test/designer.qdocconf b/tools/qdoc3/test/designer.qdocconf index 69e3a90..513801a 100644 --- a/tools/qdoc3/test/designer.qdocconf +++ b/tools/qdoc3/test/designer.qdocconf @@ -16,8 +16,7 @@ qhp.Designer.file = designer.qhp qhp.Designer.namespace = com.trolltech.designer.470 qhp.Designer.virtualFolder = qdoc qhp.Designer.indexTitle = Qt Designer Manual -qhp.Designer.extraFiles = index.html \ - images/api_examples.png \ +qhp.Designer.extraFiles = images/api_examples.png \ images/api_lookup.png \ images/api_topics.png \ images/bg_l_blank.png \ diff --git a/tools/qdoc3/test/linguist.qdocconf b/tools/qdoc3/test/linguist.qdocconf index e398d29..a3f4f00 100644 --- a/tools/qdoc3/test/linguist.qdocconf +++ b/tools/qdoc3/test/linguist.qdocconf @@ -16,8 +16,7 @@ qhp.Linguist.file = linguist.qhp qhp.Linguist.namespace = com.trolltech.linguist.470 qhp.Linguist.virtualFolder = qdoc qhp.Linguist.indexTitle = Qt Linguist Manual -qhp.Linguist.extraFiles = index.html \ - images/api_examples.png \ +qhp.Linguist.extraFiles = images/api_examples.png \ images/api_lookup.png \ images/api_topics.png \ images/bg_l_blank.png \ diff --git a/tools/qdoc3/test/qdeclarative.qdocconf b/tools/qdoc3/test/qdeclarative.qdocconf index 03514c1..ee88ada 100644 --- a/tools/qdoc3/test/qdeclarative.qdocconf +++ b/tools/qdoc3/test/qdeclarative.qdocconf @@ -27,8 +27,46 @@ qhp.Qml.indexTitle = Qml Reference # Files not referenced in any qdoc file # See also extraimages.HTML -qhp.Qml.extraFiles = classic.css \ - images/qt-logo.png +qhp.Qml.extraFiles = \ + images/api_examples.png \ + images/api_lookup.png \ + images/api_topics.png \ + images/bg_l_blank.png \ + images/bg_ll_blank.png \ + images/bg_ll.png \ + images/bg_l.png \ + images/bg_lr.png \ + images/bg_r.png \ + images/bg_ul_blank.png \ + images/bg_ul.png \ + images/bg_ur_blank.png \ + images/bg_ur.png \ + images/box_bg.png \ + images/breadcrumb.png \ + images/bullet_dn.png \ + images/bullet_gt.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/coloreditorfactoryimage.png \ + images/content_bg.png \ + images/dynamiclayouts-example.png \ + images/feedbackground.png \ + images/form_bg.png \ + images/horBar.png \ + images/page_bg.png \ + images/print.png \ + images/qt_guide.png \ + images/qt_icon.png \ + images/qt-logo.png \ + images/qt_ref_doc.png \ + images/qt_tools.png \ + images/sep.png \ + images/sprites-combined.png \ + images/stylesheet-coffee-plastique.png \ + images/taskmenuextension-example.png \ + scripts/functions.js \ + scripts/jquery.js \ + style/style.css qhp.Qml.filterAttributes = qt 4.6.0 qtrefdoc qhp.Qml.customFilters.Qt.name = Qt 4.6.0 @@ -63,19 +101,3 @@ imagedirs = $QT_SOURCE_TREE/doc/src/images \ outputdir = $QT_BUILD_TREE/doc-build/html-qml tagfile = $QT_BUILD_TREE/doc-build/html-qml/qt.tags base = file:$QT_BUILD_TREE/doc/html-qml - -HTML.stylesheets = classic.css - -HTML.postheader = "\n" \ - "\n" \ - "\n" \ - "" \ - "\n" \ - "
" \ - "" \ - "  " \ - "" \ - "Home ·" \ - " " \ - "Elements" \ - "
" diff --git a/tools/qdoc3/test/qmake.qdocconf b/tools/qdoc3/test/qmake.qdocconf index fbb59c0..f38a2a4 100644 --- a/tools/qdoc3/test/qmake.qdocconf +++ b/tools/qdoc3/test/qmake.qdocconf @@ -16,8 +16,7 @@ qhp.qmake.file = qmake.qhp qhp.qmake.namespace = com.trolltech.qmake.470 qhp.qmake.virtualFolder = qdoc qhp.qmake.indexTitle = QMake Manual -qhp.qmake.extraFiles = index.html \ - images/api_examples.png \ +qhp.qmake.extraFiles = images/api_examples.png \ images/api_lookup.png \ images/api_topics.png \ images/bg_l_blank.png \ -- cgit v0.12 From 0e3200866d90c579a8951e4ef843c6fe54c2c7bd Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 23 Apr 2010 14:12:08 +0200 Subject: Ensure that all qthelp URLs have paths that start with /qdoc/. Reviewed-by: kh --- tools/assistant/tools/assistant/helpviewer.cpp | 4 +--- tools/assistant/tools/assistant/helpviewer_qwv.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp index 22b3f30..25214e2 100644 --- a/tools/assistant/tools/assistant/helpviewer.cpp +++ b/tools/assistant/tools/assistant/helpviewer.cpp @@ -52,9 +52,7 @@ QT_BEGIN_NAMESPACE -QString AbstractHelpViewer::DocPath = QString::fromLatin1("qthelp://com." - "trolltech.qt.%1/").arg(QString(QLatin1String(QT_VERSION_STR)) - .replace(QLatin1String("."), QLatin1String(""))); +QString AbstractHelpViewer::DocPath = QString::fromLatin1("qthelp://com.trolltech."); QString AbstractHelpViewer::AboutBlank = QCoreApplication::translate("HelpViewer", "about:blank"); diff --git a/tools/assistant/tools/assistant/helpviewer_qwv.cpp b/tools/assistant/tools/assistant/helpviewer_qwv.cpp index a19b29a..585c69d 100644 --- a/tools/assistant/tools/assistant/helpviewer_qwv.cpp +++ b/tools/assistant/tools/assistant/helpviewer_qwv.cpp @@ -139,9 +139,10 @@ QNetworkReply *HelpNetworkAccessManager::createRequest(Operation /*op*/, // the virtual folder if (!helpEngine.findFile(url).isValid()) { if (url.startsWith(AbstractHelpViewer::DocPath)) { - if (!url.startsWith(AbstractHelpViewer::DocPath + QLatin1String("qdoc/"))) { - url = url.replace(AbstractHelpViewer::DocPath, - AbstractHelpViewer::DocPath + QLatin1String("qdoc/")); + QUrl newUrl = request.url(); + if (!newUrl.path().startsWith(QLatin1String("/qdoc/"))) { + newUrl.setPath(QLatin1String("/qdoc/")+newUrl.path()); + url = newUrl.toString(); } } } -- cgit v0.12 From 9206f0f867e39bbcfa2670a7ba71211b7384c601 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 23 Apr 2010 14:23:57 +0200 Subject: Doc: Fixed typos. Reviewed-by: Trust Me --- demos/sqlbrowser/browser.cpp | 2 +- doc/src/index.qdoc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/demos/sqlbrowser/browser.cpp b/demos/sqlbrowser/browser.cpp index 1232428..fe699c7 100644 --- a/demos/sqlbrowser/browser.cpp +++ b/demos/sqlbrowser/browser.cpp @@ -242,6 +242,6 @@ void Browser::updateActions() void Browser::about() { QMessageBox::about(this, tr("About"), tr("The SQL Browser demonstration " - "show how a data browser can be used to visualize the results of SQL" + "shows how a data browser can be used to visualize the results of SQL" "statements on a live database")); } diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc index 2f23e6e..2e6f9bd 100644 --- a/doc/src/index.qdoc +++ b/doc/src/index.qdoc @@ -75,7 +75,7 @@
  • All classes
  • All namespaces
  • All functions
  • -
  • Platform support & speciffics
  • +
  • Platform support & specifics
  • -- cgit v0.12 From 2ee996bb3e8449e9c9d153326a2f55bc07b6b864 Mon Sep 17 00:00:00 2001 From: kh1 Date: Mon, 26 Apr 2010 12:47:50 +0200 Subject: Improved workaround for new qt documentation, base on dboddie's work. Make the check more generic, to also work for all other Qt namespaces than qt.ver.s.ion. Still there's something broken in Qt webkit or so. Backported from Qt Creator code. Reviewed-by: ck --- tools/assistant/tools/assistant/helpviewer.cpp | 10 ++++------ tools/assistant/tools/assistant/helpviewer.h | 8 ++++---- tools/assistant/tools/assistant/helpviewer_qwv.cpp | 7 ++++--- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp index 22b3f30..6499139 100644 --- a/tools/assistant/tools/assistant/helpviewer.cpp +++ b/tools/assistant/tools/assistant/helpviewer.cpp @@ -52,17 +52,15 @@ QT_BEGIN_NAMESPACE -QString AbstractHelpViewer::DocPath = QString::fromLatin1("qthelp://com." - "trolltech.qt.%1/").arg(QString(QLatin1String(QT_VERSION_STR)) - .replace(QLatin1String("."), QLatin1String(""))); +const QLatin1String AbstractHelpViewer::DocPath("qthelp://com.trolltech."); -QString AbstractHelpViewer::AboutBlank = +const QString AbstractHelpViewer::AboutBlank = QCoreApplication::translate("HelpViewer", "about:blank"); -QString AbstractHelpViewer::LocalHelpFile = QLatin1String("qthelp://" +const QString AbstractHelpViewer::LocalHelpFile = QLatin1String("qthelp://" "com.trolltech.com.assistantinternal-1.0.0/assistant/assistant.html"); -QString AbstractHelpViewer::PageNotFoundMessage = +const QString AbstractHelpViewer::PageNotFoundMessage = QCoreApplication::translate("HelpViewer", "Error 404...


    The page could not be found


    '%1'" "

    "); diff --git a/tools/assistant/tools/assistant/helpviewer.h b/tools/assistant/tools/assistant/helpviewer.h index 80a6f87..def9418 100644 --- a/tools/assistant/tools/assistant/helpviewer.h +++ b/tools/assistant/tools/assistant/helpviewer.h @@ -67,10 +67,10 @@ public: virtual bool handleForwardBackwardMouseButtons(QMouseEvent *e) = 0; - static QString DocPath; - static QString AboutBlank; - static QString LocalHelpFile; - static QString PageNotFoundMessage; + static const QLatin1String DocPath; + static const QString AboutBlank; + static const QString LocalHelpFile; + static const QString PageNotFoundMessage; static bool isLocalUrl(const QUrl &url); static bool canOpenPage(const QString &url); diff --git a/tools/assistant/tools/assistant/helpviewer_qwv.cpp b/tools/assistant/tools/assistant/helpviewer_qwv.cpp index a19b29a..adaa45b 100644 --- a/tools/assistant/tools/assistant/helpviewer_qwv.cpp +++ b/tools/assistant/tools/assistant/helpviewer_qwv.cpp @@ -139,9 +139,10 @@ QNetworkReply *HelpNetworkAccessManager::createRequest(Operation /*op*/, // the virtual folder if (!helpEngine.findFile(url).isValid()) { if (url.startsWith(AbstractHelpViewer::DocPath)) { - if (!url.startsWith(AbstractHelpViewer::DocPath + QLatin1String("qdoc/"))) { - url = url.replace(AbstractHelpViewer::DocPath, - AbstractHelpViewer::DocPath + QLatin1String("qdoc/")); + QUrl newUrl = request.url(); + if (!newUrl.path().startsWith(QLatin1String("/qdoc/"))) { + newUrl.setPath(QLatin1String("qdoc") + newUrl.path()); + url = newUrl.toString(); } } } -- cgit v0.12 From 51c40fdceaa7caec60f8934d9f95dbff76d5ed8e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 19 Apr 2010 21:02:54 +0200 Subject: Don't rely on tryStart() to do job control. It may fail but threads become available the next instant. Instead, simply use our own currentLookups count. Reviewed-by: Markus Goetz --- src/network/kernel/qhostinfo.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index 7e006e0..f287630 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -565,13 +565,11 @@ void QHostInfoLookupManager::work() } } - if (scheduled && threadPool.tryStart(scheduled)) { + if (scheduled && currentLookups.size() < threadPool.maxThreadCount()) { // runnable now running in new thread, track this in currentLookups + threadPool.start(scheduled); iterator.remove(); currentLookups.append(scheduled); - } else if (scheduled) { - // wanted to start, but could not because thread pool is busy - break; } else { // was postponed, continue iterating continue; -- cgit v0.12 From 9e46d92af90ed6fb5b98a1a043f7564ec1e67a94 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 19 Apr 2010 21:43:03 +0200 Subject: Ensure we stop the name lookups in QAbstractSocket if we abort(). If we're not even going to connect, there's no point in trying to get the host resolution Reviewed-By: Markus Goetz --- src/network/socket/qabstractsocket.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 21cd0fd..b604e89 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -2382,6 +2382,10 @@ void QAbstractSocket::disconnectFromHostImplementation() #if defined(QABSTRACTSOCKET_DEBUG) qDebug("QAbstractSocket::disconnectFromHost() aborting immediately"); #endif + if (d->state == HostLookupState) { + QHostInfo::abortHostLookup(d->hostLookupId); + d->hostLookupId = -1; + } } else { // Perhaps emit closing() if (d->state != ClosingState) { -- cgit v0.12 From 1c1f655d82e4af2ff98970472f687e55216e9fcf Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Mon, 26 Apr 2010 14:36:58 +0200 Subject: Don't use QList's begin() and end() where possible. This avoids an unnecessary iterator creation, which can speed up some cases. Merge-request: 2371 Reviewed-by: Andreas Kling --- src/corelib/tools/qlist.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 67f63f3..722744c 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -267,9 +267,9 @@ public: inline int count() const { return p.size(); } inline int length() const { return p.size(); } // Same as count() inline T& first() { Q_ASSERT(!isEmpty()); return *begin(); } - inline const T& first() const { Q_ASSERT(!isEmpty()); return *begin(); } + inline const T& first() const { Q_ASSERT(!isEmpty()); return at(0); } T& last() { Q_ASSERT(!isEmpty()); return *(--end()); } - const T& last() const { Q_ASSERT(!isEmpty()); return *(--end()); } + const T& last() const { Q_ASSERT(!isEmpty()); return at(count() - 1); } inline void removeFirst() { Q_ASSERT(!isEmpty()); erase(begin()); } inline void removeLast() { Q_ASSERT(!isEmpty()); erase(--end()); } inline bool startsWith(const T &t) const { return !isEmpty() && first() == t; } -- cgit v0.12 From 9b3dceaac61a48a4524e586705c50637f62993d2 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 20 Apr 2010 17:01:42 +0200 Subject: save a QFile::encodeName() Reviewed-by: joao --- src/corelib/io/qfsfileengine_unix.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp index 1415e44..5762d94 100644 --- a/src/corelib/io/qfsfileengine_unix.cpp +++ b/src/corelib/io/qfsfileengine_unix.cpp @@ -122,7 +122,7 @@ void QFSFileEnginePrivate::setSymbianError(int symbianError, QFile::FileError de Returns the stdlib open string corresponding to a QIODevice::OpenMode. */ -static inline QByteArray openModeToFopenMode(QIODevice::OpenMode flags, const QString &fileName) +static inline QByteArray openModeToFopenMode(QIODevice::OpenMode flags, const QByteArray &fileName) { QByteArray mode; if ((flags & QIODevice::ReadOnly) && !(flags & QIODevice::Truncate)) { @@ -130,7 +130,7 @@ static inline QByteArray openModeToFopenMode(QIODevice::OpenMode flags, const QS if (flags & QIODevice::WriteOnly) { QT_STATBUF statBuf; if (!fileName.isEmpty() - && QT_STAT(QFile::encodeName(fileName), &statBuf) == 0 + && QT_STAT(fileName, &statBuf) == 0 && (statBuf.st_mode & S_IFMT) == S_IFREG) { mode += '+'; } else { @@ -254,7 +254,7 @@ bool QFSFileEnginePrivate::nativeOpen(QIODevice::OpenMode openMode) fh = 0; } else { - QByteArray fopenMode = openModeToFopenMode(openMode, filePath); + QByteArray fopenMode = openModeToFopenMode(openMode, nativeFilePath.constData()); // Try to open the file in buffered mode. do { -- cgit v0.12 From 22c57db236d7cd72ea6c06dfd22c174d81cd8504 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 21 Apr 2010 13:05:37 +0200 Subject: add translator comment --- src/gui/kernel/qkeysequence.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp index 9efcc4e..931bc33 100644 --- a/src/gui/kernel/qkeysequence.cpp +++ b/src/gui/kernel/qkeysequence.cpp @@ -390,6 +390,9 @@ static const struct { int key; const char* name; } keyname[] = { + //: This and all following "incomprehensible" strings in QShortcut context + //: are key names. Please use the localized names appearing on actual + //: keyboards or whatever is commonly used. { Qt::Key_Space, QT_TRANSLATE_NOOP("QShortcut", "Space") }, { Qt::Key_Escape, QT_TRANSLATE_NOOP("QShortcut", "Esc") }, { Qt::Key_Tab, QT_TRANSLATE_NOOP("QShortcut", "Tab") }, -- cgit v0.12