From 1f9074b743c727165f21149a09fd08e32157faaf Mon Sep 17 00:00:00 2001 From: Andreas Aardal Hanssen Date: Wed, 1 Apr 2009 17:04:50 +0200 Subject: Fix slowdown regression in QGraphicsItem::ItemCoordinateCache Right before Qt 4.5.0 was released, Alexis and I submitted change 7e9b000ee418ef2d9c8fadb2c6b8870e0335bd5e, which accidentally introduced a rounding error causing items whose bounding rect contains fractional numbers (e.g., QRectF(-0.5, -0.5, 11, 11)), to always be drawn with a one-pixel strech even if otherwise untransformed. This caused a significant slowdown for pixmap items and any shape item that uses almost any pen width != 0, if they enable ItemCoordinateCache. The fix is to consistently use the aligned rectangle both when generating the cache pixmap and when drawing it. Reviewed-by: Alexis --- src/gui/graphicsview/qgraphicsscene.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 1f78a18..ff46e2e 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -4595,16 +4595,17 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte if (cacheMode == QGraphicsItem::ItemCoordinateCache) { QSize pixmapSize; bool fixedCacheSize = false; + QRectF brectAligned = brect.toAlignedRect(); if ((fixedCacheSize = itemCache->fixedSize.isValid())) { pixmapSize = itemCache->fixedSize; } else { - pixmapSize = brect.toAlignedRect().size(); + pixmapSize = brectAligned.size().toSize(); } // Create or recreate the pixmap. int adjust = itemCache->fixedSize.isValid() ? 0 : 2; QSize adjustSize(adjust*2, adjust*2); - QRectF br = brect.adjusted(-adjust, -adjust, adjust, adjust); + QRectF br = brectAligned.adjusted(-adjust, -adjust, adjust, adjust); if (pix.isNull() || (!fixedCacheSize && (pixmapSize + adjustSize) != pix.size())) { pix = QPixmap(pixmapSize + adjustSize); itemCache->exposed.clear(); @@ -4614,9 +4615,11 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte // Redraw any newly exposed areas. if (itemCache->allExposed || !itemCache->exposed.isEmpty()) { // Fit the item's bounding rect into the pixmap's coordinates. - const QPointF scale(pixmapSize.width() / brect.width(), pixmapSize.height() / brect.height()); QTransform itemToPixmap; - itemToPixmap.scale(scale.x(), scale.y()); + if (fixedCacheSize) { + const QPointF scale(pixmapSize.width() / brect.width(), pixmapSize.height() / brect.height()); + itemToPixmap.scale(scale.x(), scale.y()); + } itemToPixmap.translate(-br.x(), -br.y()); // Generate the item's exposedRect and map its list of expose -- cgit v0.12 From 88482ebf36a5fdd0cfaa24c7029b42e19090c6f0 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 2 Apr 2009 09:09:28 +0200 Subject: Doc - fixed a typo: iterartor -> iterator Reviewed-by: Trust me --- src/corelib/tools/qlinkedlist.cpp | 4 ++-- src/corelib/tools/qlistdata.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/corelib/tools/qlinkedlist.cpp b/src/corelib/tools/qlinkedlist.cpp index a3cbecc..c454224 100644 --- a/src/corelib/tools/qlinkedlist.cpp +++ b/src/corelib/tools/qlinkedlist.cpp @@ -652,7 +652,7 @@ QLinkedListData QLinkedListData::shared_null = { Constructs an uninitialized iterator. Functions like operator*() and operator++() should not be called - on an uninitialized iterartor. Use operator=() to assign a value + on an uninitialized iterator. Use operator=() to assign a value to it before using it. \sa QLinkedList::begin() QLinkedList::end() @@ -858,7 +858,7 @@ QLinkedListData QLinkedListData::shared_null = { Constructs an uninitialized iterator. Functions like operator*() and operator++() should not be called - on an uninitialized iterartor. Use operator=() to assign a value + on an uninitialized iterator. Use operator=() to assign a value to it before using it. \sa QLinkedList::constBegin() QLinkedList::constEnd() diff --git a/src/corelib/tools/qlistdata.cpp b/src/corelib/tools/qlistdata.cpp index 2b1c086..d7c39a7 100644 --- a/src/corelib/tools/qlistdata.cpp +++ b/src/corelib/tools/qlistdata.cpp @@ -1193,7 +1193,7 @@ void **QListData::erase(void **xi) Constructs an uninitialized iterator. Functions like operator*() and operator++() should not be called - on an uninitialized iterartor. Use operator=() to assign a value + on an uninitialized iterator. Use operator=() to assign a value to it before using it. \sa QList::begin() QList::end() @@ -1416,7 +1416,7 @@ void **QListData::erase(void **xi) Constructs an uninitialized iterator. Functions like operator*() and operator++() should not be called - on an uninitialized iterartor. Use operator=() to assign a value + on an uninitialized iterator. Use operator=() to assign a value to it before using it. \sa QList::constBegin() QList::constEnd() -- cgit v0.12 From 4e036ebbc6351a9bd6597e89a803f5c4de746092 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 1 Apr 2009 12:26:03 +0200 Subject: optimize duplicate resolution use pointers in the index hash to avoid needless allocs and copies --- tools/linguist/shared/translator.cpp | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/tools/linguist/shared/translator.cpp b/tools/linguist/shared/translator.cpp index 3721204..9ac1dd8 100644 --- a/tools/linguist/shared/translator.cpp +++ b/tools/linguist/shared/translator.cpp @@ -416,25 +416,46 @@ void Translator::dropTranslations() } } +struct TranslatorMessagePtr { + TranslatorMessagePtr(const TranslatorMessage &tm) + { + ptr = &tm; + } + + const TranslatorMessage *ptr; +}; + +Q_DECLARE_TYPEINFO(TranslatorMessagePtr, Q_MOVABLE_TYPE); + +static inline int qHash(TranslatorMessagePtr tmp) +{ + return qHash(*tmp.ptr); +} + +static inline bool operator==(TranslatorMessagePtr tmp1, TranslatorMessagePtr tmp2) +{ + return *tmp1.ptr == *tmp2.ptr; +} + QList Translator::findDuplicates() const { - QHash dups; + QHash dups; foreach (const TranslatorMessage &msg, m_messages) dups[msg]++; QList ret; - QHash::ConstIterator it = dups.constBegin(), end = dups.constEnd(); + QHash::ConstIterator it = dups.constBegin(), end = dups.constEnd(); for (; it != end; ++it) if (it.value() > 1) - ret.append(it.key()); + ret.append(*it.key().ptr); return ret; } void Translator::resolveDualEncoded() { - QHash dups; + QHash dups; for (int i = 0; i < m_messages.count();) { const TranslatorMessage &msg = m_messages.at(i); - QHash::ConstIterator it = dups.constFind(msg); + QHash::ConstIterator it = dups.constFind(msg); if (it != dups.constEnd()) { TranslatorMessage &omsg = m_messages[*it]; if (omsg.isUtf8() != msg.isUtf8() && !omsg.isNonUtf8()) { -- cgit v0.12 From 385bb34a9dc8e7bd6d1d3c11247862b87978d629 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 1 Apr 2009 17:51:27 +0200 Subject: duplicate message handling improvements - lrelease will not abort on duplicates any more - lconvert now gets noisy, but only if messages within one file are duplicated (combining files with identical messages is ok) - lupdate stays silent, but will eliminate duplicates again - consolidate handling of dual-encoded and duplicate messages - for performance - instead of the format loader, now the app is responsible for calling the duplicate handler. this allows for the fine-grained control necessary for optimal performance. Task-number: 247738 --- tools/linguist/lconvert/main.cpp | 2 + tools/linguist/linguist/messagemodel.cpp | 10 ++-- tools/linguist/lrelease/main.cpp | 15 +----- tools/linguist/lupdate/main.cpp | 1 + tools/linguist/shared/qm.cpp | 1 - tools/linguist/shared/translator.cpp | 79 ++++++++++++++----------------- tools/linguist/shared/translator.h | 5 +- tools/linguist/shared/translatormessage.h | 26 ++++++++++ tools/linguist/shared/ts.cpp | 6 +-- 9 files changed, 77 insertions(+), 68 deletions(-) diff --git a/tools/linguist/lconvert/main.cpp b/tools/linguist/lconvert/main.cpp index 2842bc7..9ccc60e 100644 --- a/tools/linguist/lconvert/main.cpp +++ b/tools/linguist/lconvert/main.cpp @@ -210,6 +210,7 @@ int main(int argc, char *argv[]) qWarning() << qPrintable(cd.error()); return 2; } + Translator::reportDuplicates(tr.resolveDuplicates(), inFiles[0].name, verbose); for (int i = 1; i < inFiles.size(); ++i) { Translator tr2; @@ -217,6 +218,7 @@ int main(int argc, char *argv[]) qWarning() << qPrintable(cd.error()); return 2; } + Translator::reportDuplicates(tr2.resolveDuplicates(), inFiles[i].name, verbose); for (int j = 0; j < tr2.messageCount(); ++j) tr.replaceSorted(tr2.message(j)); } diff --git a/tools/linguist/linguist/messagemodel.cpp b/tools/linguist/linguist/messagemodel.cpp index b049ab9..7a8063b 100644 --- a/tools/linguist/linguist/messagemodel.cpp +++ b/tools/linguist/linguist/messagemodel.cpp @@ -209,19 +209,19 @@ bool DataModel::load(const QString &fileName, bool *langGuessed, QWidget *parent return false; } - QList dupes = tor.findDuplicates(); + QSet dupes = tor.resolveDuplicates(); if (!dupes.isEmpty()) { QString err = tr("Duplicate messages found in '%1':").arg(Qt::escape(fileName)); int numdups = 0; - foreach (const TranslatorMessage &msg, dupes) { + foreach (const TranslatorMessagePtr &msg, dupes) { if (++numdups >= 5) { err += tr("

[more duplicates omitted]"); break; } err += tr("

* Context: %1
* Source: %2") - .arg(Qt::escape(msg.context()), Qt::escape(msg.sourceText())); - if (!msg.comment().isEmpty()) - err += tr("
* Comment: %3").arg(Qt::escape(msg.comment())); + .arg(Qt::escape(msg->context()), Qt::escape(msg->sourceText())); + if (!msg->comment().isEmpty()) + err += tr("
* Comment: %3").arg(Qt::escape(msg->comment())); } QMessageBox::warning(parent, QObject::tr("Qt Linguist"), err); } diff --git a/tools/linguist/lrelease/main.cpp b/tools/linguist/lrelease/main.cpp index f1fdb3a..3bcc998 100644 --- a/tools/linguist/lrelease/main.cpp +++ b/tools/linguist/lrelease/main.cpp @@ -94,19 +94,6 @@ static bool loadTsFile(Translator &tor, const QString &tsFileName, bool /* verbo } else { if (!cd.errors().isEmpty()) printOut(cd.error()); - const QList dupes = tor.findDuplicates(); - if (!dupes.isEmpty()) { - qWarning("lrelease error: duplicate messages found in '%s':", - qPrintable(tsFileName)); - foreach (const TranslatorMessage &msg, dupes) { - qWarning("\n* Context: %s\n* Source: %s", - qPrintable(msg.context()), - qPrintable(msg.sourceText())); - if (!msg.comment().isEmpty()) - qWarning("\n* Comment: %s", qPrintable(msg.comment())); - } - ok = false; - } } return ok; } @@ -115,6 +102,8 @@ static bool releaseTranslator(Translator &tor, const QString &qmFileName, bool verbose, bool ignoreUnfinished, bool removeIdentical, TranslatorSaveMode mode) { + Translator::reportDuplicates(tor.resolveDuplicates(), qmFileName, verbose); + if (verbose) printOut(QCoreApplication::tr( "Updating '%1'...\n").arg(qmFileName)); if (removeIdentical) { diff --git a/tools/linguist/lupdate/main.cpp b/tools/linguist/lupdate/main.cpp index 5869838..b537b6e 100644 --- a/tools/linguist/lupdate/main.cpp +++ b/tools/linguist/lupdate/main.cpp @@ -146,6 +146,7 @@ static void updateTsFiles(const Translator &fetchedTor, const QStringList &tsFil *fail = true; continue; } + tor.resolveDuplicates(); cd.clearErrors(); if (!codecForTr.isEmpty() && codecForTr != tor.codecName()) qWarning("lupdate warning: Codec for tr() '%s' disagrees with " diff --git a/tools/linguist/shared/qm.cpp b/tools/linguist/shared/qm.cpp index d19b519..5563ac5 100644 --- a/tools/linguist/shared/qm.cpp +++ b/tools/linguist/shared/qm.cpp @@ -659,7 +659,6 @@ bool loadQM(Translator &translator, QIODevice &dev, ConversionData &cd) msg.setComment(comment); translator.append(msg); } - translator.resolveDualEncoded(); return ok; } diff --git a/tools/linguist/shared/translator.cpp b/tools/linguist/shared/translator.cpp index 9ac1dd8..312bb71 100644 --- a/tools/linguist/shared/translator.cpp +++ b/tools/linguist/shared/translator.cpp @@ -416,59 +416,52 @@ void Translator::dropTranslations() } } -struct TranslatorMessagePtr { - TranslatorMessagePtr(const TranslatorMessage &tm) - { - ptr = &tm; - } - - const TranslatorMessage *ptr; -}; - -Q_DECLARE_TYPEINFO(TranslatorMessagePtr, Q_MOVABLE_TYPE); - -static inline int qHash(TranslatorMessagePtr tmp) +QSet Translator::resolveDuplicates() { - return qHash(*tmp.ptr); -} - -static inline bool operator==(TranslatorMessagePtr tmp1, TranslatorMessagePtr tmp2) -{ - return *tmp1.ptr == *tmp2.ptr; -} - -QList Translator::findDuplicates() const -{ - QHash dups; - foreach (const TranslatorMessage &msg, m_messages) - dups[msg]++; - QList ret; - QHash::ConstIterator it = dups.constBegin(), end = dups.constEnd(); - for (; it != end; ++it) - if (it.value() > 1) - ret.append(*it.key().ptr); - return ret; -} - -void Translator::resolveDualEncoded() -{ - QHash dups; + QSet dups; + QHash refs; for (int i = 0; i < m_messages.count();) { const TranslatorMessage &msg = m_messages.at(i); - QHash::ConstIterator it = dups.constFind(msg); - if (it != dups.constEnd()) { + QHash::ConstIterator it = refs.constFind(msg); + if (it != refs.constEnd()) { TranslatorMessage &omsg = m_messages[*it]; if (omsg.isUtf8() != msg.isUtf8() && !omsg.isNonUtf8()) { + // Dual-encoded message omsg.setUtf8(true); omsg.setNonUtf8(true); - m_messages.removeAt(i); - continue; + } else { + // Duplicate + dups.insert(omsg); } - // Regular dupe; will complain later + if (!omsg.isTranslated() && msg.isTranslated()) + omsg.setTranslations(msg.translations()); + m_messages.removeAt(i); + } else { + refs[msg] = i; + ++i; + } + } + return dups; +} + +void Translator::reportDuplicates(const QSet &dupes, + const QString &fileName, bool verbose) +{ + if (!dupes.isEmpty()) { + if (!verbose) { + qWarning("Warning: dropping duplicate messages in '%s'\n(try -verbose for more info).", + qPrintable(fileName)); } else { - dups[msg] = i; + qWarning("Warning: dropping duplicate messages in '%s':", qPrintable(fileName)); + foreach (const TranslatorMessagePtr &msg, dupes) { + qWarning("\n* Context: %s\n* Source: %s", + qPrintable(msg->context()), + qPrintable(msg->sourceText())); + if (!msg->comment().isEmpty()) + qWarning("* Comment: %s", qPrintable(msg->comment())); + } + qWarning(); } - ++i; } } diff --git a/tools/linguist/shared/translator.h b/tools/linguist/shared/translator.h index 8908305..6b88b23 100644 --- a/tools/linguist/shared/translator.h +++ b/tools/linguist/shared/translator.h @@ -127,9 +127,10 @@ public: void stripNonPluralForms(); void stripIdenticalSourceTranslations(); void dropTranslations(); - QList findDuplicates() const; - void resolveDualEncoded(); void makeFileNamesAbsolute(const QDir &originalPath); + QSet resolveDuplicates(); + static void reportDuplicates(const QSet &dupes, + const QString &fileName, bool verbose); void setCodecName(const QByteArray &name); QByteArray codecName() const { return m_codecName; } diff --git a/tools/linguist/shared/translatormessage.h b/tools/linguist/shared/translatormessage.h index 363019e..7d31925 100644 --- a/tools/linguist/shared/translatormessage.h +++ b/tools/linguist/shared/translatormessage.h @@ -179,6 +179,32 @@ Q_DECLARE_TYPEINFO(TranslatorMessage, Q_MOVABLE_TYPE); int qHash(const TranslatorMessage &msg); +struct TranslatorMessagePtr { + TranslatorMessagePtr(const TranslatorMessage &tm) + { + ptr = &tm; + } + + inline const TranslatorMessage *operator->() const + { + return ptr; + } + + const TranslatorMessage *ptr; +}; + +Q_DECLARE_TYPEINFO(TranslatorMessagePtr, Q_MOVABLE_TYPE); + +static inline int qHash(TranslatorMessagePtr tmp) +{ + return qHash(*tmp.ptr); +} + +static inline bool operator==(TranslatorMessagePtr tmp1, TranslatorMessagePtr tmp2) +{ + return *tmp1.ptr == *tmp2.ptr; +} + QT_END_NAMESPACE #endif // QT_NO_TRANSLATION diff --git a/tools/linguist/shared/ts.cpp b/tools/linguist/shared/ts.cpp index 8a6d365..22f2a1b 100644 --- a/tools/linguist/shared/ts.cpp +++ b/tools/linguist/shared/ts.cpp @@ -242,7 +242,7 @@ bool TSReader::read(Translator &translator) STRING(userdata); STRING(utf8); STRING(value); - STRING(version); + //STRING(version); STRING(yes); static const QString strextrans(QLatin1String("extra-")); @@ -266,15 +266,13 @@ bool TSReader::read(Translator &translator) QString currentFile; QXmlStreamAttributes atts = attributes(); - QString version = atts.value(strversion).toString(); + //QString version = atts.value(strversion).toString(); translator.setLanguageCode(atts.value(strlanguage).toString()); translator.setSourceLanguageCode(atts.value(strsourcelanguage).toString()); while (!atEnd()) { readNext(); if (isEndElement()) { // found, finish local loop - if (version == QLatin1String("1.1")) - translator.resolveDualEncoded(); break; } else if (isWhiteSpace()) { // ignore these, just whitespace -- cgit v0.12 From db36d8397aa21d947abd969ee35e017935705217 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 2 Apr 2009 09:59:19 +0200 Subject: Updated WebKit from /home/shausman/src/webkit/trunk to origin/qtwebkit-4.5 ( 9c6a4a25fe741b43dd64f5dbaeccfb647cb321fb ) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes in WebKit since the last update: ++ b/WebKit/qt/ChangeLog 2009-04-02 Takumi Asaki Reviewed by Simon Hausmann. Fix pre-edit handling of text fields with input methods. The input method sends an empty preeditString() if all characters of the preedit should be deleted. So inputMethodEvent() has to use preeditString() if it's empty. * Api/qwebpage.cpp: (QWebPagePrivate::inputMethodEvent): 2009-03-30 Simon Hausmann Rubber-stamped by Tor Arne Vestbø. Document that setHtml/setContent loads only the html/data immediately, not external objects. * Api/qwebframe.cpp: * Api/qwebview.cpp: --- src/3rdparty/webkit/VERSION | 2 +- src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp | 4 ++++ src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp | 6 +++--- src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp | 4 ++++ src/3rdparty/webkit/WebKit/qt/ChangeLog | 22 ++++++++++++++++++++++ 5 files changed, 34 insertions(+), 4 deletions(-) diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index 96840d0..1ebf6ef 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -8,4 +8,4 @@ The commit imported was from the and has the sha1 checksum - 1beae2b64b5b1e9b97e82dc94de18ebac1c19efc + 9c6a4a25fe741b43dd64f5dbaeccfb647cb321fb diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp index ae71356..5dc6363 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp @@ -534,6 +534,8 @@ void QWebFrame::load(const QNetworkRequest &req, Sets the content of this frame to \a html. \a baseUrl is optional and used to resolve relative URLs in the document, such as referenced images or stylesheets. + The \a html is loaded immediately; external objects are loaded asynchronously. + When using this method WebKit assumes that external resources such as JavaScript programs or style sheets are encoded in UTF-8 unless otherwise specified. For example, the encoding of an external script can be specified through the charset attribute of the HTML script tag. It is also possible @@ -558,6 +560,8 @@ void QWebFrame::setHtml(const QString &html, const QUrl &baseUrl) External objects referenced in the content are located relative to \a baseUrl. + The \a data is loaded immediately; external objects are loaded asynchronously. + \sa toHtml() */ void QWebFrame::setContent(const QByteArray &data, const QString &mimeType, const QUrl &baseUrl) diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp index 636b6e8..de37383 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp @@ -896,14 +896,14 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev) return; } - if (!ev->preeditString().isEmpty()) { + if (!ev->commitString().isEmpty()) + editor->confirmComposition(ev->commitString()); + else { QString preedit = ev->preeditString(); // ### FIXME: use the provided QTextCharFormat (use color at least) Vector underlines; underlines.append(CompositionUnderline(0, preedit.length(), Color(0,0,0), false)); editor->setComposition(preedit, underlines, preedit.length(), 0); - } else if (!ev->commitString().isEmpty()) { - editor->confirmComposition(ev->commitString()); } ev->accept(); } diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp index ea503a1..a843eba 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp @@ -289,6 +289,8 @@ void QWebView::load(const QNetworkRequest &request, External objects such as stylesheets or images referenced in the HTML document are located relative to \a baseUrl. + The \a html is loaded immediately; external objects are loaded asynchronously. + When using this method, WebKit assumes that external resources such as JavaScript programs or style sheets are encoded in UTF-8 unless otherwise specified. For example, the encoding of an external script can be specified @@ -309,6 +311,8 @@ void QWebView::setHtml(const QString &html, const QUrl &baseUrl) External objects referenced in the content are located relative to \a baseUrl. + The \a data is loaded immediately; external objects are loaded asynchronously. + \sa load(), setHtml(), QWebFrame::toHtml() */ void QWebView::setContent(const QByteArray &data, const QString &mimeType, const QUrl &baseUrl) diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog index 32d27cd..41ca520 100644 --- a/src/3rdparty/webkit/WebKit/qt/ChangeLog +++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog @@ -1,3 +1,25 @@ +2009-04-02 Takumi Asaki + + Reviewed by Simon Hausmann. + + Fix pre-edit handling of text fields with input methods. + + The input method sends an empty preeditString() if all characters of + the preedit should be deleted. So inputMethodEvent() has to use + preeditString() if it's empty. + + * Api/qwebpage.cpp: + (QWebPagePrivate::inputMethodEvent): + +2009-03-30 Simon Hausmann + + Rubber-stamped by Tor Arne Vestbø. + + Document that setHtml/setContent loads only the html/data immediately, not external objects. + + * Api/qwebframe.cpp: + * Api/qwebview.cpp: + 2009-03-26 Simon Hausmann Rubber-stamped by Tor Arne Vestbø. -- cgit v0.12 From 212fbb28c5d0d560b46d5c00d457677a5f5d21dd Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Thu, 2 Apr 2009 10:42:23 +0200 Subject: Doc - moving this file to the Creator branch instead. --- doc/src/tutorials/addressbook-sdk.qdoc | 179 --------------------------------- 1 file changed, 179 deletions(-) delete mode 100644 doc/src/tutorials/addressbook-sdk.qdoc diff --git a/doc/src/tutorials/addressbook-sdk.qdoc b/doc/src/tutorials/addressbook-sdk.qdoc deleted file mode 100644 index b6b257d..0000000 --- a/doc/src/tutorials/addressbook-sdk.qdoc +++ /dev/null @@ -1,179 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page tutorials-addressbook-sdk.html - - \startpage {index.html}{Qt Reference Documentation} - \nextpage \l{Designing the User Interface}{Chapter 1} - - \title Address Book Tutorial - \ingroup howto - \ingroup tutorials - \brief An introduction to GUI programming with Qt and Qt Creator, - describing in detail how to put together a simple yet fully- - functioning application. - - This tutorial gives an introduction to GUI programming using the Qt SDK. - - ### Screenshot - - In the process, we will learn about some basic technologies provided by - Qt, such as: - - \list - \o Widgets and layout managers - \o Container classes - \o Signals and slots - \o Input and output devices - \endlist - - If you are completely new to Qt, please read \l{How to Learn Qt} if you - have not already done so. - - The tutorial's source code is located in Qt's - \c{examples/tutorials/addressbook} directory. - - Tutorial chapters: - - \list 1 - \o \l{Designing the User Interface} - \o \l{Adding Addresses} - \o \l{Navigating between Entries} - \o \l{Editing and Removing Addresses} - \o \l{Adding a Find Function} - \o \l{Loading and Saving} - \o \l{Additional Features} - \endlist - - Although this little application does not look much like a fully-fledged - modern GUI application, it uses many of the basic techniques that are used - in more complex applications. After you have worked through it, we - recommend checking out the \l{mainwindows/application}{Application} - example, which presents a small GUI application, with menus, toolbars, a - status bar, and so on. -*/ - - -/*! - \page tutorials-addressbook-sdk-part1.html - \contentspage {Address Book Tutorial}{Contents} - \nextpage \l{Adding Addresses}{Chapter 2} - \title Address Book 1 - Designing the User Interface - - The first part of this tutorial covers the design of the basic graphical - user interface (GUI) we use for the Address Book application. - - The first step to creating a GUI program is to design the user interface. - In this chapter, our goal is to set up the labels and input fields needed - to implement a basic address book application. The figure below is a - screenshot of our expected output. - - \image addressbook-tutorial-part1-screenshot.png - - We begin by launching Qt Creator and use it to generate a new project. To - do this, select \gui New from the \gui File menu. In the - \gui{New File or Project} dialog. Follow the step by step guide on how to - create a \gui Project with Qt Creator, refer to the document - \l{Creating a Project in Qt Creator}{here}. Ensure that you select QWidget - as your subclass and name it \c AddressBook. - - There are five files generated in this \gui{Project}: - - \list - \o \c{addressbook.pro} - the project file, - \o \c{addressbook.h} - the definition file for the \c AddressBook - class, - \o \c{addressbook.cpp} - the implementation file for the - \c AddressBook class, - \o \c{main.cpp} - the file containing a \c main() function, with an - instance of \c AddressBook, and - \o \c{addressbook.ui} - the user interface file created with \QD. - \endlist - - Now we have all the files we need, let's move on to designing the user - interface. - - \section1 Placing the Widgets on the Form - - In the \gui{Project Sidebar}, double-click on the \c{addressbook.ui} file. - The \QD plugin will be launched, allowing you to design your program's user - interface. - - We require two \l{QLabel}s to label the input fields as well as a - QLineEdit and a QTextEdit as the input fields. So, drag those widgets from - the \gui{Widget Box} to your form. In the \gui{Property Editor}, set their - \gui{objectName} property to \c nameLabel and \c addressLabel for the - \l{QLabel}s, \c nameLine for the QLineEdit and finally, \c addressText for - the QTextEdit. - - Next, we have to position the widgets properly, according to the screenshot - earlier. We use a QGridLayout to position our labels and input fields in a - structured manner. QGridLayout divides the available space into a grid and - places widgets in the cells we specify with row and column numbers. The - diagram below shows the layout cells and the position of our widgets. - - \image addressbook-tutorial-part1-labeled-screenshot.png - - - \section1 Qt Programming - Subclassing - - When writing Qt programs, we usually subclass Qt objects to add - functionality. This is one of the essential concepts behind creating custom - widgets or collections of standard widgets. Subclassing to extend or change - the behavior of a widget has the following advantages: - - \list - \o We can write implementations of virtual or pure virtual functions - to obtain exactly what we need, falling back on the base class's - implementation when necessary. - \o It allows us to encapsulate parts of the user interface within a - class, so that the other parts of the application do not need to - know about the individual widgets in the user interface. - \o The subclass can be used to create multiple custom widgets in the - same application or library, and the code for the subclass can be - reused in other projects. - \endlist - - - - -*/ -- cgit v0.12 From 227b0b1e2cfa94912180fb401ddac83a2b5525d7 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 2 Apr 2009 12:49:13 +0200 Subject: Doc: Added a note about copying by value in QMetaProperty and included details about BlockingQueuedConnection in QMetaObject::invokeMethod(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: 187869 Task-number: 216742 Reviewed-by: Thiago Macieira Reviewed-by: Morten Sørvig --- src/corelib/kernel/qmetaobject.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 719398c..b65f956 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -1007,6 +1007,11 @@ enum { MaximumParamCount = 11 }; // up to 10 arguments + 1 return value a QEvent will be sent and the member is invoked as soon as the application enters the main event loop. + \o If \a type is Qt::BlockingQueuedConnection, the method will be invoked in + the same way as for Qt::QueuedConnection, except that the current thread + will block until the event is delivered. Using this connection type to + communicate between objects in the same thread will lead to deadlocks. + \o If \a type is Qt::AutoConnection, the member is invoked synchronously if \a obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously. @@ -1897,6 +1902,12 @@ static QByteArray qualifiedName(const QMetaEnum &e) \ingroup objectmodel + Property meta-data is obtained from an object's meta-object. See + QMetaObject::property() and QMetaObject::propertyCount() for + details. + + \section1 Property Meta-Data + A property has a name() and a type(), as well as various attributes that specify its behavior: isReadable(), isWritable(), isDesignable(), isScriptable(), and isStored(). @@ -1912,9 +1923,10 @@ static QByteArray qualifiedName(const QMetaEnum &e) functions. See QObject::setProperty() and QObject::property() for details. - You get property meta-data through an object's meta-object. See - QMetaObject::property() and QMetaObject::propertyCount() for - details. + \section1 Copying and Assignment + + QMetaProperty objects can be copied by value. However, each copy will + refer to the same underlying property meta-data. \sa QMetaObject, QMetaEnum, QMetaMethod, {Qt's Property System} */ -- cgit v0.12 From e008504b5ec34975e34adf3b1a2b7170d0e4dd38 Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Thu, 2 Apr 2009 12:45:38 +0200 Subject: Fixing some CoreText errors. Apparently CoreText is too good for us and always gives us fractional information. Which would be food for design metrics, but not good for drawing to the screen. The upshot of it is that we do the ceiling of every value we get. This is as stop gap solution for the moment. Things in Creator should look better now. Also added the ability to disable kerning. Reviewed-by: Simon Hausmann --- src/gui/text/qfontengine_mac.mm | 31 ++++++++++++++++++------------- src/gui/text/qfontengine_p.h | 2 +- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm index 40d145a..425cab2 100644 --- a/src/gui/text/qfontengine_mac.mm +++ b/src/gui/text/qfontengine_mac.mm @@ -120,7 +120,7 @@ OSStatus QMacFontPath::closePath(void *data) #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 -QCoreTextFontEngineMulti::QCoreTextFontEngineMulti(const ATSFontFamilyRef &, const ATSFontRef &atsFontRef, const QFontDef &fontDef, bool) +QCoreTextFontEngineMulti::QCoreTextFontEngineMulti(const ATSFontFamilyRef &, const ATSFontRef &atsFontRef, const QFontDef &fontDef, bool kerning) : QFontEngineMulti(0) { this->fontDef = fontDef; @@ -149,11 +149,15 @@ QCoreTextFontEngineMulti::QCoreTextFontEngineMulti(const ATSFontFamilyRef &, con CFRetain(ctfont); } - const void *keys[] = { NSFontAttributeName }; - const void *values[] = { ctfont }; - attributeDict = CFDictionaryCreate(0, keys, values, 1, + attributeDict = CFDictionaryCreateMutable(0, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); + CFDictionaryAddValue(attributeDict, NSFontAttributeName, ctfont); + if (!kerning) { + float zero = 0.0; + QCFType noKern = CFNumberCreate(kCFAllocatorDefault, kCFNumberFloatType, &zero); + CFDictionaryAddValue(attributeDict, kCTKernAttributeName, &noKern); + } QCoreTextFontEngine *fe = new QCoreTextFontEngine(ctfont, fontDef, this); fe->ref.ref(); @@ -277,10 +281,11 @@ bool QCoreTextFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLay outAdvances_x[idx] = QFixed::fromReal(tmpPoints[i + 1].x - tmpPoints[i].x); outAdvances_y[idx] = QFixed::fromReal(tmpPoints[i + 1].y - tmpPoints[i].y); } - double runWidth = ceil(CTRunGetTypographicBounds(run, range, 0, 0, 0)); - runWidth += tmpPoints[0].x; + CGSize lastGlyphAdvance; + CTFontGetAdvancesForGlyphs(runFont, kCTFontHorizontalOrientation, tmpGlyphs + glyphCount - 1, &lastGlyphAdvance, 1); + outGlyphs[rtl ? 0 : (glyphCount - 1)] = tmpGlyphs[glyphCount - 1] | fontIndex; - outAdvances_x[rtl ? 0 : (glyphCount - 1)] = QFixed::fromReal(runWidth - tmpPoints[glyphCount - 1].x); + outAdvances_x[rtl ? 0 : (glyphCount - 1)] = QFixed::fromReal(lastGlyphAdvance.width).ceil(); } outGlyphs += glyphCount; outAttributes += glyphCount; @@ -365,26 +370,26 @@ glyph_metrics_t QCoreTextFontEngine::boundingBox(glyph_t glyph) ret.y = -QFixed::fromReal(rect.origin.y) - ret.height; CGSize advances[1]; CTFontGetAdvancesForGlyphs(ctfont, kCTFontHorizontalOrientation, &g, advances, 1); - ret.xoff = QFixed::fromReal(advances[0].width); - ret.yoff = QFixed::fromReal(advances[0].height); + ret.xoff = QFixed::fromReal(advances[0].width).ceil(); + ret.yoff = QFixed::fromReal(advances[0].height).ceil(); return ret; } QFixed QCoreTextFontEngine::ascent() const { - return QFixed::fromReal(CTFontGetAscent(ctfont)); + return QFixed::fromReal(CTFontGetAscent(ctfont)).ceil(); } QFixed QCoreTextFontEngine::descent() const { - return QFixed::fromReal(CTFontGetDescent(ctfont)); + return QFixed::fromReal(CTFontGetDescent(ctfont)).ceil(); } QFixed QCoreTextFontEngine::leading() const { - return QFixed::fromReal(CTFontGetLeading(ctfont)); + return QFixed::fromReal(CTFontGetLeading(ctfont)).ceil(); } QFixed QCoreTextFontEngine::xHeight() const { - return QFixed::fromReal(CTFontGetXHeight(ctfont)); + return QFixed::fromReal(CTFontGetXHeight(ctfont)).ceil(); } QFixed QCoreTextFontEngine::averageCharWidth() const { diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h index e289aa9..176c728 100644 --- a/src/gui/text/qfontengine_p.h +++ b/src/gui/text/qfontengine_p.h @@ -480,7 +480,7 @@ private: uint fontIndexForFont(CTFontRef id) const; CTFontRef ctfont; - mutable QCFType attributeDict; + mutable QCFType attributeDict; friend class QFontDialogPrivate; }; -- cgit v0.12 From ca582d6cb205461cfcdf448749b46ee654faa5fd Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Thu, 2 Apr 2009 13:19:42 +0200 Subject: Improved stylesheet support for setting background and foreground roles This makes sure that style sheets set both ButtonText and WindowText roles for all widgets. This fixes among other things the fact that you could not configure text colors for combo box popups on Mac, Gtk and CleanLooks or set the background for the whole scrollbar. Task-number: 160713 Reviewed-by: ogoffart --- src/gui/styles/gtksymbols.cpp | 4 ++-- src/gui/styles/qgtkstyle.cpp | 10 +++++++++- src/gui/styles/qstylesheetstyle.cpp | 26 +++++++------------------- src/gui/widgets/qcombobox.cpp | 2 +- 4 files changed, 19 insertions(+), 23 deletions(-) diff --git a/src/gui/styles/gtksymbols.cpp b/src/gui/styles/gtksymbols.cpp index 3fbf233..f60c980 100644 --- a/src/gui/styles/gtksymbols.cpp +++ b/src/gui/styles/gtksymbols.cpp @@ -529,14 +529,14 @@ void QGtk::applyGtkSystemPalette(QWidget *widget) ensureWidgetPalette(menubar, QLS("GtkMenuBar")); else if (QToolBar *toolbar = qobject_cast (widget)) ensureWidgetPalette(toolbar, QLS("GtkToolbar")); - else if (QMenu *menubar = qobject_cast (widget)) { + else if (QMenu *menu = qobject_cast (widget)) { // This really applies to the combo box rendering since // QComboBox copies the palette from a QMenu QPalette pal = widget->palette(); GdkColor gdkBg = QGtk::gtkWidget(QLS("GtkMenu"))->style->bg[GTK_STATE_NORMAL]; QColor bgColor(gdkBg.red>>8, gdkBg.green>>8, gdkBg.blue>>8); pal.setBrush(QPalette::Base, bgColor); - menubar->setPalette(pal); + menu->setPalette(pal); } widget->setAttribute(Qt::WA_SetPalette, false); } diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index 582962a..81d7cb8 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -2593,16 +2593,24 @@ void QGtkStyle::drawControl(ControlElement element, opt.rect = vCheckRect; drawPrimitive(PE_PanelButtonCommand, &opt, painter, widget); } - painter->drawPixmap(pmr.topLeft(), pixmap); } GdkColor gdkText = gtkMenuItem->style->fg[GTK_STATE_NORMAL]; GdkColor gdkDText = gtkMenuItem->style->fg[GTK_STATE_INSENSITIVE]; GdkColor gdkHText = gtkMenuItem->style->fg[GTK_STATE_PRELIGHT]; + uint resolve_mask = option->palette.resolve(); QColor textColor = QColor(gdkText.red>>8, gdkText.green>>8, gdkText.blue>>8); QColor disabledTextColor = QColor(gdkDText.red>>8, gdkDText.green>>8, gdkDText.blue>>8); + if (resolve_mask & (1 << QPalette::ButtonText)) { + textColor = option->palette.buttonText().color(); + disabledTextColor = option->palette.brush(QPalette::Disabled, QPalette::ButtonText);; + } + QColor highlightedTextColor = QColor(gdkHText.red>>8, gdkHText.green>>8, gdkHText.blue>>8); + if (resolve_mask & (1 << QPalette::HighlightedText)) { + highlightedTextColor = option->palette.highlightedText().color(); + } if (selected) painter->setPen(highlightedTextColor); diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index a39eeb7..49ac57a 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -1514,20 +1514,11 @@ void QRenderRule::configurePalette(QPalette *p, QPalette::ColorRole fr, QPalette void QRenderRule::configurePalette(QPalette *p, QPalette::ColorGroup cg, const QWidget *w, bool embedded) { -#ifdef QT_NO_COMBOBOX - const bool isReadOnlyCombo = false; -#else - const bool isReadOnlyCombo = qobject_cast(w) != 0; -#endif - if (bg && bg->brush.style() != Qt::NoBrush) { - if (isReadOnlyCombo) { - p->setBrush(cg, QPalette::Base, bg->brush); // for windows, windowxp - p->setBrush(cg, QPalette::Button, bg->brush); // for plastique - } else { - p->setBrush(cg, w->backgroundRole(), bg->brush); - //p->setBrush(cg, QPalette::Window, bg->brush); - } + p->setBrush(cg, QPalette::Base, bg->brush); // for windows, windowxp + p->setBrush(cg, QPalette::Button, bg->brush); // for plastique + p->setBrush(cg, w->backgroundRole(), bg->brush); + p->setBrush(cg, QPalette::Window, bg->brush); } if (embedded) { @@ -1542,12 +1533,9 @@ void QRenderRule::configurePalette(QPalette *p, QPalette::ColorGroup cg, const Q return; if (pal->foreground.style() != Qt::NoBrush) { - if (isReadOnlyCombo) { - p->setBrush(cg, QPalette::ButtonText, pal->foreground); - } else { - p->setBrush(cg, w->foregroundRole(), pal->foreground); - p->setBrush(cg, QPalette::WindowText, pal->foreground); - } + p->setBrush(cg, QPalette::ButtonText, pal->foreground); + p->setBrush(cg, w->foregroundRole(), pal->foreground); + p->setBrush(cg, QPalette::WindowText, pal->foreground); p->setBrush(cg, QPalette::Text, pal->foreground); } if (pal->selectionBackground.style() != Qt::NoBrush) diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp index c7e2590..09a51fe 100644 --- a/src/gui/widgets/qcombobox.cpp +++ b/src/gui/widgets/qcombobox.cpp @@ -109,7 +109,7 @@ QStyleOptionMenuItem QComboMenuDelegate::getStyleOption(const QStyleOptionViewIt const QModelIndex &index) const { QStyleOptionMenuItem menuOption; - menuOption.palette = QComboBoxPrivate::viewContainerPalette(mCombo).resolve(QApplication::palette("QMenu")); + menuOption.palette = option.palette.resolve(QApplication::palette("QMenu")); menuOption.state = QStyle::State_None; if (mCombo->window()->isActiveWindow()) menuOption.state = QStyle::State_Active; -- cgit v0.12 From 975a9ed5ee3de9c720cc103923fe1a4f6665a4c6 Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Thu, 2 Apr 2009 13:26:06 +0200 Subject: Doc - fixing a broken link in the documentation of QWebPage Reviewed-by: Simon Hausmann --- src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp index de37383..14288e2 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp @@ -1095,7 +1095,7 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const This enum describes the types of action which can be performed on the web page. Actions only have an effect when they are applicable. The availability of - actions can be be determined by checking \l{QAction::}{enabled()} on the + actions can be be determined by checking \l{QAction::}{isEnabled()} on the action returned by \l{QWebPage::}{action()}. One method of enabling the text editing, cursor movement, and text selection actions -- cgit v0.12 From 16f691bad83a29c7c7fdeb3398a3fdadfdaa2949 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 2 Apr 2009 13:27:25 +0200 Subject: Completed 4.5.1 changelog for Designer/uic. --- dist/changes-4.5.1 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/dist/changes-4.5.1 b/dist/changes-4.5.1 index 4e3fcc7..fac0b5d 100644 --- a/dist/changes-4.5.1 +++ b/dist/changes-4.5.1 @@ -80,7 +80,13 @@ Qt for Windows CE - Designer - + * [249097] Fixed a crash related to undoing a QGridLayout re-layouting + operation. + * [247995] Fixed a crash occurring after layout operations that cause + an instance of QGridLayout or QFormLayout to shrink. + * [248000] Fixed a crash ocurring when re-layouting empty grid layouts. + * [245961] Restricted objectname-validation to known object name + properties only. - Linguist - Linguist GUI @@ -97,7 +103,11 @@ Qt for Windows CE - uic - + * [244998] Fixed include file generation for phonon widgets. + * [248070] Fixed code generation for QStringList-type properties to use + encoding properly. + * [242447] Made uic generate class-specific code correctly in the case + of multiple levels of inheritance. - uic3 -- cgit v0.12 From ba1dee09daef790883e53d91f4f02865c75e6d57 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 2 Apr 2009 13:27:03 +0200 Subject: cosmetic bug in qmake msvc_nmake generator fixed When generating nmake makefiles, the same inference rules were generated several times. Reviewed-by: mariusSO --- qmake/generators/win32/msvc_nmake.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index 4b1b66d..b5904cc 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -244,14 +244,14 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t) project->variables().remove("QMAKE_RUN_CC"); QHash source_directories; - source_directories.insertMulti(".", (void*)1); + source_directories.insert(".", (void*)1); QString directories[] = { QString("UI_SOURCES_DIR"), QString("UI_DIR"), QString() }; for(int y = 0; !directories[y].isNull(); y++) { QString dirTemp = project->first(directories[y]); if (dirTemp.endsWith("\\")) dirTemp.truncate(dirTemp.length()-1); if(!dirTemp.isEmpty()) - source_directories.insertMulti(dirTemp, (void*)1); + source_directories.insert(dirTemp, (void*)1); } QString srcs[] = { QString("SOURCES"), QString("GENERATED_SOURCES"), QString() }; for(int x = 0; !srcs[x].isNull(); x++) { @@ -262,7 +262,7 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t) sep = "/"; QString dir = (*sit).section(sep, 0, -2); if(!dir.isEmpty() && !source_directories[dir]) - source_directories.insertMulti(dir, (void*)1); + source_directories.insert(dir, (void*)1); } } -- cgit v0.12 From a2fcc4a5ae6addf3688a3686cc89ae20d5426242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Thu, 26 Mar 2009 16:00:14 +0100 Subject: QFile::rename didn't always return false when method failed The fallback implementation for rename would return true in some situations where the move failed. Also the destination file might be created and left there in these cases. Task-number: 244500 Reviewed-by: mariusSO --- src/corelib/io/qfile.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index d8f08c9..986c6f5 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -731,10 +731,16 @@ QFile::rename(const QString &newName) } if (read == -1) { d->setError(QFile::RenameError, in.errorString()); - return true; + error = true; + } + if(!error) { + if (!in.remove()) { + d->setError(QFile::RenameError, tr("Cannot remove source file")); + error = true; + } } - if(!error) - in.remove(); + if (error) + out.remove(); return !error; } } -- cgit v0.12 From 8d50038174faf315a389010af3a680d865f6843a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Thu, 26 Mar 2009 16:53:18 +0100 Subject: Renaming a file does not change QFile's fileName QFile made no attempt to reset the file name on a rename. We now reset the fileEngine's fileName if it was able to handle the rename. Otherwise, we call setFileName, which will result in reallocation of the fileEngine. Task-number: 244485 Reviewed-by: mariusSO --- src/corelib/io/qfile.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index 986c6f5..f0a6676 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -712,6 +712,9 @@ QFile::rename(const QString &newName) if(error() == QFile::NoError) { if (fileEngine()->rename(newName)) { unsetError(); + // engine was able to handle the new name so we just reset it + fileEngine()->setFileName(newName); + d->fileName = newName; return true; } @@ -741,6 +744,8 @@ QFile::rename(const QString &newName) } if (error) out.remove(); + else + setFileName(newName); return !error; } } -- cgit v0.12 From 57ec397f66e611c7802c8cdbb8a0232b91ac78f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Thu, 2 Apr 2009 11:15:03 +0200 Subject: Delete temporary file if copy was unsuccessful This is an untested bugfix -- comes solely from reading the code. In QFile::copy's fallback implementation a (temporary) file is created for block copying from the source file. When Qt is built without temporary file support this doesn't seem to be deleted in case of an error while block copying or renaming to the final destination. Reviewed-by: mariusSO --- src/corelib/io/qfile.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index f0a6676..d7da800 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -900,7 +900,10 @@ QFile::copy(const QString &newName) error = true; d->setError(QFile::CopyError, tr("Cannot create %1 for output").arg(newName)); } -#ifndef QT_NO_TEMPORARYFILE +#ifdef QT_NO_TEMPORARYFILE + if (error) + out.remove(); +#else if (!error) out.setAutoRemove(false); #endif -- cgit v0.12 From d9e3fd083217f3b03f211d64e7d78b36da90bf51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Thu, 19 Mar 2009 12:37:02 +0100 Subject: Remove dependency on Qt3 support from qmake tests Qt3 support prevented the tests from running on Mac Cocoa. Also started some Spring cleaning (it's just around the corner!) and applied some YAGNI :-) Reviewed-by: NRC Reviewed-by: mariusSO --- tests/auto/qmake/qmake.pro | 2 - tests/auto/qmake/testcompiler.cpp | 205 ++++++++++---------------------------- tests/auto/qmake/testcompiler.h | 29 ++---- tests/auto/qmake/tst_qmake.cpp | 16 ++- 4 files changed, 67 insertions(+), 185 deletions(-) diff --git a/tests/auto/qmake/qmake.pro b/tests/auto/qmake/qmake.pro index 59cc2be..8cae6be 100644 --- a/tests/auto/qmake/qmake.pro +++ b/tests/auto/qmake/qmake.pro @@ -2,8 +2,6 @@ load(qttest_p4) HEADERS += testcompiler.h SOURCES += tst_qmake.cpp testcompiler.cpp -contains(QT_CONFIG, qt3support): QT += qt3support - cross_compile: DEFINES += QMAKE_CROSS_COMPILED diff --git a/tests/auto/qmake/testcompiler.cpp b/tests/auto/qmake/testcompiler.cpp index bfc8905..c25b851 100644 --- a/tests/auto/qmake/testcompiler.cpp +++ b/tests/auto/qmake/testcompiler.cpp @@ -44,9 +44,7 @@ #include #include -#ifdef QT3_SUPPORT - -#include +#include #include #ifdef Q_OS_WIN32 # include @@ -59,6 +57,7 @@ QString targetName( BuildType buildMode, const QString& target, const QString& version ) { + Q_UNUSED(version); QString targetName = target; #if defined (Q_OS_WIN32) @@ -135,120 +134,49 @@ QString targetName( BuildType buildMode, const QString& target, const QString& v TestCompiler::TestCompiler() { - exit_ok = FALSE; - childProc = 0; - setBaseCommands( "", "", FALSE ); + setBaseCommands( "", "" ); } TestCompiler::~TestCompiler() { - if (childProc) - delete childProc; } -bool TestCompiler::runChild( bool showOutput, QStringList argList, QStringList *envList ) +bool TestCompiler::runCommand( QString cmdline ) { - //qDebug() << "executing" << argList; - exit_ok = FALSE; - if (childProc) - delete childProc; - - child_show = showOutput; - if ( showOutput ) { - - QString S = argList.join(" "); - addMakeResult( S ); - } + testOutput_.append("Running command: " + cmdline); - childProc = new Q3Process(argList, this, argList.join(" ").latin1()); - Q_ASSERT(childProc); - - connect(childProc,SIGNAL(readyReadStdout()),this,SLOT(childHasData())); - connect(childProc,SIGNAL(processExited()),this,SLOT(childReady())); - - if (!childProc->start( envList )) { - - addMakeResult( "Error executing '" + argList[0] + "'." ); - childReady(); - return FALSE; + QProcess child; + child.start(cmdline); + if (!child.waitForStarted(-1)) { + testOutput_.append( "Unable to start child process." ); + return false; } - while (childProc != 0 && childProc->isRunning()) { - qApp->processEvents(); + bool failed = false; + child.setReadChannel(QProcess::StandardError); + while (QProcess::Running == child.state()) { + if (child.waitForReadyRead(1000)) { + QString output = child.readAllStandardError(); + testOutput_.append(output); + + output.prepend('\n'); + if (output.contains("\nProject MESSAGE: FAILED")) + failed = true; + } } - childReady(); - - return exit_ok; -} - -void TestCompiler::childReady() -{ - if (childProc != 0) { - childHasData(); - - QString S; - int pos; - while (childProc->canReadLineStderr()) { - S = childProc->readLineStderr(); - do { - pos = S.find("\t"); - if (pos >= 0) { - S.remove(pos,1); - S.insert(pos," "); - } - } while (pos >= 0); - - if (child_show) - addMakeResult( S ); - } + child.waitForFinished(-1); - exit_ok = childProc->normalExit() && childProc->exitStatus() == 0; - delete childProc; - } - childProc = 0; -} - -void TestCompiler::childHasData() -{ - QString S; - int pos; - while (childProc->canReadLineStderr()) { - - S = childProc->readLineStderr(); - do { - pos = S.find("\t"); - if (pos >= 0) { - S.remove(pos,1); - S.insert(pos," "); - } - - } while (pos >= 0); - - if ( S.startsWith("Project MESSAGE: FAILED") ) - QTest::qFail( S, __FILE__, __LINE__ ); - else if ( S.startsWith("Project MESSAGE: SKIPPED") ) - QTest::qSkip( S, QTest::SkipSingle, __FILE__, __LINE__ ); - else if (child_show) - addMakeResult( S ); - } + return failed + ? false + : (child.exitStatus() == QProcess::NormalExit) + && (child.exitCode() == 0); } -void TestCompiler::setBaseCommands( QString makeCmd, QString qmakeCmd, bool qwsMode ) +void TestCompiler::setBaseCommands( QString makeCmd, QString qmakeCmd ) { - qws_mode = qwsMode; - make_cmd = makeCmd; - - // not sure if i need this, but it doesn't hurt - if (make_cmd.startsWith("\"")) - make_cmd = make_cmd.remove(0,1); - if (make_cmd.endsWith("\"")) - make_cmd = make_cmd.remove(make_cmd.length()-1,1); - - qmake_cmd = qmakeCmd; - // also not sure if i need this, but it doesn't hurt... - if(qmake_cmd.length() >= 2 && (qmake_cmd.at(0) == '"' || qmake_cmd.at(0) == '\'') && qmake_cmd.at(qmake_cmd.length()-1) == qmake_cmd.at(0)) - qmake_cmd = qmake_cmd.mid(1, qmake_cmd.length()-2); + makeCmd_ = makeCmd; + qmakeCmd_ = qmakeCmd; } bool TestCompiler::cleanAll( const QString &workPath, const QString &destPath, const QString &exeName, const QString &exeExt ) @@ -256,7 +184,7 @@ bool TestCompiler::cleanAll( const QString &workPath, const QString &destPath, c QDir D(workPath); if (!D.exists()) { - addMakeResult( "Directory '" + workPath + "' doesn't exist" ); + testOutput_.append( "Directory '" + workPath + "' doesn't exist" ); return FALSE; } @@ -269,11 +197,7 @@ bool TestCompiler::cleanAll( const QString &workPath, const QString &destPath, c if (Fi.exists()) { // Run make clean - QStringList args; - args = QStringList::split( " ", make_cmd ); - args.append("clean"); - - return runChild( FALSE, args, 0 ); + return runCommand( makeCmd_ + " clean" ); } return TRUE; @@ -284,7 +208,7 @@ bool TestCompiler::makeClean( const QString &workPath ) QDir D; if (!D.exists(workPath)) { - addMakeResult( "Directory '" + workPath + "' doesn't exist" ); + testOutput_.append( "Directory '" + workPath + "' doesn't exist" ); return FALSE; } @@ -293,11 +217,7 @@ bool TestCompiler::makeClean( const QString &workPath ) if (Fi.exists()) { // Run make clean - QStringList args; - args = QStringList::split( " ", make_cmd ); - args.append("clean"); - - return runChild( FALSE, args, 0 ); + return runCommand( makeCmd_ + " clean" ); } return TRUE; @@ -307,20 +227,15 @@ bool TestCompiler::makeDistClean( const QString &workPath ) { QDir D; if (!D.exists(workPath)) { - addMakeResult( "Directory '" + workPath + "' doesn't exist" ); + testOutput_.append( "Directory '" + workPath + "' doesn't exist" ); return FALSE; } D.setCurrent(workPath); QFileInfo Fi( workPath + "/Makefile"); - if (Fi.exists()) { - // Run make distclean - QStringList args; - args = QStringList::split( " ", make_cmd ); - args.append("distclean"); - - return runChild( FALSE, args, 0 ); - } + if (Fi.exists()) + // Run make distclean + return runCommand( makeCmd_ + " distclean" ); return TRUE; @@ -328,26 +243,22 @@ bool TestCompiler::makeDistClean( const QString &workPath ) bool TestCompiler::qmake( const QString &workDir, const QString &proName, const QString &buildDir ) { - // Now start qmake and generate the makefile - - QDir D( workDir ); - // Make sure we start in the right directory + QDir D; D.setCurrent( workDir ); if (D.exists("Makefile")) - D.remove("Makefile"); - - QStringList args; - args = QStringList::split( " ", qmake_cmd ); + D.remove("Makefile"); - QString project_fname = workDir + "/" + proName + ".pro"; - QString makefile_fname = (buildDir.isNull()?QString():(buildDir + "/")) + "Makefile"; + QString projectFile = proName; + QString makeFile = buildDir; + if (!projectFile.endsWith(".pro")) + projectFile += ".pro"; + if (!makeFile.isEmpty() && !makeFile.endsWith('/')) + makeFile += '/'; + makeFile += "Makefile"; - args.append( project_fname ); - args.append( "-o" ); - args.append( makefile_fname ); - - return runChild( TRUE, args, 0 ); + // Now start qmake and generate the makefile + return runCommand( qmakeCmd_ + " " + projectFile + " -o " + makeFile ); } bool TestCompiler::make( const QString &workPath, const QString &target ) @@ -355,14 +266,13 @@ bool TestCompiler::make( const QString &workPath, const QString &target ) QDir D; D.setCurrent( workPath ); - QStringList args; - args = QStringList::split( " ", make_cmd ); - if ( make_cmd.lower().find("nmake") >= 0) - args.append("/NOLOGO"); - if ( !target.isNull() ) - args.append(target); + QString cmdline = makeCmd_; + if ( cmdline.contains("nmake", Qt::CaseInsensitive) ) + cmdline.append(" /NOLOGO"); + if ( !target.isEmpty() ) + cmdline += " " + target; - return runChild( TRUE, args, 0 ); + return runCommand( cmdline ); } bool TestCompiler::exists( const QString &destDir, const QString &exeName, BuildType buildType, const QString &version ) @@ -371,10 +281,6 @@ bool TestCompiler::exists( const QString &destDir, const QString &exeName, Build return f.exists(); } -void TestCompiler::addMakeResult( const QString &result ) -{ - make_result.append( result ); -} bool TestCompiler::removeMakefile( const QString &workPath ) { @@ -385,6 +291,3 @@ bool TestCompiler::removeMakefile( const QString &workPath ) else return TRUE; } - -#endif //QT3_SUPPORT - diff --git a/tests/auto/qmake/testcompiler.h b/tests/auto/qmake/testcompiler.h index 597d440..12d8878 100644 --- a/tests/auto/qmake/testcompiler.h +++ b/tests/auto/qmake/testcompiler.h @@ -41,14 +41,9 @@ #ifndef TESTCOMPILER_H #define TESTCOMPILER_H - -#ifdef QT3_SUPPORT - #include #include -QT_FORWARD_DECLARE_CLASS(Q3Process) - #define COMPILE_ERROR "Compile error" #define COMPILE_SUCCESS "Compile successfull" #define COMPILE_NOT_AVAIL "Binary not available for testing" @@ -64,7 +59,7 @@ public: TestCompiler(); virtual ~TestCompiler(); - void setBaseCommands( QString makeCmd, QString qmakeCmd, bool qwsMode ); + void setBaseCommands( QString makeCmd, QString qmakeCmd ); // builds a complete project, e.g. qmake, make clean, make and exists. bool buildProject( const QString &project, BuildType buildType, const QString &targetName, const QString &destPath, const QString &version ); @@ -86,25 +81,13 @@ public: bool removeMakefile( const QString &workPath ); private: - QString make_cmd; - QString qmake_cmd; + bool runCommand( QString cmdLine ); - Q3Process *childProc; - QStringList env_list; - - bool child_show; - bool qws_mode; - bool exit_ok; - -private: - bool runChild( bool showOutput, QStringList argList, QStringList *envList ); - void addMakeResult( const QString &result ); - QStringList make_result; + QString makeCmd_; + QString qmakeCmd_; -private slots: - void childReady(); - void childHasData(); + // need to make this available somewhere + QStringList testOutput_; }; -#endif // QT3_SUPPORT #endif // TESTCOMPILER_H diff --git a/tests/auto/qmake/tst_qmake.cpp b/tests/auto/qmake/tst_qmake.cpp index facf0bb..884a2c4 100644 --- a/tests/auto/qmake/tst_qmake.cpp +++ b/tests/auto/qmake/tst_qmake.cpp @@ -42,11 +42,9 @@ #include -#if !defined(QMAKE_CROSS_COMPILED) && defined(QT3_SUPPORT) +#if !defined(QMAKE_CROSS_COMPILED) #include -#include - #include "testcompiler.h" @@ -104,16 +102,16 @@ tst_qmake::tst_qmake() { QString cmd = QString("qmake \"QT_VERSION=%1\"").arg(QT_VERSION); #ifdef Q_CC_MSVC - test_compiler.setBaseCommands( "nmake", cmd, FALSE ); + test_compiler.setBaseCommands( "nmake", cmd ); #elif defined(Q_CC_MINGW) - test_compiler.setBaseCommands( "mingw32-make", cmd, FALSE ); + test_compiler.setBaseCommands( "mingw32-make", cmd ); #elif defined(Q_OS_WIN) && defined(Q_CC_GNU) - test_compiler.setBaseCommands( "mmmake", cmd, FALSE ); + test_compiler.setBaseCommands( "mmmake", cmd ); #else - test_compiler.setBaseCommands( "make", cmd, FALSE ); + test_compiler.setBaseCommands( "make", cmd ); #endif QDir dir; - base_path = dir.currentDirPath(); + base_path = dir.currentPath(); } tst_qmake::~tst_qmake() @@ -406,7 +404,7 @@ void tst_qmake::bundle_spaces() // make (-n). TestCompiler local_tc; - local_tc.setBaseCommands("make -n", "qmake -macx -spec macx-g++", FALSE); + local_tc.setBaseCommands("make -n", "qmake -macx -spec macx-g++"); QVERIFY( local_tc.qmake(workDir, "bundle-spaces") ); -- cgit v0.12 From 0d026b267badbf7890b02256826f0ff3821fcec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Thu, 2 Apr 2009 15:47:54 +0200 Subject: Spring cleaning in qmake tests And some indentation fixes in qmake itself. Fixes indentation; TRUE => true; FALSE => false; #includes and #defines cleanup; removes dead code; comments... and somewhere along the way marked a function static. Reviewed-by: mariusSO --- qmake/generators/makefile.h | 6 +- qmake/generators/metamakefile.cpp | 2 +- qmake/project.cpp | 2 +- tests/auto/qmake/testcompiler.cpp | 109 +++++++-------------- tests/auto/qmake/testcompiler.h | 17 +--- .../auto/qmake/testdata/shadow_files_build/README | 2 +- tests/auto/qmake/tst_qmake.cpp | 18 ++-- 7 files changed, 49 insertions(+), 107 deletions(-) diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h index a26a247..cf09a6a 100644 --- a/qmake/generators/makefile.h +++ b/qmake/generators/makefile.h @@ -109,7 +109,7 @@ protected: struct SubTarget { QString name; - QString in_directory, out_directory; + QString in_directory, out_directory; QString profile, target, makefile; QStringList depends; }; @@ -183,8 +183,8 @@ protected: void filterIncludedFiles(const QString &); virtual void processSources() { - filterIncludedFiles("SOURCES"); - filterIncludedFiles("GENERATED_SOURCES"); + filterIncludedFiles("SOURCES"); + filterIncludedFiles("GENERATED_SOURCES"); } //for cross-platform dependent directories diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp index f0683a7..3f60791 100644 --- a/qmake/generators/metamakefile.cpp +++ b/qmake/generators/metamakefile.cpp @@ -360,7 +360,7 @@ SubdirsMetaMakefileGenerator::init() } --recurseDepth; - Option::output.setFileName(old_output); + Option::output.setFileName(old_output); Option::output_dir = old_output_dir; qmake_setpwd(oldpwd); } diff --git a/qmake/project.cpp b/qmake/project.cpp index 8d49788..eef32db 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -1105,7 +1105,7 @@ QMakeProject::parse(const QString &t, QMap &place, int num } } } - } else if(!parens && *(d+d_off) == QLatin1Char('}')) { + } else if(!parens && *(d+d_off) == QLatin1Char('}')) { if(start_block) { --start_block; } else if(!scope_blocks.count()) { diff --git a/tests/auto/qmake/testcompiler.cpp b/tests/auto/qmake/testcompiler.cpp index c25b851..b518da8 100644 --- a/tests/auto/qmake/testcompiler.cpp +++ b/tests/auto/qmake/testcompiler.cpp @@ -39,23 +39,12 @@ ** ****************************************************************************/ - #include "testcompiler.h" -#include -#include - -#include -#include -#ifdef Q_OS_WIN32 -# include -#endif -#include +#include +#include -#undef SHOW_QDEBUG -#undef SHOW_COMPLETENESS - -QString targetName( BuildType buildMode, const QString& target, const QString& version ) +static QString targetName( BuildType buildMode, const QString& target, const QString& version ) { Q_UNUSED(version); QString targetName = target; @@ -64,23 +53,23 @@ QString targetName( BuildType buildMode, const QString& target, const QString& v switch (buildMode) { case Exe: // app - targetName.append(".exe"); - break; + targetName.append(".exe"); + break; case Dll: // dll - if (version != "") { - QStringList ver = QStringList::split(".", version); - targetName.append(ver.first()); - } + if (version != "") { + QStringList ver = QStringList::split(".", version); + targetName.append(ver.first()); + } targetName.append(".dll"); - break; + break; case Lib: // lib #ifdef Q_CC_GNU targetName.prepend("lib"); targetName.append(".a"); #else - targetName.append(".lib"); + targetName.append(".lib"); #endif - break; + break; case Plain: // no conversion break; @@ -89,16 +78,16 @@ QString targetName( BuildType buildMode, const QString& target, const QString& v switch (buildMode) { case Exe: // app - targetName += ".app/Contents/MacOS/" + target.section('/', -1); - break; + targetName += ".app/Contents/MacOS/" + target.section('/', -1); + break; case Dll: // dll - targetName.prepend("lib"); + targetName.prepend("lib"); targetName.append("." + version + ".dylib"); - break; + break; case Lib: // lib - targetName.prepend("lib"); - targetName.append(".a"); - break; + targetName.prepend("lib"); + targetName.append(".a"); + break; case Plain: // no conversion break; @@ -107,9 +96,9 @@ QString targetName( BuildType buildMode, const QString& target, const QString& v switch (buildMode) { case Exe: // app - break; + break; case Dll: // dll - targetName.prepend("lib"); + targetName.prepend("lib"); #if defined (Q_OS_HPUX) && !defined (__ia64) targetName.append(".sl"); #elif defined (Q_OS_AIX) @@ -117,11 +106,11 @@ QString targetName( BuildType buildMode, const QString& target, const QString& v #else targetName.append(".so"); #endif - break; + break; case Lib: // lib - targetName.prepend("lib"); - targetName.append(".a"); - break; + targetName.prepend("lib"); + targetName.append(".a"); + break; case Plain: // no conversion break; @@ -130,8 +119,6 @@ QString targetName( BuildType buildMode, const QString& target, const QString& v return targetName; } - - TestCompiler::TestCompiler() { setBaseCommands( "", "" ); @@ -179,48 +166,21 @@ void TestCompiler::setBaseCommands( QString makeCmd, QString qmakeCmd ) qmakeCmd_ = qmakeCmd; } -bool TestCompiler::cleanAll( const QString &workPath, const QString &destPath, const QString &exeName, const QString &exeExt ) -{ - QDir D(workPath); - if (!D.exists()) { - - testOutput_.append( "Directory '" + workPath + "' doesn't exist" ); - return FALSE; - } - - D.setCurrent(workPath); - // must delete at least the executable file to be able to easily and safely - // verify that the compilation was a success. - D.remove( destPath + "/" + exeName + exeExt ); - D.remove( workPath + "/Makefile"); - QFileInfo Fi( workPath + "/Makefile"); - if (Fi.exists()) { - - // Run make clean - return runCommand( makeCmd_ + " clean" ); - } - - return TRUE; -} - bool TestCompiler::makeClean( const QString &workPath ) { QDir D; if (!D.exists(workPath)) { - testOutput_.append( "Directory '" + workPath + "' doesn't exist" ); - return FALSE; + return false; } D.setCurrent(workPath); QFileInfo Fi( workPath + "/Makefile"); - if (Fi.exists()) { - - // Run make clean - return runCommand( makeCmd_ + " clean" ); - } + if (Fi.exists()) + // Run make clean + return runCommand( makeCmd_ + " clean" ); - return TRUE; + return true; } bool TestCompiler::makeDistClean( const QString &workPath ) @@ -228,7 +188,7 @@ bool TestCompiler::makeDistClean( const QString &workPath ) QDir D; if (!D.exists(workPath)) { testOutput_.append( "Directory '" + workPath + "' doesn't exist" ); - return FALSE; + return false; } D.setCurrent(workPath); @@ -237,7 +197,7 @@ bool TestCompiler::makeDistClean( const QString &workPath ) // Run make distclean return runCommand( makeCmd_ + " distclean" ); - return TRUE; + return true; } @@ -281,13 +241,12 @@ bool TestCompiler::exists( const QString &destDir, const QString &exeName, Build return f.exists(); } - bool TestCompiler::removeMakefile( const QString &workPath ) { QDir D; D.setCurrent( workPath ); if ( D.exists( "Makefile" ) ) - return D.remove( "Makefile" ); + return D.remove( "Makefile" ); else - return TRUE; + return true; } diff --git a/tests/auto/qmake/testcompiler.h b/tests/auto/qmake/testcompiler.h index 12d8878..90f7fea 100644 --- a/tests/auto/qmake/testcompiler.h +++ b/tests/auto/qmake/testcompiler.h @@ -41,19 +41,14 @@ #ifndef TESTCOMPILER_H #define TESTCOMPILER_H -#include -#include - -#define COMPILE_ERROR "Compile error" -#define COMPILE_SUCCESS "Compile successfull" -#define COMPILE_NOT_AVAIL "Binary not available for testing" -#define SELF_TEST "self-test" +#include +#include enum BuildType { Exe, Dll, Lib, Plain }; class TestCompiler : public QObject { -Q_OBJECT + Q_OBJECT public: TestCompiler(); @@ -61,9 +56,6 @@ public: void setBaseCommands( QString makeCmd, QString qmakeCmd ); - // builds a complete project, e.g. qmake, make clean, make and exists. - bool buildProject( const QString &project, BuildType buildType, const QString &targetName, const QString &destPath, const QString &version ); - // executes a make clean in the specified workPath bool makeClean( const QString &workPath ); // executes a make dist clean in the specified workPath @@ -72,9 +64,6 @@ public: bool qmake( const QString &workDir, const QString &proName, const QString &buildDir = QString() ); // executes a make in the specified workPath, with an optional target (eg. install) bool make( const QString &workPath, const QString &target = QString() ); - // executes a make clean and then deletes the makefile in workpath + deletes the executable - // in destPath. - bool cleanAll( const QString &workPath, const QString &destPath, const QString &exeName, const QString &exeExt ); // checks if the executable exists in destDir bool exists( const QString &destDir, const QString &exeName, BuildType buildType, const QString &version ); // removes the makefile diff --git a/tests/auto/qmake/testdata/shadow_files_build/README b/tests/auto/qmake/testdata/shadow_files_build/README index 46017fc..15e48c0 100644 --- a/tests/auto/qmake/testdata/shadow_files_build/README +++ b/tests/auto/qmake/testdata/shadow_files_build/README @@ -1 +1 @@ -Here to ensure include_dir_build exists +Here to ensure shadow_files_build exists, used by the shadow_files test. diff --git a/tests/auto/qmake/tst_qmake.cpp b/tests/auto/qmake/tst_qmake.cpp index 884a2c4..07389e9 100644 --- a/tests/auto/qmake/tst_qmake.cpp +++ b/tests/auto/qmake/tst_qmake.cpp @@ -39,19 +39,13 @@ ** ****************************************************************************/ - -#include - #if !defined(QMAKE_CROSS_COMPILED) -#include - #include "testcompiler.h" -#include - -//TESTED_CLASS= -//TESTED_FILES=corelib/tools/qlocale.h corelib/tools/qlocale.cpp +#include +#include +#include class tst_qmake : public QObject { @@ -61,12 +55,12 @@ public: tst_qmake(); virtual ~tst_qmake(); - public slots: void initTestCase(); void cleanupTestCase(); void init(); void cleanup(); + private slots: void simple_app(); void simple_lib(); @@ -253,10 +247,10 @@ void tst_qmake::duplicateLibraryEntries() void tst_qmake::export_across_file_boundaries() { // This relies on features so we need to set the QMAKEFEATURES environment variable - putenv("QMAKEFEATURES=."); + putenv("QMAKEFEATURES=."); QString workDir = base_path + "/testdata/export_across_file_boundaries"; QVERIFY( test_compiler.qmake( workDir, "foo" )); - putenv("QMAKEFEATURES="); + putenv("QMAKEFEATURES="); } void tst_qmake::include_dir() -- cgit v0.12 From 605746fd14ff68f19a806bb54882fb967fccc8e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Thu, 19 Mar 2009 13:36:56 +0100 Subject: In qmake tests, allow child environment to be manipulated ... without having to change the parent process's environment. Reviewed-by: mariusSO --- tests/auto/qmake/testcompiler.cpp | 13 +++++++++++++ tests/auto/qmake/testcompiler.h | 3 +++ tests/auto/qmake/tst_qmake.cpp | 4 ++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/tests/auto/qmake/testcompiler.cpp b/tests/auto/qmake/testcompiler.cpp index b518da8..122a2b8 100644 --- a/tests/auto/qmake/testcompiler.cpp +++ b/tests/auto/qmake/testcompiler.cpp @@ -133,6 +133,9 @@ bool TestCompiler::runCommand( QString cmdline ) testOutput_.append("Running command: " + cmdline); QProcess child; + if (!environment_.empty()) + child.setEnvironment(QProcess::systemEnvironment() + environment_); + child.start(cmdline); if (!child.waitForStarted(-1)) { testOutput_.append( "Unable to start child process." ); @@ -166,6 +169,16 @@ void TestCompiler::setBaseCommands( QString makeCmd, QString qmakeCmd ) qmakeCmd_ = qmakeCmd; } +void TestCompiler::resetEnvironment() +{ + environment_.clear(); +} + +void TestCompiler::addToEnvironment( QString varAssignment ) +{ + environment_.push_back(varAssignment); +} + bool TestCompiler::makeClean( const QString &workPath ) { QDir D; diff --git a/tests/auto/qmake/testcompiler.h b/tests/auto/qmake/testcompiler.h index 90f7fea..41e5177 100644 --- a/tests/auto/qmake/testcompiler.h +++ b/tests/auto/qmake/testcompiler.h @@ -55,6 +55,8 @@ public: virtual ~TestCompiler(); void setBaseCommands( QString makeCmd, QString qmakeCmd ); + void resetEnvironment(); + void addToEnvironment( QString varAssignment ); // executes a make clean in the specified workPath bool makeClean( const QString &workPath ); @@ -74,6 +76,7 @@ private: QString makeCmd_; QString qmakeCmd_; + QStringList environment_; // need to make this available somewhere QStringList testOutput_; diff --git a/tests/auto/qmake/tst_qmake.cpp b/tests/auto/qmake/tst_qmake.cpp index 07389e9..70f1f3c 100644 --- a/tests/auto/qmake/tst_qmake.cpp +++ b/tests/auto/qmake/tst_qmake.cpp @@ -247,10 +247,10 @@ void tst_qmake::duplicateLibraryEntries() void tst_qmake::export_across_file_boundaries() { // This relies on features so we need to set the QMAKEFEATURES environment variable - putenv("QMAKEFEATURES=."); + test_compiler.addToEnvironment("QMAKEFEATURES=."); QString workDir = base_path + "/testdata/export_across_file_boundaries"; QVERIFY( test_compiler.qmake( workDir, "foo" )); - putenv("QMAKEFEATURES="); + test_compiler.resetEnvironment(); } void tst_qmake::include_dir() -- cgit v0.12 From cfa31244eb9d16214360626723253d6a363a8d48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Thu, 2 Apr 2009 11:03:58 +0200 Subject: Small changes in qmake's fileFixify Removed dead code and simplified conditionals. This should not otherwise change behavior or output of qmake in any way. Reviewed-by: mariusSO --- qmake/generators/makefile.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index d0fbcbe..3e5452e 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2735,16 +2735,9 @@ MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const Q ret.prepend(pwd); ret = Option::fixPathToTargetOS(ret, false, canon); } else { //fix it.. - QString qfile(Option::fixPathToLocalOS(ret, true, canon)), in_dir(in_d), out_dir(out_d); + QString out_dir = QDir(Option::output_dir).absoluteFilePath(out_d); + QString in_dir = QDir(pwd).absoluteFilePath(in_d); { - if(out_dir.isNull() || QDir::isRelativePath(out_dir)) - out_dir.prepend(Option::output_dir + "/"); - else if(out_dir == ".") - out_dir = pwd; - if(in_dir.isEmpty() || QDir::isRelativePath(in_dir)) - in_dir.prepend(pwd); - else if(in_dir == ".") - in_dir = pwd; QFileInfo in_fi(fileInfo(in_dir)); if(in_fi.exists()) in_dir = in_fi.canonicalFilePath(); @@ -2753,6 +2746,7 @@ MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const Q out_dir = out_fi.canonicalFilePath(); } + QString qfile(Option::fixPathToLocalOS(ret, true, canon)); QFileInfo qfileinfo(fileInfo(qfile)); if(out_dir != in_dir || !qfileinfo.isRelative()) { if(qfileinfo.isRelative()) { -- cgit v0.12 From db4040f7bf1e36b9568e7a99dc090acf03b0ddd0 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 2 Apr 2009 16:42:36 +0200 Subject: make the configured namespace part of QT_BUILD_KEY The eclipse integration is namespaced, but it pulls in system plugins like the oxygen style. This breaks as the (non-namespaced) style plugin does not find a suitable QApplication instantiated (only a namespace one is there) Reviewed-by: thiago Task-number: 250185 --- configure | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure b/configure index f0b7f90..f79b1e2 100755 --- a/configure +++ b/configure @@ -6177,6 +6177,9 @@ TARGET_OPERATING_SYSTEM=`echo $XPLATFORM | cut -f 2- -d/ | cut -f -1 -d-` # when cross-compiling, don't include build-host information (build key is target specific) QT_BUILD_KEY="$CFG_USER_BUILD_KEY $CFG_ARCH $TARGET_OPERATING_SYSTEM $COMPILER $BUILD_OPTIONS" +if [ -n "$QT_NAMESPACE" ]; then + QT_BUILD_KEY="$QT_BUILD_KEY $QT_NAMESPACE" +fi MAC_NEED_TWO_BUILD_KEYS="no" if [ "$PLATFORM_MAC" = "yes" -a "$CFG_MAC_COCOA" = "yes" ]; then QT_BUILD_KEY_CARBON=$QT_BUILD_KEY -- cgit v0.12 From 0c508410dd42714b9854b523c851ef699ebcf7d7 Mon Sep 17 00:00:00 2001 From: kh Date: Thu, 2 Apr 2009 17:58:51 +0200 Subject: fixes empty tab after pdf file open Task-number: none Reviewed-by: --global --- tools/assistant/tools/assistant/contentwindow.cpp | 21 +++++++++++++++------ tools/assistant/tools/assistant/contentwindow.h | 2 ++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/tools/assistant/tools/assistant/contentwindow.cpp b/tools/assistant/tools/assistant/contentwindow.cpp index 24e7ca9..89060bd 100644 --- a/tools/assistant/tools/assistant/contentwindow.cpp +++ b/tools/assistant/tools/assistant/contentwindow.cpp @@ -132,7 +132,7 @@ bool ContentWindow::eventFilter(QObject *o, QEvent *e) qobject_cast(m_contentWidget->model()); if (contentModel) { QHelpContentItem *itm = contentModel->contentItemAt(index); - if (itm) + if (itm && !isPdfFile(itm)) CentralWidget::instance()->setSourceInNewTab(itm->url()); } } @@ -146,16 +146,19 @@ void ContentWindow::showContextMenu(const QPoint &pos) if (!m_contentWidget->indexAt(pos).isValid()) return; - QMenu menu; - QAction *curTab = menu.addAction(tr("Open Link")); - QAction *newTab = menu.addAction(tr("Open Link in New Tab")); - menu.move(m_contentWidget->mapToGlobal(pos)); - QHelpContentModel *contentModel = qobject_cast(m_contentWidget->model()); QHelpContentItem *itm = contentModel->contentItemAt(m_contentWidget->currentIndex()); + QMenu menu; + QAction *curTab = menu.addAction(tr("Open Link")); + QAction *newTab = menu.addAction(tr("Open Link in New Tab")); + if (isPdfFile(itm)) + newTab->setEnabled(false); + + menu.move(m_contentWidget->mapToGlobal(pos)); + QAction *action = menu.exec(); if (curTab == action) emit linkActivated(itm->url()); @@ -175,4 +178,10 @@ void ContentWindow::itemClicked(const QModelIndex &index) } } +bool ContentWindow::isPdfFile(QHelpContentItem *item) const +{ + const QString &path = item->url().path(); + return path.endsWith(QLatin1String(".pdf"), Qt::CaseInsensitive); +} + QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/contentwindow.h b/tools/assistant/tools/assistant/contentwindow.h index ab8f8dd..ddc3e7c 100644 --- a/tools/assistant/tools/assistant/contentwindow.h +++ b/tools/assistant/tools/assistant/contentwindow.h @@ -49,6 +49,7 @@ QT_BEGIN_NAMESPACE class QHelpEngine; +class QHelpContentItem; class QHelpContentWidget; class ContentWindow : public QWidget @@ -75,6 +76,7 @@ private: void focusInEvent(QFocusEvent *e); void keyPressEvent(QKeyEvent *e); bool eventFilter(QObject *o, QEvent *e); + bool isPdfFile(QHelpContentItem *item) const; QHelpEngine *m_helpEngine; QHelpContentWidget *m_contentWidget; -- cgit v0.12 From 468f189d73fefaeb0769365f78762dc2aa63683d Mon Sep 17 00:00:00 2001 From: kh Date: Thu, 2 Apr 2009 18:00:34 +0200 Subject: fixes empty tab after pdf file open Task-number: none Reviewed-by: --global --- tools/assistant/tools/assistant/indexwindow.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/assistant/tools/assistant/indexwindow.cpp b/tools/assistant/tools/assistant/indexwindow.cpp index 4bd6f4f..0beb5ee 100644 --- a/tools/assistant/tools/assistant/indexwindow.cpp +++ b/tools/assistant/tools/assistant/indexwindow.cpp @@ -189,13 +189,20 @@ void IndexWindow::open(QHelpIndexWidget* indexWidget, const QModelIndex &index) if (model) { QString keyword = model->data(index, Qt::DisplayRole).toString(); QMap links = model->linksForKeyword(keyword); + + QUrl url; if (links.count() > 1) { TopicChooser tc(this, keyword, links); - if (tc.exec() == QDialog::Accepted) - CentralWidget::instance()->setSourceInNewTab(tc.link()); + if (tc.exec() == QDialog::Accepted) + url = tc.link(); } else if (links.count() == 1) { - CentralWidget::instance()->setSourceInNewTab(links.constBegin().value()); + url = links.constBegin().value(); } + + if (url.path().endsWith(QLatin1String(".pdf"), Qt::CaseInsensitive)) + CentralWidget::instance()->setSource(url); + else + CentralWidget::instance()->setSourceInNewTab(url); } } -- cgit v0.12 From 8eeda065bbf039bb3305d716b8163c723c7ad1c0 Mon Sep 17 00:00:00 2001 From: kh Date: Thu, 2 Apr 2009 18:01:47 +0200 Subject: fixes empty tab after pdf file open, new tab after middle mouse click Task-number: none Reviewed-by: --global --- tools/assistant/tools/assistant/helpviewer.cpp | 59 ++++++++++++++++++++++++-- tools/assistant/tools/assistant/helpviewer.h | 1 + 2 files changed, 57 insertions(+), 3 deletions(-) diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp index 6b049e8..f7225fa 100644 --- a/tools/assistant/tools/assistant/helpviewer.cpp +++ b/tools/assistant/tools/assistant/helpviewer.cpp @@ -164,6 +164,7 @@ public: protected: virtual QWebPage *createWindow(QWebPage::WebWindowType); + virtual void triggerAction(WebAction action, bool checked = false); virtual bool acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, NavigationType type); @@ -171,16 +172,30 @@ protected: private: CentralWidget *centralWidget; QHelpEngine *helpEngine; + bool closeNewTabIfNeeded; + + friend class HelpViewer; + Qt::MouseButtons m_pressedButtons; + Qt::KeyboardModifiers m_keyboardModifiers; }; HelpPage::HelpPage(CentralWidget *central, QHelpEngine *engine, QObject *parent) - : QWebPage(parent), centralWidget(central), helpEngine(engine) + : QWebPage(parent) + , centralWidget(central) + , helpEngine(engine) + , closeNewTabIfNeeded(false) + , m_pressedButtons(Qt::NoButton) + , m_keyboardModifiers(Qt::NoModifier) { } QWebPage *HelpPage::createWindow(QWebPage::WebWindowType) { - return centralWidget->newEmptyTab()->page(); + HelpPage* newPage = static_cast(centralWidget->newEmptyTab()->page()); + if (newPage) + newPage->closeNewTabIfNeeded = closeNewTabIfNeeded; + closeNewTabIfNeeded = false; + return newPage; } static bool isLocalUrl(const QUrl &url) @@ -196,10 +211,24 @@ static bool isLocalUrl(const QUrl &url) return false; } +void HelpPage::triggerAction(WebAction action, bool checked) +{ + switch (action) { + case OpenLinkInNewWindow: + closeNewTabIfNeeded = true; + default: // fall through + QWebPage::triggerAction(action, checked); + break; + } +} + bool HelpPage::acceptNavigationRequest(QWebFrame *, - const QNetworkRequest &request, QWebPage::NavigationType) + const QNetworkRequest &request, QWebPage::NavigationType type) { const QUrl &url = request.url(); + const bool closeNewTab = closeNewTabIfNeeded; + closeNewTabIfNeeded = false; + if (isLocalUrl(url)) { const QString& path = url.path(); if (path.endsWith(QLatin1String(".pdf"))) { @@ -216,8 +245,22 @@ bool HelpPage::acceptNavigationRequest(QWebFrame *, tmpFile.close(); } QDesktopServices::openUrl(QUrl(tmpFile.fileName())); + + if (closeNewTab) + QMetaObject::invokeMethod(CentralWidget::instance(), "closeTab"); return false; } + + if (type == QWebPage::NavigationTypeLinkClicked + && (m_keyboardModifiers & Qt::ControlModifier + || m_pressedButtons == Qt::MidButton)) { + HelpViewer* viewer = centralWidget->newEmptyTab(); + if (viewer) + CentralWidget::instance()->setSource(url); + m_pressedButtons = Qt::NoButton; + m_keyboardModifiers = Qt::NoModifier; + return false; + } return true; } @@ -332,6 +375,16 @@ void HelpViewer::actionChanged() emit forwardAvailable(a->isEnabled()); } +void HelpViewer::mousePressEvent(QMouseEvent *event) +{ + HelpPage *currentPage = static_cast(page()); + if (currentPage) { + currentPage->m_pressedButtons = event->buttons(); + currentPage->m_keyboardModifiers = event->modifiers(); + } + QWebView::mousePressEvent(event); +} + #else // !defined(QT_NO_WEBKIT) HelpViewer::HelpViewer(QHelpEngine *engine, CentralWidget *parent) diff --git a/tools/assistant/tools/assistant/helpviewer.h b/tools/assistant/tools/assistant/helpviewer.h index af5c197..eea7340 100644 --- a/tools/assistant/tools/assistant/helpviewer.h +++ b/tools/assistant/tools/assistant/helpviewer.h @@ -107,6 +107,7 @@ Q_SIGNALS: protected: virtual void wheelEvent(QWheelEvent *); void mouseReleaseEvent(QMouseEvent *e); + void mousePressEvent(QMouseEvent *event); private Q_SLOTS: void actionChanged(); -- cgit v0.12 From 4ef666941209530ef266a34c3b32dc07642eef9a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 2 Apr 2009 11:55:55 +0200 Subject: fix wrong evaluation of arguments to qmake functions cherry-pick 28dacdfdf3eed04ec47a1e8eb206bd3ffb979c08 from creator --- tools/linguist/shared/profileevaluator.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/linguist/shared/profileevaluator.cpp b/tools/linguist/shared/profileevaluator.cpp index aa529c1..eb6e2a7 100644 --- a/tools/linguist/shared/profileevaluator.cpp +++ b/tools/linguist/shared/profileevaluator.cpp @@ -1002,9 +1002,10 @@ bool ProFileEvaluator::Private::isActiveConfig(const QString &config, bool regex QStringList ProFileEvaluator::Private::evaluateExpandFunction(const QString &func, const QString &arguments) { QStringList argumentsList = split_arg_list(arguments); + QStringList args; for (int i = 0; i < argumentsList.count(); ++i) - args += expandVariableReferences(argumentsList[i]); + args += expandVariableReferences(argumentsList[i]).join(Option::field_sep); enum ExpandFunc { E_MEMBER=1, E_FIRST, E_LAST, E_CAT, E_FROMFILE, E_EVAL, E_LIST, E_SPRINTF, E_JOIN, E_SPLIT, E_BASENAME, E_DIRNAME, E_SECTION, -- cgit v0.12 From 5fa1cba8220b5a73aa45c83a0878a6f7c3060343 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 2 Apr 2009 12:02:39 +0200 Subject: fix evaluation of CONFIG() and contains() cherry-picked from creator's b3ec859c80bd0656cfc48cfe6514ec4f631b8206 --- tools/linguist/shared/profileevaluator.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/linguist/shared/profileevaluator.cpp b/tools/linguist/shared/profileevaluator.cpp index eb6e2a7..a0771b4 100644 --- a/tools/linguist/shared/profileevaluator.cpp +++ b/tools/linguist/shared/profileevaluator.cpp @@ -1266,10 +1266,11 @@ bool ProFileEvaluator::Private::evaluateConditionalFunction(const QString &funct for (int mut = 0; mut < mutuals.count(); mut++) { if (configs[i] == mutuals[mut].trimmed()) { cond = (configs[i] == args[0]); - break; + goto done_T_CONFIG; } } } + done_T_CONFIG: break; } case CF_CONTAINS: { @@ -1296,12 +1297,12 @@ bool ProFileEvaluator::Private::evaluateConditionalFunction(const QString &funct for (int mut = 0; mut < mutuals.count(); mut++) { if (val == mutuals[mut].trimmed()) { cond = (regx.exactMatch(val) || val == args[1]); - break; + goto done_T_CONTAINS; } } } } - + done_T_CONTAINS: break; } case CF_COUNT: { -- cgit v0.12 From 3570e978058816745101a69b552ad9d07e349542 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 2 Apr 2009 15:12:17 +0200 Subject: re-initialize some variables for each file --- tools/linguist/shared/profileevaluator.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/linguist/shared/profileevaluator.cpp b/tools/linguist/shared/profileevaluator.cpp index a0771b4..ce53c27 100644 --- a/tools/linguist/shared/profileevaluator.cpp +++ b/tools/linguist/shared/profileevaluator.cpp @@ -157,11 +157,6 @@ ProFileEvaluator::Private::Private(ProFileEvaluator *q_) m_prevLineNo = 0; m_prevProFile = 0; m_verbose = true; - m_block = 0; - m_commentItem = 0; - m_syntaxError = 0; - m_lineNo = 0; - m_contNextLine = false; } bool ProFileEvaluator::Private::read(ProFile *pro) @@ -172,8 +167,12 @@ bool ProFileEvaluator::Private::read(ProFile *pro) return false; } + m_block = 0; + m_commentItem = 0; + m_contNextLine = false; m_syntaxError = false; m_lineNo = 1; + m_blockstack.clear(); m_blockstack.push(pro); QTextStream ts(&file); -- cgit v0.12 From 33fedde08f263c6aaa46c2fa0fdf93896c7eaa64 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 31 Mar 2009 14:38:57 +0200 Subject: re-apply improved version of 3aff9113a9702ea6f7e099a73136a718ae1b992f this time, it can deal with directories which are absolute to start with. Reviewed-by: mariusSO --- mkspecs/features/moc.prf | 5 ++++- mkspecs/features/uic.prf | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/moc.prf b/mkspecs/features/moc.prf index faa9871..d3ad4b2 100644 --- a/mkspecs/features/moc.prf +++ b/mkspecs/features/moc.prf @@ -61,7 +61,10 @@ QMAKE_EXTRA_COMPILERS += moc_source INCREDIBUILD_XGE += moc_source #make sure we can include these files -INCLUDEPATH += $$MOC_DIR +moc_dir_short = $$MOC_DIR +win32:moc_dir_short ~= s,^.:,/, +contains(moc_dir_short, ^[/\\].*):INCLUDEPATH += $$MOC_DIR +else:INCLUDEPATH += $$OUT_PWD/$$MOC_DIR #auto depend on moc unix:!no_mocdepend { diff --git a/mkspecs/features/uic.prf b/mkspecs/features/uic.prf index 885fad7..f03d623 100644 --- a/mkspecs/features/uic.prf +++ b/mkspecs/features/uic.prf @@ -34,7 +34,10 @@ isEmpty(QMAKE_MOD_UIC):QMAKE_MOD_UIC = ui_ INCREDIBUILD_XGE += uic } -INCLUDEPATH += $$UI_HEADERS_DIR +ui_dir_short = $$UI_HEADERS_DIR +win32:ui_dir_short ~= s,^.:,/, +contains(ui_dir_short, ^[/\\].*):INCLUDEPATH += $$UI_HEADERS_DIR +else:INCLUDEPATH += $$OUT_PWD/$$UI_HEADERS_DIR uic3 { isEmpty(FORMS3) { -- cgit v0.12 From c99638c9ba4b233c8d0e822a1bf6e26b885e029d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 2 Apr 2009 17:55:23 +0200 Subject: make relative #include relative to the current file i.e., use "", not <> and thus rely on the include path --- src/network/kernel/qauthenticator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp index 4f477bd..c9161f8 100644 --- a/src/network/kernel/qauthenticator.cpp +++ b/src/network/kernel/qauthenticator.cpp @@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE -#include <../3rdparty/des/des.cpp> +#include "../../3rdparty/des/des.cpp" static QByteArray qNtlmPhase1(); static QByteArray qNtlmPhase3(QAuthenticatorPrivate *ctx, const QByteArray& phase2data); -- cgit v0.12 From 7c09fda559760b8488d3130a5932fee04b2f6979 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 2 Apr 2009 18:52:51 +0200 Subject: Make mkdist-webkit work from in-source builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Explicitly unset QTDIR_build, to make sure we generate Makefiles with real rules to call the extra tools. Reviewed-by: Tor Arne Vestbø --- util/webkit/mkdist-webkit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/webkit/mkdist-webkit b/util/webkit/mkdist-webkit index 0644564..d4e6d9e 100755 --- a/util/webkit/mkdist-webkit +++ b/util/webkit/mkdist-webkit @@ -254,7 +254,7 @@ echo "generating extra sources" mkdir tmp && cd tmp && mkdir -p ../generated && - qmake -o Makefile QT_CONFIG+=phonon GENERATED_SOURCES_DIR=`pwd`/../generated OUTPUT_DIR=`pwd` ../$proj.pro && + qmake -o Makefile CONFIG-=QTDIR_build QT_CONFIG+=phonon GENERATED_SOURCES_DIR=`pwd`/../generated OUTPUT_DIR=`pwd` ../$proj.pro && make generated_files && perl -pi -e "s,$absSrcDir/,,g" ../generated/*.cpp ../generated/*.h && git add ../generated && -- cgit v0.12