From 81a45e1f13fdf56129aed952a6e3479e16c14a2c Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 26 Jul 2014 01:43:18 +0200 Subject: QTimeZone: don't use QSet, use sorted QList QSet, as a node-based container, requires one memory allocation per element inserted. QList, as a contiguous-memory container (at least in the case of a QByteArray payload), requires one memory allocation per container. The higher lookup speed might still speak for using QSet, but there are only two uses of the sets: 1. Checking for existence (or lack thereof) of timezone names. For this, first generating a container full of data just to check for existence of one item of data is extremely wasteful. The QTZPrivate API should be extended to allow said lookup to be performed on the native data store instead. That leaves 2. Returning a sorted(!) list(!) from the public QTimeZone API. There is no reason why, during the construction of those sorted lists, the data should be held in a set. Instead, the well-known technique of first cramming everything into a result container, which is subsequently sorted and has its duplicates removed, can be used here. Saves more than 8K of text size on AMD64 stripped release builds. Change-Id: I71c2298e94e02d55b0c9fb6f7ebeaed79a1fe2db Reviewed-by: Thiago Macieira --- src/corelib/tools/qtimezone.cpp | 42 +++++++++-------- src/corelib/tools/qtimezoneprivate.cpp | 74 +++++++++++++++++------------- src/corelib/tools/qtimezoneprivate_icu.cpp | 37 ++++++++------- src/corelib/tools/qtimezoneprivate_mac.mm | 13 ++++-- src/corelib/tools/qtimezoneprivate_p.h | 26 +++++------ src/corelib/tools/qtimezoneprivate_tz.cpp | 16 ++++--- src/corelib/tools/qtimezoneprivate_win.cpp | 12 +++-- 7 files changed, 125 insertions(+), 95 deletions(-) diff --git a/src/corelib/tools/qtimezone.cpp b/src/corelib/tools/qtimezone.cpp index b6160a3fd8..c2ee99a2d8 100644 --- a/src/corelib/tools/qtimezone.cpp +++ b/src/corelib/tools/qtimezone.cpp @@ -378,12 +378,10 @@ QTimeZone::QTimeZone(int offsetSeconds) QTimeZone::QTimeZone(const QByteArray &ianaId, int offsetSeconds, const QString &name, const QString &abbreviation, QLocale::Country country, const QString &comment) + : d() { - // ianaId must be a valid ID and must not clash with the standard system names - if (QTimeZonePrivate::isValidId(ianaId) && !availableTimeZoneIds().contains(ianaId)) + if (!isTimeZoneIdAvailable(ianaId)) d = new QUtcTimeZonePrivate(ianaId, offsetSeconds, name, abbreviation, country, comment); - else - d = 0; } /*! @@ -821,7 +819,20 @@ bool QTimeZone::isTimeZoneIdAvailable(const QByteArray &ianaId) { // isValidId is not strictly required, but faster to weed out invalid // IDs as availableTimeZoneIds() may be slow - return (QTimeZonePrivate::isValidId(ianaId) && (availableTimeZoneIds().contains(ianaId))); + if (!QTimeZonePrivate::isValidId(ianaId)) + return false; + const QList tzIds = availableTimeZoneIds(); + return std::binary_search(tzIds.begin(), tzIds.end(), ianaId); +} + +static QList set_union(const QList &l1, const QList &l2) +{ + QList result; + result.reserve(l1.size() + l2.size()); + std::set_union(l1.begin(), l1.end(), + l2.begin(), l2.end(), + std::back_inserter(result)); + return result; } /*! @@ -832,11 +843,8 @@ bool QTimeZone::isTimeZoneIdAvailable(const QByteArray &ianaId) QList QTimeZone::availableTimeZoneIds() { - QSet set = QUtcTimeZonePrivate().availableTimeZoneIds() - + global_tz->backend->availableTimeZoneIds(); - QList list = set.toList(); - std::sort(list.begin(), list.end()); - return list; + return set_union(QUtcTimeZonePrivate().availableTimeZoneIds(), + global_tz->backend->availableTimeZoneIds()); } /*! @@ -852,11 +860,8 @@ QList QTimeZone::availableTimeZoneIds() QList QTimeZone::availableTimeZoneIds(QLocale::Country country) { - QSet set = QUtcTimeZonePrivate().availableTimeZoneIds(country) - + global_tz->backend->availableTimeZoneIds(country); - QList list = set.toList(); - std::sort(list.begin(), list.end()); - return list; + return set_union(QUtcTimeZonePrivate().availableTimeZoneIds(country), + global_tz->backend->availableTimeZoneIds(country)); } /*! @@ -868,11 +873,8 @@ QList QTimeZone::availableTimeZoneIds(QLocale::Country country) QList QTimeZone::availableTimeZoneIds(int offsetSeconds) { - QSet set = QUtcTimeZonePrivate().availableTimeZoneIds(offsetSeconds) - + global_tz->backend->availableTimeZoneIds(offsetSeconds); - QList list = set.toList(); - std::sort(list.begin(), list.end()); - return list; + return set_union(QUtcTimeZonePrivate().availableTimeZoneIds(offsetSeconds), + global_tz->backend->availableTimeZoneIds(offsetSeconds)); } /*! diff --git a/src/corelib/tools/qtimezoneprivate.cpp b/src/corelib/tools/qtimezoneprivate.cpp index 337f0e6bfb..164db5ed0c 100644 --- a/src/corelib/tools/qtimezoneprivate.cpp +++ b/src/corelib/tools/qtimezoneprivate.cpp @@ -39,6 +39,8 @@ #include #include +#include + QT_BEGIN_NAMESPACE enum { @@ -341,36 +343,38 @@ QByteArray QTimeZonePrivate::systemTimeZoneId() const return QByteArray(); } -QSet QTimeZonePrivate::availableTimeZoneIds() const +QList QTimeZonePrivate::availableTimeZoneIds() const { - return QSet(); + return QList(); } -QSet QTimeZonePrivate::availableTimeZoneIds(QLocale::Country country) const +QList QTimeZonePrivate::availableTimeZoneIds(QLocale::Country country) const { // Default fall-back mode, use the zoneTable to find Region of know Zones - QSet regionSet; + QList regions; // First get all Zones in the Zones table belonging to the Region for (int i = 0; i < zoneDataTableSize; ++i) { if (zoneData(i)->country == country) - regionSet += ianaId(zoneData(i)).split(' ').toSet(); + regions += ianaId(zoneData(i)).split(' '); } - // Then select just those that are available - QSet set; - foreach (const QByteArray &ianaId, availableTimeZoneIds()) { - if (regionSet.contains(ianaId)) - set << ianaId; - } + std::sort(regions.begin(), regions.end()); + regions.erase(std::unique(regions.begin(), regions.end()), regions.end()); - return set; + // Then select just those that are available + const QList all = availableTimeZoneIds(); + QList result; + result.reserve(qMin(all.size(), regions.size())); + std::set_intersection(all.begin(), all.end(), regions.cbegin(), regions.cend(), + std::back_inserter(result)); + return result; } -QSet QTimeZonePrivate::availableTimeZoneIds(int offsetFromUtc) const +QList QTimeZonePrivate::availableTimeZoneIds(int offsetFromUtc) const { // Default fall-back mode, use the zoneTable to find Offset of know Zones - QSet offsetSet; + QList offsets; // First get all Zones in the table using the Offset for (int i = 0; i < windowsDataTableSize; ++i) { const QWindowsData *winData = windowsData(i); @@ -378,19 +382,21 @@ QSet QTimeZonePrivate::availableTimeZoneIds(int offsetFromUtc) const for (int j = 0; j < zoneDataTableSize; ++j) { const QZoneData *data = zoneData(j); if (data->windowsIdKey == winData->windowsIdKey) - offsetSet += ianaId(data).split(' ').toSet(); + offsets += ianaId(data).split(' '); } } } - // Then select just those that are available - QSet set; - foreach (const QByteArray &ianaId, availableTimeZoneIds()) { - if (offsetSet.contains(ianaId)) - set << ianaId; - } + std::sort(offsets.begin(), offsets.end()); + offsets.erase(std::unique(offsets.begin(), offsets.end()), offsets.end()); - return set; + // Then select just those that are available + const QList all = availableTimeZoneIds(); + QList result; + result.reserve(qMin(all.size(), offsets.size())); + std::set_intersection(all.begin(), all.end(), offsets.cbegin(), offsets.cend(), + std::back_inserter(result)); + return result; } #ifndef QT_NO_DATASTREAM @@ -682,31 +688,35 @@ QByteArray QUtcTimeZonePrivate::systemTimeZoneId() const return utcQByteArray(); } -QSet QUtcTimeZonePrivate::availableTimeZoneIds() const +QList QUtcTimeZonePrivate::availableTimeZoneIds() const { - QSet set; + QList result; for (int i = 0; i < utcDataTableSize; ++i) - set << utcId(utcData(i)); - return set; + result << utcId(utcData(i)); + std::sort(result.begin(), result.end()); // ### or already sorted?? + // ### assuming no duplicates + return result; } -QSet QUtcTimeZonePrivate::availableTimeZoneIds(QLocale::Country country) const +QList QUtcTimeZonePrivate::availableTimeZoneIds(QLocale::Country country) const { // If AnyCountry then is request for all non-region offset codes if (country == QLocale::AnyCountry) return availableTimeZoneIds(); - return QSet(); + return QList(); } -QSet QUtcTimeZonePrivate::availableTimeZoneIds(qint32 offsetSeconds) const +QList QUtcTimeZonePrivate::availableTimeZoneIds(qint32 offsetSeconds) const { - QSet set; + QList result; for (int i = 0; i < utcDataTableSize; ++i) { const QUtcData *data = utcData(i); if (data->offsetFromUtc == offsetSeconds) - set << utcId(data); + result << utcId(data); } - return set; + std::sort(result.begin(), result.end()); // ### or already sorted?? + // ### assuming no duplicates + return result; } #ifndef QT_NO_DATASTREAM diff --git a/src/corelib/tools/qtimezoneprivate_icu.cpp b/src/corelib/tools/qtimezoneprivate_icu.cpp index 3ab42661c0..dd57464a72 100644 --- a/src/corelib/tools/qtimezoneprivate_icu.cpp +++ b/src/corelib/tools/qtimezoneprivate_icu.cpp @@ -37,6 +37,9 @@ #include #include +#include + +#include QT_BEGIN_NAMESPACE @@ -234,19 +237,21 @@ static QTimeZonePrivate::Data ucalTimeZoneTransition(UCalendar *m_ucal, #endif // U_ICU_VERSION_SHORT // Convert a uenum to a QList -static QSet uenumToIdSet(UEnumeration *uenum) +static QList uenumToIdList(UEnumeration *uenum) { - QSet set; + QList list; int32_t size = 0; UErrorCode status = U_ZERO_ERROR; // TODO Perhaps use uenum_unext instead? QByteArray result = uenum_next(uenum, &size, &status); while (U_SUCCESS(status) && !result.isEmpty()) { - set << result; + list << result; status = U_ZERO_ERROR; result = uenum_next(uenum, &size, &status); } - return set; + std::sort(list.begin(), list.end()); + list.erase(std::unique(list.begin(), list.end()), list.end()); + return list; } // Qt wrapper around ucal_getDSTSavings() @@ -453,41 +458,41 @@ QByteArray QIcuTimeZonePrivate::systemTimeZoneId() const return ucalDefaultTimeZoneId(); } -QSet QIcuTimeZonePrivate::availableTimeZoneIds() const +QList QIcuTimeZonePrivate::availableTimeZoneIds() const { UErrorCode status = U_ZERO_ERROR; UEnumeration *uenum = ucal_openTimeZones(&status); - QSet set; + QList result; if (U_SUCCESS(status)) - set = uenumToIdSet(uenum); + result = uenumToIdList(uenum); uenum_close(uenum); - return set; + return result; } -QSet QIcuTimeZonePrivate::availableTimeZoneIds(QLocale::Country country) const +QList QIcuTimeZonePrivate::availableTimeZoneIds(QLocale::Country country) const { QByteArray regionCode = QLocalePrivate::countryToCode(country).toUtf8(); UErrorCode status = U_ZERO_ERROR; UEnumeration *uenum = ucal_openCountryTimeZones(regionCode, &status); - QSet set; + QList result; if (U_SUCCESS(status)) - set = uenumToIdSet(uenum); + result = uenumToIdList(uenum); uenum_close(uenum); - return set; + return result; } -QSet QIcuTimeZonePrivate::availableTimeZoneIds(int offsetFromUtc) const +QList QIcuTimeZonePrivate::availableTimeZoneIds(int offsetFromUtc) const { // TODO Available directly in C++ api but not C api, from 4.8 onwards new filter method works #if U_ICU_VERSION_MAJOR_NUM >= 49 || (U_ICU_VERSION_MAJOR_NUM == 4 && U_ICU_VERSION_MINOR_NUM == 8) UErrorCode status = U_ZERO_ERROR; UEnumeration *uenum = ucal_openTimeZoneIDEnumeration(UCAL_ZONE_TYPE_ANY, 0, &offsetFromUtc, &status); - QSet set; + QList result; if (U_SUCCESS(status)) - set = uenumToIdSet(uenum); + result = uenumToIdList(uenum); uenum_close(uenum); - return set; + return result; #else return QTimeZonePrivate::availableTimeZoneIds(offsetFromUtc); #endif diff --git a/src/corelib/tools/qtimezoneprivate_mac.mm b/src/corelib/tools/qtimezoneprivate_mac.mm index b0c3c9e64f..f316fe0a6d 100644 --- a/src/corelib/tools/qtimezoneprivate_mac.mm +++ b/src/corelib/tools/qtimezoneprivate_mac.mm @@ -41,6 +41,8 @@ #include +#include + QT_BEGIN_NAMESPACE /* @@ -247,18 +249,21 @@ QByteArray QMacTimeZonePrivate::systemTimeZoneId() const return QCFString::toQString([[NSTimeZone systemTimeZone] name]).toUtf8(); } -QSet QMacTimeZonePrivate::availableTimeZoneIds() const +QList QMacTimeZonePrivate::availableTimeZoneIds() const { NSEnumerator *enumerator = [[NSTimeZone knownTimeZoneNames] objectEnumerator]; QByteArray tzid = QCFString::toQString([enumerator nextObject]).toUtf8(); - QSet set; + QList list; while (!tzid.isEmpty()) { - set << tzid; + list << tzid; tzid = QCFString::toQString([enumerator nextObject]).toUtf8(); } - return set; + std::sort(list.begin(), list.end()); + list.erase(std::unique(list.begin(), list.end()), list.end()); + + return list; } QT_END_NAMESPACE diff --git a/src/corelib/tools/qtimezoneprivate_p.h b/src/corelib/tools/qtimezoneprivate_p.h index 609ed50c56..64827950e2 100644 --- a/src/corelib/tools/qtimezoneprivate_p.h +++ b/src/corelib/tools/qtimezoneprivate_p.h @@ -126,9 +126,9 @@ public: virtual QByteArray systemTimeZoneId() const; - virtual QSet availableTimeZoneIds() const; - virtual QSet availableTimeZoneIds(QLocale::Country country) const; - virtual QSet availableTimeZoneIds(int utcOffset) const; + virtual QList availableTimeZoneIds() const; + virtual QList availableTimeZoneIds(QLocale::Country country) const; + virtual QList availableTimeZoneIds(int utcOffset) const; virtual void serialize(QDataStream &ds) const; @@ -199,9 +199,9 @@ public: QByteArray systemTimeZoneId() const Q_DECL_OVERRIDE; - QSet availableTimeZoneIds() const Q_DECL_OVERRIDE; - QSet availableTimeZoneIds(QLocale::Country country) const Q_DECL_OVERRIDE; - QSet availableTimeZoneIds(int utcOffset) const Q_DECL_OVERRIDE; + QList availableTimeZoneIds() const Q_DECL_OVERRIDE; + QList availableTimeZoneIds(QLocale::Country country) const Q_DECL_OVERRIDE; + QList availableTimeZoneIds(int utcOffset) const Q_DECL_OVERRIDE; void serialize(QDataStream &ds) const Q_DECL_OVERRIDE; @@ -250,9 +250,9 @@ public: QByteArray systemTimeZoneId() const Q_DECL_OVERRIDE; - QSet availableTimeZoneIds() const Q_DECL_OVERRIDE; - QSet availableTimeZoneIds(QLocale::Country country) const Q_DECL_OVERRIDE; - QSet availableTimeZoneIds(int offsetFromUtc) const Q_DECL_OVERRIDE; + QList availableTimeZoneIds() const Q_DECL_OVERRIDE; + QList availableTimeZoneIds(QLocale::Country country) const Q_DECL_OVERRIDE; + QList availableTimeZoneIds(int offsetFromUtc) const Q_DECL_OVERRIDE; private: void init(const QByteArray &ianaId); @@ -318,8 +318,8 @@ public: QByteArray systemTimeZoneId() const Q_DECL_OVERRIDE; - QSet availableTimeZoneIds() const Q_DECL_OVERRIDE; - QSet availableTimeZoneIds(QLocale::Country country) const Q_DECL_OVERRIDE; + QList availableTimeZoneIds() const Q_DECL_OVERRIDE; + QList availableTimeZoneIds(QLocale::Country country) const Q_DECL_OVERRIDE; private: void init(const QByteArray &ianaId); @@ -369,7 +369,7 @@ public: QByteArray systemTimeZoneId() const Q_DECL_OVERRIDE; - QSet availableTimeZoneIds() const Q_DECL_OVERRIDE; + QList availableTimeZoneIds() const Q_DECL_OVERRIDE; private: void init(const QByteArray &zoneId); @@ -420,7 +420,7 @@ public: QByteArray systemTimeZoneId() const Q_DECL_OVERRIDE; - QSet availableTimeZoneIds() const Q_DECL_OVERRIDE; + QList availableTimeZoneIds() const Q_DECL_OVERRIDE; private: void init(const QByteArray &ianaId); diff --git a/src/corelib/tools/qtimezoneprivate_tz.cpp b/src/corelib/tools/qtimezoneprivate_tz.cpp index 0d8ae3b47f..29f0e17012 100644 --- a/src/corelib/tools/qtimezoneprivate_tz.cpp +++ b/src/corelib/tools/qtimezoneprivate_tz.cpp @@ -41,6 +41,7 @@ #include +#include QT_BEGIN_NAMESPACE @@ -956,20 +957,23 @@ QByteArray QTzTimeZonePrivate::systemTimeZoneId() const return ianaId; } -QSet QTzTimeZonePrivate::availableTimeZoneIds() const +QList QTzTimeZonePrivate::availableTimeZoneIds() const { - return tzZones->keys().toSet(); + QList result = tzZones->keys(); + std::sort(result.begin(), result.end()); + return result; } -QSet QTzTimeZonePrivate::availableTimeZoneIds(QLocale::Country country) const +QList QTzTimeZonePrivate::availableTimeZoneIds(QLocale::Country country) const { // TODO AnyCountry - QSet set; + QList result; foreach (const QByteArray &key, tzZones->keys()) { if (tzZones->value(key).country == country) - set << key; + result << key; } - return set; + std::sort(result.begin(), result.end()); + return result; } QT_END_NAMESPACE diff --git a/src/corelib/tools/qtimezoneprivate_win.cpp b/src/corelib/tools/qtimezoneprivate_win.cpp index 2d0caf07a8..a9bb3aa3b5 100644 --- a/src/corelib/tools/qtimezoneprivate_win.cpp +++ b/src/corelib/tools/qtimezoneprivate_win.cpp @@ -38,6 +38,8 @@ #include "qdebug.h" +#include + QT_BEGIN_NAMESPACE /* @@ -632,14 +634,16 @@ QByteArray QWinTimeZonePrivate::systemTimeZoneId() const return ianaId; } -QSet QWinTimeZonePrivate::availableTimeZoneIds() const +QList QWinTimeZonePrivate::availableTimeZoneIds() const { - QSet set; + QList result; foreach (const QByteArray &winId, availableWindowsIds()) { foreach (const QByteArray &ianaId, windowsIdToIanaIds(winId)) - set << ianaId; + result << ianaId; } - return set; + std::sort(result.begin(), result.end()); + result.erase(std::unique(result.begin(), result.end()), result.end()); + return result; } QWinTimeZonePrivate::QWinTransitionRule QWinTimeZonePrivate::ruleForYear(int year) const -- cgit v1.2.3 From 12d6f700378702d70a3c3c34ab49e2bf2c9cb882 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 8 Jan 2015 13:29:04 +0100 Subject: Fix QTextDocument test when default font is pixel-sized MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the default font has the pixel size set instead of point size, then pointSize() will return -1 and the output from the HTML will include the pixel size instead. This happens e.g. on Android when we extract font information from the system. Change-Id: I26dc49fff215c9887cf0b78dcfff88df0f74450d Reviewed-by: Tor Arne Vestbø --- .../gui/text/qtextdocument/tst_qtextdocument.cpp | 53 +++++++++++++++++----- 1 file changed, 41 insertions(+), 12 deletions(-) diff --git a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp index 94cd64ed09..c51d33487e 100644 --- a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp +++ b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp @@ -191,6 +191,7 @@ private slots: private: void backgroundImage_checkExpectedHtml(const QTextDocument &doc); void buildRegExpData(); + static QString cssFontSizeString(const QFont &font); QTextDocument *doc; QTextCursor cursor; @@ -212,6 +213,13 @@ public: void documentChanged(int, int, int) {} }; +QString tst_QTextDocument::cssFontSizeString(const QFont &font) +{ + return font.pointSize() >= 0 + ? QStringLiteral("%1pt").arg(font.pointSizeF()) + : QStringLiteral("%1px").arg(font.pixelSize()); +} + // Testing get/set functions void tst_QTextDocument::getSetCheck() { @@ -254,8 +262,12 @@ void tst_QTextDocument::init() "" - "\n"); - htmlHead = htmlHead.arg(defaultFont.family()).arg(defaultFont.pointSizeF()).arg(defaultFont.weight() * 8).arg((defaultFont.italic() ? "italic" : "normal")); + "\n"); + htmlHead = htmlHead + .arg(defaultFont.family()) + .arg(cssFontSizeString(defaultFont)) + .arg(defaultFont.weight() * 8) + .arg((defaultFont.italic() ? "italic" : "normal")); htmlTail = QString(""); } @@ -1789,12 +1801,16 @@ void tst_QTextDocument::toHtmlBodyBgColor() "" - "\n" "

Blah

" ""); - expectedHtml = expectedHtml.arg(defaultFont.family()).arg(defaultFont.pointSizeF()).arg(defaultFont.weight() * 8).arg((defaultFont.italic() ? "italic" : "normal")); + expectedHtml = expectedHtml + .arg(defaultFont.family()) + .arg(cssFontSizeString(defaultFont)) + .arg(defaultFont.weight() * 8) + .arg((defaultFont.italic() ? "italic" : "normal")); QCOMPARE(doc.toHtml(), expectedHtml); } @@ -1814,12 +1830,15 @@ void tst_QTextDocument::toHtmlBodyBgColorRgba() "" - "\n" "

Blah

" ""); - expectedHtml = expectedHtml.arg(defaultFont.family()).arg(defaultFont.pointSizeF()).arg(defaultFont.weight() * 8).arg((defaultFont.italic() ? "italic" : "normal")); + expectedHtml = expectedHtml.arg(defaultFont.family()) + .arg(cssFontSizeString(defaultFont)) + .arg(defaultFont.weight() * 8) + .arg((defaultFont.italic() ? "italic" : "normal")); QCOMPARE(doc.toHtml(), expectedHtml); } @@ -1839,12 +1858,16 @@ void tst_QTextDocument::toHtmlBodyBgColorTransparent() "" - "\n" "

Blah

" ""); - expectedHtml = expectedHtml.arg(defaultFont.family()).arg(defaultFont.pointSizeF()).arg(defaultFont.weight() * 8).arg((defaultFont.italic() ? "italic" : "normal")); + expectedHtml = expectedHtml + .arg(defaultFont.family()) + .arg(cssFontSizeString(defaultFont)) + .arg(defaultFont.weight() * 8) + .arg((defaultFont.italic() ? "italic" : "normal")); QCOMPARE(doc.toHtml(), expectedHtml); } @@ -2463,8 +2486,10 @@ void tst_QTextDocument::html_defaultFont() doc->setDefaultFont(f); doc->setPlainText("Test"); - QString bodyPart = QString::fromLatin1("") - .arg(f.family()).arg(f.pointSizeF()).arg(f.weight() * 8); + QString bodyPart = QString::fromLatin1("") + .arg(f.family()) + .arg(cssFontSizeString(f)) + .arg(f.weight() * 8); QString html = doc->toHtml(); if (!html.contains(bodyPart)) { @@ -2600,13 +2625,17 @@ void tst_QTextDocument::backgroundImage_checkExpectedHtml(const QTextDocument &d "" - "\n" + "\n" "" "\n\n
" "\n

Blah

" "
"); - expectedHtml = expectedHtml.arg(defaultFont.family()).arg(defaultFont.pointSizeF()).arg(defaultFont.weight() * 8).arg((defaultFont.italic() ? "italic" : "normal")); + expectedHtml = expectedHtml + .arg(defaultFont.family()) + .arg(cssFontSizeString(defaultFont)) + .arg(defaultFont.weight() * 8) + .arg((defaultFont.italic() ? "italic" : "normal")); QCOMPARE(doc.toHtml(), expectedHtml); } -- cgit v1.2.3 From c3e680c3b1c21ad7b418e0a0faee7fbe1b66957c Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 12 Feb 2015 10:43:28 +0100 Subject: Android: Fix tst_QDir::cdBelowRoot() The /tmp directory doesn't exist on Android, and the test needs a directory that it can cd into which is one level above root. So we just use /system which should be available on all devices. Change-Id: I8e6a15f278429491fd871f87af497e5d7184ddf8 Reviewed-by: BogDan Vatra --- tests/auto/corelib/io/qdir/tst_qdir.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp index b93407f2e4..caa22db144 100644 --- a/tests/auto/corelib/io/qdir/tst_qdir.cpp +++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp @@ -2176,7 +2176,11 @@ void tst_QDir::cdNonreadable() void tst_QDir::cdBelowRoot() { -#if defined (Q_OS_UNIX) +#if defined (Q_OS_ANDROID) +#define ROOT QString("/") +#define DIR QString("/system") +#define CD_INTO "system" +#elif defined (Q_OS_UNIX) #define ROOT QString("/") #define DIR QString("/tmp") #define CD_INTO "tmp" -- cgit v1.2.3 From 62475eb8b09ab1d26ba02032e110bb44872392a6 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 20 Jan 2015 23:48:22 +0100 Subject: QDateTime: change an instance of out parameters to return-by-value Compilers don't like out parameters. Effects on Linux GCC 4.9 stripped release builds: text -528B data +-0B relocs +-0 Change-Id: I32ee1a6c4388900bacfc6eb20feb4b81d71cb1f2 Reviewed-by: Thiago Macieira --- src/corelib/tools/qdatetime.cpp | 100 +++++++++++++++++++--------------------- 1 file changed, 48 insertions(+), 52 deletions(-) diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index adfcbcecf0..a25e913d92 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -117,7 +117,12 @@ static inline qint64 julianDayFromDate(int year, int month, int day) return day + floordiv(153 * m + 2, 5) + 365 * y + floordiv(y, 4) - floordiv(y, 100) + floordiv(y, 400) - 32045; } -static void getDateFromJulianDay(qint64 julianDay, int *yearp, int *monthp, int *dayp) +struct ParsedDate +{ + int year, month, day; +}; + +static ParsedDate getDateFromJulianDay(qint64 julianDay) { /* * Math from The Calendar FAQ at http://www.tondering.dk/claus/cal/julperiod.php @@ -140,12 +145,8 @@ static void getDateFromJulianDay(qint64 julianDay, int *yearp, int *monthp, int if (year <= 0) --year ; - if (yearp) - *yearp = year; - if (monthp) - *monthp = month; - if (dayp) - *dayp = day; + const ParsedDate result = { year, month, day }; + return result; } /***************************************************************************** @@ -449,9 +450,7 @@ int QDate::year() const if (isNull()) return 0; - int y; - getDateFromJulianDay(jd, &y, 0, 0); - return y; + return getDateFromJulianDay(jd).year; } /*! @@ -483,9 +482,7 @@ int QDate::month() const if (isNull()) return 0; - int m; - getDateFromJulianDay(jd, 0, &m, 0); - return m; + return getDateFromJulianDay(jd).month; } /*! @@ -501,9 +498,7 @@ int QDate::day() const if (isNull()) return 0; - int d; - getDateFromJulianDay(jd, 0, 0, &d); - return d; + return getDateFromJulianDay(jd).day; } /*! @@ -555,12 +550,11 @@ int QDate::daysInMonth() const if (isNull()) return 0; - int y, m; - getDateFromJulianDay(jd, &y, &m, 0); - if (m == 2 && isLeapYear(y)) + const ParsedDate pd = getDateFromJulianDay(jd); + if (pd.month == 2 && isLeapYear(pd.year)) return 29; else - return monthDays[m]; + return monthDays[pd.month]; } /*! @@ -576,9 +570,7 @@ int QDate::daysInYear() const if (isNull()) return 0; - int y; - getDateFromJulianDay(jd, &y, 0, 0); - return isLeapYear(y) ? 366 : 365; + return isLeapYear(getDateFromJulianDay(jd).year) ? 366 : 365; } /*! @@ -895,7 +887,7 @@ QString QDate::toString(Qt::DateFormat format) const if (!isValid()) return QString(); - int y, m, d; + ParsedDate pd; switch (format) { case Qt::SystemLocaleDate: @@ -913,19 +905,19 @@ QString QDate::toString(Qt::DateFormat format) const default: #ifndef QT_NO_TEXTDATE case Qt::TextDate: - getDateFromJulianDay(jd, &y, &m, &d); + pd = getDateFromJulianDay(jd); return QString::fromLatin1("%1 %2 %3 %4").arg(shortDayName(dayOfWeek())) - .arg(shortMonthName(m)) - .arg(d) - .arg(y); + .arg(shortMonthName(pd.month)) + .arg(pd.day) + .arg(pd.year); #endif case Qt::ISODate: - getDateFromJulianDay(jd, &y, &m, &d); - if (y < 0 || y > 9999) + pd = getDateFromJulianDay(jd); + if (pd.year < 0 || pd.year > 9999) return QString(); - return QString::fromLatin1("%1-%2-%3").arg(y, 4, 10, QLatin1Char('0')) - .arg(m, 2, 10, QLatin1Char('0')) - .arg(d, 2, 10, QLatin1Char('0')); + return QString::fromLatin1("%1-%2-%3").arg(pd.year, 4, 10, QLatin1Char('0')) + .arg(pd.month, 2, 10, QLatin1Char('0')) + .arg(pd.day, 2, 10, QLatin1Char('0')); } } @@ -1031,16 +1023,16 @@ bool QDate::setDate(int year, int month, int day) */ void QDate::getDate(int *year, int *month, int *day) { - if (isValid()) { - getDateFromJulianDay(jd, year, month, day); - } else { - if (year) - *year = 0; - if (month) - *month = 0; - if (day) - *day = 0; - } + ParsedDate pd = { 0, 0, 0 }; + if (isValid()) + pd = getDateFromJulianDay(jd); + + if (year) + *year = pd.year; + if (month) + *month = pd.month; + if (day) + *day = pd.day; } /*! @@ -1082,7 +1074,12 @@ QDate QDate::addMonths(int nmonths) const return *this; int old_y, y, m, d; - getDateFromJulianDay(jd, &y, &m, &d); + { + const ParsedDate pd = getDateFromJulianDay(jd); + y = pd.year; + m = pd.month; + d = pd.day; + } old_y = y; bool increasing = nmonths > 0; @@ -1140,19 +1137,18 @@ QDate QDate::addYears(int nyears) const if (!isValid()) return QDate(); - int y, m, d; - getDateFromJulianDay(jd, &y, &m, &d); + ParsedDate pd = getDateFromJulianDay(jd); - int old_y = y; - y += nyears; + int old_y = pd.year; + pd.year += nyears; // was there a sign change? - if ((old_y > 0 && y <= 0) || - (old_y < 0 && y >= 0)) + if ((old_y > 0 && pd.year <= 0) || + (old_y < 0 && pd.year >= 0)) // yes, adjust the date by +1 or -1 years - y += nyears > 0 ? +1 : -1; + pd.year += nyears > 0 ? +1 : -1; - return fixedDate(y, m, d); + return fixedDate(pd.year, pd.month, pd.day); } /*! -- cgit v1.2.3 From d8d114989ab653cf77304cafc65392d295212c00 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 21 Jan 2015 00:51:34 +0100 Subject: QDateTime: optimize rfcDateImpl() Get the captured texts once and use indexing into the QStringList instead of repeatedly calling QRegExp::cap(n). (Impressive) effects on Linux GCC 4.9 stripped release builds: text -2876B data +-0B relocs +-0 Change-Id: I3a02eab1a691f31c30654cd89a0c030414b40de0 Reviewed-by: Thiago Macieira --- src/corelib/tools/qdatetime.cpp | 42 +++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index a25e913d92..a31e91db97 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -202,20 +202,21 @@ static void rfcDateImpl(const QString &s, QDate *dd = 0, QTime *dt = 0, int *utc // Matches "Wdy, DD Mon YYYY HH:mm:ss ±hhmm" (Wdy, being optional) QRegExp rex(QStringLiteral("^(?:[A-Z][a-z]+,)?[ \\t]*(\\d{1,2})[ \\t]+([A-Z][a-z]+)[ \\t]+(\\d\\d\\d\\d)(?:[ \\t]+(\\d\\d):(\\d\\d)(?::(\\d\\d))?)?[ \\t]*(?:([+-])(\\d\\d)(\\d\\d))?")); if (s.indexOf(rex) == 0) { + const QStringList cap = rex.capturedTexts(); if (dd) { - day = rex.cap(1).toInt(); - month = qt_monthNumberFromShortName(rex.cap(2)); - year = rex.cap(3).toInt(); + day = cap[1].toInt(); + month = qt_monthNumberFromShortName(cap[2]); + year = cap[3].toInt(); } if (dt) { - if (!rex.cap(4).isEmpty()) { - hour = rex.cap(4).toInt(); - min = rex.cap(5).toInt(); - sec = rex.cap(6).toInt(); + if (!cap[4].isEmpty()) { + hour = cap[4].toInt(); + min = cap[5].toInt(); + sec = cap[6].toInt(); } - positiveOffset = (rex.cap(7) == QLatin1String("+")); - hourOffset = rex.cap(8).toInt(); - minOffset = rex.cap(9).toInt(); + positiveOffset = (cap[7] == QLatin1String("+")); + hourOffset = cap[8].toInt(); + minOffset = cap[9].toInt(); } if (utcOffset) *utcOffset = ((hourOffset * 60 + minOffset) * (positiveOffset ? 60 : -60)); @@ -223,20 +224,21 @@ static void rfcDateImpl(const QString &s, QDate *dd = 0, QTime *dt = 0, int *utc // Matches "Wdy Mon DD HH:mm:ss YYYY" QRegExp rex(QStringLiteral("^[A-Z][a-z]+[ \\t]+([A-Z][a-z]+)[ \\t]+(\\d\\d)(?:[ \\t]+(\\d\\d):(\\d\\d):(\\d\\d))?[ \\t]+(\\d\\d\\d\\d)[ \\t]*(?:([+-])(\\d\\d)(\\d\\d))?")); if (s.indexOf(rex) == 0) { + const QStringList cap = rex.capturedTexts(); if (dd) { - month = qt_monthNumberFromShortName(rex.cap(1)); - day = rex.cap(2).toInt(); - year = rex.cap(6).toInt(); + month = qt_monthNumberFromShortName(cap[1]); + day = cap[2].toInt(); + year = cap[6].toInt(); } if (dt) { - if (!rex.cap(3).isEmpty()) { - hour = rex.cap(3).toInt(); - min = rex.cap(4).toInt(); - sec = rex.cap(5).toInt(); + if (!cap[3].isEmpty()) { + hour = cap[3].toInt(); + min = cap[4].toInt(); + sec = cap[5].toInt(); } - positiveOffset = (rex.cap(7) == QLatin1String("+")); - hourOffset = rex.cap(8).toInt(); - minOffset = rex.cap(9).toInt(); + positiveOffset = (cap[7] == QLatin1String("+")); + hourOffset = cap[8].toInt(); + minOffset = cap[9].toInt(); } if (utcOffset) *utcOffset = ((hourOffset * 60 + minOffset) * (positiveOffset ? 60 : -60)); -- cgit v1.2.3 From 70bfc75d18cfabf07e7a2cac016f729fb46bd2d7 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 21 Jan 2015 10:17:00 +0100 Subject: QDateTime: replace out parameters with return-by-value in rfcDateImpl() Compilers *really* don't like out parameters. (Impressive) effects on Linux GCC 4.9 stripped release builds: text -2512B data +-0B relocs +-0 Change-Id: I0fe370a438f7b82aaa9cc04ddd56e45a5969e7a9 Reviewed-by: Thiago Macieira --- src/corelib/tools/qdatetime.cpp | 98 ++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 66 deletions(-) diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index a31e91db97..e366717d96 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -187,68 +187,43 @@ static int fromShortMonthName(const QStringRef &monthName) #endif // QT_NO_TEXTDATE #ifndef QT_NO_DATESTRING -static void rfcDateImpl(const QString &s, QDate *dd = 0, QTime *dt = 0, int *utcOffset = 0) -{ - int day = -1; - int month = -1; - int year = -1; - int hour = -1; - int min = -1; - int sec = -1; - int hourOffset = 0; - int minOffset = 0; - bool positiveOffset = false; +struct ParsedRfcDateTime { + QDate date; + QTime time; + int utcOffset; +}; + +static ParsedRfcDateTime rfcDateImpl(const QString &s) +{ + ParsedRfcDateTime result; // Matches "Wdy, DD Mon YYYY HH:mm:ss ±hhmm" (Wdy, being optional) QRegExp rex(QStringLiteral("^(?:[A-Z][a-z]+,)?[ \\t]*(\\d{1,2})[ \\t]+([A-Z][a-z]+)[ \\t]+(\\d\\d\\d\\d)(?:[ \\t]+(\\d\\d):(\\d\\d)(?::(\\d\\d))?)?[ \\t]*(?:([+-])(\\d\\d)(\\d\\d))?")); if (s.indexOf(rex) == 0) { const QStringList cap = rex.capturedTexts(); - if (dd) { - day = cap[1].toInt(); - month = qt_monthNumberFromShortName(cap[2]); - year = cap[3].toInt(); - } - if (dt) { - if (!cap[4].isEmpty()) { - hour = cap[4].toInt(); - min = cap[5].toInt(); - sec = cap[6].toInt(); - } - positiveOffset = (cap[7] == QLatin1String("+")); - hourOffset = cap[8].toInt(); - minOffset = cap[9].toInt(); - } - if (utcOffset) - *utcOffset = ((hourOffset * 60 + minOffset) * (positiveOffset ? 60 : -60)); + result.date = QDate(cap[3].toInt(), qt_monthNumberFromShortName(cap[2]), cap[1].toInt()); + if (!cap[4].isEmpty()) + result.time = QTime(cap[4].toInt(), cap[5].toInt(), cap[6].toInt()); + const bool positiveOffset = (cap[7] == QLatin1String("+")); + const int hourOffset = cap[8].toInt(); + const int minOffset = cap[9].toInt(); + result.utcOffset = ((hourOffset * 60 + minOffset) * (positiveOffset ? 60 : -60)); } else { // Matches "Wdy Mon DD HH:mm:ss YYYY" QRegExp rex(QStringLiteral("^[A-Z][a-z]+[ \\t]+([A-Z][a-z]+)[ \\t]+(\\d\\d)(?:[ \\t]+(\\d\\d):(\\d\\d):(\\d\\d))?[ \\t]+(\\d\\d\\d\\d)[ \\t]*(?:([+-])(\\d\\d)(\\d\\d))?")); if (s.indexOf(rex) == 0) { const QStringList cap = rex.capturedTexts(); - if (dd) { - month = qt_monthNumberFromShortName(cap[1]); - day = cap[2].toInt(); - year = cap[6].toInt(); - } - if (dt) { - if (!cap[3].isEmpty()) { - hour = cap[3].toInt(); - min = cap[4].toInt(); - sec = cap[5].toInt(); - } - positiveOffset = (cap[7] == QLatin1String("+")); - hourOffset = cap[8].toInt(); - minOffset = cap[9].toInt(); - } - if (utcOffset) - *utcOffset = ((hourOffset * 60 + minOffset) * (positiveOffset ? 60 : -60)); + result.date = QDate(cap[6].toInt(), qt_monthNumberFromShortName(cap[1]), cap[2].toInt()); + if (!cap[3].isEmpty()) + result.time = QTime(cap[3].toInt(), cap[4].toInt(), cap[5].toInt()); + const bool positiveOffset = (cap[7] == QLatin1String("+")); + const int hourOffset = cap[8].toInt(); + const int minOffset = cap[9].toInt(); + result.utcOffset = ((hourOffset * 60 + minOffset) * (positiveOffset ? 60 : -60)); } } - if (dd) - *dd = QDate(year, month, day); - if (dt) - *dt = QTime(hour, min, sec); + return result; } #endif // QT_NO_DATESTRING @@ -1253,11 +1228,8 @@ QDate QDate::fromString(const QString& string, Qt::DateFormat format) return QLocale().toDate(string, QLocale::ShortFormat); case Qt::DefaultLocaleLongDate: return QLocale().toDate(string, QLocale::LongFormat); - case Qt::RFC2822Date: { - QDate date; - rfcDateImpl(string, &date); - return date; - } + case Qt::RFC2822Date: + return rfcDateImpl(string).date; default: #ifndef QT_NO_TEXTDATE case Qt::TextDate: { @@ -2001,11 +1973,8 @@ QTime QTime::fromString(const QString& string, Qt::DateFormat format) return QLocale().toTime(string, QLocale::ShortFormat); case Qt::DefaultLocaleLongDate: return QLocale().toTime(string, QLocale::LongFormat); - case Qt::RFC2822Date: { - QTime time; - rfcDateImpl(string, 0, &time); - return time; - } + case Qt::RFC2822Date: + return rfcDateImpl(string).time; case Qt::ISODate: case Qt::TextDate: default: @@ -4415,16 +4384,13 @@ QDateTime QDateTime::fromString(const QString& string, Qt::DateFormat format) case Qt::DefaultLocaleLongDate: return QLocale().toDateTime(string, QLocale::LongFormat); case Qt::RFC2822Date: { - QDate date; - QTime time; - int utcOffset = 0; - rfcDateImpl(string, &date, &time, &utcOffset); + const ParsedRfcDateTime rfc = rfcDateImpl(string); - if (!date.isValid() || !time.isValid()) + if (!rfc.date.isValid() || !rfc.time.isValid()) return QDateTime(); - QDateTime dateTime(date, time, Qt::UTC); - dateTime.setOffsetFromUtc(utcOffset); + QDateTime dateTime(rfc.date, rfc.time, Qt::UTC); + dateTime.setOffsetFromUtc(rfc.utcOffset); return dateTime; } case Qt::ISODate: { -- cgit v1.2.3 From df0d933db519620f02034ed0f1477b77dabdb8f4 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 21 Jan 2015 23:18:40 +0100 Subject: QDateTimePrivate: remove pointless copy ctor The compiler-generated one is just as fine, more maintainable, and doesn't inhibit moves (which probably doesn't matter here). No change in executable code size. Change-Id: Ideee493a5911808430d3e09e6eb07e91d7a19b12 Reviewed-by: Thiago Macieira --- src/corelib/tools/qdatetime_p.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/corelib/tools/qdatetime_p.h b/src/corelib/tools/qdatetime_p.h index d703442963..99d69a575d 100644 --- a/src/corelib/tools/qdatetime_p.h +++ b/src/corelib/tools/qdatetime_p.h @@ -101,16 +101,6 @@ public: QDateTimePrivate(const QDate &toDate, const QTime &toTime, const QTimeZone & timeZone); #endif // QT_BOOTSTRAPPED - QDateTimePrivate(const QDateTimePrivate &other) : QSharedData(other), - m_msecs(other.m_msecs), - m_spec(other.m_spec), - m_offsetFromUtc(other.m_offsetFromUtc), -#ifndef QT_BOOTSTRAPPED - m_timeZone(other.m_timeZone), -#endif // QT_BOOTSTRAPPED - m_status(other.m_status) - {} - // ### XXX: when the tooling situation improves, look at fixing the padding. // 4 bytes padding -- cgit v1.2.3 From 94078f864577d9bd08cb17eb4b695e5d03ac1b3e Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 21 Jan 2015 23:29:52 +0100 Subject: QDateTimePrivate: remove pointless comparisons For any 1-bit flag: bool(var & flag) <=> (var & flag) == flag but gcc didn't seem to get it: (Surprising) effects on Linux GCC 4.9 stripped release builds: text -4936B (!!) data +-0B relocs +-0 It seems this enables some dead code detection, but I must confess I don't quite understand how such a small change can have such a dramatic effect on the executable size, even after diffing the assembler output. Change-Id: Ia307fde0de16160ea51bbb3ed6c1ff203d4f9091 Reviewed-by: Thiago Macieira --- src/corelib/tools/qdatetime_p.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/corelib/tools/qdatetime_p.h b/src/corelib/tools/qdatetime_p.h index 99d69a575d..78e9d6cabd 100644 --- a/src/corelib/tools/qdatetime_p.h +++ b/src/corelib/tools/qdatetime_p.h @@ -126,14 +126,14 @@ public: void refreshDateTime(); // Get/set date and time status - inline bool isNullDate() const { return (m_status & NullDate) == NullDate; } - inline bool isNullTime() const { return (m_status & NullTime) == NullTime; } - inline bool isValidDate() const { return (m_status & ValidDate) == ValidDate; } - inline bool isValidTime() const { return (m_status & ValidTime) == ValidTime; } - inline bool isValidDateTime() const { return (m_status & ValidDateTime) == ValidDateTime; } + inline bool isNullDate() const { return m_status & NullDate; } + inline bool isNullTime() const { return m_status & NullTime; } + inline bool isValidDate() const { return m_status & ValidDate; } + inline bool isValidTime() const { return m_status & ValidTime; } + inline bool isValidDateTime() const { return m_status & ValidDateTime; } inline void setValidDateTime() { m_status = m_status | ValidDateTime; } inline void clearValidDateTime() { m_status = m_status & ~ValidDateTime; } - inline bool isTimeZoneCached() const { return (m_status & TimeZoneCached) == TimeZoneCached; } + inline bool isTimeZoneCached() const { return m_status & TimeZoneCached; } inline void setTimeZoneCached() { m_status = m_status | TimeZoneCached; } inline void clearTimeZoneCached() { m_status = m_status & ~TimeZoneCached; } inline void clearSetToDaylightStatus() { m_status = m_status & ~SetToStandardTime & ~SetToDaylightTime; } -- cgit v1.2.3 From 5b7729ae79cea9c75d297ecfa043ab329f84bc3b Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 21 Jan 2015 23:50:05 +0100 Subject: QDateTimePrivate: make bit manipulation code more readable ...by using var op= ... instead of var = var op ... No change in executable code size. Change-Id: I1c29ff6700f0f21be07768af8d002f0823c89fbd Reviewed-by: Oswald Buddenhagen --- src/corelib/tools/qdatetime_p.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/corelib/tools/qdatetime_p.h b/src/corelib/tools/qdatetime_p.h index 78e9d6cabd..a139390a9d 100644 --- a/src/corelib/tools/qdatetime_p.h +++ b/src/corelib/tools/qdatetime_p.h @@ -131,12 +131,12 @@ public: inline bool isValidDate() const { return m_status & ValidDate; } inline bool isValidTime() const { return m_status & ValidTime; } inline bool isValidDateTime() const { return m_status & ValidDateTime; } - inline void setValidDateTime() { m_status = m_status | ValidDateTime; } - inline void clearValidDateTime() { m_status = m_status & ~ValidDateTime; } + inline void setValidDateTime() { m_status |= ValidDateTime; } + inline void clearValidDateTime() { m_status &= ~ValidDateTime; } inline bool isTimeZoneCached() const { return m_status & TimeZoneCached; } - inline void setTimeZoneCached() { m_status = m_status | TimeZoneCached; } - inline void clearTimeZoneCached() { m_status = m_status & ~TimeZoneCached; } - inline void clearSetToDaylightStatus() { m_status = m_status & ~SetToStandardTime & ~SetToDaylightTime; } + inline void setTimeZoneCached() { m_status |= TimeZoneCached; } + inline void clearTimeZoneCached() { m_status &= ~TimeZoneCached; } + inline void clearSetToDaylightStatus() { m_status &= ~(SetToStandardTime | SetToDaylightTime); } #ifndef QT_BOOTSTRAPPED static qint64 zoneMSecsToEpochMSecs(qint64 msecs, const QTimeZone &zone, -- cgit v1.2.3 From 8f553484fa1d0ef7db026723ef8b1cbe79f85faa Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 22 Jan 2015 12:23:14 +0100 Subject: QDateTime: optimize toOffsetString() Instead of using a QString::arg() cascade, which creates tons of temporaries, use good 'ol sprintf(). As a consequence, this function is now inlined into all four callers and the total executable size _still_ goes down: Effects on Linux GCC 4.9 stripped release builds: text -420B data +-0B relocs +-0 Change-Id: I10d6abd94b489db7c2f01dc5424f30a798602522 Reviewed-by: Thiago Macieira --- src/corelib/tools/qdatetime.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index e366717d96..b31eb8c23c 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -228,18 +228,14 @@ static ParsedRfcDateTime rfcDateImpl(const QString &s) #endif // QT_NO_DATESTRING // Return offset in [+-]HH:mm format -// Qt::ISODate puts : between the hours and minutes, but Qt:TextDate does not static QString toOffsetString(Qt::DateFormat format, int offset) { - QString result; - if (format == Qt::TextDate) - result = QStringLiteral("%1%2%3"); - else // Qt::ISODate - result = QStringLiteral("%1%2:%3"); - - return result.arg(offset >= 0 ? QLatin1Char('+') : QLatin1Char('-')) - .arg(qAbs(offset) / SECS_PER_HOUR, 2, 10, QLatin1Char('0')) - .arg((qAbs(offset) / 60) % 60, 2, 10, QLatin1Char('0')); + return QString::asprintf("%c%02d%s%02d", + offset >= 0 ? '+' : '-', + qAbs(offset) / SECS_PER_HOUR, + // Qt::ISODate puts : between the hours and minutes, but Qt:TextDate does not: + format == Qt::TextDate ? "" : ":", + (qAbs(offset) / 60) % 60); } // Parse offset in [+-]HH[[:]mm] format -- cgit v1.2.3 From 647ad3fe2510d49299ee496a4d8db2058d832db1 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 22 Jan 2015 12:34:44 +0100 Subject: QDate: optimize QDate::toString() Instead of using a QString::arg() cascade, which creates tons of temporaries, use good 'ol sprintf(). Effects on Linux GCC 4.9 stripped release builds: text -216B data +-0B relocs +-0 Change-Id: I6ff551cb9f42e0c05a64f03a8e177fb527915481 Reviewed-by: Thiago Macieira --- src/corelib/tools/qdatetime.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index b31eb8c23c..191fcf8cfd 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -888,9 +888,7 @@ QString QDate::toString(Qt::DateFormat format) const pd = getDateFromJulianDay(jd); if (pd.year < 0 || pd.year > 9999) return QString(); - return QString::fromLatin1("%1-%2-%3").arg(pd.year, 4, 10, QLatin1Char('0')) - .arg(pd.month, 2, 10, QLatin1Char('0')) - .arg(pd.day, 2, 10, QLatin1Char('0')); + return QString::asprintf("%04d-%02d-%02d", pd.year, pd.month, pd.day); } } -- cgit v1.2.3 From 4c4940a744558fc8faa713439d7e27e26b52774d Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 1 Oct 2014 12:03:59 +0200 Subject: tst_QList: test all memory layouts The Movable type, surprisingly, was as large as sizeof(void*), so on 32-bit platforms, we were not testing the QList memory layout where items are placed directly into the void*-slots, but are too small, leaving gaps. Fixed by making sure that Movable is smaller than void* and adding a variant of Movable, Optimal, that is guaranteed to be the same size as void*, and replacing the int tests with tests of Optimal. Had to demote the State variable to uchar, since MSVC will apparently not make a collection of bit-fields smaller than the largest type used in any of the consituent bitfields, so State s : 8 wouldn't work. Change-Id: I4f0e24bd6928f076b4ce60e8d977d5d98a724161 Reviewed-by: Thiago Macieira --- tests/auto/corelib/tools/qlist/tst_qlist.cpp | 319 +++++++++++++++++++-------- 1 file changed, 226 insertions(+), 93 deletions(-) diff --git a/tests/auto/corelib/tools/qlist/tst_qlist.cpp b/tests/auto/corelib/tools/qlist/tst_qlist.cpp index 1e7b3ee2d6..95744051e4 100644 --- a/tests/auto/corelib/tools/qlist/tst_qlist.cpp +++ b/tests/auto/corelib/tools/qlist/tst_qlist.cpp @@ -79,14 +79,16 @@ private: static int liveCount; enum State { Constructed = 106, Destructed = 110 }; - State state; + uchar state; - static void check(const State state1, const State state2) + static void check(const uchar state1, const uchar state2) { QCOMPARE(state1, state2); } }; +Q_STATIC_ASSERT(sizeof(Movable) < sizeof(void*)); + int Movable::liveCount = 0; QT_BEGIN_NAMESPACE @@ -100,6 +102,75 @@ int qHash(const Movable& movable) return qHash(movable.i); } +struct Optimal +{ + Optimal(char input = 'j') + : i(input), + state(Constructed) + { + ++liveCount; + } + Optimal(const Optimal &other) + : i(other.i), + state(Constructed) + { + check(other.state, Constructed); + ++liveCount; + } + + ~Optimal() + { + check(state, Constructed); + i = 0; + --liveCount; + state = Destructed; + } + + bool operator ==(const Optimal &other) const + { + check(state, Constructed); + check(other.state, Constructed); + return i == other.i; + } + + Optimal &operator=(const Optimal &other) + { + check(state, Constructed); + check(other.state, Constructed); + i = other.i; + return *this; + } + char i; + + static int getLiveCount() { return liveCount; } +private: + static int liveCount; + + enum State { Constructed = 106, Destructed = 110 }; + uchar state; + char padding[sizeof(void*) - 2]; + + static void check(const uchar state1, const uchar state2) + { + QCOMPARE(state1, state2); + } +}; + +Q_STATIC_ASSERT(sizeof(Optimal) == sizeof(void*)); + +int Optimal::liveCount = 0; + +QT_BEGIN_NAMESPACE +Q_DECLARE_TYPEINFO(Optimal, Q_MOVABLE_TYPE); +QT_END_NAMESPACE + +Q_DECLARE_METATYPE(Optimal); + +int qHash(const Optimal& key) +{ + return qHash(key.i); +} + struct Complex { Complex(int val = 0) @@ -160,6 +231,8 @@ Q_STATIC_ASSERT(!QTypeInfo::isStatic); Q_STATIC_ASSERT(!QTypeInfo::isComplex); Q_STATIC_ASSERT(!QTypeInfo::isStatic); Q_STATIC_ASSERT(QTypeInfo::isComplex); +Q_STATIC_ASSERT(!QTypeInfo::isStatic); +Q_STATIC_ASSERT(QTypeInfo::isComplex); Q_STATIC_ASSERT(QTypeInfo::isStatic); Q_STATIC_ASSERT(QTypeInfo::isComplex); @@ -168,100 +241,100 @@ class tst_QList : public QObject Q_OBJECT private slots: - void lengthInt() const; + void lengthOptimal() const; void lengthMovable() const; void lengthComplex() const; void lengthSignature() const; - void appendInt() const; + void appendOptimal() const; void appendMovable() const; void appendComplex() const; void prepend() const; - void midInt() const; + void midOptimal() const; void midMovable() const; void midComplex() const; - void atInt() const; + void atOptimal() const; void atMovable() const; void atComplex() const; - void firstInt() const; + void firstOptimal() const; void firstMovable() const; void firstComplex() const; - void lastInt() const; + void lastOptimal() const; void lastMovable() const; void lastComplex() const; - void beginInt() const; + void beginOptimal() const; void beginMovable() const; void beginComplex() const; - void endInt() const; + void endOptimal() const; void endMovable() const; void endComplex() const; - void containsInt() const; + void containsOptimal() const; void containsMovable() const; void containsComplex() const; - void countInt() const; + void countOptimal() const; void countMovable() const; void countComplex() const; - void emptyInt() const; + void emptyOptimal() const; void emptyMovable() const; void emptyComplex() const; - void endsWithInt() const; + void endsWithOptimal() const; void endsWithMovable() const; void endsWithComplex() const; - void lastIndexOfInt() const; + void lastIndexOfOptimal() const; void lastIndexOfMovable() const; void lastIndexOfComplex() const; - void moveInt() const; + void moveOptimal() const; void moveMovable() const; void moveComplex() const; - void removeAllInt() const; + void removeAllOptimal() const; void removeAllMovable() const; void removeAllComplex() const; - void removeAtInt() const; + void removeAtOptimal() const; void removeAtMovable() const; void removeAtComplex() const; - void removeOneInt() const; + void removeOneOptimal() const; void removeOneMovable() const; void removeOneComplex() const; - void replaceInt() const; + void replaceOptimal() const; void replaceMovable() const; void replaceComplex() const; - void startsWithInt() const; + void startsWithOptimal() const; void startsWithMovable() const; void startsWithComplex() const; - void swapInt() const; + void swapOptimal() const; void swapMovable() const; void swapComplex() const; - void takeAtInt() const; + void takeAtOptimal() const; void takeAtMovable() const; void takeAtComplex() const; - void takeFirstInt() const; + void takeFirstOptimal() const; void takeFirstMovable() const; void takeFirstComplex() const; - void takeLastInt() const; + void takeLastOptimal() const; void takeLastMovable() const; void takeLastComplex() const; - void toSetInt() const; + void toSetOptimal() const; void toSetMovable() const; void toSetComplex() const; - void toStdListInt() const; + void toStdListOptimal() const; void toStdListMovable() const; void toStdListComplex() const; - void toVectorInt() const; + void toVectorOptimal() const; void toVectorMovable() const; void toVectorComplex() const; - void valueInt() const; + void valueOptimal() const; void valueMovable() const; void valueComplex() const; - void testOperatorsInt() const; + void testOperatorsOptimal() const; void testOperatorsMovable() const; void testOperatorsComplex() const; - void testSTLIteratorsInt() const; + void testSTLIteratorsOptimal() const; void testSTLIteratorsMovable() const; void testSTLIteratorsComplex() const; void initializeList() const; - void constSharedNullInt() const; + void constSharedNullOptimal() const; void constSharedNullMovable() const; void constSharedNullComplex() const; void setSharableInt_data() const; @@ -320,7 +393,7 @@ template struct SimpleValue }; template<> -const int SimpleValue::values[] = { 10, 20, 30, 40, 100, 101, 102 }; +const Optimal SimpleValue::values[] = { 10, 20, 30, 40, 100, 101, 102 }; template<> const Movable SimpleValue::values[] = { 10, 20, 30, 40, 100, 101, 102 }; template<> @@ -369,9 +442,11 @@ void tst_QList::length() const } } -void tst_QList::lengthInt() const +void tst_QList::lengthOptimal() const { - length(); + const int liveCount = Optimal::getLiveCount(); + length(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::lengthMovable() const @@ -421,9 +496,11 @@ void tst_QList::append() const QCOMPARE(list1, listTotal); } -void tst_QList::appendInt() const +void tst_QList::appendOptimal() const { - append(); + const int liveCount = Optimal::getLiveCount(); + append(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::appendMovable() const @@ -486,9 +563,11 @@ void tst_QList::mid() const QCOMPARE(list1.mid(1, 1).length(), 0); } -void tst_QList::midInt() const +void tst_QList::midOptimal() const { - mid(); + const int liveCount = Optimal::getLiveCount(); + mid(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::midMovable() const @@ -534,9 +613,11 @@ void tst_QList::at() const QCOMPARE(list.at(2), T_CAT); } -void tst_QList::atInt() const +void tst_QList::atOptimal() const { - at(); + const int liveCount = Optimal::getLiveCount(); + at(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::atMovable() const @@ -567,9 +648,11 @@ void tst_QList::first() const QCOMPARE(list.first(), T_BAR); } -void tst_QList::firstInt() const +void tst_QList::firstOptimal() const { - first(); + const int liveCount = Optimal::getLiveCount(); + first(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::firstMovable() const @@ -600,9 +683,11 @@ void tst_QList::last() const QCOMPARE(list.last(), T_FOO); } -void tst_QList::lastInt() const +void tst_QList::lastOptimal() const { - last(); + const int liveCount = Optimal::getLiveCount(); + last(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::lastMovable() const @@ -633,9 +718,11 @@ void tst_QList::begin() const QCOMPARE(*list.begin(), T_BAR); } -void tst_QList::beginInt() const +void tst_QList::beginOptimal() const { - begin(); + const int liveCount = Optimal::getLiveCount(); + begin(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::beginMovable() const @@ -666,9 +753,11 @@ void tst_QList::end() const QCOMPARE(*--list.end(), T_FOO); } -void tst_QList::endInt() const +void tst_QList::endOptimal() const { - end(); + const int liveCount = Optimal::getLiveCount(); + end(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::endMovable() const @@ -699,9 +788,11 @@ void tst_QList::contains() const QVERIFY(list.contains(T_BLAH) == true); } -void tst_QList::containsInt() const +void tst_QList::containsOptimal() const { - contains(); + const int liveCount = Optimal::getLiveCount(); + contains(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::containsMovable() const @@ -743,9 +834,11 @@ void tst_QList::count() const QVERIFY(list.count() == 0); } -void tst_QList::countInt() const +void tst_QList::countOptimal() const { - count(); + const int liveCount = Optimal::getLiveCount(); + count(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::countMovable() const @@ -779,9 +872,11 @@ void tst_QList::empty() const QVERIFY(list.empty()); } -void tst_QList::emptyInt() const +void tst_QList::emptyOptimal() const { - empty(); + const int liveCount = Optimal::getLiveCount(); + empty(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::emptyMovable() const @@ -813,9 +908,11 @@ void tst_QList::endsWith() const QVERIFY(list.endsWith(T_BAR)); } -void tst_QList::endsWithInt() const +void tst_QList::endsWithOptimal() const { - endsWith(); + const int liveCount = Optimal::getLiveCount(); + endsWith(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::endsWithMovable() const @@ -856,9 +953,11 @@ void tst_QList::lastIndexOf() const QVERIFY(list.lastIndexOf(T_BAZ, 1) == -1); } -void tst_QList::lastIndexOfInt() const +void tst_QList::lastIndexOfOptimal() const { - lastIndexOf(); + const int liveCount = Optimal::getLiveCount(); + lastIndexOf(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::lastIndexOfMovable() const @@ -894,9 +993,11 @@ void tst_QList::move() const QCOMPARE(list, QList() << T_BAR << T_FOO << T_BAZ); } -void tst_QList::moveInt() const +void tst_QList::moveOptimal() const { - move(); + const int liveCount = Optimal::getLiveCount(); + move(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::moveMovable() const @@ -933,9 +1034,11 @@ void tst_QList::removeAll() const QCOMPARE(list, QList() << T_FOO << T_BAZ << T_FOO << T_BAZ << T_FOO << T_BAZ << T_FOO << T_BAZ); } -void tst_QList::removeAllInt() const +void tst_QList::removeAllOptimal() const { - removeAll(); + const int liveCount = Optimal::getLiveCount(); + removeAll(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::removeAllMovable() const @@ -971,9 +1074,11 @@ void tst_QList::removeAt() const QCOMPARE(list, QList()); } -void tst_QList::removeAtInt() const +void tst_QList::removeAtOptimal() const { - removeAt(); + const int liveCount = Optimal::getLiveCount(); + removeAt(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::removeAtMovable() const @@ -1018,9 +1123,11 @@ void tst_QList::removeOne() const QCOMPARE(list, QList() << T_FOO); } -void tst_QList::removeOneInt() const +void tst_QList::removeOneOptimal() const { - removeOne(); + const int liveCount = Optimal::getLiveCount(); + removeOne(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::removeOneMovable() const @@ -1059,9 +1166,11 @@ void tst_QList::replace() const << T_DOG << T_BLAH); } -void tst_QList::replaceInt() const +void tst_QList::replaceOptimal() const { - replace(); + const int liveCount = Optimal::getLiveCount(); + replace(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::replaceMovable() const @@ -1092,9 +1201,11 @@ void tst_QList::startsWith() const QVERIFY(list.startsWith(T_BAR)); } -void tst_QList::startsWithInt() const +void tst_QList::startsWithOptimal() const { - startsWith(); + const int liveCount = Optimal::getLiveCount(); + startsWith(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::startsWithMovable() const @@ -1133,9 +1244,11 @@ void tst_QList::swap() const QCOMPARE(list2, QList() << T_BAZ << T_FOO << T_BAR); } -void tst_QList::swapInt() const +void tst_QList::swapOptimal() const { - swap(); + const int liveCount = Optimal::getLiveCount(); + swap(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::swapMovable() const @@ -1166,9 +1279,11 @@ void tst_QList::takeAt() const QVERIFY(list.size() == 0); } -void tst_QList::takeAtInt() const +void tst_QList::takeAtOptimal() const { - takeAt(); + const int liveCount = Optimal::getLiveCount(); + takeAt(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::takeAtMovable() const @@ -1199,9 +1314,11 @@ void tst_QList::takeFirst() const QVERIFY(list.size() == 0); } -void tst_QList::takeFirstInt() const +void tst_QList::takeFirstOptimal() const { - takeFirst(); + const int liveCount = Optimal::getLiveCount(); + takeFirst(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::takeFirstMovable() const @@ -1229,9 +1346,11 @@ void tst_QList::takeLast() const QCOMPARE(list.takeLast(), T_FOO); } -void tst_QList::takeLastInt() const +void tst_QList::takeLastOptimal() const { - takeLast(); + const int liveCount = Optimal::getLiveCount(); + takeLast(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::takeLastMovable() const @@ -1265,9 +1384,11 @@ void tst_QList::toSet() const << T_FOO << T_BAR << T_BAZ); } -void tst_QList::toSetInt() const +void tst_QList::toSetOptimal() const { - toSet(); + const int liveCount = Optimal::getLiveCount(); + toSet(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::toSetMovable() const @@ -1300,9 +1421,11 @@ void tst_QList::toStdList() const QCOMPARE(list, QList() << T_FOO << T_BAR << T_BAZ); } -void tst_QList::toStdListInt() const +void tst_QList::toStdListOptimal() const { - toStdList(); + const int liveCount = Optimal::getLiveCount(); + toStdList(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::toStdListMovable() const @@ -1328,9 +1451,11 @@ void tst_QList::toVector() const QCOMPARE(list.toVector(), QVector() << T_FOO << T_BAR << T_BAZ); } -void tst_QList::toVectorInt() const +void tst_QList::toVectorOptimal() const { - toVector(); + const int liveCount = Optimal::getLiveCount(); + toVector(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::toVectorMovable() const @@ -1367,9 +1492,11 @@ void tst_QList::value() const QCOMPARE(list.value(3, defaultT), defaultT); } -void tst_QList::valueInt() const +void tst_QList::valueOptimal() const { - value(); + const int liveCount = Optimal::getLiveCount(); + value(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::valueMovable() const @@ -1419,9 +1546,11 @@ void tst_QList::testOperators() const QCOMPARE(list[list.size() - 1], T_CAT); } -void tst_QList::testOperatorsInt() const +void tst_QList::testOperatorsOptimal() const { - testOperators(); + const int liveCount = Optimal::getLiveCount(); + testOperators(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::testOperatorsMovable() const @@ -1478,9 +1607,11 @@ void tst_QList::testSTLIterators() const QCOMPARE(*it, T_FOO); } -void tst_QList::testSTLIteratorsInt() const +void tst_QList::testSTLIteratorsOptimal() const { - testSTLIterators(); + const int liveCount = Optimal::getLiveCount(); + testSTLIterators(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::testSTLIteratorsMovable() const @@ -1525,9 +1656,11 @@ void tst_QList::constSharedNull() const QVERIFY(!list2.isDetached()); } -void tst_QList::constSharedNullInt() const +void tst_QList::constSharedNullOptimal() const { - constSharedNull(); + const int liveCount = Optimal::getLiveCount(); + constSharedNull(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::constSharedNullMovable() const -- cgit v1.2.3 From 40d6e8adf5e3cc45b3bd4a94ad3b57f9444e447f Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 1 Oct 2014 10:56:14 +0200 Subject: QList: prepare for tag dispatching based on memory layout Add one tag class for each of QList's three different memory layouts to QListData, and inherit QList::MemoryLayout from exactly one of them. To simplify overloading, added tag classes that express the negation of the two extreme poles of memory layout (C-compatible and heap), too. The "missing" one could be added when needed, too. Change-Id: I45ea603731499fd3fdfb37d60a0a98fb22ac15ec Reviewed-by: Thiago Macieira --- src/corelib/tools/qlist.h | 19 +++++++++++++++++ tests/auto/corelib/tools/qlist/tst_qlist.cpp | 32 ++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 023dafb223..255816d0ba 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -66,6 +66,14 @@ template struct QListSpecialMethods { }; template <> struct QListSpecialMethods; struct Q_CORE_EXPORT QListData { + // tags for tag-dispatching of QList implementations, + // based on QList's three different memory layouts: + struct NotArrayCompatibleLayout {}; + struct NotIndirectLayout {}; + struct ArrayCompatibleLayout : NotIndirectLayout {}; // data laid out like a C array + struct InlineWithPaddingLayout : NotArrayCompatibleLayout, NotIndirectLayout {}; // data laid out like a C array with padding + struct IndirectLayout : NotArrayCompatibleLayout {}; // data allocated on the heap + struct Data { QtPrivate::RefCount ref; int alloc, begin, end; @@ -99,6 +107,17 @@ struct Q_CORE_EXPORT QListData { template class QList : public QListSpecialMethods { +public: + struct MemoryLayout + : QtPrivate::if_< + QTypeInfo::isStatic || QTypeInfo::isLarge, + QListData::IndirectLayout, + typename QtPrivate::if_< + sizeof(T) == sizeof(void*), + QListData::ArrayCompatibleLayout, + QListData::InlineWithPaddingLayout + >::type>::type {}; +private: struct Node { void *v; #if defined(Q_CC_BOR) Q_INLINE_TEMPLATE T &t(); diff --git a/tests/auto/corelib/tools/qlist/tst_qlist.cpp b/tests/auto/corelib/tools/qlist/tst_qlist.cpp index 95744051e4..1207986dde 100644 --- a/tests/auto/corelib/tools/qlist/tst_qlist.cpp +++ b/tests/auto/corelib/tools/qlist/tst_qlist.cpp @@ -35,6 +35,17 @@ #include #include +template +class is_qlist_array_memory_layout { + struct No { char c; }; + struct Yes { No n[2]; }; + Q_STATIC_ASSERT(sizeof(No) != sizeof(Yes)); + static No check(...); + static Yes check(MemoryLayout); +public: + enum { value = sizeof(check(typename QList::MemoryLayout())) == sizeof(Yes) }; +}; + struct Movable { Movable(char input = 'j') : i(input) @@ -235,6 +246,27 @@ Q_STATIC_ASSERT(!QTypeInfo::isStatic); Q_STATIC_ASSERT(QTypeInfo::isComplex); Q_STATIC_ASSERT(QTypeInfo::isStatic); Q_STATIC_ASSERT(QTypeInfo::isComplex); +// iow: +Q_STATIC_ASSERT(( is_qlist_array_memory_layout ::value)); +Q_STATIC_ASSERT((!is_qlist_array_memory_layout ::value)); + +Q_STATIC_ASSERT((!is_qlist_array_memory_layout ::value)); +Q_STATIC_ASSERT((!is_qlist_array_memory_layout::value)); +Q_STATIC_ASSERT(( is_qlist_array_memory_layout ::value)); +Q_STATIC_ASSERT(( is_qlist_array_memory_layout ::value)); +Q_STATIC_ASSERT((!is_qlist_array_memory_layout ::value)); + +Q_STATIC_ASSERT(( is_qlist_array_memory_layout ::value)); +Q_STATIC_ASSERT(( is_qlist_array_memory_layout::value)); +Q_STATIC_ASSERT(( is_qlist_array_memory_layout ::value)); +Q_STATIC_ASSERT((!is_qlist_array_memory_layout ::value)); +Q_STATIC_ASSERT((!is_qlist_array_memory_layout ::value)); + +Q_STATIC_ASSERT((!is_qlist_array_memory_layout ::value)); +Q_STATIC_ASSERT(( is_qlist_array_memory_layout::value)); +Q_STATIC_ASSERT((!is_qlist_array_memory_layout ::value)); +Q_STATIC_ASSERT((!is_qlist_array_memory_layout ::value)); +Q_STATIC_ASSERT(( is_qlist_array_memory_layout ::value)); class tst_QList : public QObject { -- cgit v1.2.3 From 18885297de880493831f63d20a8d45c6689a01b8 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 19 Aug 2014 23:30:38 +0200 Subject: QList: share the implementations of contains()/count() with QVector where possible If QList data-layout-compatible with QVector and a C array, implement count() via std::count() and contains() via std::find() and use const_pointer instead of const_iterator as the iterators. This essentially makes the QVector and QList implementations identical to each other, at least for important cases such as QString. To switch between the different implementations, use tag dispatching instead of the previously used technique "use 'if' as if it were 'static if'", which imposes accidental requirements on the element types (something that esp. QVector is plagued with). Change-Id: I6caf74442a22059676b5bf115a6089768f3a0952 Reviewed-by: Thiago Macieira --- src/corelib/tools/qlist.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 255816d0ba..5d6cf9fe15 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -377,6 +377,12 @@ private: { return (constBegin().i <= i.i) && (i.i <= constEnd().i); } + +private: + inline bool contains_impl(const T &, QListData::NotArrayCompatibleLayout) const; + inline bool contains_impl(const T &, QListData::ArrayCompatibleLayout) const; + inline int count_impl(const T &, QListData::NotArrayCompatibleLayout) const; + inline int count_impl(const T &, QListData::ArrayCompatibleLayout) const; }; #if defined(Q_CC_BOR) @@ -940,6 +946,12 @@ Q_OUTOFLINE_TEMPLATE int QList::lastIndexOf(const T &t, int from) const template Q_OUTOFLINE_TEMPLATE bool QList::contains(const T &t) const +{ + return contains_impl(t, MemoryLayout()); +} + +template +inline bool QList::contains_impl(const T &t, QListData::NotArrayCompatibleLayout) const { Node *e = reinterpret_cast(p.end()); Node *i = reinterpret_cast(p.begin()); @@ -949,8 +961,22 @@ Q_OUTOFLINE_TEMPLATE bool QList::contains(const T &t) const return false; } +template +inline bool QList::contains_impl(const T &t, QListData::ArrayCompatibleLayout) const +{ + const T *b = reinterpret_cast(p.begin()); + const T *e = reinterpret_cast(p.end()); + return std::find(b, e, t) != e; +} + template Q_OUTOFLINE_TEMPLATE int QList::count(const T &t) const +{ + return this->count_impl(t, MemoryLayout()); +} + +template +inline int QList::count_impl(const T &t, QListData::NotArrayCompatibleLayout) const { int c = 0; Node *e = reinterpret_cast(p.end()); @@ -961,6 +987,14 @@ Q_OUTOFLINE_TEMPLATE int QList::count(const T &t) const return c; } +template +inline int QList::count_impl(const T &t, QListData::ArrayCompatibleLayout) const +{ + return int(std::count(reinterpret_cast(p.begin()), + reinterpret_cast(p.end()), + t)); +} + Q_DECLARE_SEQUENTIAL_ITERATOR(List) Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR(List) -- cgit v1.2.3 From ddd61b4aec7d17741faffe988b44c7c0a19ce71f Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 26 Aug 2014 10:53:42 +0200 Subject: QList: share implementation of operator== with QVector where possible Same change as was already applied for count() and contains(). Change-Id: Ibd62e4b36e03741993ba33e730c9449ef19bff5f Reviewed-by: Thiago Macieira --- src/corelib/tools/qlist.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 5d6cf9fe15..57e67d52d7 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -379,6 +379,8 @@ private: } private: + inline bool op_eq_impl(const QList &other, QListData::NotArrayCompatibleLayout) const; + inline bool op_eq_impl(const QList &other, QListData::ArrayCompatibleLayout) const; inline bool contains_impl(const T &, QListData::NotArrayCompatibleLayout) const; inline bool contains_impl(const T &, QListData::ArrayCompatibleLayout) const; inline int count_impl(const T &, QListData::NotArrayCompatibleLayout) const; @@ -796,6 +798,12 @@ Q_OUTOFLINE_TEMPLATE bool QList::operator==(const QList &l) const return true; if (p.size() != l.p.size()) return false; + return this->op_eq_impl(l, MemoryLayout()); +} + +template +inline bool QList::op_eq_impl(const QList &l, QListData::NotArrayCompatibleLayout) const +{ Node *i = reinterpret_cast(p.begin()); Node *e = reinterpret_cast(p.end()); Node *li = reinterpret_cast(l.p.begin()); @@ -806,6 +814,15 @@ Q_OUTOFLINE_TEMPLATE bool QList::operator==(const QList &l) const return true; } +template +inline bool QList::op_eq_impl(const QList &l, QListData::ArrayCompatibleLayout) const +{ + const T *lb = reinterpret_cast(l.p.begin()); + const T *b = reinterpret_cast(p.begin()); + const T *e = reinterpret_cast(p.end()); + return std::equal(b, e, lb); +} + template Q_OUTOFLINE_TEMPLATE void QList::dealloc(QListData::Data *data) { -- cgit v1.2.3 From 1649b973fd2ecd6c2398387f8bb5d0d768142336 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 19 Jan 2015 20:58:41 +0100 Subject: QPair: add noexcept to ctors and assignment operators Change-Id: Id201d1f1e7a087083ca6c13ab31c721e672ef566 Reviewed-by: Thiago Macieira --- src/corelib/tools/qpair.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/corelib/tools/qpair.h b/src/corelib/tools/qpair.h index aa0a53388c..d637067fa8 100644 --- a/src/corelib/tools/qpair.h +++ b/src/corelib/tools/qpair.h @@ -45,22 +45,31 @@ struct QPair typedef T1 first_type; typedef T2 second_type; - Q_DECL_CONSTEXPR QPair() : first(), second() {} - Q_DECL_CONSTEXPR QPair(const T1 &t1, const T2 &t2) : first(t1), second(t2) {} + Q_DECL_CONSTEXPR QPair() + Q_DECL_NOEXCEPT_EXPR(noexcept(T1()) && noexcept(T2())) + : first(), second() {} + Q_DECL_CONSTEXPR QPair(const T1 &t1, const T2 &t2) + Q_DECL_NOEXCEPT_EXPR(noexcept(T1(t1)) && noexcept(T2(t2))) + : first(t1), second(t2) {} // compiler-generated copy/move ctor/assignment operators are fine! template - Q_DECL_CONSTEXPR QPair(const QPair &p) : first(p.first), second(p.second) {} + Q_DECL_CONSTEXPR QPair(const QPair &p) + Q_DECL_NOEXCEPT_EXPR(noexcept(T1(p.first)) && noexcept(T2(p.second))) + : first(p.first), second(p.second) {} template Q_DECL_RELAXED_CONSTEXPR QPair &operator=(const QPair &p) + Q_DECL_NOEXCEPT_EXPR(noexcept(std::declval() = p.first) && noexcept(std::declval() = p.second)) { first = p.first; second = p.second; return *this; } #ifdef Q_COMPILER_RVALUE_REFS template Q_DECL_CONSTEXPR QPair(QPair &&p) // can't use std::move here as it's not constexpr in C++11: + Q_DECL_NOEXCEPT_EXPR(noexcept(T1(static_cast(p.first))) && noexcept(T2(static_cast(p.second)))) : first(static_cast(p.first)), second(static_cast(p.second)) {} template Q_DECL_RELAXED_CONSTEXPR QPair &operator=(QPair &&p) + Q_DECL_NOEXCEPT_EXPR(noexcept(std::declval() = std::move(p.first)) && noexcept(std::declval() = std::move(p.second))) { first = std::move(p.first); second = std::move(p.second); return *this; } #endif -- cgit v1.2.3 From 57ca50cbc7e8b4bd7f898c62ad5dee0260937691 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 12 Feb 2015 13:41:02 +0100 Subject: Android: Fix tst_QFileInfo::isExecutable() Use correct path for executable file. Change-Id: I50283fc43fe6561cb8eb687f739f21a3d5cbadbd Reviewed-by: Christian Stromme --- tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp index f4c0affd92..0c71675e1a 100644 --- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp @@ -1611,9 +1611,13 @@ void tst_QFileInfo::isWritable() void tst_QFileInfo::isExecutable() { QString appPath = QCoreApplication::applicationDirPath(); +#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK) + appPath += "/libtst_qfileinfo.so"; +#else appPath += "/tst_qfileinfo"; -#if defined(Q_OS_WIN) +# if defined(Q_OS_WIN) appPath += ".exe"; +# endif #endif QFileInfo fi(appPath); QCOMPARE(fi.isExecutable(), true); -- cgit v1.2.3 From f727ffa1eb6ffe18a485fd91d1d702c5c1558c4f Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 16 Feb 2015 08:39:57 +0100 Subject: compose: Rename main.cpp to qcomposeplatforminputcontextmain.cpp Files with same base name cause extra trouble for debuggers. Similarly to 26cf0f0d5a8, it can be avoided here. Change-Id: Ide47170f417d636aa031b0d84a1951df8bf32316 Reviewed-by: Friedemann Kleint --- .../platforminputcontexts/compose/compose.pro | 2 +- src/plugins/platforminputcontexts/compose/main.cpp | 62 ---------------------- .../compose/qcomposeplatforminputcontextmain.cpp | 62 ++++++++++++++++++++++ 3 files changed, 63 insertions(+), 63 deletions(-) delete mode 100644 src/plugins/platforminputcontexts/compose/main.cpp create mode 100644 src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontextmain.cpp diff --git a/src/plugins/platforminputcontexts/compose/compose.pro b/src/plugins/platforminputcontexts/compose/compose.pro index 10e50a7a7e..a9da36c473 100644 --- a/src/plugins/platforminputcontexts/compose/compose.pro +++ b/src/plugins/platforminputcontexts/compose/compose.pro @@ -9,7 +9,7 @@ QT += gui-private DEFINES += X11_PREFIX='\\"$$QMAKE_X11_PREFIX\\"' -SOURCES += $$PWD/main.cpp \ +SOURCES += $$PWD/qcomposeplatforminputcontextmain.cpp \ $$PWD/qcomposeplatforminputcontext.cpp \ $$PWD/generator/qtablegenerator.cpp \ diff --git a/src/plugins/platforminputcontexts/compose/main.cpp b/src/plugins/platforminputcontexts/compose/main.cpp deleted file mode 100644 index e0c252eaf6..0000000000 --- a/src/plugins/platforminputcontexts/compose/main.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include - -#include "qcomposeplatforminputcontext.h" - -QT_BEGIN_NAMESPACE - -class QComposePlatformInputContextPlugin : public QPlatformInputContextPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformInputContextFactoryInterface" FILE "compose.json") - -public: - QComposeInputContext *create(const QString &, const QStringList &) Q_DECL_OVERRIDE; -}; - -QComposeInputContext *QComposePlatformInputContextPlugin::create(const QString &system, const QStringList ¶mList) -{ - Q_UNUSED(paramList); - - if (system.compare(system, QLatin1String("compose"), Qt::CaseInsensitive) == 0) - return new QComposeInputContext; - return 0; -} - -QT_END_NAMESPACE - -#include "main.moc" diff --git a/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontextmain.cpp b/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontextmain.cpp new file mode 100644 index 0000000000..5ab0dd8f04 --- /dev/null +++ b/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontextmain.cpp @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include + +#include "qcomposeplatforminputcontext.h" + +QT_BEGIN_NAMESPACE + +class QComposePlatformInputContextPlugin : public QPlatformInputContextPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformInputContextFactoryInterface" FILE "compose.json") + +public: + QComposeInputContext *create(const QString &, const QStringList &) Q_DECL_OVERRIDE; +}; + +QComposeInputContext *QComposePlatformInputContextPlugin::create(const QString &system, const QStringList ¶mList) +{ + Q_UNUSED(paramList); + + if (system.compare(system, QLatin1String("compose"), Qt::CaseInsensitive) == 0) + return new QComposeInputContext; + return 0; +} + +QT_END_NAMESPACE + +#include "qcomposeplatforminputcontextmain.moc" -- cgit v1.2.3 From 6ccf0a326ef415b7c9c8d80e9ede0da85e2fb52b Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Mon, 9 Feb 2015 18:48:11 +0100 Subject: Use relative path for QMAKE_BUNDLE_DATA Use of FileFixifyAbsolute with non-default in_dir and out_dir is not defined (and produces bogus results). Using FileFixifyRelative when handling QMAKE_BUNDLE_DATA as a relative path is fine. Change-Id: I49902dc9f5b8029d092a4419c0cff5483e419c30 Reviewed-by: Oswald Buddenhagen --- qmake/generators/mac/pbuilder_pbx.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 6af51d845d..24b9091a03 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -1107,7 +1107,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) //all files const ProStringList &files = project->values(ProKey(bundle_data[i] + ".files")); for(int file = 0; file < files.count(); file++) { - QString fn = fileFixify(files[file].toQString(), Option::output_dir, input_dir, FileFixifyAbsolute); + QString fn = fileFixify(files[file].toQString(), Option::output_dir, input_dir, FileFixifyRelative); QString name = fn.split(Option::dir_sep).back(); QString file_ref_key = keyFor("QMAKE_PBX_BUNDLE_DATA_FILE_REF." + bundle_data[i] + "-" + fn); bundle_file_refs += file_ref_key; -- cgit v1.2.3 From c0d67bb5c9370408ca68f21925de5ec9e89ad9cb Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 20 Nov 2014 16:20:16 +0100 Subject: fix filename handling in replaceExtraCompilerVariables() fixing and escaping is now a tri-state option: - none (this removes the need to unescape the result right afterwards in some cases) - local shell (for system()) - target shell (for Makefile) Change-Id: I5b78d9b70630fe4484dc964eff5f62793da35764 Reviewed-by: Joerg Bornemann --- qmake/generators/mac/pbuilder_pbx.cpp | 3 +- qmake/generators/makefile.cpp | 62 +++++++++++++++++------------ qmake/generators/makefile.h | 39 ++++++++++-------- qmake/generators/projectgenerator.cpp | 2 +- qmake/generators/win32/msvc_objectmodel.cpp | 22 +++++----- qmake/generators/win32/msvc_vcproj.cpp | 22 +++++----- qmake/generators/win32/msvc_vcproj.h | 7 ++-- 7 files changed, 89 insertions(+), 68 deletions(-) diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 24b9091a03..123d056914 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -773,7 +773,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) mkt << "\\\n\t"; ++added; const QString file_name = fileFixify(fn, Option::output_dir, Option::output_dir); - mkt << " " << replaceExtraCompilerVariables(Option::fixPathToTargetOS(tmp_out.first().toQString(), false), file_name, QString()); + mkt << " " << replaceExtraCompilerVariables( + Option::fixPathToTargetOS(tmp_out.first().toQString(), false), file_name, QString(), NoShell); } } } diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index eebd0e1be5..fcb376ea62 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -61,6 +61,8 @@ QT_BEGIN_NAMESPACE +using namespace QMakeInternal; + bool MakefileGenerator::canExecute(const QStringList &cmdline, int *a) const { int argv0 = -1; @@ -210,7 +212,7 @@ MakefileGenerator::initOutPaths() for (ProStringList::Iterator input = inputs.begin(); input != inputs.end(); ++input) { QString finp = fileFixify((*input).toQString(), Option::output_dir, Option::output_dir); *input = ProString(finp); - QString path = unescapeFilePath(replaceExtraCompilerVariables(tmp_out, finp, QString())); + QString path = replaceExtraCompilerVariables(tmp_out, finp, QString(), NoShell); path = Option::fixPathToTargetOS(path); int slash = path.lastIndexOf(Option::dir_sep); if(slash != -1) { @@ -728,7 +730,7 @@ MakefileGenerator::init() QString in = Option::fixPathToTargetOS(inpf, false); if (!verifyExtraCompiler((*it).toQString(), in)) //verify continue; - QString out = replaceExtraCompilerVariables(tmp_out.toQString(), inpf, QString()); + QString out = replaceExtraCompilerVariables(tmp_out.toQString(), inpf, QString(), NoShell); out = fileFixify(out, Option::output_dir, Option::output_dir); bool pre_dep = (config.indexOf("target_predeps") != -1); if (v.contains(vokey)) { @@ -1513,7 +1515,8 @@ MakefileGenerator::createObjectList(const ProStringList &sources) return ret; } -ReplaceExtraCompilerCacheKey::ReplaceExtraCompilerCacheKey(const QString &v, const QStringList &i, const QStringList &o) +ReplaceExtraCompilerCacheKey::ReplaceExtraCompilerCacheKey( + const QString &v, const QStringList &i, const QStringList &o, MakefileGenerator::ReplaceFor s) { static QString doubleColon = QLatin1String("::"); @@ -1530,11 +1533,13 @@ ReplaceExtraCompilerCacheKey::ReplaceExtraCompilerCacheKey(const QString &v, con ol.sort(); out = ol.join(doubleColon); } + forShell = s; } bool ReplaceExtraCompilerCacheKey::operator==(const ReplaceExtraCompilerCacheKey &f) const { return (hashCode() == f.hashCode() && + f.forShell == forShell && f.in == in && f.out == out && f.var == var && @@ -1543,10 +1548,11 @@ bool ReplaceExtraCompilerCacheKey::operator==(const ReplaceExtraCompilerCacheKey QString -MakefileGenerator::replaceExtraCompilerVariables(const QString &orig_var, const QStringList &in, const QStringList &out) +MakefileGenerator::replaceExtraCompilerVariables( + const QString &orig_var, const QStringList &in, const QStringList &out, ReplaceFor forShell) { //lazy cache - ReplaceExtraCompilerCacheKey cacheKey(orig_var, in, out); + ReplaceExtraCompilerCacheKey cacheKey(orig_var, in, out, forShell); QString cacheVal = extraCompilerVariablesCache.value(cacheKey); if(!cacheVal.isNull()) return cacheVal; @@ -1633,12 +1639,14 @@ MakefileGenerator::replaceExtraCompilerVariables(const QString &orig_var, const if(!val.isEmpty()) { QString fullVal; - if(filePath) { + if (filePath && forShell != NoShell) { for(int i = 0; i < val.size(); ++i) { - const QString file = Option::fixPathToTargetOS(unescapeFilePath(val.at(i)), false); if(!fullVal.isEmpty()) fullVal += " "; - fullVal += escapeFilePath(file); + if (forShell == LocalShell) + fullVal += IoUtils::shellQuote(Option::fixPathToLocalOS(unescapeFilePath(val.at(i)), false)); + else + fullVal += escapeFilePath(Option::fixPathToTargetOS(unescapeFilePath(val.at(i)), false)); } } else { fullVal = val.join(' '); @@ -1705,7 +1713,7 @@ MakefileGenerator::verifyExtraCompiler(const ProString &comp, const QString &fil QString in = fileFixify(Option::fixPathToTargetOS(inpf, false)); if(in == file) { bool pass = project->test(verify.toKey(), - QList() << ProStringList(replaceExtraCompilerVariables(tmp_out.toQString(), inpf, QString())) << + QList() << ProStringList(replaceExtraCompilerVariables(tmp_out.toQString(), inpf, QString(), NoShell)) << ProStringList(file)); if(invert) pass = !pass; @@ -1723,7 +1731,7 @@ MakefileGenerator::verifyExtraCompiler(const ProString &comp, const QString &fil return false; const QString tmp_cmd = project->values(ProKey(comp + ".commands")).join(' '); if (config.indexOf("combine") != -1) { - QString cmd = replaceExtraCompilerVariables(tmp_cmd, QString(), tmp_out); + QString cmd = replaceExtraCompilerVariables(tmp_cmd, QString(), tmp_out, LocalShell); if(system(cmd.toLatin1().constData())) return false; } else { @@ -1736,8 +1744,8 @@ MakefileGenerator::verifyExtraCompiler(const ProString &comp, const QString &fil QString inpf = (*input).toQString(); QString in = fileFixify(Option::fixPathToTargetOS(inpf, false)); if(in == file) { - QString out = replaceExtraCompilerVariables(tmp_out, inpf, QString()); - QString cmd = replaceExtraCompilerVariables(tmp_cmd, in, out); + QString out = replaceExtraCompilerVariables(tmp_out, inpf, QString(), NoShell); + QString cmd = replaceExtraCompilerVariables(tmp_cmd, in, out, LocalShell); if(system(cmd.toLatin1().constData())) return false; break; @@ -1814,10 +1822,12 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) if (config.indexOf("combine") != -1) { // compilers with a combined input only have one output QString input = project->first(ProKey(*it + ".output")).toQString(); - t << " " << escapeDependencyPath(Option::fixPathToTargetOS(replaceExtraCompilerVariables(tmp_out, input, QString()))); + t << ' ' << escapeDependencyPath(Option::fixPathToTargetOS( + replaceExtraCompilerVariables(tmp_out, input, QString(), NoShell))); } else { for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) { - t << " " << escapeDependencyPath(Option::fixPathToTargetOS(replaceExtraCompilerVariables(tmp_out, (*input).toQString(), QString()))); + t << ' ' << escapeDependencyPath(Option::fixPathToTargetOS( + replaceExtraCompilerVariables(tmp_out, (*input).toQString(), QString(), NoShell))); } } t << endl; @@ -1849,7 +1859,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) { QString tinp = (*input).toQString(); cleans.append(" " + Option::fixPathToTargetOS(replaceExtraCompilerVariables(tmp_clean, tinp, - replaceExtraCompilerVariables(tmp_out, tinp, QString())))); + replaceExtraCompilerVariables(tmp_out, tinp, QString(), NoShell), TargetShell))); } } else { QString files, file; @@ -1857,7 +1867,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) for(int input = 0; input < tmp_inputs.size(); ++input) { QString tinp = tmp_inputs.at(input).toQString(); file = " " + replaceExtraCompilerVariables(tmp_clean, tinp, - replaceExtraCompilerVariables(tmp_out, tinp, QString())); + replaceExtraCompilerVariables(tmp_out, tinp, QString(), NoShell), TargetShell); if(del_statement.length() + files.length() + qMax(fixEnvVariables(file).length(), file.length()) > commandlineLimit) { cleans.append(files); @@ -1875,7 +1885,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) { QString tinp = (*input).toQString(); t << "\n\t" << replaceExtraCompilerVariables(tmp_clean_cmds, tinp, - replaceExtraCompilerVariables(tmp_out, tinp, QString())); + replaceExtraCompilerVariables(tmp_out, tinp, QString(), NoShell), TargetShell); } } } @@ -1897,7 +1907,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) inputs += Option::fixPathToTargetOS(inpf, false); if(!tmp_dep_cmd.isEmpty() && doDepends()) { char buff[256]; - QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, inpf, tmp_out); + QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, inpf, tmp_out, LocalShell); dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd); if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) { QString indeps; @@ -1959,8 +1969,8 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) if (inputs.isEmpty()) continue; - QString out = replaceExtraCompilerVariables(tmp_out, QString(), QString()); - QString cmd = replaceExtraCompilerVariables(tmp_cmd, escapeFilePaths(inputs), QStringList() << out); + QString out = replaceExtraCompilerVariables(tmp_out, QString(), QString(), NoShell); + QString cmd = replaceExtraCompilerVariables(tmp_cmd, inputs, QStringList() << out, TargetShell); t << escapeDependencyPath(Option::fixPathToTargetOS(out)) << ":"; // compiler.CONFIG+=explicit_dependencies means that ONLY compiler.depends gets to cause Makefile dependencies if (config.indexOf("explicit_dependencies") != -1) { @@ -1976,19 +1986,19 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) QString in = Option::fixPathToTargetOS(inpf, false); QStringList deps = findDependencies(inpf); deps += escapeDependencyPath(in); - QString out = unescapeFilePath(Option::fixPathToTargetOS(replaceExtraCompilerVariables(tmp_out, inpf, QString()))); + QString out = Option::fixPathToTargetOS(replaceExtraCompilerVariables(tmp_out, inpf, QString(), NoShell)); if(!tmp_dep.isEmpty()) { QStringList pre_deps = fileFixify(tmp_dep, Option::output_dir, Option::output_dir); for(int i = 0; i < pre_deps.size(); ++i) - deps += replaceExtraCompilerVariables(pre_deps.at(i), inpf, out); + deps << replaceExtraCompilerVariables(pre_deps.at(i), inpf, out, NoShell); } - QString cmd = replaceExtraCompilerVariables(tmp_cmd, inpf, out); + QString cmd = replaceExtraCompilerVariables(tmp_cmd, inpf, out, LocalShell); // NOTE: The var -> QMAKE_COMP_var replace feature is unsupported, do not use! for (ProStringList::ConstIterator it3 = vars.constBegin(); it3 != vars.constEnd(); ++it3) cmd.replace("$(" + (*it3) + ")", "$(QMAKE_COMP_" + (*it3)+")"); if(!tmp_dep_cmd.isEmpty() && doDepends()) { char buff[256]; - QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, inpf, out); + QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, inpf, out, LocalShell); dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd); if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) { QString indeps; @@ -2982,8 +2992,8 @@ MakefileGenerator::findFileForDep(const QMakeLocalFileName &dep, const QMakeLoca for (ProStringList::ConstIterator it2 = tmp.begin(); it2 != tmp.end(); ++it2) { const ProStringList &inputs = project->values((*it2).toKey()); for (ProStringList::ConstIterator input = inputs.begin(); input != inputs.end(); ++input) { - QString out = Option::fixPathToTargetOS(unescapeFilePath( - replaceExtraCompilerVariables(tmp_out.toQString(), (*input).toQString(), QString()))); + QString out = Option::fixPathToTargetOS( + replaceExtraCompilerVariables(tmp_out.toQString(), (*input).toQString(), QString(), NoShell)); if (out == dep.real() || out.section(Option::dir_sep, -1) == dep_basename) { ret = QMakeLocalFileName(fileFixify(out, qmake_getpwd(), Option::output_dir)); goto found_dep_from_heuristic; diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h index 2753a15e1c..972127916c 100644 --- a/qmake/generators/makefile.h +++ b/qmake/generators/makefile.h @@ -52,20 +52,6 @@ QT_BEGIN_NAMESPACE #define QT_PCLOSE pclose #endif -struct ReplaceExtraCompilerCacheKey -{ - mutable uint hash; - QString var, in, out, pwd; - ReplaceExtraCompilerCacheKey(const QString &v, const QStringList &i, const QStringList &o); - bool operator==(const ReplaceExtraCompilerCacheKey &f) const; - inline uint hashCode() const { - if(!hash) - hash = qHash(var) ^ qHash(in) ^ qHash(out) /*^ qHash(pwd)*/; - return hash; - } -}; -inline uint qHash(const ReplaceExtraCompilerCacheKey &f) { return f.hashCode(); } - struct ReplaceExtraCompilerCacheKey; class MakefileGenerator : protected QMakeSourceFileInfo @@ -81,6 +67,10 @@ class MakefileGenerator : protected QMakeSourceFileInfo mutable QHash dependsCache; mutable QHash extraCompilerVariablesCache; +public: + // We can't make it visible to VCFilter in VS2008 except by making it public or directly friending it. + enum ReplaceFor { NoShell, LocalShell, TargetShell }; + protected: enum TARG_MODE { TARG_UNIX_MODE, TARG_MAC_MODE, TARG_WIN_MODE } target_mode; @@ -132,9 +122,9 @@ protected: //extra compiler interface bool verifyExtraCompiler(const ProString &c, const QString &f); - virtual QString replaceExtraCompilerVariables(const QString &, const QStringList &, const QStringList &); - inline QString replaceExtraCompilerVariables(const QString &val, const QString &in, const QString &out) - { return replaceExtraCompilerVariables(val, QStringList(in), QStringList(out)); } + virtual QString replaceExtraCompilerVariables(const QString &, const QStringList &, const QStringList &, ReplaceFor forShell); + inline QString replaceExtraCompilerVariables(const QString &val, const QString &in, const QString &out, ReplaceFor forShell) + { return replaceExtraCompilerVariables(val, QStringList(in), QStringList(out), forShell); } //interface to the source file info QMakeLocalFileName fixPathForFile(const QMakeLocalFileName &, bool); @@ -281,6 +271,21 @@ inline bool MakefileGenerator::findLibraries() inline MakefileGenerator::~MakefileGenerator() { } +struct ReplaceExtraCompilerCacheKey +{ + mutable uint hash; + QString var, in, out, pwd; + MakefileGenerator::ReplaceFor forShell; + ReplaceExtraCompilerCacheKey(const QString &v, const QStringList &i, const QStringList &o, MakefileGenerator::ReplaceFor s); + bool operator==(const ReplaceExtraCompilerCacheKey &f) const; + inline uint hashCode() const { + if (!hash) + hash = (uint)forShell ^ qHash(var) ^ qHash(in) ^ qHash(out) /*^ qHash(pwd)*/; + return hash; + } +}; +inline uint qHash(const ReplaceExtraCompilerCacheKey &f) { return f.hashCode(); } + QT_END_NAMESPACE #endif // MAKEFILE_H diff --git a/qmake/generators/projectgenerator.cpp b/qmake/generators/projectgenerator.cpp index fa2e65e647..bcda1dbf0c 100644 --- a/qmake/generators/projectgenerator.cpp +++ b/qmake/generators/projectgenerator.cpp @@ -308,7 +308,7 @@ ProjectGenerator::init() for (ProStringList::ConstIterator it2 = tmp.begin(); it2 != tmp.end(); ++it2) { ProStringList &inputs = project->values((*it2).toKey()); for (ProStringList::Iterator input = inputs.begin(); input != inputs.end(); ++input) { - QString path = replaceExtraCompilerVariables(tmp_out, (*input).toQString(), QString()); + QString path = replaceExtraCompilerVariables(tmp_out, (*input).toQString(), QString(), NoShell); path = fixPathToQmake(path).section('/', -1); for(int i = 0; i < var_out.size(); ++i) { ProString v = var_out.at(i); diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 28a67d9902..62f5814ce3 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -2295,9 +2295,8 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info) QString cmd, cmd_name, out; QStringList deps, inputs; // Variabel replacement of output name - out = Option::fixPathToTargetOS( - Project->replaceExtraCompilerVariables(tmp_out, inFile, QString()), - false); + out = Option::fixPathToTargetOS(Project->replaceExtraCompilerVariables( + tmp_out, inFile, QString(), MakefileGenerator::NoShell), false); // If file has built-in compiler, we've swapped the input and output of // the command, as we in Visual Studio cannot have a Custom Buildstep on @@ -2318,9 +2317,8 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info) if (!tmp_dep_cmd.isEmpty()) { // Execute dependency command, and add every line as a dep char buff[256]; - QString dep_cmd = Project->replaceExtraCompilerVariables(tmp_dep_cmd, - Option::fixPathToLocalOS(inFile, true, false), - out); + QString dep_cmd = Project->replaceExtraCompilerVariables( + tmp_dep_cmd, inFile, out, MakefileGenerator::LocalShell); if(Project->canExecute(dep_cmd)) { dep_cmd.prepend(QLatin1String("cd ") + Project->escapeFilePath(Option::fixPathToLocalOS(Option::output_dir, false)) @@ -2347,7 +2345,8 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info) } for (int i = 0; i < deps.count(); ++i) deps[i] = Option::fixPathToTargetOS( - Project->replaceExtraCompilerVariables(deps.at(i), inFile, out), + Project->replaceExtraCompilerVariables( + deps.at(i), inFile, out, MakefileGenerator::NoShell), false).trimmed(); // Command for file if (combined) { @@ -2367,16 +2366,19 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info) // ### join gives path issues with directories containing spaces! cmd = Project->replaceExtraCompilerVariables(tmp_cmd, inputs.join(' '), - out); + out, + MakefileGenerator::TargetShell); } else { deps.prepend(inFile); // input file itself too.. cmd = Project->replaceExtraCompilerVariables(tmp_cmd, inFile, - out); + out, + MakefileGenerator::TargetShell); } // Name for command if (!tmp_cmd_name.isEmpty()) { - cmd_name = Project->replaceExtraCompilerVariables(tmp_cmd_name, inFile, out); + cmd_name = Project->replaceExtraCompilerVariables( + tmp_cmd_name, inFile, out, MakefileGenerator::NoShell); } else { int space = cmd.indexOf(' '); if (space != -1) diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 64252ff076..dd0fdafb49 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -893,7 +893,7 @@ void VcprojGenerator::init() extraCompilerSources[file] += quc.toQString(); } else { QString out = Option::fixPathToTargetOS(replaceExtraCompilerVariables( - compiler_out, file, QString()), false); + compiler_out, file, QString(), NoShell), false); extraCompilerSources[out] += quc.toQString(); extraCompilerOutputs[out] = QStringList(file); // Can only have one } @@ -1532,7 +1532,8 @@ void VcprojGenerator::initResourceFiles() if(!qrc_files.isEmpty()) { for (int i = 0; i < qrc_files.count(); ++i) { char buff[256]; - QString dep_cmd = replaceExtraCompilerVariables(rcc_dep_cmd, qrc_files.at(i).toQString(), ""); + QString dep_cmd = replaceExtraCompilerVariables( + rcc_dep_cmd, qrc_files.at(i).toQString(), QString(), LocalShell); dep_cmd = Option::fixPathToLocalOS(dep_cmd, true, false); if(canExecute(dep_cmd)) { @@ -1605,16 +1606,16 @@ void VcprojGenerator::initExtraCompilerOutputs() QString tmp_out = project->first(ProKey(*it + ".output")).toQString(); if (project->values(ProKey(*it + ".CONFIG")).indexOf("combine") != -1) { // Combined output, only one file result - extraCompile.addFile( - Option::fixPathToTargetOS(replaceExtraCompilerVariables(tmp_out, QString(), QString()), false)); + extraCompile.addFile(Option::fixPathToTargetOS( + replaceExtraCompilerVariables(tmp_out, QString(), QString(), NoShell), false)); } else { // One output file per input const ProStringList &tmp_in = project->values(project->first(ProKey(*it + ".input")).toKey()); for (int i = 0; i < tmp_in.count(); ++i) { const QString &filename = tmp_in.at(i).toQString(); if (extraCompilerSources.contains(filename)) - extraCompile.addFile( - Option::fixPathToTargetOS(replaceExtraCompilerVariables(filename, tmp_out, QString()), false)); + extraCompile.addFile(Option::fixPathToTargetOS( + replaceExtraCompilerVariables(filename, tmp_out, QString(), NoShell), false)); } } } else { @@ -1629,8 +1630,8 @@ void VcprojGenerator::initExtraCompilerOutputs() for (int i = 0; i < tmp_in.count(); ++i) { const QString &filename = tmp_in.at(i).toQString(); if (extraCompilerSources.contains(filename)) - extraCompile.addFile( - Option::fixPathToTargetOS(replaceExtraCompilerVariables(filename, QString(), QString()), false)); + extraCompile.addFile(Option::fixPathToTargetOS( + replaceExtraCompilerVariables(filename, QString(), QString(), NoShell), false)); } } } @@ -1650,9 +1651,10 @@ VCProjectWriter *VcprojGenerator::createProjectWriter() return new VCProjectWriter; } -QString VcprojGenerator::replaceExtraCompilerVariables(const QString &var, const QStringList &in, const QStringList &out) +QString VcprojGenerator::replaceExtraCompilerVariables( + const QString &var, const QStringList &in, const QStringList &out, ReplaceFor forShell) { - QString ret = MakefileGenerator::replaceExtraCompilerVariables(var, in, out); + QString ret = MakefileGenerator::replaceExtraCompilerVariables(var, in, out, forShell); ProStringList &defines = project->values("VCPROJ_MAKEFILE_DEFINES"); if(defines.isEmpty()) diff --git a/qmake/generators/win32/msvc_vcproj.h b/qmake/generators/win32/msvc_vcproj.h index 7d912616fd..87cc39f323 100644 --- a/qmake/generators/win32/msvc_vcproj.h +++ b/qmake/generators/win32/msvc_vcproj.h @@ -76,9 +76,10 @@ protected: virtual VCProjectWriter *createProjectWriter(); virtual bool doDepends() const { return false; } //never necesary virtual void processSources() { filterIncludedFiles("SOURCES"); filterIncludedFiles("GENERATED_SOURCES"); } - virtual QString replaceExtraCompilerVariables(const QString &, const QStringList &, const QStringList &); - inline QString replaceExtraCompilerVariables(const QString &val, const QString &in, const QString &out) - { return MakefileGenerator::replaceExtraCompilerVariables(val, in, out); } + using MakefileGenerator::ReplaceFor; + virtual QString replaceExtraCompilerVariables(const QString &, const QStringList &, const QStringList &, ReplaceFor); + inline QString replaceExtraCompilerVariables(const QString &val, const QString &in, const QString &out, ReplaceFor forShell) + { return MakefileGenerator::replaceExtraCompilerVariables(val, in, out, forShell); } virtual bool supportsMetaBuild() { return true; } virtual bool supportsMergedBuilds() { return true; } virtual bool mergeBuildProject(MakefileGenerator *other); -- cgit v1.2.3 From e3a7237d8214bb229997730775fd89d06b9db269 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 6 Feb 2015 15:30:02 +0100 Subject: fix quoting issues. all of them. (*) instead of quoting more or less random variable contents early, consistently quote everything only right before it is needed. this way we can be sure that everything is correctly quoted, but not over-quoted. this removed the need for the insanity that unescapeFilePath() and similar ad-hoc contraptions were. this had the somewhat counter-intuitive effect that it was possible to remove escapeFilePath() calls from PBX::writeSettings() calls - these were actually only unescaping. [ChangeLog][qmake][Important Behavior Changes] A lot of quoting issues have been fixed. As a side effect, qmake has become more sensitive to over-quoted file names in project files. (*) ok, maybe not. close enough. Task-number: fatal: out of memory Change-Id: I8c51cfffb59ccd156b46bd5c56754c480667443a Reviewed-by: Joerg Bornemann --- qmake/generators/mac/pbuilder_pbx.cpp | 105 ++++----- qmake/generators/mac/pbuilder_pbx.h | 2 - qmake/generators/makefile.cpp | 145 ++++++------ qmake/generators/makefile.h | 12 +- qmake/generators/unix/unixmake.cpp | 109 +++++---- qmake/generators/unix/unixmake.h | 1 + qmake/generators/unix/unixmake2.cpp | 333 +++++++++++++++------------- qmake/generators/win32/mingw_make.cpp | 56 ++--- qmake/generators/win32/mingw_make.h | 3 +- qmake/generators/win32/msvc_nmake.cpp | 61 ++--- qmake/generators/win32/msvc_objectmodel.cpp | 8 +- qmake/generators/win32/msvc_vcproj.cpp | 24 +- qmake/generators/win32/winmakefile.cpp | 126 +++++------ qmake/generators/win32/winmakefile.h | 2 + qmake/meta.cpp | 3 - 15 files changed, 514 insertions(+), 476 deletions(-) diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 123d056914..bc094d82d1 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -215,7 +215,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t) t << "\t\t" << project_key << " = {\n" << "\t\t\t" << writeSettings("isa", "PBXFileReference", SettingsNoQuote) << ";\n" << "\t\t\t" << writeSettings("lastKnownFileType", "wrapper.pb-project") << ";\n" - << "\t\t\t" << writeSettings("name", escapeFilePath(tmp_proj.first("TARGET") + projectSuffix())) << ";\n" + << "\t\t\t" << writeSettings("name", tmp_proj.first("TARGET") + projectSuffix()) << ";\n" << "\t\t\t" << writeSettings("path", pbxproj) << ";\n" << "\t\t\t" << writeSettings("sourceTree", "") << ";\n" << "\t\t};\n"; @@ -283,7 +283,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t) t << "\t\t" << keyFor(grp_it.key()) << " = {\n" << "\t\t\t" << writeSettings("isa", "PBXGroup", SettingsNoQuote) << ";\n" << "\t\t\t" << writeSettings("children", grp_it.value(), SettingsAsList, 4) << ";\n" - << "\t\t\t" << writeSettings("name", escapeFilePath(grp_it.key().section(Option::dir_sep, -1))) << ";\n" + << "\t\t\t" << writeSettings("name", grp_it.key().section(Option::dir_sep, -1)) << ";\n" << "\t\t\t" << writeSettings("sourceTree", "") << ";\n" << "\t\t};\n"; } @@ -626,8 +626,6 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) const QStringList &files = fileFixify(sources.at(source).files(project)); for(int f = 0; f < files.count(); ++f) { QString file = files[f]; - if(file.length() >= 2 && (file[0] == '"' || file[0] == '\'') && file[(int) file.length()-1] == file[0]) - file = file.mid(1, file.length()-2); if(!sources.at(source).compilerName().isNull() && !verifyExtraCompiler(sources.at(source).compilerName(), file)) continue; @@ -678,9 +676,9 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) //source reference t << "\t\t" << src_key << " = {\n" << "\t\t\t" << writeSettings("isa", "PBXFileReference", SettingsNoQuote) << ";\n" - << "\t\t\t" << writeSettings("path", escapeFilePath(file)) << ";\n"; + << "\t\t\t" << writeSettings("path", file) << ";\n"; if (name != file) - t << "\t\t\t" << writeSettings("name", escapeFilePath(name)) << ";\n"; + t << "\t\t\t" << writeSettings("name", name) << ";\n"; t << "\t\t\t" << writeSettings("sourceTree", "") << ";\n"; QString filetype = xcodeFiletypeForFilename(file); if (!filetype.isNull()) @@ -715,7 +713,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) t << "\t\t" << keyFor(grp_it.key()) << " = {\n" << "\t\t\t" << writeSettings("isa", "PBXGroup", SettingsNoQuote) << ";\n" << "\t\t\t" << writeSettings("children", grp_it.value(), SettingsAsList, 4) << ";\n" - << "\t\t\t" << writeSettings("name", escapeFilePath(grp_it.key().section(Option::dir_sep, -1))) << ";\n" + << "\t\t\t" << writeSettings("name", grp_it.key().section(Option::dir_sep, -1)) << ";\n" << "\t\t\t" << writeSettings("sourceTree", "") << ";\n" << "\t\t};\n"; } @@ -773,8 +771,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) mkt << "\\\n\t"; ++added; const QString file_name = fileFixify(fn, Option::output_dir, Option::output_dir); - mkt << " " << replaceExtraCompilerVariables( - Option::fixPathToTargetOS(tmp_out.first().toQString(), false), file_name, QString(), NoShell); + mkt << " " << escapeDependencyPath(replaceExtraCompilerVariables( + Option::fixPathToTargetOS(tmp_out.first().toQString(), false), file_name, QString(), NoShell)); } } } @@ -823,8 +821,6 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) bool remove = false; QString library, name; ProString opt = tmp[x].trimmed(); - if (opt.length() >= 2 && (opt.at(0) == '"' || opt.at(0) == '\'') && opt.endsWith(opt.at(0))) - opt = opt.mid(1, opt.length()-2); if(opt.startsWith("-L")) { QString r = opt.mid(2).toQString(); fixForOutput(r); @@ -935,8 +931,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) bool is_frmwrk = (library.endsWith(".framework")); t << "\t\t" << key << " = {\n" << "\t\t\t" << writeSettings("isa", "PBXFileReference", SettingsNoQuote) << ";\n" - << "\t\t\t" << writeSettings("name", escapeFilePath(name)) << ";\n" - << "\t\t\t" << writeSettings("path", escapeFilePath(library)) << ";\n" + << "\t\t\t" << writeSettings("name", name) << ";\n" + << "\t\t\t" << writeSettings("path", library) << ";\n" << "\t\t\t" << writeSettings("refType", QString::number(reftypeForFile(library)), SettingsNoQuote) << ";\n" << "\t\t\t" << writeSettings("sourceTree", "") << ";\n"; if (is_frmwrk) @@ -971,14 +967,15 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) QTextStream mkt(&mkf); writeHeader(mkt); mkt << "SUBLIBS= "; + // ### This is missing the parametrization found in unixmake2.cpp tmp = project->values("SUBLIBS"); for(int i = 0; i < tmp.count(); i++) - t << "tmp/lib" << tmp[i] << ".a "; + t << escapeFilePath("tmp/lib" + tmp[i] + ".a") << ' '; t << endl << endl; mkt << "sublibs: $(SUBLIBS)\n\n"; tmp = project->values("SUBLIBS"); for(int i = 0; i < tmp.count(); i++) - t << "tmp/lib" << tmp[i] << ".a:\n\t" + t << escapeFilePath("tmp/lib" + tmp[i] + ".a") + ":\n\t" << var(ProKey("MAKELIB" + tmp[i])) << endl << endl; mkt.flush(); mkf.close(); @@ -1042,7 +1039,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) t << "\t\t" << key << " = {\n" << "\t\t\t" << writeSettings("children", project->values("QMAKE_PBX_LIBRARIES"), SettingsAsList, 4) << ";\n" << "\t\t\t" << writeSettings("isa", "PBXGroup", SettingsNoQuote) << ";\n" - << "\t\t\t" << writeSettings("name", escapeFilePath(grp)) << ";\n" + << "\t\t\t" << writeSettings("name", grp) << ";\n" << "\t\t\t" << writeSettings("sourceTree", "") << ";\n" << "\t\t};\n"; } @@ -1055,7 +1052,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) << "\t\t\t" << writeSettings("files", project->values("QMAKE_PBX_BUILD_LIBRARIES"), SettingsAsList, 4) << ";\n" << "\t\t\t" << writeSettings("isa", "PBXFrameworksBuildPhase", SettingsNoQuote) << ";\n" << "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n" - << "\t\t\t" << writeSettings("name", escapeFilePath(grp)) << ";\n" + << "\t\t\t" << writeSettings("name", grp) << ";\n" << "\t\t};\n"; } @@ -1090,7 +1087,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) << "\t\t\t" << writeSettings("outputPaths", ProStringList(), SettingsAsList, 4) << ";\n" << "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n" << "\t\t\t" << writeSettings("shellPath", "/bin/sh") << ";\n" - << "\t\t\t" << writeSettings("shellScript", fixForOutput("cp -r $BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME " + escapeFilePath(destDir))) << ";\n" + << "\t\t\t" << writeSettings("shellScript", fixForOutput("cp -r $BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME " + IoUtils::shellQuoteUnix(destDir))) << ";\n" << "\t\t};\n"; } bool copyBundleResources = project->isActiveConfig("app_bundle") && project->first("TEMPLATE") == "app"; @@ -1114,7 +1111,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) bundle_file_refs += file_ref_key; t << "\t\t" << file_ref_key << " = {\n" << "\t\t\t" << writeSettings("isa", "PBXFileReference", SettingsNoQuote) << ";\n" - << "\t\t\t" << writeSettings("path", escapeFilePath(fn)) << ";\n" + << "\t\t\t" << writeSettings("path", fn) << ";\n" << "\t\t\t" << writeSettings("name", name) << ";\n" << "\t\t\t" << writeSettings("sourceTree", "") << ";\n" << "\t\t};\n"; @@ -1140,7 +1137,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) t << "\t\t" << phase_key << " = {\n" << "\t\t\t" << writeSettings("name", "Copy '" + bundle_data[i] + "' Files to Bundle") << ";\n" << "\t\t\t" << writeSettings("buildActionMask", "2147483647", SettingsNoQuote) << ";\n" - << "\t\t\t" << writeSettings("dstPath", escapeFilePath(path)) << ";\n" + << "\t\t\t" << writeSettings("dstPath", path) << ";\n" << "\t\t\t" << writeSettings("dstSubfolderSpec", "1", SettingsNoQuote) << ";\n" << "\t\t\t" << writeSettings("isa", "PBXCopyFilesBuildPhase", SettingsNoQuote) << ";\n" << "\t\t\t" << writeSettings("files", bundle_files, SettingsAsList, 4) << ";\n" @@ -1164,8 +1161,6 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) if (copyBundleResources) { if (!project->isEmpty("ICON")) { ProString icon = project->first("ICON"); - if (icon.length() >= 2 && (icon.at(0) == '"' || icon.at(0) == '\'') && icon.endsWith(icon.at(0))) - icon = icon.mid(1, icon.length() - 2); bundle_resources_files += keyFor(icon + ".BUILDABLE"); } @@ -1178,7 +1173,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) << "\t\t\t" << writeSettings("files", bundle_resources_files, SettingsAsList, 4) << ";\n" << "\t\t\t" << writeSettings("isa", "PBXResourcesBuildPhase", SettingsNoQuote) << ";\n" << "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n" - << "\t\t\t" << writeSettings("name", escapeFilePath(grp)) << ";\n" + << "\t\t\t" << writeSettings("name", grp) << ";\n" << "\t\t};\n"; } @@ -1203,7 +1198,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) } else { t << "\t\t\t" << writeSettings("explicitFileType", "compiled.mach-o.executable") << ";\n"; } - t << "\t\t\t" << writeSettings("path", escapeFilePath(targ)) << ";\n"; + t << "\t\t\t" << writeSettings("path", targ) << ";\n"; } else { ProString lib = project->first("QMAKE_ORIG_TARGET"); if(project->isActiveConfig("staticlib")) { @@ -1231,7 +1226,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) } else { t << "\t\t\t" << writeSettings("explicitFileType", "compiled.mach-o.dylib") << ";\n"; } - t << "\t\t\t" << writeSettings("path", escapeFilePath(lib)) << ";\n"; + t << "\t\t\t" << writeSettings("path", lib) << ";\n"; } t << "\t\t\t" << writeSettings("sourceTree", "BUILT_PRODUCTS_DIR", SettingsNoQuote) << ";\n" << "\t\t};\n"; @@ -1251,7 +1246,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) t << "\t\t" << keyFor("QMAKE_PBX_ROOT_GROUP") << " = {\n" << "\t\t\t" << writeSettings("children", project->values("QMAKE_PBX_GROUPS"), SettingsAsList, 4) << ";\n" << "\t\t\t" << writeSettings("isa", "PBXGroup", SettingsNoQuote) << ";\n" - << "\t\t\t" << writeSettings("name", escapeFilePath(project->first("QMAKE_ORIG_TARGET"))) << ";\n" + << "\t\t\t" << writeSettings("name", project->first("QMAKE_ORIG_TARGET")) << ";\n" << "\t\t\t" << writeSettings("sourceTree", "") << ";\n" << "\t\t};\n"; @@ -1297,14 +1292,14 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) else t << "\t\t\t" << writeSettings("productType", "com.apple.product-type.tool") << ";\n"; } - t << "\t\t\t" << writeSettings("name", escapeFilePath(project->first("QMAKE_ORIG_TARGET"))) << ";\n" - << "\t\t\t" << writeSettings("productName", escapeFilePath(project->first("QMAKE_ORIG_TARGET"))) << ";\n"; + t << "\t\t\t" << writeSettings("name", project->first("QMAKE_ORIG_TARGET")) << ";\n" + << "\t\t\t" << writeSettings("productName", project->first("QMAKE_ORIG_TARGET")) << ";\n"; } else { ProString lib = project->first("QMAKE_ORIG_TARGET"); if(!project->isActiveConfig("lib_bundle") && !project->isActiveConfig("staticlib")) lib.prepend("lib"); - t << "\t\t\t" << writeSettings("name", escapeFilePath(lib)) << ";\n" - << "\t\t\t" << writeSettings("productName", escapeFilePath(lib)) << ";\n"; + t << "\t\t\t" << writeSettings("name", lib) << ";\n" + << "\t\t\t" << writeSettings("productName", lib) << ";\n"; if (!project->isEmpty("QMAKE_PBX_PRODUCT_TYPE")) t << "\t\t\t" << writeSettings("productType", project->first("QMAKE_PBX_PRODUCT_TYPE")) << ";\n"; else if (project->isActiveConfig("staticlib")) @@ -1315,7 +1310,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) t << "\t\t\t" << writeSettings("productType", "com.apple.product-type.library.dynamic") << ";\n"; } if(!project->isEmpty("DESTDIR")) - t << "\t\t\t" << writeSettings("productInstallPath", escapeFilePath(project->first("DESTDIR"))) << ";\n"; + t << "\t\t\t" << writeSettings("productInstallPath", project->first("DESTDIR")) << ";\n"; t << "\t\t};\n"; //DEBUG/RELEASE QString defaultConfig; @@ -1353,7 +1348,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) ProString lib = project->first("QMAKE_ORIG_TARGET"); if (!project->isActiveConfig("lib_bundle") && !project->isActiveConfig("staticlib")) lib.prepend("lib"); - settings.insert("PRODUCT_NAME", escapeFilePath(lib.toQString())); + settings.insert("PRODUCT_NAME", lib.toQString()); } if (project->isActiveConfig("debug") != (bool)as_release) @@ -1423,7 +1418,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) } } - t << "\t\t\t\t" << writeSettings("SYMROOT", escapeFilePath(qmake_getpwd())) << ";\n"; + t << "\t\t\t\t" << writeSettings("SYMROOT", qmake_getpwd()) << ";\n"; if (!project->isEmpty("DESTDIR")) { ProString dir = project->first("DESTDIR"); @@ -1459,11 +1454,11 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) QString var = tmp[i].toQString(), val = QString::fromLocal8Bit(qgetenv(var.toLatin1().constData())); if (val.isEmpty() && var == "TB") val = "/usr/bin/"; - t << "\t\t\t\t" << writeSettings(var, escapeFilePath(val)) << ";\n"; + t << "\t\t\t\t" << writeSettings(var, val) << ";\n"; } if (!project->isEmpty("PRECOMPILED_HEADER")) { t << "\t\t\t\t" << writeSettings("GCC_PRECOMPILE_PREFIX_HEADER", "YES") << ";\n" - << "\t\t\t\t" << writeSettings("GCC_PREFIX_HEADER", escapeFilePath(project->first("PRECOMPILED_HEADER"))) << ";\n"; + << "\t\t\t\t" << writeSettings("GCC_PREFIX_HEADER", project->first("PRECOMPILED_HEADER")) << ";\n"; } t << "\t\t\t\t" << writeSettings("HEADER_SEARCH_PATHS", fixListForOutput("INCLUDEPATH"), SettingsAsList, 5) << ";\n" << "\t\t\t\t" << writeSettings("LIBRARY_SEARCH_PATHS", fixListForOutput("QMAKE_PBX_LIBPATHS"), SettingsAsList, 5) << ";\n" @@ -1494,8 +1489,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) t << "\t\t\t\t" << writeSettings("OTHER_LDFLAGS", fixListForOutput("SUBLIBS") + fixListForOutput("QMAKE_LFLAGS") - + fixListForOutput("QMAKE_LIBS") - + fixListForOutput("QMAKE_LIBS_PRIVATE"), + + fixListForOutput(fixLibFlags("QMAKE_LIBS")) + + fixListForOutput(fixLibFlags("QMAKE_LIBS_PRIVATE")), SettingsAsList, 6) << ";\n"; } const ProStringList &archs = !project->values("QMAKE_XCODE_ARCHS").isEmpty() ? @@ -1503,7 +1498,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) if (!archs.isEmpty()) t << "\t\t\t\t" << writeSettings("ARCHS", archs) << ";\n"; if (!project->isEmpty("OBJECTS_DIR")) - t << "\t\t\t\t" << writeSettings("OBJROOT", escapeFilePath(project->first("OBJECTS_DIR").toQString())) << ";\n"; + t << "\t\t\t\t" << writeSettings("OBJROOT", project->first("OBJECTS_DIR")) << ";\n"; } else { if (project->first("TEMPLATE") == "app") { t << "\t\t\t\t" << writeSettings("PRODUCT_NAME", fixForOutput(project->first("QMAKE_ORIG_TARGET").toQString())) << ";\n"; @@ -1515,7 +1510,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) ProString lib = project->first("QMAKE_ORIG_TARGET"); if (!project->isActiveConfig("lib_bundle") && !project->isActiveConfig("staticlib")) lib.prepend("lib"); - t << "\t\t\t\t" << writeSettings("PRODUCT_NAME", escapeFilePath(lib)) << ";\n"; + t << "\t\t\t\t" << writeSettings("PRODUCT_NAME", lib) << ";\n"; } } t << "\t\t\t};\n" @@ -1561,13 +1556,14 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) QTextStream mkwrapt(&mkwrapf); writeHeader(mkwrapt); const char cleans[] = "preprocess_clean "; + const QString cmd = escapeFilePath(project->first("QMAKE_ORIG_TARGET") + projectSuffix() + "/") + " && " + pbxbuild(); mkwrapt << "#This is a makefile wrapper for PROJECT BUILDER\n" << "all:\n\t" - << "cd " << project->first("QMAKE_ORIG_TARGET") << projectSuffix() << "/ && " << pbxbuild() << "\n" + << "cd " << cmd << "\n" << "install: all\n\t" - << "cd " << project->first("QMAKE_ORIG_TARGET") << projectSuffix() << "/ && " << pbxbuild() << " install\n" + << "cd " << cmd << " install\n" << "distclean clean: preprocess_clean\n\t" - << "cd " << project->first("QMAKE_ORIG_TARGET") << projectSuffix() << "/ && " << pbxbuild() << " clean\n" + << "cd " << cmd << " clean\n" << (!did_preprocess ? cleans : "") << ":\n"; if(did_preprocess) mkwrapt << cleans << ":\n\t" @@ -1667,7 +1663,6 @@ ProjectBuilderMakefileGenerator::openOutput(QFile &file, const QString &build) c output += QDir::separator(); } output += QString("project.pbxproj"); - output = unescapeFilePath(output); file.setFileName(output); } bool ret = UnixMakefileGenerator::openOutput(file, build); @@ -1724,8 +1719,6 @@ ProjectBuilderMakefileGenerator::pbuilderVersion() const else version_plist = "/Developer/Applications/Project Builder.app/Contents/version.plist"; #endif - } else { - version_plist.replace(QRegExp("\""), ""); } if (ret.isEmpty()) { QFile version_file(version_plist); @@ -1786,7 +1779,7 @@ int ProjectBuilderMakefileGenerator::reftypeForFile(const QString &where) { int ret = 0; //absolute is the default.. - if(QDir::isRelativePath(unescapeFilePath(where))) + if (QDir::isRelativePath(where)) ret = 4; //relative return ret; } @@ -1812,26 +1805,6 @@ ProjectBuilderMakefileGenerator::pbxbuild() return (pbuilderVersion() >= 38 ? "xcodebuild" : "pbxbuild"); } -QString -ProjectBuilderMakefileGenerator::escapeFilePath(const QString &path) const -{ -#if 1 - //in the middle of generating a Makefile! - if(writingUnixMakefileGenerator) - return UnixMakefileGenerator::escapeFilePath(path); - - //generating stuff for the xml file! - QString ret = path; - if(!ret.isEmpty()) { - ret = unescapeFilePath(ret); - debug_msg(2, "EscapeFilePath: %s -> %s", path.toLatin1().constData(), ret.toLatin1().constData()); - } - return ret; -#else - return UnixMakefileGenerator::escapeFilePath(path); -#endif -} - static QString quotedStringLiteral(const QString &value) { QString result; diff --git a/qmake/generators/mac/pbuilder_pbx.h b/qmake/generators/mac/pbuilder_pbx.h index 2ecf7b6f36..f517ce4bbd 100644 --- a/qmake/generators/mac/pbuilder_pbx.h +++ b/qmake/generators/mac/pbuilder_pbx.h @@ -72,8 +72,6 @@ public: virtual bool supportsMetaBuild() { return false; } virtual bool openOutput(QFile &, const QString &) const; protected: - virtual QString escapeFilePath(const QString &path) const; - ProString escapeFilePath(const ProString &path) const { return MakefileGenerator::escapeFilePath(path); } bool doPrecompiledHeaders() const { return false; } virtual bool doDepends() const { return writingUnixMakefileGenerator && UnixMakefileGenerator::doDepends(); } }; diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index fcb376ea62..39c00d72d7 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -277,8 +277,6 @@ MakefileGenerator::findFilesInVPATH(ProStringList l, uchar flags, const QString } if(!(flags & VPATH_NoFixify)) file = fileFixify(file, qmake_getpwd(), Option::output_dir); - if (file.at(0) == '\"' && file.at(file.length() - 1) == '\"') - file = file.mid(1, file.length() - 2); if(exists(file)) { ++val_it; @@ -774,7 +772,7 @@ MakefileGenerator::init() incDirs += v["INCLUDEPATH"]; QList deplist; for (ProStringList::Iterator it = incDirs.begin(); it != incDirs.end(); ++it) - deplist.append(QMakeLocalFileName(unescapeFilePath((*it).toQString()))); + deplist.append(QMakeLocalFileName((*it).toQString())); QMakeSourceFileInfo::setDependencyPaths(deplist); debug_msg(1, "Dependency Directories: %s", incDirs.join(" :: ").toLatin1().constData()); //cache info @@ -829,7 +827,7 @@ MakefileGenerator::init() ProStringList &l = v[fixpaths[path]]; for (ProStringList::Iterator val_it = l.begin(); val_it != l.end(); ++val_it) { if(!(*val_it).isEmpty()) - (*val_it) = escapeDependencyPath(Option::fixPathToTargetOS((*val_it).toQString(), false, false)); + (*val_it) = Option::fixPathToTargetOS((*val_it).toQString(), false, false); } } @@ -1054,9 +1052,9 @@ MakefileGenerator::writeProjectMakefile() writeSubTargets(t, targets, SubTargetsNoFlags); if(!project->isActiveConfig("no_autoqmake")) { + QString mkf = escapeDependencyPath(Option::fixPathToTargetOS(fileFixify(Option::output.fileName()))); for(QList::Iterator it = targets.begin(); it != targets.end(); ++it) - t << (*it)->makefile << ": " << - Option::fixPathToTargetOS(fileFixify(Option::output.fileName())) << endl; + t << escapeDependencyPath((*it)->makefile) << ": " << mkf << endl; } qDeleteAll(targets); return true; @@ -1208,7 +1206,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild) QString dst; if (installConfigValues.indexOf("no_path") == -1 && installConfigValues.indexOf("dummy_install") == -1) { - dst = fileFixify(unescapeFilePath(project->first(pvar).toQString()), FileFixifyAbsolute, false); + dst = fileFixify(project->first(pvar).toQString(), FileFixifyAbsolute, false); if(!dst.endsWith(Option::dir_sep)) dst += Option::dir_sep; } @@ -1375,7 +1373,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild) t << "uninstall_" << (*it) << ": FORCE"; for (int i = uninst.size(); --i >= 0; ) t << "\n\t" << uninst.at(i); - t << "\n\t-$(DEL_DIR) " << filePrefixRoot(root, dst) << " \n\n"; + t << "\n\t-$(DEL_DIR) " << escapeFilePath(filePrefixRoot(root, dst)) << " \n\n"; } t << endl; @@ -1388,8 +1386,8 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild) debug_msg(1, "no definition for install %s: install target not created",(*it).toLatin1().constData()); } } - t << "install: " << var("INSTALLDEPS") << " " << all_installs - << " FORCE\n\nuninstall: " << all_uninstalls << " " << var("UNINSTALLDEPS") + t << "install:" << depVar("INSTALLDEPS") << ' ' << all_installs + << " FORCE\n\nuninstall: " << all_uninstalls << depVar("UNINSTALLDEPS") << " FORCE\n\n"; } @@ -1399,6 +1397,24 @@ MakefileGenerator::var(const ProKey &var) const return val(project->values(var)); } +QString +MakefileGenerator::fileVar(const ProKey &var) const +{ + return val(escapeFilePaths(project->values(var))); +} + +QString +MakefileGenerator::fileVarList(const ProKey &var) const +{ + return valList(escapeFilePaths(project->values(var))); +} + +QString +MakefileGenerator::depVar(const ProKey &var) const +{ + return val(escapeDependencyPaths(project->values(var))); +} + QString MakefileGenerator::val(const ProStringList &varList) const { @@ -1417,6 +1433,12 @@ MakefileGenerator::varGlue(const ProKey &var, const QString &before, const QStri return valGlue(project->values(var), before, glue, after); } +QString +MakefileGenerator::fileVarGlue(const ProKey &var, const QString &before, const QString &glue, const QString &after) const +{ + return valGlue(escapeFilePaths(project->values(var)), before, glue, after); +} + QString MakefileGenerator::fixFileVarGlue(const ProKey &var, const QString &before, const QString &glue, const QString &after) const { @@ -1644,9 +1666,9 @@ MakefileGenerator::replaceExtraCompilerVariables( if(!fullVal.isEmpty()) fullVal += " "; if (forShell == LocalShell) - fullVal += IoUtils::shellQuote(Option::fixPathToLocalOS(unescapeFilePath(val.at(i)), false)); + fullVal += IoUtils::shellQuote(Option::fixPathToLocalOS(val.at(i), false)); else - fullVal += escapeFilePath(Option::fixPathToTargetOS(unescapeFilePath(val.at(i)), false)); + fullVal += escapeFilePath(Option::fixPathToTargetOS(val.at(i), false)); } } else { fullVal = val.join(' '); @@ -1833,7 +1855,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) t << endl; if (config.indexOf("no_clean") == -1) { - QString tmp_clean = project->values(ProKey(*it + ".clean")).join(' '); + QString tmp_clean = escapeFilePaths(project->values(ProKey(*it + ".clean"))).join(' '); QString tmp_clean_cmds = project->values(ProKey(*it + ".clean_commands")).join(' '); if(!tmp_inputs.isEmpty()) clean_targets += QString("compiler_" + (*it) + "_clean "); @@ -1846,7 +1868,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) wrote_clean_cmds = true; } if(tmp_clean.isEmpty()) - tmp_clean = tmp_out; + tmp_clean = escapeFilePath(tmp_out); if(tmp_clean.indexOf("${QMAKE_") == -1) { t << "\n\t-$(DEL_FILE) " << tmp_clean; wrote_clean = true; @@ -1919,6 +1941,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) } QT_PCLOSE(proc); if(!indeps.isEmpty()) { + // ### This is basically fubar. Add 'lines' flag to CONFIG? QStringList dep_cmd_deps = indeps.replace('\n', ' ').simplified().split(' '); for(int i = 0; i < dep_cmd_deps.count(); ++i) { QString &file = dep_cmd_deps[i]; @@ -1985,7 +2008,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) QString inpf = (*input).toQString(); QString in = Option::fixPathToTargetOS(inpf, false); QStringList deps = findDependencies(inpf); - deps += escapeDependencyPath(in); + deps << in; QString out = Option::fixPathToTargetOS(replaceExtraCompilerVariables(tmp_out, inpf, QString(), NoShell)); if(!tmp_dep.isEmpty()) { QStringList pre_deps = fileFixify(tmp_dep, Option::output_dir, Option::output_dir); @@ -2010,6 +2033,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) } QT_PCLOSE(proc); if(!indeps.isEmpty()) { + // ### This is basically fubar. Add 'lines' flag to CONFIG? QStringList dep_cmd_deps = indeps.replace('\n', ' ').simplified().split(' '); for(int i = 0; i < dep_cmd_deps.count(); ++i) { QString &file = dep_cmd_deps[i]; @@ -2087,7 +2111,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) } for(int i = 0; i < deps.size(); ) { QString &dep = deps[i]; - dep = Option::fixPathToTargetOS(unescapeFilePath(dep), false); + dep = Option::fixPathToTargetOS(dep, false); if(out == dep) deps.removeAt(i); else @@ -2251,7 +2275,7 @@ MakefileGenerator::writeHeader(QTextStream &t) QString ofile = Option::fixPathToTargetOS(Option::output.fileName()); if (ofile.lastIndexOf(Option::dir_sep) != -1) ofile.remove(0, ofile.lastIndexOf(Option::dir_sep) +1); - t << "MAKEFILE = " << ofile << endl << endl; + t << "MAKEFILE = " << escapeFilePath(ofile) << endl << endl; } QList @@ -2441,8 +2465,8 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QListmakefile; + : "\n\tcd " + escapeFilePath(out_directory) + " && "; + QString makefilein = " -f " + escapeFilePath(subtarget->makefile); //qmake it QString out; @@ -2452,6 +2476,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QListprofile, FileFixifyAbsolute)); if(out.startsWith(in_directory)) out = out.mid(in_directory.length()); + out = escapeFilePath(out); t << subtarget->target << "-qmake_all: "; if (flags & SubTargetOrdered) { if (target) @@ -2545,18 +2570,18 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList recurse; @@ -2602,8 +2627,8 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QListmakefile; + : "\n\tcd " + escapeFilePath(out_directory) + " && "; + QString makefilein = " -f " + escapeFilePath(subtarget->makefile); QString out; QString in; @@ -2612,6 +2637,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QListprofile, FileFixifyAbsolute)); if (out.startsWith(in_directory)) out = out.mid(in_directory.length()); + out = escapeFilePath(out); } //write the rule/depends @@ -2659,14 +2685,14 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll) { QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName())); if(project->isEmpty("QMAKE_FAILED_REQUIREMENTS") && !project->isEmpty("QMAKE_INTERNAL_PRL_FILE")) { - QStringList files = fileFixify(Option::mkfile::project_files); + QStringList files = escapeFilePaths(fileFixify(Option::mkfile::project_files)); t << escapeDependencyPath(project->first("QMAKE_INTERNAL_PRL_FILE").toQString()) << ": \n\t" << "@$(QMAKE) -prl " << buildArgs() << " " << files.join(' ') << endl; } QString qmake = build_args(); if(!ofile.isEmpty() && !project->isActiveConfig("no_autoqmake")) { - t << escapeFilePath(ofile) << ": " + t << escapeDependencyPath(ofile) << ": " << escapeDependencyPath(fileFixify(project->projectFile())) << " "; if (Option::globals->do_cache) { if (!project->confFile().isEmpty()) @@ -2678,8 +2704,8 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll) if(exists(Option::fixPathToLocalOS(specdir()+QDir::separator()+"qmake.conf"))) t << escapeDependencyPath(specdir() + Option::dir_sep + "qmake.conf") << " "; } - const ProStringList &included = project->values("QMAKE_INTERNAL_INCLUDED_FILES"); - t << escapeDependencyPaths(included).join(" \\\n\t\t") << "\n\t" + const ProStringList &included = escapeDependencyPaths(project->values("QMAKE_INTERNAL_INCLUDED_FILES")); + t << included.join(" \\\n\t\t") << "\n\t" << qmake << endl; for(int include = 0; include < included.size(); ++include) { const ProString &i = included.at(include); @@ -2714,19 +2740,22 @@ MakefileGenerator::fileInfo(QString file) const return fi; } -QString -MakefileGenerator::unescapeFilePath(const QString &path) const +ProStringList +MakefileGenerator::fixLibFlags(const ProKey &var) { - QString ret = path; - ret.replace(QLatin1String("\\ "), QLatin1String(" ")); - ret.remove(QLatin1Char('\"')); + ProStringList in = project->values(var); + ProStringList ret; + + ret.reserve(in.length()); + foreach (const ProString &v, in) + ret << fixLibFlag(v); return ret; } -ProString -MakefileGenerator::unescapeFilePath(const ProString &path) const +ProString MakefileGenerator::fixLibFlag(const ProString &) { - return ProString(unescapeFilePath(path.toQString())); + qFatal("MakefileGenerator::fixLibFlag() called"); + return ProString(); } ProString @@ -2753,6 +2782,12 @@ MakefileGenerator::escapeFilePaths(const ProStringList &paths) const return ret; } +ProString +MakefileGenerator::escapeDependencyPath(const ProString &path) const +{ + return ProString(escapeDependencyPath(path.toQString())); +} + QStringList MakefileGenerator::escapeDependencyPaths(const QStringList &paths) const { @@ -2771,24 +2806,6 @@ MakefileGenerator::escapeDependencyPaths(const ProStringList &paths) const return ret; } -QStringList -MakefileGenerator::unescapeFilePaths(const QStringList &paths) const -{ - QStringList ret; - for(int i = 0; i < paths.size(); ++i) - ret.append(unescapeFilePath(paths.at(i))); - return ret; -} - -ProStringList -MakefileGenerator::unescapeFilePaths(const ProStringList &paths) const -{ - ProStringList ret; - for (int i = 0; i < paths.size(); ++i) - ret.append(unescapeFilePath(paths.at(i))); - return ret; -} - QStringList MakefileGenerator::fileFixify(const QStringList& files, const QString &out_dir, const QString &in_dir, FileFixifyType fix, bool canon) const @@ -2809,7 +2826,7 @@ MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const Q { if(file.isEmpty()) return file; - QString ret = unescapeFilePath(file); + QString ret = file; //do the fixin' QString orig_file = ret; @@ -3223,9 +3240,9 @@ MakefileGenerator::writePkgConfigFile() } ProString bundle; if (!project->isEmpty("QMAKE_FRAMEWORK_BUNDLE_NAME")) - bundle = unescapeFilePath(project->first("QMAKE_FRAMEWORK_BUNDLE_NAME")); + bundle = project->first("QMAKE_FRAMEWORK_BUNDLE_NAME"); else - bundle = unescapeFilePath(project->first("TARGET")); + bundle = project->first("TARGET"); int suffix = bundle.lastIndexOf(".framework"); if (suffix != -1) bundle = bundle.left(suffix); @@ -3233,11 +3250,11 @@ MakefileGenerator::writePkgConfigFile() } else { if (!project->values("QMAKE_DEFAULT_LIBDIRS").contains(libDir)) t << "-L${libdir} "; - pkgConfiglibName = "-l" + unescapeFilePath(project->first("QMAKE_ORIG_TARGET")); + pkgConfiglibName = "-l" + project->first("QMAKE_ORIG_TARGET"); if (project->isActiveConfig("shared")) pkgConfiglibName += project->first("TARGET_VERSION_EXT").toQString(); } - t << pkgConfiglibName << " \n"; + t << shellQuote(pkgConfiglibName) << " \n"; ProStringList libs; if(!project->isEmpty("QMAKE_INTERNAL_PRL_LIBS")) { @@ -3249,7 +3266,7 @@ MakefileGenerator::writePkgConfigFile() libs << "QMAKE_LFLAGS_THREAD"; //not sure about this one, but what about things like -pthread? t << "Libs.private: "; for (ProStringList::ConstIterator it = libs.begin(); it != libs.end(); ++it) { - t << project->values((*it).toKey()).join(' ') << " "; + t << fixLibFlags((*it).toKey()).join(' ') << ' '; } t << endl; @@ -3287,7 +3304,7 @@ QString MakefileGenerator::installMetaFile(const ProKey &replace_rule, const QSt QString ret; if (project->isEmpty(replace_rule) || project->isActiveConfig("no_sed_meta_install")) { - ret += "-$(INSTALL_FILE) \"" + src + "\" \"" + dst + "\""; + ret += "-$(INSTALL_FILE) " + escapeFilePath(src) + ' ' + escapeFilePath(dst); } else { ret += "-$(SED)"; const ProStringList &replace_rules = project->values(replace_rule); @@ -3301,7 +3318,7 @@ QString MakefileGenerator::installMetaFile(const ProKey &replace_rule, const QSt + "," + windowsifyPath(replace.toQString()) + ",gi"); } } - ret += " \"" + src + "\" >\"" + dst + "\""; + ret += ' ' + escapeFilePath(src) + " > " + escapeFilePath(dst); } return ret; } diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h index 972127916c..7282d3ad1f 100644 --- a/qmake/generators/makefile.h +++ b/qmake/generators/makefile.h @@ -133,15 +133,12 @@ protected: QMakeProject *project; //escape - virtual QString unescapeFilePath(const QString &path) const; - ProString unescapeFilePath(const ProString &path) const; - virtual QStringList unescapeFilePaths(const QStringList &path) const; - ProStringList unescapeFilePaths(const ProStringList &path) const; virtual QString escapeFilePath(const QString &path) const { return path; } ProString escapeFilePath(const ProString &path) const; QStringList escapeFilePaths(const QStringList &paths) const; ProStringList escapeFilePaths(const ProStringList &paths) const; virtual QString escapeDependencyPath(const QString &path) const { return escapeFilePath(path); } + ProString escapeDependencyPath(const ProString &path) const; QStringList escapeDependencyPaths(const QStringList &paths) const; ProStringList escapeDependencyPaths(const ProStringList &paths) const; @@ -211,6 +208,10 @@ protected: QString varGlue(const ProKey &var, const QString &before, const QString &glue, const QString &after) const; QString varList(const ProKey &var) const; QString fixFileVarGlue(const ProKey &var, const QString &before, const QString &glue, const QString &after) const; + QString fileVarList(const ProKey &var) const; + QString fileVarGlue(const ProKey &var, const QString &before, const QString &glue, const QString &after) const; + QString fileVar(const ProKey &var) const; + QString depVar(const ProKey &var) const; QString val(const ProStringList &varList) const; QString val(const QStringList &varList) const; QString valGlue(const QStringList &varList, const QString &before, const QString &glue, const QString &after) const; @@ -220,6 +221,9 @@ protected: QString filePrefixRoot(const QString &, const QString &); + ProStringList fixLibFlags(const ProKey &var); + virtual ProString fixLibFlag(const ProString &lib); + //file fixification to unify all file names into a single pattern enum FileFixifyType { FileFixifyAbsolute, FileFixifyRelative, FileFixifyDefault }; QString fileFixify(const QString& file, const QString &out_dir=QString(), diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index b4bc49438e..2c98e716d0 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -75,8 +75,6 @@ UnixMakefileGenerator::init() if(project->isEmpty("QMAKE_SYMBOLIC_LINK")) project->values("QMAKE_SYMBOLIC_LINK").append("ln -f -s"); - if (!project->isEmpty("TARGET")) - project->values("TARGET") = escapeFilePaths(project->values("TARGET")); project->values("QMAKE_ORIG_TARGET") = project->values("TARGET"); //version handling @@ -111,8 +109,8 @@ UnixMakefileGenerator::init() } project->values("QMAKE_ORIG_DESTDIR") = project->values("DESTDIR"); - project->values("QMAKE_LIBS") += escapeFilePaths(project->values("LIBS")); - project->values("QMAKE_LIBS_PRIVATE") += escapeFilePaths(project->values("LIBS_PRIVATE")); + project->values("QMAKE_LIBS") += project->values("LIBS"); + project->values("QMAKE_LIBS_PRIVATE") += project->values("LIBS_PRIVATE"); if((!project->isEmpty("QMAKE_LIB_FLAG") && !project->isActiveConfig("staticlib")) || (project->isActiveConfig("qt") && project->isActiveConfig("plugin"))) { if(configs.indexOf("dll") == -1) configs.append("dll"); @@ -194,11 +192,13 @@ UnixMakefileGenerator::init() pchBaseName += project->first("QMAKE_ORIG_TARGET").toQString(); // replace place holders - pchFlags.replace("${QMAKE_PCH_INPUT}", project->first("PRECOMPILED_HEADER").toQString()); - pchFlags.replace("${QMAKE_PCH_OUTPUT_BASE}", pchBaseName); + pchFlags.replace("${QMAKE_PCH_INPUT}", + escapeFilePath(project->first("PRECOMPILED_HEADER").toQString())); + pchFlags.replace("${QMAKE_PCH_OUTPUT_BASE}", escapeFilePath(pchBaseName)); if (project->isActiveConfig("icc_pch_style")) { // icc style - pchFlags.replace("${QMAKE_PCH_OUTPUT}", pchBaseName + project->first("QMAKE_PCH_OUTPUT_EXT")); + pchFlags.replace("${QMAKE_PCH_OUTPUT}", + escapeFilePath(pchBaseName + project->first("QMAKE_PCH_OUTPUT_EXT"))); } else { // gcc style (including clang_pch_style) QString headerSuffix; @@ -222,7 +222,8 @@ UnixMakefileGenerator::init() } if(!pchOutputFile.isEmpty()) { - pchFlags.replace("${QMAKE_PCH_OUTPUT}", pchBaseName + pchOutputFile + headerSuffix); + pchFlags.replace("${QMAKE_PCH_OUTPUT}", + escapeFilePath(pchBaseName + pchOutputFile + headerSuffix)); } } @@ -253,15 +254,15 @@ UnixMakefileGenerator::init() ((project->isActiveConfig("build_pass") || project->isEmpty("BUILDS")))) { ProString bundle; if(project->isActiveConfig("bundle") && !project->isEmpty("QMAKE_BUNDLE_EXTENSION")) { - bundle = unescapeFilePath(project->first("TARGET")); + bundle = project->first("TARGET"); if(!project->isEmpty("QMAKE_BUNDLE_NAME")) - bundle = unescapeFilePath(project->first("QMAKE_BUNDLE_NAME")); + bundle = project->first("QMAKE_BUNDLE_NAME"); if(!bundle.endsWith(project->first("QMAKE_BUNDLE_EXTENSION"))) bundle += project->first("QMAKE_BUNDLE_EXTENSION"); } else if(project->first("TEMPLATE") == "app" && project->isActiveConfig("app_bundle")) { - bundle = unescapeFilePath(project->first("TARGET")); + bundle = project->first("TARGET"); if(!project->isEmpty("QMAKE_APPLICATION_BUNDLE_NAME")) - bundle = unescapeFilePath(project->first("QMAKE_APPLICATION_BUNDLE_NAME")); + bundle = project->first("QMAKE_APPLICATION_BUNDLE_NAME"); if(!bundle.endsWith(".app")) bundle += ".app"; if(project->isEmpty("QMAKE_BUNDLE_LOCATION")) @@ -271,10 +272,10 @@ UnixMakefileGenerator::init() } else if(project->first("TEMPLATE") == "lib" && !project->isActiveConfig("staticlib") && ((!project->isActiveConfig("plugin") && project->isActiveConfig("lib_bundle")) || (project->isActiveConfig("plugin") && project->isActiveConfig("plugin_bundle")))) { - bundle = unescapeFilePath(project->first("TARGET")); + bundle = project->first("TARGET"); if(project->isActiveConfig("plugin")) { if(!project->isEmpty("QMAKE_PLUGIN_BUNDLE_NAME")) - bundle = unescapeFilePath(project->first("QMAKE_PLUGIN_BUNDLE_NAME")); + bundle = project->first("QMAKE_PLUGIN_BUNDLE_NAME"); if (project->isEmpty("QMAKE_BUNDLE_EXTENSION")) project->values("QMAKE_BUNDLE_EXTENSION").append(".plugin"); if (!bundle.endsWith(project->first("QMAKE_BUNDLE_EXTENSION"))) @@ -283,7 +284,7 @@ UnixMakefileGenerator::init() project->values("QMAKE_BUNDLE_LOCATION").append("Contents/MacOS"); } else { if(!project->isEmpty("QMAKE_FRAMEWORK_BUNDLE_NAME")) - bundle = unescapeFilePath(project->first("QMAKE_FRAMEWORK_BUNDLE_NAME")); + bundle = project->first("QMAKE_FRAMEWORK_BUNDLE_NAME"); if (project->isEmpty("QMAKE_BUNDLE_EXTENSION")) project->values("QMAKE_BUNDLE_EXTENSION").append(".framework"); if (!bundle.endsWith(project->first("QMAKE_BUNDLE_EXTENSION"))) @@ -354,7 +355,7 @@ UnixMakefileGenerator::init() if(QDir::isRelativePath(rpath)) rpath.prepend(Option::output_dir + Option::dir_sep); } - comp_flags += " -rpath " + Option::fixPathToTargetOS(rpath, false); + comp_flags += " -rpath " + escapeFilePath(Option::fixPathToTargetOS(rpath, false)); } } } @@ -439,6 +440,12 @@ QStringList return ret; } +ProString +UnixMakefileGenerator::fixLibFlag(const ProString &lib) +{ + return escapeFilePath(lib); +} + bool UnixMakefileGenerator::findLibraries() { @@ -465,7 +472,7 @@ UnixMakefileGenerator::findLibraries() } libdirs.insert(libidx++, f); if (!libArg.isEmpty()) - *it = libArg + lib; + *it = libArg + f.real(); } else if(opt.startsWith("-l")) { if (project->isActiveConfig("rvct_linker") || project->isActiveConfig("armcc_linker")) { (*it) = "lib" + opt.mid(2) + ".so"; @@ -619,7 +626,7 @@ UnixMakefileGenerator::processPrlFiles() ProStringList &prl_libs = project->values("QMAKE_CURRENT_PRL_LIBS"); if(!prl_libs.isEmpty()) { for(int prl = 0; prl < prl_libs.size(); ++prl) - l.insert(lit+prl+1, escapeFilePath(prl_libs.at(prl).toQString())); + l.insert(lit+prl+1, prl_libs.at(prl).toQString()); prl_libs.clear(); } } @@ -739,30 +746,31 @@ UnixMakefileGenerator::defaultInstall(const QString &t) } for(int i = 0; i < targets.size(); ++i) { QString src = targets.at(i).toQString(), - dst = filePrefixRoot(root, targetdir + src.section('/', -1)); + dst = escapeFilePath(filePrefixRoot(root, targetdir + src.section('/', -1))); if(!ret.isEmpty()) ret += "\n\t"; - ret += "-$(INSTALL_FILE) \"" + src + "\" \"" + dst + "\""; + ret += "-$(INSTALL_FILE) " + escapeFilePath(src) + ' ' + dst; if(!uninst.isEmpty()) uninst.append("\n\t"); - uninst.append("-$(DEL_FILE) \"" + dst + "\""); + uninst.append("-$(DEL_FILE) " + dst); } if (bundle == NoBundle && project->isActiveConfig("compile_libtool")) { - QString src_targ = target; + QString src_targ = escapeFilePath(target); if(src_targ == "$(TARGET)") src_targ = "$(TARGETL)"; QString dst_dir = fileFixify(targetdir, FileFixifyAbsolute); if(QDir::isRelativePath(dst_dir)) dst_dir = Option::fixPathToTargetOS(Option::output_dir + Option::dir_sep + dst_dir); - ret = "-$(LIBTOOL) --mode=install cp \"" + src_targ + "\" \"" + filePrefixRoot(root, dst_dir) + "\""; - uninst.append("-$(LIBTOOL) --mode=uninstall \"" + src_targ + "\""); + ret = "-$(LIBTOOL) --mode=install cp " + src_targ + ' ' + escapeFilePath(filePrefixRoot(root, dst_dir)); + uninst.append("-$(LIBTOOL) --mode=uninstall " + src_targ); } else { QString src_targ = target; if(!destdir.isEmpty()) src_targ = Option::fixPathToTargetOS(destdir + target, false); QString plain_targ = filePrefixRoot(root, fileFixify(targetdir + target, FileFixifyAbsolute)); QString dst_targ = plain_targ; + plain_targ = escapeFilePath(plain_targ); if (bundle != NoBundle) { QString suffix; if (project->first("TEMPLATE") == "lib") @@ -773,33 +781,34 @@ UnixMakefileGenerator::defaultInstall(const QString &t) if (bundle == SolidBundle) { if (!ret.isEmpty()) ret += "\n\t"; - ret += "$(DEL_FILE) -r \"" + plain_targ + "\"\n\t"; + ret += "$(DEL_FILE) -r " + plain_targ + "\n\t"; } else { src_targ += suffix; } } + src_targ = escapeFilePath(src_targ); + dst_targ = escapeFilePath(dst_targ); if(!ret.isEmpty()) ret += "\n\t"; QString copy_cmd("-"); if (bundle == SolidBundle) { - copy_cmd += "$(INSTALL_DIR) \"" + src_targ + "\" \"" + plain_targ + "\""; + copy_cmd += "$(INSTALL_DIR) " + src_targ + ' ' + plain_targ; } else if (project->first("TEMPLATE") == "lib" && project->isActiveConfig("staticlib")) { - copy_cmd += "$(INSTALL_FILE) \"" + src_targ + "\" \"" + dst_targ + "\""; + copy_cmd += "$(INSTALL_FILE) " + src_targ + ' ' + dst_targ; } else { if (bundle == SlicedBundle) - ret += mkdir_p_asstring("\"`dirname \"" + dst_targ + "\"`\"", false) + "\n\t"; - copy_cmd += "$(INSTALL_PROGRAM) \"" + src_targ + "\" \"" + dst_targ + "\""; + ret += mkdir_p_asstring("\"`dirname " + dst_targ + "`\"", false) + "\n\t"; + copy_cmd += "$(INSTALL_PROGRAM) " + src_targ + ' ' + dst_targ; } if(project->first("TEMPLATE") == "lib" && !project->isActiveConfig("staticlib") && project->values(ProKey(t + ".CONFIG")).indexOf("fix_rpath") != -1) { if(!project->isEmpty("QMAKE_FIX_RPATH")) { ret += copy_cmd; - ret += "\n\t-" + var("QMAKE_FIX_RPATH") + " \"" + - dst_targ + "\" \"" + dst_targ + "\""; + ret += "\n\t-" + var("QMAKE_FIX_RPATH") + ' ' + dst_targ + ' ' + dst_targ; } else if(!project->isEmpty("QMAKE_LFLAGS_RPATH")) { - ret += "-$(LINK) $(LFLAGS) " + var("QMAKE_LFLAGS_RPATH") + targetdir + " -o \"" + - dst_targ + "\" $(OBJECTS) $(LIBS) $(OBJCOMP)"; + ret += "-$(LINK) $(LFLAGS) " + var("QMAKE_LFLAGS_RPATH") + targetdir + " -o " + + dst_targ + " $(OBJECTS) $(LIBS) $(OBJCOMP)"; } else { ret += copy_cmd; } @@ -809,7 +818,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t) if(project->first("TEMPLATE") == "lib" && project->isActiveConfig("staticlib")) { if(!project->isEmpty("QMAKE_RANLIB")) - ret += QString("\n\t$(RANLIB) \"") + dst_targ + "\""; + ret += QString("\n\t$(RANLIB) ") + dst_targ; } else if (!project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") && !project->isEmpty("QMAKE_STRIP")) { ret += "\n\t-$(STRIP)"; @@ -820,27 +829,28 @@ UnixMakefileGenerator::defaultInstall(const QString &t) if (!project->isEmpty("QMAKE_STRIPFLAGS_APP")) ret += " " + var("QMAKE_STRIPFLAGS_APP"); } - ret += " \"" + dst_targ + "\""; + ret += ' ' + dst_targ; } if(!uninst.isEmpty()) uninst.append("\n\t"); if (bundle == SolidBundle) - uninst.append("-$(DEL_FILE) -r \"" + plain_targ + "\""); + uninst.append("-$(DEL_FILE) -r " + plain_targ); else - uninst.append("-$(DEL_FILE) \"" + dst_targ + "\""); + uninst.append("-$(DEL_FILE) " + dst_targ); if (bundle == SlicedBundle) { int dstlen = project->first("DESTDIR").length(); foreach (const ProString &src, project->values("QMAKE_BUNDLED_FILES")) { - QString file = unescapeFilePath(src.toQString()).mid(dstlen); - QString dst = filePrefixRoot(root, fileFixify(targetdir + file, FileFixifyAbsolute)); + ProString file = src.mid(dstlen); + QString dst = escapeFilePath( + filePrefixRoot(root, fileFixify(targetdir + file, FileFixifyAbsolute))); if (!ret.isEmpty()) ret += "\n\t"; - ret += mkdir_p_asstring("\"`dirname \"" + dst + "\"`\"", false) + "\n\t"; - ret += "-$(DEL_FILE) \"" + dst + "\"\n\t"; // Can't overwrite symlinks to directories - ret += "-$(INSTALL_DIR) " + src + " \"" + dst + "\""; // Use cp -R to copy symlinks + ret += mkdir_p_asstring("\"`dirname " + dst + "`\"", false) + "\n\t"; + ret += "-$(DEL_FILE) " + dst + "\n\t"; // Can't overwrite symlinks to directories + ret += "-$(INSTALL_DIR) " + escapeFilePath(src) + " " + dst; // Use cp -R to copy symlinks if (!uninst.isEmpty()) uninst.append("\n\t"); - uninst.append("-$(DEL_FILE) \"" + dst + "\""); + uninst.append("-$(DEL_FILE) " + dst); } } if(!links.isEmpty()) { @@ -850,11 +860,12 @@ UnixMakefileGenerator::defaultInstall(const QString &t) int lslash = link.lastIndexOf(Option::dir_sep); if(lslash != -1) link = link.right(link.length() - (lslash + 1)); - QString dst_link = filePrefixRoot(root, fileFixify(targetdir + link, FileFixifyAbsolute)); - ret += "\n\t-$(SYMLINK) \"$(TARGET)\" \"" + dst_link + "\""; + QString dst_link = escapeFilePath( + filePrefixRoot(root, fileFixify(targetdir + link, FileFixifyAbsolute))); + ret += "\n\t-$(SYMLINK) $(TARGET) " + dst_link; if(!uninst.isEmpty()) uninst.append("\n\t"); - uninst.append("-$(DEL_FILE) \"" + dst_link + "\""); + uninst.append("-$(DEL_FILE) " + dst_link); } } } @@ -879,7 +890,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t) QString dst_meta = filePrefixRoot(root, fileFixify(targetdir + meta, FileFixifyAbsolute)); if(!uninst.isEmpty()) uninst.append("\n\t"); - uninst.append("-$(DEL_FILE) \"" + dst_meta + "\""); + uninst.append("-$(DEL_FILE) " + escapeFilePath(dst_meta)); const QString dst_meta_dir = fileInfo(dst_meta).path(); if(!dst_meta_dir.isEmpty()) { if(!ret.isEmpty()) @@ -900,8 +911,8 @@ UnixMakefileGenerator::escapeFilePath(const QString &path) const { QString ret = path; if(!ret.isEmpty()) { - ret = unescapeFilePath(ret).replace(QLatin1Char(' '), QLatin1String("\\ ")) - .replace(QLatin1Char('\t'), QLatin1String("\\\t")); + ret.replace(QLatin1Char(' '), QLatin1String("\\ ")) + .replace(QLatin1Char('\t'), QLatin1String("\\\t")); debug_msg(2, "EscapeFilePath: %s -> %s", path.toLatin1().constData(), ret.toLatin1().constData()); } return ret; diff --git a/qmake/generators/unix/unixmake.h b/qmake/generators/unix/unixmake.h index 3a2ba06c0c..b136ea04d0 100644 --- a/qmake/generators/unix/unixmake.h +++ b/qmake/generators/unix/unixmake.h @@ -53,6 +53,7 @@ protected: virtual bool doPrecompiledHeaders() const { return project->isActiveConfig("precompile_header"); } virtual bool doDepends() const { return !Option::mkfile::do_stub_makefile && MakefileGenerator::doDepends(); } virtual QString defaultInstall(const QString &); + virtual ProString fixLibFlag(const ProString &lib); virtual void processPrlFiles(); virtual bool findLibraries(); diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 05b96f3ec6..641b475cba 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -101,7 +101,7 @@ UnixMakefileGenerator::writeDefaultVariables(QTextStream &t) distname += project->first("VERSION"); project->values("QMAKE_DISTNAME") = distname; } - t << "DISTNAME = " << var("QMAKE_DISTNAME") << endl; + t << "DISTNAME = " << fileVar("QMAKE_DISTNAME") << endl; if (project->isEmpty("QMAKE_DISTDIR")) project->values("QMAKE_DISTDIR") = project->first("QMAKE_DISTNAME"); @@ -127,7 +127,7 @@ UnixMakefileGenerator::writeSubTargets(QTextStream &t, QListfirst("QMAKE_ABSOLUTE_SOURCE_PATH").toQString(); for (int target = 0; target < targets.size(); ++target) { @@ -148,8 +148,9 @@ UnixMakefileGenerator::writeSubTargets(QTextStream &t, QListmakefile + " distdir DISTDIR=$(DISTDIR)" + dist_directory; + : "\n\tcd " + escapeFilePath(out_directory) + " && "; + QString makefilein = " -e -f " + escapeFilePath(subtarget->makefile) + + " distdir DISTDIR=$(DISTDIR)" + escapeFilePath(dist_directory); QString out = subtarget->makefile; QString in = escapeFilePath(fileFixify(in_directory + subtarget->profile, FileFixifyAbsolute)); @@ -157,7 +158,7 @@ UnixMakefileGenerator::writeSubTargets(QTextStream &t, QListtarget << "-distdir: FORCE"; - writeSubTargetCall(t, in_directory, in, out_directory, out, + writeSubTargetCall(t, in_directory, in, out_directory, escapeFilePath(out), out_directory_cdin, makefilein); t << endl; } @@ -166,7 +167,6 @@ UnixMakefileGenerator::writeSubTargets(QTextStream &t, QListisActiveConfig("incremental") && !project->values("QMAKE_INCREMENTAL").isEmpty() && (!project->values("QMAKE_APP_FLAG").isEmpty() || @@ -188,14 +188,15 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) QString isystem = var("QMAKE_CFLAGS_ISYSTEM"); const ProStringList &incs = project->values("INCLUDEPATH"); for(int i = 0; i < incs.size(); ++i) { - ProString inc = escapeFilePath(incs.at(i)); + const ProString &inc = incs.at(i); if (inc.isEmpty()) continue; if (!isystem.isEmpty() && isSystemInclude(inc.toQString())) - t << ' ' << isystem << ' ' << inc; + t << ' ' << isystem << ' '; else - t << " -I" << inc; + t << " -I"; + t << escapeFilePath(inc); } } if(!project->isEmpty("QMAKE_FRAMEWORKPATH_FLAGS")) @@ -207,7 +208,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if(!project->isActiveConfig("staticlib")) { t << "LINK = " << var("QMAKE_LINK") << endl; t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl; - t << "LIBS = $(SUBLIBS) " << var("QMAKE_LIBS") << " " << var("QMAKE_LIBS_PRIVATE") << endl; + t << "LIBS = $(SUBLIBS) " << fixLibFlags("QMAKE_LIBS").join(' ') << ' ' + << fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << endl; } t << "AR = " << var("QMAKE_AR") << endl; @@ -220,16 +222,17 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << endl; t << "####### Output directory\n\n"; + // This is used in commands by some .prf files. if (! project->values("OBJECTS_DIR").isEmpty()) - t << "OBJECTS_DIR = " << var("OBJECTS_DIR") << endl; + t << "OBJECTS_DIR = " << fileVar("OBJECTS_DIR") << endl; else t << "OBJECTS_DIR = ./\n"; t << endl; /* files */ t << "####### Files\n\n"; - t << "SOURCES = " << valList(escapeFilePaths(project->values("SOURCES"))) << " " - << valList(escapeFilePaths(project->values("GENERATED_SOURCES"))) << endl; + // This is used by the dist target. + t << "SOURCES = " << fileVarList("SOURCES") << ' ' << fileVarList("GENERATED_SOURCES") << endl; if(do_incremental) { const ProStringList &objs = project->values("OBJECTS"); const ProStringList &incrs = project->values("QMAKE_INCREMENTAL"); @@ -258,37 +261,37 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << "INCREMENTAL_OBJECTS = " << escapeFilePaths(incrs_out).join(" \\\n\t\t") << endl; } } else { - t << "OBJECTS = " << valList(escapeFilePaths(project->values("OBJECTS"))) << endl; + // Used all over the place in both deps and commands. + t << "OBJECTS = " << valList(escapeDependencyPaths(project->values("OBJECTS"))) << endl; } if(do_incremental && !src_incremental) do_incremental = false; t << "DIST = " << valList(fileFixify(project->values("DISTFILES").toQStringList())) << " " - << valList(escapeFilePaths(project->values("HEADERS"))) << " " - << valList(escapeFilePaths(project->values("SOURCES"))) << endl; - t << "QMAKE_TARGET = " << var("QMAKE_ORIG_TARGET") << endl; + << fileVarList("HEADERS") << ' ' << fileVarList("SOURCES") << endl; + t << "QMAKE_TARGET = " << fileVar("QMAKE_ORIG_TARGET") << endl; // The comment is important for mingw32-make.exe on Windows as otherwise trailing slashes // would be interpreted as line continuation. The lack of spacing between the value and the // comment is also important as otherwise quoted use of "$(DESTDIR)" would include this // spacing. - t << "DESTDIR = " << var("DESTDIR") << "#avoid trailing-slash linebreak\n"; + t << "DESTDIR = " << fileVar("DESTDIR") << "#avoid trailing-slash linebreak\n"; if(project->isActiveConfig("compile_libtool")) - t << "TARGETL = " << var("TARGET_la") << endl; - t << "TARGET = " << escapeFilePath(var("TARGET")) << endl; + t << "TARGETL = " << fileVar("TARGET_la") << endl; + t << "TARGET = " << fileVar("TARGET") << endl; // ### mixed use! if(project->isActiveConfig("plugin")) { - t << "TARGETD = " << escapeFilePath(var("TARGET")) << endl; + t << "TARGETD = " << fileVar("TARGET") << endl; } else if(!project->isActiveConfig("staticlib") && project->values("QMAKE_APP_FLAG").isEmpty()) { - t << "TARGETA = " << escapeFilePath(var("TARGETA")) << endl; + t << "TARGETA = " << fileVar("TARGETA") << endl; // ### mixed use! if(!project->isEmpty("QMAKE_BUNDLE")) { - t << "TARGETD = " << escapeFilePath(var("TARGET_x.y")) << endl; - t << "TARGET0 = " << escapeFilePath(var("TARGET_")) << endl; + t << "TARGETD = " << fileVar("TARGET_x.y") << endl; + t << "TARGET0 = " << fileVar("TARGET_") << endl; } else if (!project->isActiveConfig("unversioned_libname")) { - t << "TARGET0 = " << escapeFilePath(var("TARGET_")) << endl; + t << "TARGET0 = " << fileVar("TARGET_") << endl; if (project->isEmpty("QMAKE_HPUX_SHLIB")) { - t << "TARGETD = " << escapeFilePath(var("TARGET_x.y.z")) << endl; - t << "TARGET1 = " << escapeFilePath(var("TARGET_x")) << endl; - t << "TARGET2 = " << escapeFilePath(var("TARGET_x.y")) << endl; + t << "TARGETD = " << fileVar("TARGET_x.y.z") << endl; + t << "TARGET1 = " << fileVar("TARGET_x") << endl; + t << "TARGET2 = " << fileVar("TARGET_x.y") << endl; } else { - t << "TARGETD = " << escapeFilePath(var("TARGET_x")) << endl; + t << "TARGETD = " << fileVar("TARGET_x") << endl; } } } @@ -300,7 +303,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) const ProStringList &qeui = project->values("QMAKE_EXTRA_INCLUDES"); ProStringList::ConstIterator it; for(it = qeui.begin(); it != qeui.end(); ++it) - t << "include " << (*it) << endl; + t << "include " << escapeDependencyPath(*it) << endl; /* rules */ t << "first: all\n"; @@ -321,29 +324,30 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) ProStringList objects = project->values("OBJECTS"); for (ProStringList::Iterator it = objects.begin(); it != objects.end(); ++it) { QString d_file = (*it).toQString().replace(QRegExp(Option::obj_ext + "$"), ".d"); - t << "-include " << d_file << endl; + t << "-include " << escapeDependencyPath(d_file) << endl; project->values("QMAKE_DISTCLEAN") << d_file; } } else { QString cmd=var("QMAKE_CFLAGS_DEPS") + " "; cmd += varGlue("DEFINES","-D"," -D","") + varGlue("PRL_EXPORT_DEFINES"," -D"," -D",""); if(!project->isEmpty("QMAKE_ABSOLUTE_SOURCE_PATH")) - cmd += " -I" + project->first("QMAKE_ABSOLUTE_SOURCE_PATH") + " "; - cmd += " $(INCPATH) " + varGlue("DEPENDPATH", "-I", " -I", ""); + cmd += " -I" + fileVar("QMAKE_ABSOLUTE_SOURCE_PATH") + ' '; + cmd += " $(INCPATH) " + fileVarGlue("DEPENDPATH", "-I", " -I", ""); ProString odir; if(!project->values("OBJECTS_DIR").isEmpty()) odir = project->first("OBJECTS_DIR"); + QString odird = escapeDependencyPath(odir.toQString()); QString pwd = escapeFilePath(fileFixify(qmake_getpwd())); t << "###### Dependencies\n\n"; - t << odir << ".deps/%.d: " << pwd << "/%.cpp\n\t"; + t << odird << ".deps/%.d: " << pwd << "/%.cpp\n\t"; if(project->isActiveConfig("echo_depend_creation")) t << "@echo Creating depend for $<\n\t"; t << mkdir_p_asstring("$(@D)", false) << "\n\t" << "@$(CXX) " << cmd << " $< | sed \"s,^\\($(*F).o\\):," << odir << "\\1:,g\" >$@\n\n"; - t << odir << ".deps/%.d: " << pwd << "/%.c\n\t"; + t << odird << ".deps/%.d: " << pwd << "/%.c\n\t"; if(project->isActiveConfig("echo_depend_creation")) t << "@echo Creating depend for $<\n\t"; t << mkdir_p_asstring("$(@D)", false) << "\n\t" @@ -374,11 +378,12 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if(!d_file.isEmpty()) { d_file = odir + ".deps/" + fileFixify(d_file, pwd, Option::output_dir) + ".d"; + QString d_file_d = escapeDependencyPath(d_file); QStringList deps = findDependencies((*it).toQString()).filter(QRegExp( "((^|/)" + Option::h_moc_mod + "|" + Option::cpp_moc_ext + "$)")); if(!deps.isEmpty()) - t << d_file << ": " << deps.join(' ') << endl; - t << "-include " << d_file << endl; + t << d_file_d << ": " << escapeDependencyPaths(deps).join(' ') << endl; + t << "-include " << d_file_d << endl; project->values("QMAKE_DISTCLEAN") += d_file; } } @@ -395,10 +400,11 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << "SUBLIBS = "; const ProStringList &l = project->values("SUBLIBS"); for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) - t << libdir << project->first("QMAKE_PREFIX_STATICLIB") << (*it) << "." - << project->first("QMAKE_EXTENSION_STATICLIB") << " "; + t << escapeFilePath(libdir + project->first("QMAKE_PREFIX_STATICLIB") + (*it) + '.' + + project->first("QMAKE_EXTENSION_STATICLIB")) << ' '; t << endl << endl; } + QString target_deps; if ((project->isActiveConfig("depend_prl") || project->isActiveConfig("fast_depend_prl")) && !project->isEmpty("QMAKE_PRL_INTERNAL_FILES")) { const ProStringList &l = project->values("QMAKE_PRL_INTERNAL_FILES"); @@ -411,18 +417,20 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if(slsh != -1) dir = (*it).left(slsh + 1); QString targ = dir + libinfo.first("QMAKE_PRL_TARGET"); - target_deps += " " + targ; - t << targ; + QString targ_d = escapeDependencyPath(targ); + target_deps += ' ' + targ_d; + t << targ_d; if (project->isActiveConfig("fast_depend_prl")) t << ":\n\t@echo \"Creating '"; else t << ": FORCE\n\t@echo \"Creating/updating '"; t << targ << "'\"\n\t" - << "(cd " << libinfo.first("QMAKE_PRL_BUILD_DIR") << ";" + << "(cd " << escapeFilePath(libinfo.first("QMAKE_PRL_BUILD_DIR")) << ';' << "$(MAKE))\n"; } } } + QString deps = escapeDependencyPath(fileFixify(Option::output.fileName())); QString allDeps; if (!project->values("QMAKE_APP_FLAG").isEmpty() || project->first("TEMPLATE") == "aux") { QString destdir = project->first("DESTDIR").toQString(); @@ -443,19 +451,23 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) QString incr_deps, incr_objs; if(project->first("QMAKE_INCREMENTAL_STYLE") == "ld") { QString incr_target_dir = var("OBJECTS_DIR") + incr_target + Option::obj_ext; + QString incr_target_dir_d = escapeDependencyPath(incr_target_dir); + QString incr_target_dir_f = escapeFilePath(incr_target_dir); //actual target - t << incr_target_dir << ": $(OBJECTS)\n\t" - << "ld -r -o "<< incr_target_dir << " $(OBJECTS)\n"; + t << incr_target_dir_d << ": $(OBJECTS)\n\t" + << "ld -r -o " << incr_target_dir_f << " $(OBJECTS)\n"; //communicated below - deps.prepend(incr_target_dir + " "); + deps.prepend(incr_target_dir_d + ' '); incr_deps = "$(INCREMENTAL_OBJECTS)"; if(!incr_objs.isEmpty()) incr_objs += " "; - incr_objs += incr_target_dir; + incr_objs += incr_target_dir_f; } else { //actual target QString incr_target_dir = var("DESTDIR") + "lib" + incr_target + "." + project->first("QMAKE_EXTENSION_SHLIB"); + QString incr_target_dir_d = escapeDependencyPath(incr_target_dir); + QString incr_target_dir_f = escapeFilePath(incr_target_dir); QString incr_lflags = var("QMAKE_LFLAGS_SHLIB") + " "; if(project->isActiveConfig("debug")) incr_lflags += var("QMAKE_LFLAGS_DEBUG"); @@ -463,31 +475,31 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) incr_lflags += var("QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO"); else incr_lflags += var("QMAKE_LFLAGS_RELEASE"); - t << incr_target_dir << ": $(INCREMENTAL_OBJECTS)\n\t"; + t << incr_target_dir_d << ": $(INCREMENTAL_OBJECTS)\n\t"; if(!destdir.isEmpty()) t << "\n\t" << mkdir_p_asstring(destdir) << "\n\t"; - t << "$(LINK) " << incr_lflags << " -o "<< incr_target_dir << + t << "$(LINK) " << incr_lflags << " -o "<< incr_target_dir_f << " $(INCREMENTAL_OBJECTS)\n"; //communicated below if(!destdir.isEmpty()) { if(!incr_objs.isEmpty()) incr_objs += " "; - incr_objs += "-L" + destdir; + incr_objs += "-L" + escapeFilePath(destdir); } else { if(!incr_objs.isEmpty()) incr_objs += " "; - incr_objs += "-L" + qmake_getpwd(); + incr_objs += "-L" + escapeFilePath(qmake_getpwd()); } if(!incr_objs.isEmpty()) incr_objs += " "; - incr_objs += " -l" + incr_target; - deps.prepend(incr_target_dir + " "); + incr_objs += " -l" + escapeFilePath(incr_target); + deps.prepend(incr_target_dir_d + ' '); incr_deps = "$(OBJECTS)"; } //real target - t << var("TARGET") << ": " << var("PRE_TARGETDEPS") << " " << incr_deps << " " << target_deps - << " " << var("POST_TARGETDEPS") << "\n\t"; + t << var("TARGET") << ": " << depVar("PRE_TARGETDEPS") << ' ' << incr_deps << ' ' << target_deps + << ' ' << depVar("POST_TARGETDEPS") << "\n\t"; if(!destdir.isEmpty()) t << "\n\t" << mkdir_p_asstring(destdir) << "\n\t"; if(!project->isEmpty("QMAKE_PRE_LINK")) @@ -497,8 +509,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << "\n\t" << var("QMAKE_POST_LINK"); t << endl << endl; } else { - t << "$(TARGET): " << var("PRE_TARGETDEPS") << " $(OBJECTS) " - << target_deps << " " << var("POST_TARGETDEPS") << "\n\t"; + t << "$(TARGET): " << depVar("PRE_TARGETDEPS") << " $(OBJECTS) " + << target_deps << ' ' << depVar("POST_TARGETDEPS") << "\n\t"; if (project->first("TEMPLATE") != "aux") { if (!destdir.isEmpty()) t << mkdir_p_asstring(destdir) << "\n\t"; @@ -512,16 +524,17 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } allDeps = " $(TARGET)"; } else if(!project->isActiveConfig("staticlib")) { - QString destdir = unescapeFilePath(project->first("DESTDIR").toQString()), incr_deps; + QString destdir_r = project->first("DESTDIR").toQString(), incr_deps; if(!project->isEmpty("QMAKE_BUNDLE")) { QString bundle_loc = project->first("QMAKE_BUNDLE_LOCATION").toQString(); if(!bundle_loc.isEmpty() && !bundle_loc.startsWith("/")) bundle_loc.prepend("/"); if(!bundle_loc.endsWith("/")) bundle_loc += "/"; - destdir += project->first("QMAKE_BUNDLE") + bundle_loc; + destdir_r += project->first("QMAKE_BUNDLE") + bundle_loc; } - destdir = escapeFilePath(destdir); + QString destdir_d = escapeDependencyPath(destdir_r); + QString destdir = escapeFilePath(destdir_r); if(do_incremental) { ProString s_ext = project->first("QMAKE_EXTENSION_SHLIB"); @@ -530,23 +543,26 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if(incr_target.indexOf(Option::dir_sep) != -1) incr_target = incr_target.right(incr_target.length() - (incr_target.lastIndexOf(Option::dir_sep) + 1)); - incr_target = escapeFilePath(incr_target); if(project->first("QMAKE_INCREMENTAL_STYLE") == "ld") { - QString incr_target_dir = escapeFilePath(var("OBJECTS_DIR") + incr_target + Option::obj_ext); + QString incr_target_dir = var("OBJECTS_DIR") + incr_target + Option::obj_ext; + QString incr_target_dir_d = escapeDependencyPath(incr_target_dir); + QString incr_target_dir_f = escapeFilePath(incr_target_dir); //actual target const QString link_deps = "$(OBJECTS) "; - t << incr_target_dir << ": " << link_deps << "\n\t" - << "ld -r -o " << incr_target_dir << " " << link_deps << endl; + t << incr_target_dir_d << ": " << link_deps << "\n\t" + << "ld -r -o " << incr_target_dir_f << ' ' << link_deps << endl; //communicated below ProStringList &cmd = project->values("QMAKE_LINK_SHLIB_CMD"); cmd[0] = cmd.at(0).toQString().replace("$(OBJECTS) ", "$(INCREMENTAL_OBJECTS)"); //ick - cmd.append(incr_target_dir); - deps.prepend(incr_target_dir + " "); + cmd.append(incr_target_dir_f); + deps.prepend(incr_target_dir_d + ' '); incr_deps = "$(INCREMENTAL_OBJECTS)"; } else { //actual target - QString incr_target_dir = escapeFilePath(destdir + "lib" + incr_target + "." + s_ext); + QString incr_target_dir = destdir_r + "lib" + incr_target + '.' + s_ext; + QString incr_target_dir_d = escapeDependencyPath(incr_target_dir); + QString incr_target_dir_f = escapeFilePath(incr_target_dir); QString incr_lflags = var("QMAKE_LFLAGS_SHLIB") + " "; if(!project->isEmpty("QMAKE_LFLAGS_INCREMENTAL")) incr_lflags += var("QMAKE_LFLAGS_INCREMENTAL") + " "; @@ -556,29 +572,29 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) incr_lflags += var("QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO"); else incr_lflags += var("QMAKE_LFLAGS_RELEASE"); - t << incr_target_dir << ": $(INCREMENTAL_OBJECTS)\n\t"; + t << incr_target_dir_d << ": $(INCREMENTAL_OBJECTS)\n\t"; if(!destdir.isEmpty()) t << mkdir_p_asstring(destdir, false) << "\n\t"; - t << "$(LINK) " << incr_lflags << " " << var("QMAKE_LINK_O_FLAG") << incr_target_dir << + t << "$(LINK) " << incr_lflags << ' ' << var("QMAKE_LINK_O_FLAG") << incr_target_dir_f << " $(INCREMENTAL_OBJECTS)\n"; //communicated below ProStringList &cmd = project->values("QMAKE_LINK_SHLIB_CMD"); if(!destdir.isEmpty()) cmd.append(" -L" + destdir); - cmd.append(" -l" + incr_target); - deps.prepend(incr_target_dir + " "); + cmd.append(" -l" + escapeFilePath(incr_target)); + deps.prepend(incr_target_dir_d + ' '); incr_deps = "$(OBJECTS)"; } //real target - t << destdir << "$(TARGET): " << var("PRE_TARGETDEPS") << " " - << incr_deps << " $(SUBLIBS) " << target_deps << " " << var("POST_TARGETDEPS"); + t << destdir_d << "$(TARGET): " << depVar("PRE_TARGETDEPS") << ' ' + << incr_deps << " $(SUBLIBS) " << target_deps << ' ' << depVar("POST_TARGETDEPS"); } else { - t << destdir << "$(TARGET): " << var("PRE_TARGETDEPS") + t << destdir_d << "$(TARGET): " << depVar("PRE_TARGETDEPS") << " $(OBJECTS) $(SUBLIBS) $(OBJCOMP) " << target_deps - << " " << var("POST_TARGETDEPS"); + << ' ' << depVar("POST_TARGETDEPS"); } - allDeps = ' ' + destdir + "$(TARGET)"; + allDeps = ' ' + destdir_d + "$(TARGET)"; if(!destdir.isEmpty()) t << "\n\t" << mkdir_p_asstring(destdir, false); if(!project->isEmpty("QMAKE_PRE_LINK")) @@ -598,8 +614,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << "\n\t" << var("QMAKE_POST_LINK"); t << endl << endl; } else if(!project->isEmpty("QMAKE_BUNDLE")) { - QString currentLink = destdir + "Versions/Current"; - bundledFiles << currentLink << destdir + "$(TARGET)"; + QString currentLink = destdir_r + "Versions/Current"; + QString currentLink_f = escapeDependencyPath(currentLink); + bundledFiles << currentLink << destdir_r + "$(TARGET)"; t << "\n\t" << "-$(DEL_FILE) $(TARGET) $(TARGET0) $(DESTDIR)$(TARGET0)\n\t" << var("QMAKE_LINK_SHLIB_CMD") << "\n\t" @@ -608,9 +625,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) << mkdir_p_asstring("\"`dirname $(DESTDIR)$(TARGET0)`\"", false) << "\n\t" << varGlue("QMAKE_LN_SHLIB", "-", " ", " Versions/Current/$(TARGET) $(DESTDIR)$(TARGET0)") << "\n\t" - << "-$(DEL_FILE) " << currentLink << "\n\t" + << "-$(DEL_FILE) " << currentLink_f << "\n\t" << varGlue("QMAKE_LN_SHLIB","-"," ", " " + project->first("QMAKE_FRAMEWORK_VERSION") + - " " + currentLink) << "\n\t"; + ' ' + currentLink_f) << "\n\t"; if(!project->isEmpty("QMAKE_POST_LINK")) t << "\n\t" << var("QMAKE_POST_LINK"); t << endl << endl; @@ -667,10 +684,10 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if (! project->isActiveConfig("plugin")) { t << "staticlib: $(TARGETA)\n\n"; - t << "$(TARGETA): " << var("PRE_TARGETDEPS") << " $(OBJECTS) $(OBJCOMP)"; + t << "$(TARGETA): " << depVar("PRE_TARGETDEPS") << " $(OBJECTS) $(OBJCOMP)"; if(do_incremental) t << " $(INCREMENTAL_OBJECTS)"; - t << " " << var("POST_TARGETDEPS") << "\n\t" + t << ' ' << depVar("POST_TARGETDEPS") << "\n\t" << "-$(DEL_FILE) $(TARGETA) \n\t" << var("QMAKE_AR_CMD"); if(do_incremental) @@ -680,15 +697,17 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << endl << endl; } } else { - QString destdir = project->first("DESTDIR").toQString(); - allDeps = ' ' + destdir + "$(TARGET)" - + varGlue("QMAKE_AR_SUBLIBS", ' ' + destdir, ' ' + destdir, ""); - t << "staticlib: " << destdir << "$(TARGET)\n\n"; + QString destdir_r = project->first("DESTDIR").toQString(); + QString destdir_d = escapeDependencyPath(destdir_r); + QString destdir = escapeFilePath(destdir_r); + allDeps = ' ' + destdir_d + "$(TARGET)" + + varGlue("QMAKE_AR_SUBLIBS", ' ' + destdir_d, ' ' + destdir_d, ""); + t << "staticlib: " << destdir_d << "$(TARGET)\n\n"; if(project->isEmpty("QMAKE_AR_SUBLIBS")) { - t << destdir << "$(TARGET): " << var("PRE_TARGETDEPS") - << " $(OBJECTS) $(OBJCOMP) " << var("POST_TARGETDEPS") << "\n\t"; + t << destdir_d << "$(TARGET): " << depVar("PRE_TARGETDEPS") + << " $(OBJECTS) $(OBJCOMP) " << depVar("POST_TARGETDEPS") << "\n\t"; if(!destdir.isEmpty()) - t << mkdir_p_asstring(destdir) << "\n\t"; + t << mkdir_p_asstring(destdir, false) << "\n\t"; t << "-$(DEL_FILE) $(TARGET)\n\t" << var("QMAKE_AR_CMD") << "\n"; if(!project->isEmpty("QMAKE_POST_LINK")) @@ -709,26 +728,27 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) for(int cnt = 0; cnt < max_files && objit != objs.end(); ++objit, cnt++) build << (*objit); QString ar; + ProString lib = escapeFilePath(*libit); if((*libit) == "$(TARGET)") { - t << destdir << "$(TARGET): " << var("PRE_TARGETDEPS") - << " " << var("POST_TARGETDEPS") << valList(build) << "\n\t"; + t << destdir_d << "$(TARGET): " << depVar("PRE_TARGETDEPS") + << ' ' << depVar("POST_TARGETDEPS") << valList(escapeDependencyPaths(build)) << "\n\t"; ar = project->first("QMAKE_AR_CMD").toQString(); - ar.replace("$(OBJECTS)", build.join(' ')); + ar.replace("$(OBJECTS)", escapeFilePaths(build).join(' ')); } else { - t << (*libit) << ": " << valList(build) << "\n\t"; - ar = "$(AR) " + (*libit) + " " + build.join(' '); + t << escapeDependencyPath(*libit) << ": " << valList(escapeDependencyPaths(build)) << "\n\t"; + ar = "$(AR) " + lib + ' ' + escapeFilePaths(build).join(' '); } if(!destdir.isEmpty()) - t << mkdir_p_asstring(destdir) << "\n\t"; - t << "-$(DEL_FILE) " << (*libit) << "\n\t" + t << mkdir_p_asstring(destdir, false) << "\n\t"; + t << "-$(DEL_FILE) " << lib << "\n\t" << ar << "\n"; if(!project->isEmpty("QMAKE_POST_LINK")) t << "\t" << var("QMAKE_POST_LINK") << "\n"; if(!project->isEmpty("QMAKE_RANLIB")) - t << "\t$(RANLIB) " << (*libit) << "\n"; + t << "\t$(RANLIB) " << lib << "\n"; if(!destdir.isEmpty()) - t << "\t-$(DEL_FILE) " << destdir << (*libit) << "\n" - << "\t-$(MOVE) " << (*libit) << " " << destdir << " \n"; + t << "\t-$(DEL_FILE) " << destdir << lib << "\n" + << "\t-$(MOVE) " << lib << ' ' << destdir << " \n"; } } t << endl << endl; @@ -746,7 +766,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } if(!meta_files.isEmpty()) t << escapeDependencyPaths(meta_files).join(" ") << ": \n\t" - << "@$(QMAKE) -prl " << buildArgs() << " " << project->projectFile() << endl; + << "@$(QMAKE) -prl " << buildArgs() << ' ' << escapeFilePath(project->projectFile()) << endl; } if (!project->isEmpty("QMAKE_BUNDLE")) { @@ -754,31 +774,35 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) ProStringList &alldeps = project->values("ALL_DEPS"); QString bundle_dir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/"; if (!project->first("QMAKE_PKGINFO").isEmpty()) { - ProString pkginfo = escapeFilePath(project->first("QMAKE_PKGINFO")); + ProString pkginfo = project->first("QMAKE_PKGINFO"); + ProString pkginfo_f = escapeFilePath(pkginfo); + ProString pkginfo_d = escapeDependencyPath(pkginfo); bundledFiles << pkginfo; alldeps << pkginfo; QString destdir = bundle_dir + "Contents"; - t << pkginfo << ": \n\t"; + t << pkginfo_d << ": \n\t"; if (!destdir.isEmpty()) t << mkdir_p_asstring(destdir) << "\n\t"; - t << "@$(DEL_FILE) " << pkginfo << "\n\t" + t << "@$(DEL_FILE) " << pkginfo_f << "\n\t" << "@echo \"APPL" << (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) - << "\" >" << pkginfo << endl; + << "\" > " << pkginfo_f << endl; } if (!project->first("QMAKE_BUNDLE_RESOURCE_FILE").isEmpty()) { - ProString resources = escapeFilePath(project->first("QMAKE_BUNDLE_RESOURCE_FILE")); + ProString resources = project->first("QMAKE_BUNDLE_RESOURCE_FILE"); + ProString resources_f = escapeFilePath(resources); + ProString resources_d = escapeDependencyPath(resources); bundledFiles << resources; alldeps << resources; QString destdir = bundle_dir + "Contents/Resources"; - t << resources << ": \n\t"; + t << resources_d << ": \n\t"; t << mkdir_p_asstring(destdir) << "\n\t"; - t << "@touch " << resources << "\n\t\n"; + t << "@touch " << resources_f << "\n\t\n"; } //copy the plist while (!project->isActiveConfig("no_plist")) { // 'while' just to be able to 'break' - QString info_plist = escapeFilePath(fileFixify(project->first("QMAKE_INFO_PLIST").toQString())); + QString info_plist = fileFixify(project->first("QMAKE_INFO_PLIST").toQString()); if (info_plist.isEmpty()) info_plist = specdir() + QDir::separator() + "Info.plist." + project->first("TEMPLATE"); if (!exists(Option::fixPathToLocalOS(info_plist))) { @@ -786,15 +810,17 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) info_plist.toLatin1().constData()); break; } + info_plist = escapeFilePath(info_plist); bool isApp = (project->first("TEMPLATE") == "app"); - QString info_plist_out = escapeFilePath( + QString info_plist_out = bundle_dir + (isApp ? "Contents/Info.plist" : "Versions/" + project->first("QMAKE_FRAMEWORK_VERSION") - + "/Resources/Info.plist")); + + "/Resources/Info.plist"); bundledFiles << info_plist_out; alldeps << info_plist_out; QString destdir = info_plist_out.section(Option::dir_sep, 0, -2); - t << info_plist_out << ": \n\t"; + t << escapeDependencyPath(info_plist_out) << ": \n\t"; + info_plist_out = escapeFilePath(info_plist_out); if (!destdir.isEmpty()) t << mkdir_p_asstring(destdir, false) << "\n\t"; ProStringList commonSedArgs; @@ -834,13 +860,14 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) //copy the icon if (!project->isEmpty("ICON")) { QString dir = bundle_dir + "Contents/Resources/"; - const QString icon_path = escapeFilePath(dir + icon.section(Option::dir_sep, -1)); + const QString icon_path = dir + icon.section(Option::dir_sep, -1); + QString icon_path_f = escapeFilePath(icon_path); bundledFiles << icon_path; alldeps << icon_path; - t << icon_path << ": " << icon << "\n\t" + t << escapeDependencyPath(icon_path) << ": " << escapeDependencyPath(icon) << "\n\t" << mkdir_p_asstring(dir) << "\n\t" - << "@$(DEL_FILE) " << icon_path << "\n\t" - << "@$(COPY_FILE) " << escapeFilePath(icon) << " " << icon_path << endl; + << "@$(DEL_FILE) " << icon_path_f << "\n\t" + << "@$(COPY_FILE) " << escapeFilePath(icon) << ' ' << icon_path_f << endl; } } else { symlinks[bundle_dir + "Resources"] = "Versions/Current/Resources"; @@ -882,12 +909,13 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) QString src = fileFixify(fn, FileFixifyAbsolute); if (!QFile::exists(src)) src = fn; - src = escapeFilePath(src); - const QString dst = escapeFilePath(path + Option::dir_sep + fileInfo(fn).fileName()); + QString dst = path + Option::dir_sep + fileInfo(fn).fileName(); bundledFiles << dst; alldeps << dst; - t << dst << ": " << src << "\n\t" + t << escapeDependencyPath(dst) << ": " << escapeDependencyPath(src) << "\n\t" << mkdir_p_asstring(path) << "\n\t"; + src = escapeFilePath(src); + dst = escapeFilePath(dst); QFileInfo fi(fileInfo(fn)); if(fi.isDir()) t << "@$(DEL_FILE) -r " << dst << "\n\t" @@ -898,18 +926,19 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } } } + QString bundle_dir_f = escapeFilePath(bundle_dir); QHash::ConstIterator symIt = symlinks.constBegin(), symEnd = symlinks.constEnd(); for (; symIt != symEnd; ++symIt) { bundledFiles << symIt.key(); alldeps << symIt.key(); - t << symIt.key() << ":\n\t" + t << escapeDependencyPath(symIt.key()) << ":\n\t" << mkdir_p_asstring(bundle_dir) << "\n\t" - << "@$(SYMLINK) " << symIt.value() << " " << bundle_dir << endl; + << "@$(SYMLINK) " << escapeFilePath(symIt.value()) << ' ' << bundle_dir_f << endl; } } - t << endl << "all: " << escapeDependencyPath(deps) + t << endl << "all: " << deps << valGlue(escapeDependencyPaths(project->values("ALL_DEPS")), " \\\n\t\t", " \\\n\t\t", "") << allDeps << endl << endl; @@ -930,15 +959,16 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) const ProStringList &val = project->values((*var_it).toKey()); if(val.isEmpty()) continue; - t << "\t$(COPY_FILE) --parents " << val.join(' ') << " $(DISTDIR)" << Option::dir_sep << endl; + t << "\t$(COPY_FILE) --parents " << escapeFilePaths(val).join(' ') + << " $(DISTDIR)" << Option::dir_sep << endl; } } } if(!project->isEmpty("TRANSLATIONS")) - t << "\t$(COPY_FILE) --parents " << var("TRANSLATIONS") << " $(DISTDIR)" << Option::dir_sep << endl; + t << "\t$(COPY_FILE) --parents " << fileVar("TRANSLATIONS") << " $(DISTDIR)" << Option::dir_sep << endl; t << endl << endl; - QString clean_targets = "compiler_clean " + var("CLEAN_DEPS"); + QString clean_targets = " compiler_clean " + depVar("CLEAN_DEPS"); if(do_incremental) { t << "incrclean:\n"; if(src_incremental) @@ -993,26 +1023,27 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) precomp_files += precomph_out_dir + header_prefix + "objective-c++" + header_suffix; } } - t << "-$(DEL_FILE) " << precomp_files.join(' ') << "\n\t"; + t << "-$(DEL_FILE) " << escapeFilePaths(precomp_files).join(' ') << "\n\t"; } if(src_incremental) t << "-$(DEL_FILE) $(INCREMENTAL_OBJECTS)\n\t"; - t << varGlue("QMAKE_CLEAN","-$(DEL_FILE) "," ","\n\t") + t << fileVarGlue("QMAKE_CLEAN","-$(DEL_FILE) "," ","\n\t") << "-$(DEL_FILE) *~ core *.core\n" - << varGlue("CLEAN_FILES","\t-$(DEL_FILE) "," ","") << endl << endl; + << fileVarGlue("CLEAN_FILES","\t-$(DEL_FILE) "," ","") << endl << endl; ProString destdir = project->first("DESTDIR"); if (!destdir.isEmpty() && !destdir.endsWith(Option::dir_sep)) destdir += Option::dir_sep; - t << "distclean: clean " << var("DISTCLEAN_DEPS") << '\n'; + t << "distclean: clean " << depVar("DISTCLEAN_DEPS") << '\n'; if(!project->isEmpty("QMAKE_BUNDLE")) { QString bundlePath = escapeFilePath(destdir + project->first("QMAKE_BUNDLE")); t << "\t-$(DEL_FILE) -r " << bundlePath << endl; } else if(project->isActiveConfig("compile_libtool")) { t << "\t-$(LIBTOOL) --mode=clean $(DEL_FILE) $(TARGET)\n"; } else if (project->isActiveConfig("staticlib")) { - t << "\t-$(DEL_FILE) " << destdir << "$(TARGET) \n"; + t << "\t-$(DEL_FILE) " << escapeFilePath(destdir) << "$(TARGET) \n"; } else if (project->values("QMAKE_APP_FLAG").isEmpty() && !project->isActiveConfig("plugin")) { + destdir = escapeFilePath(destdir); t << "\t-$(DEL_FILE) " << destdir << "$(TARGET) \n"; if (!project->isActiveConfig("unversioned_libname")) { t << "\t-$(DEL_FILE) " << destdir << "$(TARGET0) " << destdir << "$(TARGET1) " @@ -1023,11 +1054,11 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } else { t << "\t-$(DEL_FILE) $(TARGET) \n"; } - t << varGlue("QMAKE_DISTCLEAN","\t-$(DEL_FILE) "," ","\n"); + t << fileVarGlue("QMAKE_DISTCLEAN","\t-$(DEL_FILE) "," ","\n"); { QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName())); if(!ofile.isEmpty()) - t << "\t-$(DEL_FILE) " << ofile << endl; + t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << endl; } t << endl << endl; @@ -1038,8 +1069,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) libdir = project->first("SUBLIBS_DIR"); const ProStringList &l = project->values("SUBLIBS"); for (it = l.begin(); it != l.end(); ++it) - t << libdir << project->first("QMAKE_PREFIX_STATICLIB") << (*it) << "." - << project->first("QMAKE_EXTENSION_STATICLIB") << ":\n\t" + t << escapeDependencyPath(libdir + project->first("QMAKE_PREFIX_STATICLIB") + (*it) + '.' + + project->first("QMAKE_EXTENSION_STATICLIB")) << ":\n\t" << var(ProKey("MAKELIB" + *it)) << endl << endl; } @@ -1069,13 +1100,15 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if (project->isActiveConfig("icc_pch_style")) { // icc style QString sourceFile = pchOutput + Option::cpp_ext.first(); + QString sourceFile_f = escapeFilePath(sourceFile); QString objectFile = createObjectList(ProStringList(sourceFile)).first().toQString(); - t << pchOutput << ": " << pchInput << " " << findDependencies(pchInput).join(" \\\n\t\t") - << "\n\techo \"// Automatically generated, do not modify\" > " << sourceFile - << "\n\trm -f " << pchOutput; + t << escapeDependencyPath(pchOutput) << ": " << escapeDependencyPath(pchInput) << ' ' + << escapeDependencyPaths(findDependencies(pchInput)).join(" \\\n\t\t") + << "\n\techo \"// Automatically generated, do not modify\" > " << sourceFile_f + << "\n\trm -f " << escapeFilePath(pchOutput); - pchFlags.replace("${QMAKE_PCH_TEMP_SOURCE}", sourceFile) - .replace("${QMAKE_PCH_TEMP_OBJECT}", objectFile); + pchFlags.replace("${QMAKE_PCH_TEMP_SOURCE}", sourceFile_f) + .replace("${QMAKE_PCH_TEMP_OBJECT}", escapeFilePath(objectFile)); } else { // gcc style (including clang_pch_style) ProString header_prefix = project->first("QMAKE_PRECOMP_PREFIX"); @@ -1098,12 +1131,13 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) continue; pchOutput += header_prefix + pchOutputFile + header_suffix; - t << pchOutput << ": " << pchInput << " " << findDependencies(pchInput).join(" \\\n\t\t") + t << escapeDependencyPath(pchOutput) << ": " << escapeDependencyPath(pchInput) << ' ' + << escapeDependencyPaths(findDependencies(pchInput)).join(" \\\n\t\t") << "\n\t" << mkdir_p_asstring(pchOutputDir); } - pchFlags.replace("${QMAKE_PCH_INPUT}", pchInput) - .replace("${QMAKE_PCH_OUTPUT_BASE}", pchBaseName.toQString()) - .replace("${QMAKE_PCH_OUTPUT}", pchOutput.toQString()); + pchFlags.replace("${QMAKE_PCH_INPUT}", escapeFilePath(pchInput)) + .replace("${QMAKE_PCH_OUTPUT_BASE}", escapeFilePath(pchBaseName.toQString())) + .replace("${QMAKE_PCH_OUTPUT}", escapeFilePath(pchOutput.toQString())); QString compiler; if(comps[i] == "C" || comps[i] == "OBJC" || comps[i] == "OBJCXX") @@ -1166,11 +1200,11 @@ void UnixMakefileGenerator::init2() if(!bundle_loc.endsWith("/")) bundle_loc += "/"; project->values("TARGET_").append(project->first("QMAKE_BUNDLE") + - bundle_loc + unescapeFilePath(project->first("TARGET"))); + bundle_loc + project->first("TARGET")); project->values("TARGET_x.y").append(project->first("QMAKE_BUNDLE") + "/Versions/" + project->first("QMAKE_FRAMEWORK_VERSION") + - bundle_loc + unescapeFilePath(project->first("TARGET"))); + bundle_loc + project->first("TARGET")); } else if(project->isActiveConfig("plugin")) { QString prefix; if(!project->isActiveConfig("no_plugin_name_prefix")) @@ -1388,22 +1422,23 @@ UnixMakefileGenerator::writeLibtoolFile() t << "\n"; t << "# The name that we can dlopen(3).\n" - << "dlname='" << var(project->isActiveConfig("plugin") ? "TARGET" : "TARGET_x") + << "dlname='" << fileVar(project->isActiveConfig("plugin") ? "TARGET" : "TARGET_x") << "'\n\n"; t << "# Names of this library.\n"; t << "library_names='"; if(project->isActiveConfig("plugin")) { - t << var("TARGET"); + t << fileVar("TARGET"); } else { if (project->isEmpty("QMAKE_HPUX_SHLIB")) - t << var("TARGET_x.y.z") << " "; - t << var("TARGET_x") << " " << var("TARGET_"); + t << fileVar("TARGET_x.y.z") << ' '; + t << fileVar("TARGET_x") << ' ' << fileVar("TARGET_"); } t << "'\n\n"; t << "# The name of the static archive.\n" - << "old_library='" << lname.left(lname.length()-Option::libtool_ext.length()) << ".a'\n\n"; + << "old_library='" << escapeFilePath(lname.left(lname.length()-Option::libtool_ext.length())) + << ".a'\n\n"; t << "# Libraries that this one depends upon.\n"; ProStringList libs; @@ -1413,7 +1448,7 @@ UnixMakefileGenerator::writeLibtoolFile() libs << "QMAKE_LIBS"; //obvious one t << "dependency_libs='"; for (ProStringList::ConstIterator it = libs.begin(); it != libs.end(); ++it) - t << project->values((*it).toKey()).join(' ') << " "; + t << fixLibFlags((*it).toKey()).join(' ') << ' '; t << "'\n\n"; t << "# Version information for " << lname << "\n"; diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp index 8aff6f93f3..b5bb7b5b7e 100644 --- a/qmake/generators/win32/mingw_make.cpp +++ b/qmake/generators/win32/mingw_make.cpp @@ -46,17 +46,12 @@ QT_BEGIN_NAMESPACE MingwMakefileGenerator::MingwMakefileGenerator() : Win32MakefileGenerator() { - if (isWindowsShell()) - quote = "\""; - else - quote = "'"; } QString MingwMakefileGenerator::escapeDependencyPath(const QString &path) const { QString ret = path; - ret.remove('\"'); - ret.replace('\\', "/"); + ret.replace('\\', "/"); // ### this shouldn't be here ret.replace(' ', "\\ "); return ret; } @@ -71,6 +66,13 @@ QString MingwMakefileGenerator::getManifestFileForRcFile() const return project->first("QMAKE_MANIFEST").toQString(); } +ProString MingwMakefileGenerator::fixLibFlag(const ProString &lib) +{ + if (lib.startsWith("lib")) + return QStringLiteral("-l") + escapeFilePath(lib.mid(3)); + return escapeFilePath(lib); +} + bool MingwMakefileGenerator::findLibraries() { QList dirs; @@ -99,7 +101,9 @@ bool MingwMakefileGenerator::findLibraries() if (!out.isEmpty()) // We assume if it never finds it that its correct (*it) = out; } else if ((*it).startsWith("-L")) { - dirs.append(QMakeLocalFileName((*it).mid(2).toQString())); + QMakeLocalFileName f((*it).mid(2).toQString()); + dirs.append(f); + *it = "-L" + f.real(); } ++it; @@ -124,7 +128,7 @@ bool MingwMakefileGenerator::writeMakefile(QTextStream &t) t << "QMAKE = " << var("QMAKE_QMAKE") << endl; const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS"); for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it) - t << *it << " "; + t << escapeDependencyPath(*it) << ' '; t << "first all clean install distclean uninstall: qmake\n" << "qmake_all:\n"; writeMakeQmake(t); @@ -150,6 +154,7 @@ void createLdObjectScriptFile(const QString &fileName, const ProStringList &objL t << "INPUT(\n"; for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) { QString path = (*it).toQString(); + // ### quoting? if (QDir::isRelativePath(path)) t << "./" << path << endl; else @@ -167,6 +172,7 @@ void createArObjectScriptFile(const QString &fileName, const QString &target, co QFile file(filePath); if (file.open(QIODevice::WriteOnly | QIODevice::Text)) { QTextStream t(&file); + // ### quoting? t << "CREATE " << target << endl; for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) { t << "ADDMOD " << *it << endl; @@ -185,6 +191,7 @@ void createRvctObjectScriptFile(const QString &fileName, const ProStringList &ob QTextStream t(&file); for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) { QString path = (*it).toQString(); + // ### quoting? if (QDir::isRelativePath(path)) t << "./" << path << endl; else @@ -205,14 +212,14 @@ void MingwMakefileGenerator::writeMingwParts(QTextStream &t) t << escapeDependencyPath(cHeader) << ": " << escapeDependencyPath(header) << " " << escapeDependencyPaths(findDependencies(header)).join(" \\\n\t\t") << "\n\t" << mkdir_p_asstring(preCompHeaderOut) - << "\n\t$(CC) -x c-header -c $(CFLAGS) $(INCPATH) -o " << cHeader << " " << header - << endl << endl; + << "\n\t$(CC) -x c-header -c $(CFLAGS) $(INCPATH) -o " << escapeFilePath(cHeader) + << ' ' << escapeFilePath(header) << endl << endl; QString cppHeader = preCompHeaderOut + Option::dir_sep + "c++"; t << escapeDependencyPath(cppHeader) << ": " << escapeDependencyPath(header) << " " << escapeDependencyPaths(findDependencies(header)).join(" \\\n\t\t") << "\n\t" << mkdir_p_asstring(preCompHeaderOut) - << "\n\t$(CXX) -x c++-header -c $(CXXFLAGS) $(INCPATH) -o " << cppHeader << " " << header - << endl << endl; + << "\n\t$(CXX) -x c++-header -c $(CXXFLAGS) $(INCPATH) -o " << escapeFilePath(cppHeader) + << ' ' << escapeFilePath(header) << endl << endl; } } @@ -246,9 +253,7 @@ void MingwMakefileGenerator::init() processVars(); - if (!project->values("RES_FILE").isEmpty()) { - project->values("QMAKE_LIBS") += escapeFilePaths(project->values("RES_FILE")); - } + project->values("QMAKE_LIBS") += project->values("RES_FILE"); if (project->isActiveConfig("dll")) { QString destDir = ""; @@ -256,7 +261,7 @@ void MingwMakefileGenerator::init() destDir = Option::fixPathToTargetOS(project->first("DESTDIR") + Option::dir_sep, false, false); project->values("MINGW_IMPORT_LIB").prepend(destDir + "lib" + project->first("TARGET") + project->first("TARGET_VERSION_EXT") + ".a"); - project->values("QMAKE_LFLAGS").append(QString("-Wl,--out-implib,") + project->first("MINGW_IMPORT_LIB")); + project->values("QMAKE_LFLAGS").append(QString("-Wl,--out-implib,") + fileVar("MINGW_IMPORT_LIB")); } if (!project->values("DEF_FILE").isEmpty()) { @@ -278,6 +283,7 @@ void MingwMakefileGenerator::init() project->values("QMAKE_CLEAN").append(preCompHeaderOut + Option::dir_sep + "c"); project->values("QMAKE_CLEAN").append(preCompHeaderOut + Option::dir_sep + "c++"); + preCompHeader = escapeFilePath(preCompHeader); project->values("QMAKE_RUN_CC").clear(); project->values("QMAKE_RUN_CC").append("$(CC) -c -include " + preCompHeader + " $(CFLAGS) $(INCPATH) " + var("QMAKE_CC_O_FLAG") + "$obj $src"); @@ -306,13 +312,12 @@ void MingwMakefileGenerator::writeIncPart(QTextStream &t) for (ProStringList::ConstIterator incit = incs.begin(); incit != incs.end(); ++incit) { QString inc = (*incit).toQString(); inc.replace(QRegExp("\\\\$"), ""); - inc.replace(QRegExp("\""), ""); if (!isystem.isEmpty() && isSystemInclude(inc)) t << isystem << ' '; else t << "-I"; - t << quote << inc << quote << " "; + t << escapeFilePath(inc) << ' '; } t << endl; } @@ -325,8 +330,8 @@ void MingwMakefileGenerator::writeLibsPart(QTextStream &t) t << "LINKER = " << var("QMAKE_LINK") << endl; t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl; t << "LIBS = " - << var("QMAKE_LIBS").replace(QRegExp("(\\slib|^lib)")," -l") << ' ' - << var("QMAKE_LIBS_PRIVATE").replace(QRegExp("(\\slib|^lib)")," -l") << endl; + << fixLibFlags("QMAKE_LIBS").join(' ') << ' ' + << fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << endl; } } @@ -345,7 +350,7 @@ void MingwMakefileGenerator::writeObjectsPart(QTextStream &t) QString ar_cmd = project->values("QMAKE_LIB").join(' '); if (ar_cmd.isEmpty()) ar_cmd = "armar --create"; - objectsLinkLine = ar_cmd + " " + var("DEST_TARGET") + " --via " + escapeFilePath(ar_script_file); + objectsLinkLine = ar_cmd + ' ' + fileVar("DEST_TARGET") + " --via " + escapeFilePath(ar_script_file); } else { // Strip off any options since the ar commands will be read from file. QString ar_cmd = var("QMAKE_LIB").section(" ", 0, 0);; @@ -373,8 +378,9 @@ void MingwMakefileGenerator::writeObjectsPart(QTextStream &t) void MingwMakefileGenerator::writeBuildRulesPart(QTextStream &t) { t << "first: all\n"; - t << "all: " << escapeDependencyPath(fileFixify(Option::output.fileName())) << " " << valGlue(escapeDependencyPaths(project->values("ALL_DEPS"))," "," "," ") << " $(DESTDIR_TARGET)\n\n"; - t << "$(DESTDIR_TARGET): " << var("PRE_TARGETDEPS") << " $(OBJECTS) " << var("POST_TARGETDEPS"); + t << "all: " << escapeDependencyPath(fileFixify(Option::output.fileName())) + << ' ' << depVar("ALL_DEPS") << " $(DESTDIR_TARGET)\n\n"; + t << "$(DESTDIR_TARGET): " << depVar("PRE_TARGETDEPS") << " $(OBJECTS) " << depVar("POST_TARGETDEPS"); if(!project->isEmpty("QMAKE_PRE_LINK")) t << "\n\t" <isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") { @@ -409,8 +415,8 @@ void MingwMakefileGenerator::writeRcFilePart(QTextStream &t) } if (!rc_file.isEmpty()) { - t << escapeDependencyPath(var("RES_FILE")) << ": " << rc_file << "\n\t" - << var("QMAKE_RC") << " -i " << rc_file << " -o " << var("RES_FILE") + t << escapeDependencyPath(var("RES_FILE")) << ": " << escapeDependencyPath(rc_file) << "\n\t" + << var("QMAKE_RC") << " -i " << escapeFilePath(rc_file) << " -o " << fileVar("RES_FILE") << incPathStr << " $(DEFINES)\n\n"; } } diff --git a/qmake/generators/win32/mingw_make.h b/qmake/generators/win32/mingw_make.h index a29442c916..e76391080c 100644 --- a/qmake/generators/win32/mingw_make.h +++ b/qmake/generators/win32/mingw_make.h @@ -45,6 +45,8 @@ public: ~MingwMakefileGenerator(); protected: QString escapeDependencyPath(const QString &path) const; + ProString escapeDependencyPath(const ProString &path) const { return MakefileGenerator::escapeDependencyPath(path); } + virtual ProString fixLibFlag(const ProString &lib); QString getLibTarget(); virtual QString getManifestFileForRcFile() const; bool writeMakefile(QTextStream &); @@ -64,7 +66,6 @@ private: virtual bool findLibraries(); QString objectsLinkLine; - QString quote; }; inline MingwMakefileGenerator::~MingwMakefileGenerator() diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index bd17b6c528..450f224654 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -260,15 +260,14 @@ QString NmakeMakefileGenerator::defaultInstall(const QString &t) if (project->isActiveConfig("debug_info")) { if (t == "dlltarget" || project->values(ProKey(t + ".CONFIG")).indexOf("no_dll") == -1) { QString pdb_target = getPdbTarget(); - pdb_target.remove('"'); QString src_targ = (project->isEmpty("DESTDIR") ? QString("$(DESTDIR)") : project->first("DESTDIR")) + pdb_target; QString dst_targ = filePrefixRoot(root, fileFixify(targetdir + pdb_target, FileFixifyAbsolute)); if(!ret.isEmpty()) ret += "\n\t"; - ret += QString("-$(INSTALL_FILE)") + " \"" + src_targ + "\" \"" + dst_targ + "\""; + ret += QString("-$(INSTALL_FILE) ") + escapeFilePath(src_targ) + ' ' + escapeFilePath(dst_targ); if(!uninst.isEmpty()) uninst.append("\n\t"); - uninst.append("-$(DEL_FILE) \"" + dst_targ + "\""); + uninst.append("-$(DEL_FILE) " + escapeFilePath(dst_targ)); } } @@ -294,9 +293,12 @@ void NmakeMakefileGenerator::writeNmakeParts(QTextStream &t) // precompiled header if(usePCH) { - QString precompRule = QString("-c -Yc -Fp%1 -Fo%2").arg(precompPch).arg(precompObj); - t << precompObj << ": " << precompH << " " << escapeDependencyPaths(findDependencies(precompH)).join(" \\\n\t\t") - << "\n\t$(CXX) " + precompRule +" $(CXXFLAGS) $(INCPATH) -TP " << precompH << endl << endl; + QString precompRule = QString("-c -Yc -Fp%1 -Fo%2") + .arg(escapeFilePath(precompPch), escapeFilePath(precompObj)); + t << escapeDependencyPath(precompObj) << ": " << escapeDependencyPath(precompH) << ' ' + << escapeDependencyPaths(findDependencies(precompH)).join(" \\\n\t\t") + << "\n\t$(CXX) " + precompRule +" $(CXXFLAGS) $(INCPATH) -TP " + << escapeFilePath(precompH) << endl << endl; } } @@ -307,10 +309,9 @@ QString NmakeMakefileGenerator::var(const ProKey &value) const || value == "QMAKE_RUN_CXX_IMP" || value == "QMAKE_RUN_CXX")) { QFileInfo precompHInfo(fileInfo(precompH)); + QString precompH_f = escapeFilePath(precompHInfo.fileName()); QString precompRule = QString("-c -FI%1 -Yu%2 -Fp%3") - .arg(precompHInfo.fileName()) - .arg(precompHInfo.fileName()) - .arg(precompPch); + .arg(precompH_f, precompH_f, escapeFilePath(precompPch)); QString p = MakefileGenerator::var(value); p.replace("-c", precompRule); // Cannot use -Gm with -FI & -Yu, as this gives an @@ -357,9 +358,7 @@ void NmakeMakefileGenerator::init() processVars(); - if (!project->values("RES_FILE").isEmpty()) { - project->values("QMAKE_LIBS") += escapeFilePaths(project->values("RES_FILE")); - } + project->values("QMAKE_LIBS") += project->values("RES_FILE"); if (!project->values("DEF_FILE").isEmpty()) { QString defFileName = fileFixify(project->first("DEF_FILE").toQString()); @@ -502,11 +501,15 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t) if (objDir == ".\\") objDir = ""; for(QStringList::Iterator cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit) - t << "{" << sourceDir << "}" << (*cppit) << "{" << objDir << "}" << Option::obj_ext << "::\n\t" - << var("QMAKE_RUN_CXX_IMP_BATCH").replace(QRegExp("\\$@"), var("OBJECTS_DIR")) << endl << "\t$<\n<<\n\n"; + t << '{' << escapeDependencyPath(sourceDir) << '}' << (*cppit) + << '{' << escapeDependencyPath(objDir) << '}' << Option::obj_ext << "::\n\t" + << var("QMAKE_RUN_CXX_IMP_BATCH").replace(QRegExp("\\$@"), fileVar("OBJECTS_DIR")) + << "\n\t$<\n<<\n\n"; for(QStringList::Iterator cit = Option::c_ext.begin(); cit != Option::c_ext.end(); ++cit) - t << "{" << sourceDir << "}" << (*cit) << "{" << objDir << "}" << Option::obj_ext << "::\n\t" - << var("QMAKE_RUN_CC_IMP_BATCH").replace(QRegExp("\\$@"), var("OBJECTS_DIR")) << endl << "\t$<\n<<\n\n"; + t << '{' << escapeDependencyPath(sourceDir) << '}' << (*cit) + << '{' << escapeDependencyPath(objDir) << '}' << Option::obj_ext << "::\n\t" + << var("QMAKE_RUN_CC_IMP_BATCH").replace(QRegExp("\\$@"), fileVar("OBJECTS_DIR")) + << "\n\t$<\n<<\n\n"; } } else { for(QStringList::Iterator cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit) @@ -522,8 +525,9 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t) const ProString templateName = project->first("TEMPLATE"); t << "first: all\n"; - t << "all: " << fileFixify(Option::output.fileName()) << " " << varGlue("ALL_DEPS"," "," "," ") << "$(DESTDIR_TARGET)\n\n"; - t << "$(DESTDIR_TARGET): " << var("PRE_TARGETDEPS") << " $(OBJECTS) " << var("POST_TARGETDEPS"); + t << "all: " << escapeDependencyPath(fileFixify(Option::output.fileName())) + << ' ' << depVar("ALL_DEPS") << " $(DESTDIR_TARGET)\n\n"; + t << "$(DESTDIR_TARGET): " << depVar("PRE_TARGETDEPS") << " $(OBJECTS) " << depVar("POST_TARGETDEPS"); if(!project->isEmpty("QMAKE_PRE_LINK")) t << "\n\t" <values("QMAKE_CLEAN") << manifest; } } else { - manifest = escapeFilePath(fileFixify(manifest)); + manifest = fileFixify(manifest); } const QString resourceId = (templateName == "app") ? "1" : "2"; @@ -560,16 +564,19 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t) if (incrementalLinking && !linkerSupportsEmbedding) { // Link a resource that contains the manifest without modifying the exe/dll after linking. - QString manifest_rc = escapeFilePath(target + "_manifest.rc"); - QString manifest_res = escapeFilePath(target + "_manifest.res"); - QString manifest_bak = escapeFilePath(target + "_manifest.bak"); + QString manifest_rc = target + "_manifest.rc"; + QString manifest_res = target + "_manifest.res"; project->values("QMAKE_CLEAN") << manifest_rc << manifest_res; + manifest_rc = escapeFilePath(manifest_rc); + manifest_res = escapeFilePath(manifest_res); t << "\n\techo " << resourceId << " /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ " - << cQuoted(unescapeFilePath(manifest)) << ">" << manifest_rc; + << cQuoted(manifest) << '>' << manifest_rc; if (generateManifest) { + manifest = escapeFilePath(manifest); + QString manifest_bak = escapeFilePath(target + "_manifest.bak"); t << "\n\tif not exist $(DESTDIR_TARGET) if exist " << manifest << " del " << manifest; t << "\n\tif exist " << manifest << " copy /Y " << manifest << ' ' << manifest_bak; @@ -591,7 +598,7 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t) t << "\n\t"; writeLinkCommand(t, extraLFlags); if (!linkerSupportsEmbedding) { - t << "\n\tmt.exe /nologo /manifest " << manifest + t << "\n\tmt.exe /nologo /manifest " << escapeFilePath(manifest) << " /outputresource:$(DESTDIR_TARGET);" << resourceId; } } @@ -604,7 +611,7 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t) bool useSignature = !signature.isEmpty() && !project->isActiveConfig("staticlib") && !project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH"); if(useSignature) { - t << "\n\tsigntool sign /F " << signature << " $(DESTDIR_TARGET)"; + t << "\n\tsigntool sign /F " << escapeFilePath(signature) << " $(DESTDIR_TARGET)"; } if(!project->isEmpty("QMAKE_POST_LINK")) { t << "\n\t" << var("QMAKE_POST_LINK"); diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 62f5814ce3..d14bb7b892 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -2363,10 +2363,9 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info) deps = inputs + deps; // input files themselves too.. // Replace variables for command w/all input files - // ### join gives path issues with directories containing spaces! cmd = Project->replaceExtraCompilerVariables(tmp_cmd, - inputs.join(' '), - out, + inputs, + QStringList(out), MakefileGenerator::TargetShell); } else { deps.prepend(inFile); // input file itself too.. @@ -2385,9 +2384,6 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info) cmd_name = cmd.left(space); else cmd_name = cmd; - if ((cmd_name[0] == '\'' || cmd_name[0] == '"') && - cmd_name[0] == cmd_name[cmd_name.length()-1]) - cmd_name = cmd_name.mid(1,cmd_name.length()-2); } // Fixify paths diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index dd0fdafb49..5da6f5807d 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -505,7 +505,7 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHashfirst("QMAKE_PROJECT_NAME") + project->first("VCPROJ_EXTENSION")); + QString vcproj = tmp_vcproj.project->first("QMAKE_PROJECT_NAME") + project->first("VCPROJ_EXTENSION"); QString vcprojDir = qmake_getpwd(); // If file doesn't exsist, then maybe the users configuration @@ -535,7 +535,7 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHashvcprojFile = vcprojDir + Option::dir_sep + vcproj; - newDep->orig_target = unescapeFilePath(tmp_proj.first("QMAKE_ORIG_TARGET")).toQString(); + newDep->orig_target = tmp_proj.first("QMAKE_ORIG_TARGET").toQString(); newDep->target = tmp_proj.first("MSVCPROJ_TARGET").toQString().section(Option::dir_sep, -1); newDep->targetType = tmp_vcproj.projectTarget; newDep->uuid = tmp_proj.isEmpty("QMAKE_UUID") ? getProjectUUID(Option::fixPathToLocalOS(vcprojDir + QDir::separator() + vcproj)).toString().toUpper(): tmp_proj.first("QMAKE_UUID").toQString(); @@ -671,6 +671,7 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) // write out projects for (QList::Iterator it = solution_cleanup.begin(); it != solution_cleanup.end(); ++it) { + // ### quoting rules? t << _slnProjectBeg << _slnMSVCvcprojGUID << _slnProjectMid << "\"" << (*it)->orig_target << "\", \"" << (*it)->vcprojFile << "\", \"" << (*it)->uuid << "\""; @@ -799,9 +800,7 @@ void VcprojGenerator::init() const ProStringList &incs = project->values("INCLUDEPATH"); for (ProStringList::ConstIterator incit = incs.begin(); incit != incs.end(); ++incit) { QString inc = (*incit).toQString(); - if (!inc.startsWith('"') && !inc.endsWith('"')) - inc = QString("\"%1\"").arg(inc); // Quote all paths if not quoted already - project->values("MSVCPROJ_INCPATH").append("-I" + inc); + project->values("MSVCPROJ_INCPATH").append("-I" + escapeFilePath(inc)); } QString dest = Option::fixPathToTargetOS(project->first("TARGET").toQString()) + project->first("TARGET_EXT"); @@ -815,7 +814,7 @@ void VcprojGenerator::init() for (dlldir = dlldirs.begin(); dlldir != dlldirs.end(); ++dlldir) { if (!copydll.isEmpty()) copydll += " && "; - copydll += "copy \"$(TargetPath)\" \"" + *dlldir + "\""; + copydll += "copy \"$(TargetPath)\" " + escapeFilePath(*dlldir); } QString deststr("Copy " + dest + " to "); @@ -842,8 +841,7 @@ void VcprojGenerator::init() projectTarget = Application; } else if(project->first("TEMPLATE") == "vclib") { if(project->isActiveConfig("staticlib")) { - if (!project->values("RES_FILE").isEmpty()) - project->values("QMAKE_LIBS") += escapeFilePaths(project->values("RES_FILE")); + project->values("QMAKE_LIBS") += project->values("RES_FILE"); projectTarget = StaticLib; } else projectTarget = SharedLib; @@ -856,7 +854,7 @@ void VcprojGenerator::init() if (usePCH) { precompHFilename = fileInfo(precompH).fileName(); // Created files - QString origTarget = unescapeFilePath(project->first("QMAKE_ORIG_TARGET").toQString()); + QString origTarget = project->first("QMAKE_ORIG_TARGET").toQString(); precompObj = origTarget + Option::obj_ext; precompPch = origTarget + ".pch"; // Add PRECOMPILED_HEADER to HEADERS @@ -947,7 +945,7 @@ void VcprojGenerator::initProject() initExtraCompilerOutputs(); // Own elements ----------------------------- - vcProject.Name = unescapeFilePath(project->first("QMAKE_ORIG_TARGET").toQString()); + vcProject.Name = project->first("QMAKE_ORIG_TARGET").toQString(); switch (which_dotnet_version(project->first("MSVC_VER").toLatin1())) { case NET2013: vcProject.Version = "12.00"; @@ -1179,7 +1177,7 @@ void VcprojGenerator::initLinkerTool() ProStringList l = ProStringList(libs); conf.linker.parseOptions(l); } else { - conf.linker.AdditionalDependencies += libs.toQString(); + conf.linker.AdditionalDependencies << escapeFilePath(libs.toQString()); } } @@ -1239,7 +1237,7 @@ void VcprojGenerator::initPostBuildEventTools() !project->isHostBuild() && !project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH"); if (useSignature) { conf.postBuild.CommandLine.prepend( - QLatin1String("signtool sign /F ") + signature + QLatin1String(" \"$(TargetPath)\"")); + QLatin1String("signtool sign /F ") + escapeFilePath(signature) + QLatin1String(" \"$(TargetPath)\"")); conf.postBuild.ExcludedFromBuild = _False; } @@ -1682,7 +1680,7 @@ bool VcprojGenerator::openOutput(QFile &file, const QString &/*build*/) const ProString ext = project->first("VCPROJ_EXTENSION"); if(project->first("TEMPLATE") == "vcsubdirs") ext = project->first("VCSOLUTION_EXTENSION"); - ProString outputName = unescapeFilePath(project->first("TARGET")); + ProString outputName = project->first("TARGET"); if (!project->first("MAKEFILE").isEmpty()) outputName = project->first("MAKEFILE"); file.setFileName(outdir + outputName + ext); diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index 41a8567545..bcacdb0615 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -96,6 +96,16 @@ Win32MakefileGenerator::findHighestVersion(const QString &d, const QString &stem return biggest; } +ProString Win32MakefileGenerator::fixLibFlag(const ProString &lib) +{ + if (lib.startsWith('/')) { + if (lib.startsWith("/LIBPATH:")) + return QStringLiteral("/LIBPATH:") + escapeFilePath(lib.mid(9)); + return lib; + } + return escapeFilePath(lib); +} + bool Win32MakefileGenerator::findLibraries() { @@ -104,26 +114,23 @@ Win32MakefileGenerator::findLibraries() for (int i = 0; lflags[i]; i++) { ProStringList &l = project->values(lflags[i]); for (ProStringList::Iterator it = l.begin(); it != l.end();) { - QChar quote; - bool modified_opt = false, remove = false; + bool remove = false; QString opt = (*it).trimmed().toQString(); - if((opt[0] == '\'' || opt[0] == '"') && opt[(int)opt.length()-1] == opt[0]) { - quote = opt[0]; - opt = opt.mid(1, opt.length()-2); - } if(opt.startsWith("/LIBPATH:")) { - dirs.append(QMakeLocalFileName(opt.mid(9))); + QString libpath = opt.mid(9); + QMakeLocalFileName l(libpath); + if (!dirs.contains(l)) { + dirs.append(l); + (*it) = "/LIBPATH:" + l.real(); + } else { + remove = true; + } } else if(opt.startsWith("-L") || opt.startsWith("/L")) { QString libpath = Option::fixPathToTargetOS(opt.mid(2), false, false); QMakeLocalFileName l(libpath); if(!dirs.contains(l)) { dirs.append(l); - modified_opt = true; - if (!quote.isNull()) { - libpath = quote + libpath + quote; - quote = QChar(); - } - (*it) = "/LIBPATH:" + libpath; + (*it) = "/LIBPATH:" + l.real(); } else { remove = true; } @@ -142,17 +149,12 @@ Win32MakefileGenerator::findLibraries() if(QMakeMetaInfo::libExists((*it).local() + Option::dir_sep + lib) || exists((*it).local() + Option::dir_sep + lib + extension)) { out = (*it).real() + Option::dir_sep + lib + extension; - if (out.contains(QLatin1Char(' '))) { - out.prepend(QLatin1Char('\"')); - out.append(QLatin1Char('\"')); - } break; } } } if(out.isEmpty()) out = lib + ".lib"; - modified_opt = true; (*it) = out; } else if(!exists(Option::fixPathToLocalOS(opt))) { QList lib_dirs; @@ -182,7 +184,6 @@ Win32MakefileGenerator::findLibraries() dir += Option::dir_sep; lib_tmpl.prepend(dir); } - modified_opt = true; (*it) = lib_tmpl; break; } @@ -193,8 +194,6 @@ Win32MakefileGenerator::findLibraries() if(remove) { it = l.erase(it); } else { - if(!quote.isNull() && modified_opt) - (*it) = quote + (*it) + quote; ++it; } } @@ -212,8 +211,6 @@ Win32MakefileGenerator::processPrlFiles() ProStringList &l = project->values(lflags[i]); for (int lit = 0; lit < l.size(); ++lit) { QString opt = l.at(lit).trimmed().toQString(); - if((opt[0] == '\'' || opt[0] == '"') && opt[(int)opt.length()-1] == opt[0]) - opt = opt.mid(1, opt.length()-2); if (opt.startsWith(libArg)) { QMakeLocalFileName l(opt.mid(libArg.length())); if (!libdirs.contains(l)) @@ -233,14 +230,8 @@ Win32MakefileGenerator::processPrlFiles() } } ProStringList &prl_libs = project->values("QMAKE_CURRENT_PRL_LIBS"); - for (int prl = 0; prl < prl_libs.size(); ++prl) { - ProString arg = prl_libs.at(prl); - if (arg.startsWith(libArg)) - arg = arg.left(libArg.length()) + escapeFilePath(arg.mid(libArg.length()).toQString()); - else if (!arg.startsWith('/')) - arg = escapeFilePath(arg.toQString()); - l.insert(lit + prl + 1, arg); - } + for (int prl = 0; prl < prl_libs.size(); ++prl) + l.insert(lit + prl + 1, prl_libs.at(prl)); prl_libs.clear(); } @@ -311,14 +302,13 @@ void Win32MakefileGenerator::processVars() for (ProStringList::Iterator libDir_it = libDir.begin(); libDir_it != libDir.end(); ++libDir_it) { QString lib = (*libDir_it).toQString(); if (!lib.isEmpty()) { - lib.remove('"'); if (lib.endsWith('\\')) lib.chop(1); - libs << libArg + escapeFilePath(Option::fixPathToTargetOS(lib, false, false)); + libs << libArg + Option::fixPathToTargetOS(lib, false, false); } } - project->values("QMAKE_LIBS") += libs + escapeFilePaths(project->values("LIBS")); - project->values("QMAKE_LIBS_PRIVATE") += escapeFilePaths(project->values("LIBS_PRIVATE")); + project->values("QMAKE_LIBS") += libs + project->values("LIBS"); + project->values("QMAKE_LIBS_PRIVATE") += project->values("LIBS_PRIVATE"); if (project->values("TEMPLATE").contains("app")) { project->values("QMAKE_CFLAGS") += project->values("QMAKE_CFLAGS_APP"); @@ -533,7 +523,7 @@ void Win32MakefileGenerator::processRcFileVar() void Win32MakefileGenerator::writeCleanParts(QTextStream &t) { - t << "clean: compiler_clean " << var("CLEAN_DEPS"); + t << "clean: compiler_clean " << depVar("CLEAN_DEPS"); { const char *clean_targets[] = { "OBJECTS", "QMAKE_CLEAN", "CLEAN_FILES", 0 }; for(int i = 0; clean_targets[i]; ++i) { @@ -562,7 +552,7 @@ void Win32MakefileGenerator::writeCleanParts(QTextStream &t) } t << endl << endl; - t << "distclean: clean " << var("DISTCLEAN_DEPS"); + t << "distclean: clean " << depVar("DISTCLEAN_DEPS"); { const char *clean_targets[] = { "QMAKE_DISTCLEAN", 0 }; for(int i = 0; clean_targets[i]; ++i) { @@ -593,7 +583,7 @@ void Win32MakefileGenerator::writeCleanParts(QTextStream &t) { QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName())); if(!ofile.isEmpty()) - t << "\t-$(DEL_FILE) " << ofile << endl; + t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << endl; } t << endl; } @@ -606,9 +596,8 @@ void Win32MakefileGenerator::writeIncPart(QTextStream &t) for(int i = 0; i < incs.size(); ++i) { QString inc = incs.at(i).toQString(); inc.replace(QRegExp("\\\\$"), ""); - inc.replace(QRegExp("\""), ""); if(!inc.isEmpty()) - t << "-I\"" << inc << "\" "; + t << "-I" << escapeFilePath(inc) << ' '; } t << endl; } @@ -633,8 +622,8 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t) t << "IDL = " << (project->isEmpty("QMAKE_IDL") ? QString("midl") : var("QMAKE_IDL")) << endl; t << "ZIP = " << var("QMAKE_ZIP") << endl; - t << "DEF_FILE = " << varList("DEF_FILE") << endl; - t << "RES_FILE = " << varList("RES_FILE") << endl; // Not on mingw, can't see why not though... + t << "DEF_FILE = " << fileVar("DEF_FILE") << endl; + t << "RES_FILE = " << fileVar("RES_FILE") << endl; // Not on mingw, can't see why not though... t << "COPY = " << var("QMAKE_COPY") << endl; t << "SED = " << var("QMAKE_STREAM_EDITOR") << endl; t << "COPY_FILE = " << var("QMAKE_COPY_FILE") << endl; @@ -651,7 +640,7 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t) t << "####### Output directory\n\n"; if(!project->values("OBJECTS_DIR").isEmpty()) - t << "OBJECTS_DIR = " << var("OBJECTS_DIR").replace(QRegExp("\\\\$"),"") << endl; + t << "OBJECTS_DIR = " << escapeFilePath(var("OBJECTS_DIR").remove(QRegExp("\\\\$"))) << endl; else t << "OBJECTS_DIR = . \n"; t << endl; @@ -666,7 +655,6 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t) if (!destDir.isEmpty() && (orgDestDir.endsWith('/') || orgDestDir.endsWith(Option::dir_sep))) destDir += Option::dir_sep; QString target = QString(project->first("TARGET")+project->first("TARGET_EXT")); - target.remove("\""); project->values("DEST_TARGET").prepend(destDir + target); writeObjectsPart(t); @@ -674,15 +662,14 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t) writeExtraCompilerVariables(t); writeExtraVariables(t); - t << "DIST = " << varList("DISTFILES") << " " - << varList("HEADERS") << " " - << varList("SOURCES") << endl; - t << "QMAKE_TARGET = " << var("QMAKE_ORIG_TARGET") << endl; + t << "DIST = " << fileVarList("DISTFILES") << ' ' + << fileVarList("HEADERS") << ' ' << fileVarList("SOURCES") << endl; + t << "QMAKE_TARGET = " << fileVar("QMAKE_ORIG_TARGET") << endl; // The comment is important to maintain variable compatibility with Unix // Makefiles, while not interpreting a trailing-slash as a linebreak t << "DESTDIR = " << escapeFilePath(destDir) << " #avoid trailing-slash linebreak\n"; t << "TARGET = " << escapeFilePath(target) << endl; - t << "DESTDIR_TARGET = " << escapeFilePath(var("DEST_TARGET")) << endl; + t << "DESTDIR_TARGET = " << fileVar("DEST_TARGET") << endl; t << endl; t << "####### Implicit rules\n\n"; @@ -694,8 +681,8 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t) if(project->isActiveConfig("shared") && !project->values("DLLDESTDIR").isEmpty()) { const ProStringList &dlldirs = project->values("DLLDESTDIR"); for (ProStringList::ConstIterator dlldir = dlldirs.begin(); dlldir != dlldirs.end(); ++dlldir) { - t << "\t-$(COPY_FILE) \"$(DESTDIR_TARGET)\" " - << Option::fixPathToTargetOS((*dlldir).toQString(), false) << endl; + t << "\t-$(COPY_FILE) $(DESTDIR_TARGET) " + << escapeFilePath(Option::fixPathToTargetOS((*dlldir).toQString(), false)) << endl; } } t << endl; @@ -719,13 +706,13 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t) } t << "dist:\n\t" << "$(ZIP) " << var("QMAKE_ORIG_TARGET") << ".zip $(SOURCES) $(DIST) " - << dist_files.join(' ') << " " << var("TRANSLATIONS") << " "; + << escapeFilePaths(dist_files).join(' ') << ' ' << fileVar("TRANSLATIONS") << ' '; if(!project->isEmpty("QMAKE_EXTRA_COMPILERS")) { const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS"); for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) { const ProStringList &inputs = project->values(ProKey(*it + ".input")); for (ProStringList::ConstIterator input = inputs.begin(); input != inputs.end(); ++input) - t << (*input) << " "; + t << escapeFilePath(*input) << ' '; } } t << endl << endl; @@ -744,12 +731,14 @@ void Win32MakefileGenerator::writeLibsPart(QTextStream &t) } else { t << "LINKER = " << var("QMAKE_LINK") << endl; t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl; - t << "LIBS = " << var("QMAKE_LIBS") << " " << var("QMAKE_LIBS_PRIVATE") << endl; + t << "LIBS = " << fixLibFlags("QMAKE_LIBS").join(' ') << ' ' + << fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << endl; } } void Win32MakefileGenerator::writeObjectsPart(QTextStream &t) { + // Used in both deps and commands. t << "OBJECTS = " << valList(escapeDependencyPaths(project->values("OBJECTS"))) << endl; } @@ -791,9 +780,10 @@ void Win32MakefileGenerator::writeRcFilePart(QTextStream &t) incPathStr += escapeFilePath(path); } - t << res_file << ": " << rc_file << "\n\t" + t << escapeDependencyPath(res_file) << ": " << escapeDependencyPath(rc_file) << "\n\t" << var("QMAKE_RC") << (project->isActiveConfig("debug") ? " -D_DEBUG" : "") - << " $(DEFINES)" << incPathStr << " -fo " << res_file << " " << rc_file; + << " $(DEFINES)" << incPathStr << " -fo " << escapeFilePath(res_file) + << ' ' << escapeFilePath(rc_file); t << endl << endl; } } @@ -829,7 +819,7 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t) ret += installMetaFile(ProKey("QMAKE_PRL_INSTALL_REPLACE"), project->first("QMAKE_INTERNAL_PRL_FILE").toQString(), dst_prl); if(!uninst.isEmpty()) uninst.append("\n\t"); - uninst.append("-$(DEL_FILE) \"" + dst_prl + "\""); + uninst.append("-$(DEL_FILE) " + escapeFilePath(dst_prl)); } if(project->isActiveConfig("create_pc")) { QString dst_pc = pkgConfigFileName(false); @@ -846,32 +836,35 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t) ret += installMetaFile(ProKey("QMAKE_PKGCONFIG_INSTALL_REPLACE"), pkgConfigFileName(true), dst_pc); if(!uninst.isEmpty()) uninst.append("\n\t"); - uninst.append("-$(DEL_FILE) \"" + dst_pc + "\""); + uninst.append("-$(DEL_FILE) " + escapeFilePath(dst_pc)); } } if(project->isActiveConfig("shared") && !project->isActiveConfig("plugin")) { QString lib_target = getLibTarget(); - lib_target.remove('"'); - QString src_targ = (project->isEmpty("DESTDIR") ? QString("$(DESTDIR)") : project->first("DESTDIR")) + lib_target; - QString dst_targ = filePrefixRoot(root, fileFixify(targetdir + lib_target, FileFixifyAbsolute)); + QString src_targ = escapeFilePath( + (project->isEmpty("DESTDIR") ? QString("$(DESTDIR)") : project->first("DESTDIR")) + + lib_target); + QString dst_targ = escapeFilePath( + filePrefixRoot(root, fileFixify(targetdir + lib_target, FileFixifyAbsolute))); if(!ret.isEmpty()) ret += "\n\t"; - ret += QString("-$(INSTALL_FILE)") + " \"" + src_targ + "\" \"" + dst_targ + "\""; + ret += QString("-$(INSTALL_FILE) ") + src_targ + ' ' + dst_targ; if(!uninst.isEmpty()) uninst.append("\n\t"); - uninst.append("-$(DEL_FILE) \"" + dst_targ + "\""); + uninst.append("-$(DEL_FILE) " + dst_targ); } } if (t == "dlltarget" || project->values(ProKey(t + ".CONFIG")).indexOf("no_dll") == -1) { QString src_targ = "$(DESTDIR_TARGET)"; - QString dst_targ = filePrefixRoot(root, fileFixify(targetdir + "$(TARGET)", FileFixifyAbsolute)); + QString dst_targ = escapeFilePath( + filePrefixRoot(root, fileFixify(targetdir + "$(TARGET)", FileFixifyAbsolute))); if(!ret.isEmpty()) ret += "\n\t"; - ret += QString("-$(INSTALL_FILE)") + " \"" + src_targ + "\" \"" + dst_targ + "\""; + ret += QString("-$(INSTALL_FILE) ") + src_targ + ' ' + dst_targ; if(!uninst.isEmpty()) uninst.append("\n\t"); - uninst.append("-$(DEL_FILE) \"" + dst_targ + "\""); + uninst.append("-$(DEL_FILE) " + dst_targ); } return ret; } @@ -880,7 +873,6 @@ QString Win32MakefileGenerator::escapeFilePath(const QString &path) const { QString ret = path; if(!ret.isEmpty()) { - ret = unescapeFilePath(ret); if (ret.contains(' ') || ret.contains('\t')) ret = "\"" + ret + "\""; debug_msg(2, "EscapeFilePath: %s -> %s", path.toLatin1().constData(), ret.toLatin1().constData()); diff --git a/qmake/generators/win32/winmakefile.h b/qmake/generators/win32/winmakefile.h index 795ca2b874..ea763c3175 100644 --- a/qmake/generators/win32/winmakefile.h +++ b/qmake/generators/win32/winmakefile.h @@ -60,6 +60,8 @@ protected: int findHighestVersion(const QString &dir, const QString &stem, const QString &ext = QLatin1String("lib")); virtual bool findLibraries(); + virtual ProString fixLibFlag(const ProString &lib); + virtual void processPrlFiles(); void processVars(); void fixTargetExt(); diff --git a/qmake/meta.cpp b/qmake/meta.cpp index 5653241b39..d7aa885541 100644 --- a/qmake/meta.cpp +++ b/qmake/meta.cpp @@ -94,9 +94,6 @@ QMakeMetaInfo::clear() QString QMakeMetaInfo::findLib(QString lib) { - if((lib[0] == '\'' || lib[0] == '"') && - lib[lib.length()-1] == lib[0]) - lib = lib.mid(1, lib.length()-2); lib = Option::normalizePath(lib); QString ret; -- cgit v1.2.3 From 70f85674291722b255e2086d409da721d9fcd71a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 20 Nov 2014 16:23:34 +0100 Subject: remove pointless path trimming there is no reason why there should be unexpected leading or trailing whitespace in an extra compiler's .depends list. Change-Id: I46be75063180131e135fc6eea0238a482073618a Reviewed-by: Joerg Bornemann --- qmake/generators/win32/msvc_objectmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index d14bb7b892..913e2a26ce 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -2347,7 +2347,7 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info) deps[i] = Option::fixPathToTargetOS( Project->replaceExtraCompilerVariables( deps.at(i), inFile, out, MakefileGenerator::NoShell), - false).trimmed(); + false); // Command for file if (combined) { // Add dependencies for each file -- cgit v1.2.3 From 1cacf1e70d01cc989d973739ce4d5c7f00c5068c Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 18 Nov 2014 14:57:21 +0100 Subject: more autotests for spaces, destdirs and library linking Change-Id: Ie106d1151e61a50081bccea0a6d0d70728451a5b Reviewed-by: Joerg Bornemann --- .../quotedfilenames/include folder/header.h | 1 + .../tools/qmake/testdata/quotedfilenames/main.cpp | 2 +- .../testdata/quotedfilenames/quotedfilenames.pro | 6 ++- .../tools/qmake/testdata/simple_app/simple_app.pro | 4 +- .../tools/qmake/testdata/simple_dll/simple_dll.pro | 4 +- .../tools/qmake/testdata/simple_lib/simple_lib.pro | 4 +- .../qmake/testdata/subdirs/simple_app/main.cpp | 3 +- .../testdata/subdirs/simple_app/simple_app.pro | 7 +++- .../qmake/testdata/subdirs/simple_dll/simple.h | 9 ++++- .../testdata/subdirs/simple_dll/simple_dll.pro | 6 +-- .../auto/tools/qmake/testdata/subdirs/subdirs.pro | 4 +- tests/auto/tools/qmake/tst_qmake.cpp | 43 ++++++++++++---------- 12 files changed, 56 insertions(+), 37 deletions(-) create mode 100644 tests/auto/tools/qmake/testdata/quotedfilenames/include folder/header.h diff --git a/tests/auto/tools/qmake/testdata/quotedfilenames/include folder/header.h b/tests/auto/tools/qmake/testdata/quotedfilenames/include folder/header.h new file mode 100644 index 0000000000..595c0cac3c --- /dev/null +++ b/tests/auto/tools/qmake/testdata/quotedfilenames/include folder/header.h @@ -0,0 +1 @@ +/* a random header file */ diff --git a/tests/auto/tools/qmake/testdata/quotedfilenames/main.cpp b/tests/auto/tools/qmake/testdata/quotedfilenames/main.cpp index 4cbb8f8b09..2a56d5b59b 100644 --- a/tests/auto/tools/qmake/testdata/quotedfilenames/main.cpp +++ b/tests/auto/tools/qmake/testdata/quotedfilenames/main.cpp @@ -31,7 +31,7 @@ ** ****************************************************************************/ - +#include #include diff --git a/tests/auto/tools/qmake/testdata/quotedfilenames/quotedfilenames.pro b/tests/auto/tools/qmake/testdata/quotedfilenames/quotedfilenames.pro index 61d6f38696..c4e0257769 100644 --- a/tests/auto/tools/qmake/testdata/quotedfilenames/quotedfilenames.pro +++ b/tests/auto/tools/qmake/testdata/quotedfilenames/quotedfilenames.pro @@ -2,8 +2,12 @@ TEMPLATE = app TARGET = quotedfilenames SOURCES = main.cpp +CONFIG += no_batch + +INCLUDEPATH += "include folder" + RCCINPUT = "rc folder/test.qrc" -RCCOUTPUT = test.cpp +RCCOUTPUT = "cpp folder/test.cpp" qtPrepareTool(QMAKE_RCC, rcc) diff --git a/tests/auto/tools/qmake/testdata/simple_app/simple_app.pro b/tests/auto/tools/qmake/testdata/simple_app/simple_app.pro index c57a1c877c..0e78a91f46 100644 --- a/tests/auto/tools/qmake/testdata/simple_app/simple_app.pro +++ b/tests/auto/tools/qmake/testdata/simple_app/simple_app.pro @@ -3,5 +3,5 @@ HEADERS = test_file.h SOURCES = test_file.cpp \ main.cpp RESOURCES = test.qrc -TARGET = simple_app -DESTDIR = ./ +TARGET = "simple app" +DESTDIR = "dest dir" diff --git a/tests/auto/tools/qmake/testdata/simple_dll/simple_dll.pro b/tests/auto/tools/qmake/testdata/simple_dll/simple_dll.pro index f589d2b3d4..c427309b2a 100644 --- a/tests/auto/tools/qmake/testdata/simple_dll/simple_dll.pro +++ b/tests/auto/tools/qmake/testdata/simple_dll/simple_dll.pro @@ -10,5 +10,5 @@ VERSION = 1.0.0 INCLUDEPATH += . tmp MOC_DIR = tmp OBJECTS_DIR = tmp -TARGET = simple_dll -DESTDIR = ./ +TARGET = "simple dll" +DESTDIR = "dest dir" diff --git a/tests/auto/tools/qmake/testdata/simple_lib/simple_lib.pro b/tests/auto/tools/qmake/testdata/simple_lib/simple_lib.pro index 9abc3e9f26..cd6c7dd7f9 100644 --- a/tests/auto/tools/qmake/testdata/simple_lib/simple_lib.pro +++ b/tests/auto/tools/qmake/testdata/simple_lib/simple_lib.pro @@ -9,5 +9,5 @@ VERSION = 1.0.0 INCLUDEPATH += . tmp MOC_DIR = tmp OBJECTS_DIR = tmp -TARGET = simple_lib -DESTDIR = ./ +TARGET = "simple lib" +DESTDIR = "dest dir" diff --git a/tests/auto/tools/qmake/testdata/subdirs/simple_app/main.cpp b/tests/auto/tools/qmake/testdata/subdirs/simple_app/main.cpp index 332dde7e2f..3bc36acdb0 100644 --- a/tests/auto/tools/qmake/testdata/subdirs/simple_app/main.cpp +++ b/tests/auto/tools/qmake/testdata/subdirs/simple_app/main.cpp @@ -31,7 +31,7 @@ ** ****************************************************************************/ - +#include #include "test_file.h" #include @@ -39,6 +39,7 @@ int main( int argc, char **argv ) { QGuiApplication a( argc, argv ); + Simple s; SomeObject sc; return a.exec(); } diff --git a/tests/auto/tools/qmake/testdata/subdirs/simple_app/simple_app.pro b/tests/auto/tools/qmake/testdata/subdirs/simple_app/simple_app.pro index d63f1d4362..e882c33b3d 100644 --- a/tests/auto/tools/qmake/testdata/subdirs/simple_app/simple_app.pro +++ b/tests/auto/tools/qmake/testdata/subdirs/simple_app/simple_app.pro @@ -2,5 +2,8 @@ TEMPLATE = app HEADERS = test_file.h SOURCES = test_file.cpp \ main.cpp -TARGET = simple_app -DESTDIR = ./ +TARGET = "simple app" +DESTDIR = "dest dir" + +INCLUDEPATH += ../simple_dll +LIBS += -L"../simple_dll/dest dir" -l"simple dll" diff --git a/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple.h b/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple.h index d7e5f48730..e24df46f42 100644 --- a/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple.h +++ b/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple.h @@ -35,8 +35,13 @@ #include -//class SIMPLEDLL_EXPORT Simple -class Simple +#ifdef SIMPLEDLL_MAKEDLL +# define SIMPLEDLL_EXPORT Q_DECL_EXPORT +#else +# define SIMPLEDLL_EXPORT Q_DECL_IMPORT +#endif + +class SIMPLEDLL_EXPORT Simple { public: Simple(); diff --git a/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple_dll.pro b/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple_dll.pro index f589d2b3d4..4e362bb918 100644 --- a/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple_dll.pro +++ b/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple_dll.pro @@ -1,7 +1,7 @@ TEMPLATE = lib CONFIG += dll -win32:DEFINES += SIMPLEDLL_MAKEDLL +DEFINES += SIMPLEDLL_MAKEDLL HEADERS = simple.h SOURCES = simple.cpp @@ -10,5 +10,5 @@ VERSION = 1.0.0 INCLUDEPATH += . tmp MOC_DIR = tmp OBJECTS_DIR = tmp -TARGET = simple_dll -DESTDIR = ./ +TARGET = "simple dll" +DESTDIR = "dest dir" diff --git a/tests/auto/tools/qmake/testdata/subdirs/subdirs.pro b/tests/auto/tools/qmake/testdata/subdirs/subdirs.pro index 5da200eabb..bc96812e6d 100644 --- a/tests/auto/tools/qmake/testdata/subdirs/subdirs.pro +++ b/tests/auto/tools/qmake/testdata/subdirs/subdirs.pro @@ -1,6 +1,6 @@ TEMPLATE = subdirs -SUBDIRS = simple_app \ - simple_dll +SUBDIRS = simple_dll \ + simple_app CONFIG += ordered diff --git a/tests/auto/tools/qmake/tst_qmake.cpp b/tests/auto/tools/qmake/tst_qmake.cpp index 6f52ffb9aa..8d7f7bbc68 100644 --- a/tests/auto/tools/qmake/tst_qmake.cpp +++ b/tests/auto/tools/qmake/tst_qmake.cpp @@ -141,14 +141,15 @@ void tst_qmake::cleanup() void tst_qmake::simple_app() { QString workDir = base_path + "/testdata/simple_app"; + QString destDir = workDir + "/dest dir"; QVERIFY( test_compiler.qmake( workDir, "simple_app" )); QVERIFY( test_compiler.make( workDir )); - QVERIFY( test_compiler.exists( workDir, "simple_app", Exe, "1.0.0" )); + QVERIFY( test_compiler.exists( destDir, "simple app", Exe, "1.0.0" )); QVERIFY( test_compiler.makeClean( workDir )); - QVERIFY( test_compiler.exists( workDir, "simple_app", Exe, "1.0.0" )); // Should still exist after a make clean + QVERIFY( test_compiler.exists( destDir, "simple app", Exe, "1.0.0" )); // Should still exist after a make clean QVERIFY( test_compiler.makeDistClean( workDir )); - QVERIFY( !test_compiler.exists( workDir, "simple_app", Exe, "1.0.0" )); // Should not exist after a make distclean + QVERIFY( !test_compiler.exists( destDir, "simple app", Exe, "1.0.0" )); // Should not exist after a make distclean QVERIFY( test_compiler.removeMakefile( workDir ) ); } @@ -156,14 +157,15 @@ void tst_qmake::simple_app_shadowbuild() { QString workDir = base_path + "/testdata/simple_app"; QString buildDir = base_path + "/testdata/simple_app_build"; + QString destDir = buildDir + "/dest dir"; QVERIFY( test_compiler.qmake( workDir, "simple_app", buildDir )); QVERIFY( test_compiler.make( buildDir )); - QVERIFY( test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); + QVERIFY( test_compiler.exists( destDir, "simple app", Exe, "1.0.0" )); QVERIFY( test_compiler.makeClean( buildDir )); - QVERIFY( test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); // Should still exist after a make clean + QVERIFY( test_compiler.exists( destDir, "simple app", Exe, "1.0.0" )); // Should still exist after a make clean QVERIFY( test_compiler.makeDistClean( buildDir )); - QVERIFY( !test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); // Should not exist after a make distclean + QVERIFY( !test_compiler.exists( destDir, "simple app", Exe, "1.0.0" )); // Should not exist after a make distclean QVERIFY( test_compiler.removeMakefile( buildDir ) ); } @@ -171,46 +173,49 @@ void tst_qmake::simple_app_shadowbuild2() { QString workDir = base_path + "/testdata/simple_app"; QString buildDir = base_path + "/testdata/simple_app/build"; + QString destDir = buildDir + "/dest dir"; QVERIFY( test_compiler.qmake( workDir, "simple_app", buildDir )); QVERIFY( test_compiler.make( buildDir )); - QVERIFY( test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); + QVERIFY( test_compiler.exists( destDir, "simple app", Exe, "1.0.0" )); QVERIFY( test_compiler.makeClean( buildDir )); - QVERIFY( test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); // Should still exist after a make clean + QVERIFY( test_compiler.exists( destDir, "simple app", Exe, "1.0.0" )); // Should still exist after a make clean QVERIFY( test_compiler.makeDistClean( buildDir )); - QVERIFY( !test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); // Should not exist after a make distclean + QVERIFY( !test_compiler.exists( destDir, "simple app", Exe, "1.0.0" )); // Should not exist after a make distclean QVERIFY( test_compiler.removeMakefile( buildDir ) ); } void tst_qmake::simple_dll() { QString workDir = base_path + "/testdata/simple_dll"; + QString destDir = workDir + "/dest dir"; QDir D; D.remove( workDir + "/Makefile"); QVERIFY( test_compiler.qmake( workDir, "simple_dll" )); QVERIFY( test_compiler.make( workDir )); - QVERIFY( test_compiler.exists( workDir, "simple_dll", Dll, "1.0.0" )); + QVERIFY( test_compiler.exists( destDir, "simple dll", Dll, "1.0.0" )); QVERIFY( test_compiler.makeClean( workDir )); - QVERIFY( test_compiler.exists( workDir, "simple_dll", Dll, "1.0.0" )); // Should still exist after a make clean + QVERIFY( test_compiler.exists( destDir, "simple dll", Dll, "1.0.0" )); // Should still exist after a make clean QVERIFY( test_compiler.makeDistClean( workDir )); - QVERIFY( !test_compiler.exists( workDir, "simple_dll", Dll, "1.0.0" )); // Should not exist after a make distclean + QVERIFY( !test_compiler.exists( destDir, "simple dll", Dll, "1.0.0" )); // Should not exist after a make distclean QVERIFY( test_compiler.removeMakefile( workDir ) ); } void tst_qmake::simple_lib() { QString workDir = base_path + "/testdata/simple_lib"; + QString destDir = workDir + "/dest dir"; QDir D; D.remove( workDir + "/Makefile"); QVERIFY( test_compiler.qmake( workDir, "simple_lib" )); QVERIFY( test_compiler.make( workDir )); - QVERIFY( test_compiler.exists( workDir, "simple_lib", Lib, "1.0.0" )); + QVERIFY( test_compiler.exists( destDir, "simple lib", Lib, "1.0.0" )); QVERIFY( test_compiler.makeClean( workDir )); - QVERIFY( test_compiler.exists( workDir, "simple_lib", Lib, "1.0.0" )); // Should still exist after a make clean + QVERIFY( test_compiler.exists( destDir, "simple lib", Lib, "1.0.0" )); // Should still exist after a make clean QVERIFY( test_compiler.makeDistClean( workDir )); - QVERIFY( !test_compiler.exists( workDir, "simple_lib", Lib, "1.0.0" )); // Should not exist after a make distclean + QVERIFY( !test_compiler.exists( destDir, "simple lib", Lib, "1.0.0" )); // Should not exist after a make distclean QVERIFY( test_compiler.removeMakefile( workDir ) ); } @@ -223,12 +228,12 @@ void tst_qmake::subdirs() D.remove( workDir + "/simple_dll/Makefile"); QVERIFY( test_compiler.qmake( workDir, "subdirs" )); QVERIFY( test_compiler.make( workDir )); - QVERIFY( test_compiler.exists( workDir + "/simple_app", "simple_app", Exe, "1.0.0" )); - QVERIFY( test_compiler.exists( workDir + "/simple_dll", "simple_dll", Dll, "1.0.0" )); + QVERIFY( test_compiler.exists( workDir + "/simple_app/dest dir", "simple app", Exe, "1.0.0" )); + QVERIFY( test_compiler.exists( workDir + "/simple_dll/dest dir", "simple dll", Dll, "1.0.0" )); QVERIFY( test_compiler.makeClean( workDir )); // Should still exist after a make clean - QVERIFY( test_compiler.exists( workDir + "/simple_app", "simple_app", Exe, "1.0.0" )); - QVERIFY( test_compiler.exists( workDir + "/simple_dll", "simple_dll", Dll, "1.0.0" )); + QVERIFY( test_compiler.exists( workDir + "/simple_app/dest dir", "simple app", Exe, "1.0.0" )); + QVERIFY( test_compiler.exists( workDir + "/simple_dll/dest dir", "simple dll", Dll, "1.0.0" )); // Since subdirs templates do not have a make dist clean, we should clean up ourselves // properly QVERIFY( test_compiler.makeDistClean( workDir )); -- cgit v1.2.3 From e0962270d74db5950b9567d4996189f115a1c75a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 24 Nov 2014 16:02:38 +0100 Subject: replace incorrect uses of fixPathToLocalOS() (mostly) in most cases, it actually means normalizePath() (because the file name is used with qt i/o functions afterwards). this affects QMakeLocalFile::local() as well, so many not immediately obvious places are affected as well. there was also one case of fixPathToTargetOS() falling into this category. this is mostly a no-op, as the qt functions are agnostic to the path separator. in some other cases (in particular in the vcproj generator), it actually means fixPathToTargetOS(). this is mostly a no-op as well, as the two functions are equal except on msys anyway. in the FileName() functions, the use of a fixPath*() function is bogus in the first place - fileFixify() already does fixPathToTargetOS(), and this is correct when the file name is used verbatim in a make command (which it is). otherwise it's irrelevant. Change-Id: I26712da8f888c704f8b7f42dbe24c941b6ad031d Reviewed-by: Joerg Bornemann --- qmake/generators/mac/pbuilder_pbx.cpp | 4 +- qmake/generators/makefile.cpp | 66 +++++++++++++------------- qmake/generators/makefiledeps.cpp | 2 +- qmake/generators/unix/unixmake.cpp | 10 ++-- qmake/generators/unix/unixmake2.cpp | 8 ++-- qmake/generators/win32/mingw_make.cpp | 6 +-- qmake/generators/win32/msbuild_objectmodel.cpp | 6 +-- qmake/generators/win32/msvc_objectmodel.cpp | 4 +- qmake/generators/win32/msvc_vcproj.cpp | 17 +++---- qmake/generators/win32/winmakefile.cpp | 12 ++--- 10 files changed, 68 insertions(+), 67 deletions(-) diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index bc094d82d1..e1918f2c7a 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -151,7 +151,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t) subdir += Option::dir_sep; tmp = subdir + tmp; } - QFileInfo fi(fileInfo(Option::fixPathToLocalOS(tmp, true))); + QFileInfo fi(fileInfo(Option::normalizePath(tmp))); if(fi.exists()) { if(fi.isDir()) { QString profile = tmp; @@ -1076,7 +1076,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) if (!project->isEmpty("DESTDIR")) { QString phase_key = keyFor("QMAKE_PBX_TARGET_COPY_PHASE"); QString destDir = project->first("DESTDIR").toQString(); - destDir = fileInfo(Option::fixPathToLocalOS(destDir)).absoluteFilePath(); + destDir = fileInfo(Option::normalizePath(destDir)).absoluteFilePath(); project->values("QMAKE_PBX_BUILDPHASES").append(phase_key); t << "\t\t" << phase_key << " = {\n" << "\t\t\t" << writeSettings("isa", "PBXShellScriptBuildPhase", SettingsNoQuote) << ";\n" diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 39c00d72d7..3e06f3fec0 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -75,7 +75,7 @@ bool MakefileGenerator::canExecute(const QStringList &cmdline, int *a) const if(a) *a = argv0; if(argv0 != -1) { - const QString c = Option::fixPathToLocalOS(cmdline.at(argv0), true); + const QString c = Option::normalizePath(cmdline.at(argv0)); if(exists(c)) return true; } @@ -90,7 +90,7 @@ QString MakefileGenerator::mkdir_p_asstring(const QString &dir, bool escape) con bool MakefileGenerator::mkdir(const QString &in_path) const { - QString path = Option::fixPathToLocalOS(in_path); + QString path = Option::normalizePath(in_path); if(QFile::exists(path)) return true; @@ -213,8 +213,8 @@ MakefileGenerator::initOutPaths() QString finp = fileFixify((*input).toQString(), Option::output_dir, Option::output_dir); *input = ProString(finp); QString path = replaceExtraCompilerVariables(tmp_out, finp, QString(), NoShell); - path = Option::fixPathToTargetOS(path); - int slash = path.lastIndexOf(Option::dir_sep); + path = Option::normalizePath(path); + int slash = path.lastIndexOf('/'); if(slash != -1) { path = path.left(slash); // Make out path only if it does not contain makefile variables @@ -230,7 +230,7 @@ MakefileGenerator::initOutPaths() if(!v["DESTDIR"].isEmpty()) { QDir d(v["DESTDIR"].first().toQString()); - if(Option::fixPathToLocalOS(d.absolutePath()) == Option::fixPathToLocalOS(Option::output_dir)) + if (Option::normalizePath(d.absolutePath()) == Option::normalizePath(Option::output_dir)) v.remove("DESTDIR"); } } @@ -293,8 +293,8 @@ MakefileGenerator::findFilesInVPATH(ProStringList l, uchar flags, const QString } for (ProStringList::Iterator vpath_it = vpath.begin(); vpath_it != vpath.end(); ++vpath_it) { - QString real_dir = Option::fixPathToLocalOS((*vpath_it).toQString()); - if(exists(real_dir + QDir::separator() + val)) { + QString real_dir = Option::normalizePath((*vpath_it).toQString()); + if (exists(real_dir + '/' + val)) { ProString dir = (*vpath_it); if(!dir.endsWith(Option::dir_sep)) dir += Option::dir_sep; @@ -818,7 +818,7 @@ MakefileGenerator::init() if(!project->isEmpty("TRANSLATIONS")) { ProStringList &trf = project->values("TRANSLATIONS"); for (ProStringList::Iterator it = trf.begin(); it != trf.end(); ++it) - (*it) = Option::fixPathToLocalOS((*it).toQString()); + (*it) = Option::fixPathToTargetOS((*it).toQString()); } //fix up the target deps @@ -844,9 +844,9 @@ MakefileGenerator::init() if (exists(dep)) { out_deps.append(dep); } else { - QString dir, regex = Option::fixPathToLocalOS(dep); - if(regex.lastIndexOf(Option::dir_sep) != -1) { - dir = regex.left(regex.lastIndexOf(Option::dir_sep) + 1); + QString dir, regex = Option::normalizePath(dep); + if (regex.lastIndexOf('/') != -1) { + dir = regex.left(regex.lastIndexOf('/') + 1); regex.remove(0, dir.length()); } QStringList files = QDir(dir).entryList(QStringList(regex)); @@ -885,7 +885,7 @@ MakefileGenerator::processPrlFile(QString &file) meta_file = tmp; } // meta_file = fileFixify(meta_file); - QString real_meta_file = Option::fixPathToLocalOS(meta_file); + QString real_meta_file = Option::normalizePath(meta_file); if(!meta_file.isEmpty()) { QString f = fileFixify(real_meta_file, qmake_getpwd(), Option::output_dir); if(QMakeMetaInfo::libExists(f)) { @@ -905,7 +905,7 @@ MakefileGenerator::processPrlFile(QString &file) defs.append(def); if(try_replace_file && !libinfo.isEmpty("QMAKE_PRL_TARGET")) { QString dir; - int slsh = real_meta_file.lastIndexOf(Option::dir_sep); + int slsh = real_meta_file.lastIndexOf('/'); if(slsh != -1) dir = real_meta_file.left(slsh+1); file = libinfo.first("QMAKE_PRL_TARGET").toQString(); @@ -1102,7 +1102,7 @@ MakefileGenerator::prlFileName(bool fixify) if(fixify) { if(!project->isEmpty("DESTDIR")) ret.prepend(project->first("DESTDIR").toQString()); - ret = Option::fixPathToLocalOS(fileFixify(ret, qmake_getpwd(), Option::output_dir)); + ret = fileFixify(ret, qmake_getpwd(), Option::output_dir); } return ret; } @@ -1294,7 +1294,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild) uninst.append(rm_dir_contents + " " + escapeFilePath(filePrefixRoot(root, fileFixify(dst_dir + filestr, FileFixifyAbsolute, false)))); continue; } - QString local_dirstr = Option::fixPathToLocalOS(dirstr, true); + QString local_dirstr = Option::normalizePath(dirstr); QStringList files = QDir(local_dirstr).entryList(QStringList(filestr), QDir::NoDotAndDotDot | QDir::AllEntries); if (installConfigValues.contains("no_check_exist") && files.isEmpty()) { @@ -1504,7 +1504,7 @@ MakefileGenerator::createObjectList(const ProStringList &sources) objdir = project->first("OBJECTS_DIR").toQString(); for (ProStringList::ConstIterator it = sources.begin(); it != sources.end(); ++it) { QString sfn = (*it).toQString(); - QFileInfo fi(fileInfo(Option::fixPathToLocalOS(sfn))); + QFileInfo fi(fileInfo(Option::normalizePath(sfn))); QString dir; if (project->isActiveConfig("object_parallel_to_source")) { // The source paths are relative to the output dir, but we need source-relative paths @@ -1604,7 +1604,7 @@ MakefileGenerator::replaceExtraCompilerVariables( } else if(var == QLatin1String("QMAKE_FILE_BASE") || var == QLatin1String("QMAKE_FILE_IN_BASE")) { //filePath = true; for(int i = 0; i < in.size(); ++i) { - QFileInfo fi(fileInfo(Option::fixPathToLocalOS(in.at(i)))); + QFileInfo fi(fileInfo(Option::normalizePath(in.at(i)))); QString base = fi.completeBaseName(); if(base.isNull()) base = fi.fileName(); @@ -1613,7 +1613,7 @@ MakefileGenerator::replaceExtraCompilerVariables( } else if(var == QLatin1String("QMAKE_FILE_EXT")) { filePath = true; for(int i = 0; i < in.size(); ++i) { - QFileInfo fi(fileInfo(Option::fixPathToLocalOS(in.at(i)))); + QFileInfo fi(fileInfo(Option::normalizePath(in.at(i)))); QString ext; // Ensure complementarity with QMAKE_FILE_BASE int baseLen = fi.completeBaseName().length(); @@ -1626,11 +1626,11 @@ MakefileGenerator::replaceExtraCompilerVariables( } else if(var == QLatin1String("QMAKE_FILE_PATH") || var == QLatin1String("QMAKE_FILE_IN_PATH")) { filePath = true; for(int i = 0; i < in.size(); ++i) - val += fileInfo(Option::fixPathToLocalOS(in.at(i))).path(); + val += fileInfo(Option::normalizePath(in.at(i))).path(); } else if(var == QLatin1String("QMAKE_FILE_NAME") || var == QLatin1String("QMAKE_FILE_IN")) { filePath = true; for(int i = 0; i < in.size(); ++i) - val += fileInfo(Option::fixPathToLocalOS(in.at(i))).filePath(); + val += fileInfo(Option::normalizePath(in.at(i))).filePath(); } } @@ -1642,11 +1642,11 @@ MakefileGenerator::replaceExtraCompilerVariables( } else if(var == QLatin1String("QMAKE_FILE_OUT")) { filePath = true; for(int i = 0; i < out.size(); ++i) - val += fileInfo(Option::fixPathToLocalOS(out.at(i))).filePath(); + val += fileInfo(Option::normalizePath(out.at(i))).filePath(); } else if(var == QLatin1String("QMAKE_FILE_OUT_BASE")) { //filePath = true; for(int i = 0; i < out.size(); ++i) { - QFileInfo fi(fileInfo(Option::fixPathToLocalOS(out.at(i)))); + QFileInfo fi(fileInfo(Option::normalizePath(out.at(i)))); QString base = fi.completeBaseName(); if(base.isNull()) base = fi.fileName(); @@ -1690,7 +1690,7 @@ MakefileGenerator::verifyExtraCompiler(const ProString &comp, const QString &fil { if(noIO()) return false; - const QString file = Option::fixPathToLocalOS(file_unfixed); + const QString file = Option::normalizePath(file_unfixed); const ProStringList &config = project->values(ProKey(comp + ".CONFIG")); if (config.indexOf("moc_verify") != -1) { @@ -1953,8 +1953,8 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) QList depdirs = QMakeSourceFileInfo::dependencyPaths(); for (QList::Iterator dit = depdirs.begin(); dit != depdirs.end(); ++dit) { - if (exists((*dit).real() + Option::dir_sep + file)) { - localFile = (*dit).local() + Option::dir_sep + file; + if (exists((*dit).local() + '/' + file)) { + localFile = (*dit).local() + '/' + file; break; } } @@ -2045,8 +2045,8 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) QList depdirs = QMakeSourceFileInfo::dependencyPaths(); for (QList::Iterator dit = depdirs.begin(); dit != depdirs.end(); ++dit) { - if (exists((*dit).real() + Option::dir_sep + file)) { - localFile = (*dit).local() + Option::dir_sep + file; + if (exists((*dit).local() + '/' + file)) { + localFile = (*dit).local() + '/' + file; break; } } @@ -2358,7 +2358,7 @@ MakefileGenerator::findSubDirsSubTargets() const if (!project->isEmpty(dtkey)) { st->depends += project->first(dtkey); } else { - QString d = Option::fixPathToLocalOS(subName); + QString d = Option::fixPathToTargetOS(subName); const ProKey dfkey(fixedSubDep + ".file"); if (!project->isEmpty(dfkey)) { d = project->first(dfkey).toQString(); @@ -2701,7 +2701,7 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll) t << escapeDependencyPath(fileFixify(project->cacheFile())) << " "; } if(!specdir().isEmpty()) { - if(exists(Option::fixPathToLocalOS(specdir()+QDir::separator()+"qmake.conf"))) + if (exists(Option::normalizePath(specdir() + "/qmake.conf"))) t << escapeDependencyPath(specdir() + Option::dir_sep + "qmake.conf") << " "; } const ProStringList &included = escapeDependencyPaths(project->values("QMAKE_INTERNAL_INCLUDED_FILES")); @@ -2856,7 +2856,7 @@ MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const Q out_dir = out_fi.canonicalFilePath(); } - QString qfile(Option::fixPathToLocalOS(ret, true, canon)); + QString qfile(Option::normalizePath(ret)); QFileInfo qfileinfo(fileInfo(qfile)); if(out_dir != in_dir || !qfileinfo.isRelative()) { if(qfileinfo.isRelative()) { @@ -2985,7 +2985,7 @@ MakefileGenerator::findFileForDep(const QMakeLocalFileName &dep, const QMakeLoca } } { //is it from an EXTRA_TARGET - const QString dep_basename = dep.local().section(Option::dir_sep, -1); + const QString dep_basename = dep.local().section('/', -1); const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS"); for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it) { QString targ = var(ProKey(*it + ".target")); @@ -2999,7 +2999,7 @@ MakefileGenerator::findFileForDep(const QMakeLocalFileName &dep, const QMakeLoca } } { //is it from an EXTRA_COMPILER - const QString dep_basename = dep.local().section(Option::dir_sep, -1); + const QString dep_basename = dep.local().section('/', -1); const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS"); for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) { const ProString &tmp_out = project->first(ProKey(*it + ".output")); @@ -3129,7 +3129,7 @@ MakefileGenerator::pkgConfigFileName(bool fixify) if(fixify) { if(QDir::isRelativePath(ret) && !project->isEmpty("DESTDIR")) ret.prepend(project->first("DESTDIR").toQString()); - ret = Option::fixPathToLocalOS(fileFixify(ret, qmake_getpwd(), Option::output_dir)); + ret = fileFixify(ret, qmake_getpwd(), Option::output_dir); } return ret; } diff --git a/qmake/generators/makefiledeps.cpp b/qmake/generators/makefiledeps.cpp index 9258c3df8d..79e017a560 100644 --- a/qmake/generators/makefiledeps.cpp +++ b/qmake/generators/makefiledeps.cpp @@ -77,7 +77,7 @@ const QString &QMakeLocalFileName::local() const { if(!is_null && local_name.isNull()) - local_name = Option::fixPathToLocalOS(real_name, true); + local_name = Option::normalizePath(real_name); return local_name; } diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 2c98e716d0..4ee18c46ab 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -511,7 +511,7 @@ UnixMakefileGenerator::findLibraries() for (ProStringList::Iterator extit = extens.begin(); extit != extens.end(); ++extit) { if(dir.isNull()) { for(QList::Iterator dep_it = libdirs.begin(); dep_it != libdirs.end(); ++dep_it) { - QString pathToLib = ((*dep_it).local() + Option::dir_sep + QString pathToLib = ((*dep_it).local() + '/' + project->first("QMAKE_PREFIX_SHLIB") + stub + "." + (*extit)); if(exists(pathToLib)) { @@ -531,7 +531,7 @@ UnixMakefileGenerator::findLibraries() } if(!found && project->isActiveConfig("compile_libtool")) { for(int dep_i = 0; dep_i < libdirs.size(); ++dep_i) { - if (exists(libdirs[dep_i].local() + Option::dir_sep + project->first("QMAKE_PREFIX_SHLIB") + stub + Option::libtool_ext)) { + if (exists(libdirs[dep_i].local() + '/' + project->first("QMAKE_PREFIX_SHLIB") + stub + Option::libtool_ext)) { (*it) = libdirs[dep_i].real() + Option::dir_sep + project->first("QMAKE_PREFIX_SHLIB") + stub + Option::libtool_ext; found = true; break; @@ -579,15 +579,15 @@ UnixMakefileGenerator::processPrlFiles() for(int dep_i = 0; dep_i < libdirs.size(); ++dep_i) { const QMakeLocalFileName &lfn = libdirs[dep_i]; if(!project->isActiveConfig("compile_libtool")) { //give them the .libs.. - QString la = lfn.local() + Option::dir_sep + project->first("QMAKE_PREFIX_SHLIB") + lib + Option::libtool_ext; - if(exists(la) && QFile::exists(lfn.local() + Option::dir_sep + ".libs")) { + QString la = lfn.local() + '/' + project->first("QMAKE_PREFIX_SHLIB") + lib + Option::libtool_ext; + if (exists(la) && QFile::exists(lfn.local() + "/.libs")) { QString dot_libs = lfn.real() + Option::dir_sep + ".libs"; l.append("-L" + dot_libs); libdirs.insert(libidx++, QMakeLocalFileName(dot_libs)); } } - QString prl = lfn.local() + Option::dir_sep + project->first("QMAKE_PREFIX_SHLIB") + lib + prl_ext; + QString prl = lfn.local() + '/' + project->first("QMAKE_PREFIX_SHLIB") + lib + prl_ext; if(processPrlFile(prl)) { if(prl.startsWith(lfn.local())) prl.replace(0, lfn.local().length(), lfn.real()); diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 641b475cba..ea9a03b174 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -805,7 +805,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) QString info_plist = fileFixify(project->first("QMAKE_INFO_PLIST").toQString()); if (info_plist.isEmpty()) info_plist = specdir() + QDir::separator() + "Info.plist." + project->first("TEMPLATE"); - if (!exists(Option::fixPathToLocalOS(info_plist))) { + if (!exists(Option::normalizePath(info_plist))) { warn_msg(WarnLogic, "Could not resolve Info.plist: '%s'. Check if QMAKE_INFO_PLIST points to a valid file.", info_plist.toLatin1().constData()); break; @@ -898,12 +898,12 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) int pos = name.indexOf('/'); if (pos > 0) name = name.mid(0, pos); - symlinks[Option::fixPathToLocalOS(path + name)] = + symlinks[Option::fixPathToTargetOS(path + name)] = project->first(vkey) + "/Current/" + name; path += version; } path += project->first(pkey).toQString(); - path = Option::fixPathToLocalOS(path); + path = Option::fixPathToTargetOS(path); for(int file = 0; file < files.count(); file++) { QString fn = files.at(file).toQString(); QString src = fileFixify(fn, FileFixifyAbsolute); @@ -1397,7 +1397,7 @@ UnixMakefileGenerator::libtoolFileName(bool fixify) if(fixify) { if(QDir::isRelativePath(ret) && !project->isEmpty("DESTDIR")) ret.prepend(project->first("DESTDIR").toQString()); - ret = Option::fixPathToLocalOS(fileFixify(ret, qmake_getpwd(), Option::output_dir)); + ret = fileFixify(ret, qmake_getpwd(), Option::output_dir); } return ret; } diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp index b5bb7b5b7e..af5e62330e 100644 --- a/qmake/generators/win32/mingw_make.cpp +++ b/qmake/generators/win32/mingw_make.cpp @@ -91,9 +91,9 @@ bool MingwMakefileGenerator::findLibraries() if (ver > 0) extension += QString::number(ver); extension += suffix; - if(QMakeMetaInfo::libExists((*dir_it).local() + Option::dir_sep + steam) || - exists((*dir_it).local() + Option::dir_sep + steam + extension + ".a") || - exists((*dir_it).local() + Option::dir_sep + steam + extension + ".dll.a")) { + if (QMakeMetaInfo::libExists((*dir_it).local() + '/' + steam) + || exists((*dir_it).local() + '/' + steam + extension + ".a") + || exists((*dir_it).local() + '/' + steam + extension + ".dll.a")) { out = *it + extension; break; } diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index a6ca07efee..3bb70c5c19 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -1900,11 +1900,11 @@ bool VCXProjectWriter::outputFileConfig(OutputFilterData *d, XmlOutput &xml, Xml fileAdded = true; xmlFilter << tag("CustomBuild") - << attrTag("Include",Option::fixPathToLocalOS(filename)) + << attrTag("Include", Option::fixPathToTargetOS(filename)) << attrTagS("Filter", filter.Name); xml << tag("CustomBuild") - << attrTag("Include",Option::fixPathToLocalOS(filename)); + << attrTag("Include", Option::fixPathToTargetOS(filename)); if (filter.Name.startsWith("Form Files") || filter.Name.startsWith("Generated Files") @@ -1963,7 +1963,7 @@ bool VCXProjectWriter::outputFileConfig(OutputFilterData *d, XmlOutput &xml, Xml void VCXProjectWriter::outputFileConfig(XmlOutput &xml, XmlOutput &xmlFilter, const QString &filePath, const QString &filterName) { - const QString nativeFilePath = Option::fixPathToLocalOS(filePath); + const QString nativeFilePath = Option::fixPathToTargetOS(filePath); if (filterName.startsWith("Source Files")) { xmlFilter << tag("ClCompile") << attrTag("Include", nativeFilePath) diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 913e2a26ce..4a65d24687 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -2901,7 +2901,7 @@ void VCProjectWriter::write(XmlOutput &xml, VCFilter &tool) for (int i = 0; i < tool.Files.count(); ++i) { const VCFilterFile &info = tool.Files.at(i); xml << tag(q_File) - << attrS(_RelativePath, Option::fixPathToLocalOS(info.file)) + << attrS(_RelativePath, Option::fixPathToTargetOS(info.file)) << data(); // In case no custom builds, to avoid "/>" endings outputFileConfig(tool, xml, tool.Files.at(i).file); xml << closetag(q_File); @@ -2960,7 +2960,7 @@ void VCProjectWriter::outputFilter(VCProject &project, XmlOutput &xml, const QSt void VCProjectWriter::outputFileConfigs(VCProject &project, XmlOutput &xml, const VCFilterFile &info, const QString &filtername) { xml << tag(q_File) - << attrS(_RelativePath, Option::fixPathToLocalOS(info.file)); + << attrS(_RelativePath, Option::fixPathToTargetOS(info.file)); for (int i = 0; i < project.SingleProjects.count(); ++i) { VCFilter filter = project.SingleProjects.at(i).filterByName(filtername); if (filter.Config) // only if the filter is not empty diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 5da6f5807d..57557732c5 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -324,7 +324,8 @@ QUuid VcprojGenerator::getProjectUUID(const QString &filename) // If none, create one based on the MD5 of absolute project path if(uuid.isNull() || !filename.isEmpty()) { - QString abspath = Option::fixPathToLocalOS(filename.isEmpty()?project->first("QMAKE_MAKEFILE").toQString():filename); + QString abspath = Option::fixPathToTargetOS( + filename.isEmpty() ? project->first("QMAKE_MAKEFILE").toQString() : filename); QByteArray digest = QCryptographicHash::hash(abspath.toUtf8(), QCryptographicHash::Sha1); memcpy((unsigned char*)(&uuid), digest.constData(), sizeof(QUuid)); validUUID = !uuid.isNull(); @@ -457,14 +458,14 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash subdir = collectedIt.next(); QString profile = subdir.first; - QFileInfo fi(fileInfo(Option::fixPathToLocalOS(profile, true))); + QFileInfo fi(fileInfo(Option::normalizePath(profile))); if (fi.exists()) { if (fi.isDir()) { if (!profile.endsWith(Option::dir_sep)) profile += Option::dir_sep; profile += fi.baseName() + Option::pro_ext; QString profileKey = fi.absoluteFilePath(); - fi = QFileInfo(fileInfo(Option::fixPathToLocalOS(profile, true))); + fi = QFileInfo(fileInfo(Option::normalizePath(profile))); if (!fi.exists()) continue; projLookup.insert(profileKey, fi.absoluteFilePath()); @@ -1344,13 +1345,13 @@ void VcprojGenerator::initDeploymentTool() || devicePath.at(0) == QLatin1Char('\\') || devicePath.at(0) == QLatin1Char('%'))) { // create output path - devicePath = Option::fixPathToLocalOS(QDir::cleanPath(targetPath + QLatin1Char('\\') + devicePath)); + devicePath = Option::fixPathToTargetOS(targetPath + QLatin1Char('\\') + devicePath); } } // foreach d in item.files foreach (const ProString &src, project->values(ProKey(item + ".files"))) { QString itemDevicePath = devicePath; - QString source = Option::fixPathToLocalOS(src.toQString()); + QString source = Option::normalizePath(src.toQString()); QString nameFilter; QFileInfo info(source); QString searchPath; @@ -1359,7 +1360,7 @@ void VcprojGenerator::initDeploymentTool() itemDevicePath += "\\" + info.fileName(); searchPath = info.absoluteFilePath(); } else { - nameFilter = source.split('\\').last(); + nameFilter = info.fileName(); searchPath = info.absolutePath(); } @@ -1371,10 +1372,10 @@ void VcprojGenerator::initDeploymentTool() while(iterator.hasNext()) { iterator.next(); if (conf.WinRT) { - QString absoluteItemFilePath = Option::fixPathToLocalOS(QFileInfo(iterator.filePath()).absoluteFilePath()); + QString absoluteItemFilePath = Option::fixPathToTargetOS(QFileInfo(iterator.filePath()).absoluteFilePath()); vcProject.DeploymentFiles.addFile(absoluteItemFilePath); } else { - QString absoluteItemPath = Option::fixPathToLocalOS(QFileInfo(iterator.filePath()).absolutePath()); + QString absoluteItemPath = Option::fixPathToTargetOS(QFileInfo(iterator.filePath()).absolutePath()); // Identify if it is just another subdir int diffSize = absoluteItemPath.size() - pathSize; // write out rules diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index bcacdb0615..69a3e9c783 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -52,12 +52,12 @@ Win32MakefileGenerator::Win32MakefileGenerator() : MakefileGenerator() int Win32MakefileGenerator::findHighestVersion(const QString &d, const QString &stem, const QString &ext) { - QString bd = Option::fixPathToLocalOS(d, true); + QString bd = Option::normalizePath(d); if(!exists(bd)) return -1; QMakeMetaInfo libinfo(project); - bool libInfoRead = libinfo.readLib(bd + Option::dir_sep + stem); + bool libInfoRead = libinfo.readLib(bd + '/' + stem); // If the library, for which we're trying to find the highest version // number, is a static library @@ -146,8 +146,8 @@ Win32MakefileGenerator::findLibraries() extension += QString::number(ver); extension += suffix; extension += ".lib"; - if(QMakeMetaInfo::libExists((*it).local() + Option::dir_sep + lib) || - exists((*it).local() + Option::dir_sep + lib + extension)) { + if (QMakeMetaInfo::libExists((*it).local() + '/' + lib) + || exists((*it).local() + '/' + lib + extension)) { out = (*it).real() + Option::dir_sep + lib + extension; break; } @@ -156,7 +156,7 @@ Win32MakefileGenerator::findLibraries() if(out.isEmpty()) out = lib + ".lib"; (*it) = out; - } else if(!exists(Option::fixPathToLocalOS(opt))) { + } else if (!exists(Option::normalizePath(opt))) { QList lib_dirs; QString file = Option::fixPathToTargetOS(opt); int slsh = file.lastIndexOf(Option::dir_sep); @@ -223,7 +223,7 @@ Win32MakefileGenerator::processPrlFiles() else tmp = opt; for(QList::Iterator it = libdirs.begin(); it != libdirs.end(); ++it) { - QString prl = (*it).local() + Option::dir_sep + tmp; + QString prl = (*it).local() + '/' + tmp; if (processPrlFile(prl)) break; } -- cgit v1.2.3 From 552741143724e43d8b06132537b389da7e4ff837 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 24 Nov 2014 19:51:32 +0100 Subject: remove pointless fixPathToTargetOS() calls it makes no sense to call it on paths that are fixified right before or after, as fileFixify() calls it itself. and verifyExtraCompiler() calls normalizePath() on its file argument. Change-Id: I8fb21e129fd29428d1855de73483087842bc1bdd Reviewed-by: Joerg Bornemann --- qmake/generators/makefile.cpp | 19 ++++++++----------- qmake/generators/unix/unixmake.cpp | 3 +-- qmake/generators/unix/unixmake2.cpp | 2 +- qmake/generators/win32/msvc_nmake.cpp | 3 +-- qmake/generators/win32/winmakefile.cpp | 5 ++--- 5 files changed, 13 insertions(+), 19 deletions(-) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 3e06f3fec0..5c0fd046bc 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -725,8 +725,7 @@ MakefileGenerator::init() if((*input).isEmpty()) continue; QString inpf = (*input).toQString(); - QString in = Option::fixPathToTargetOS(inpf, false); - if (!verifyExtraCompiler((*it).toQString(), in)) //verify + if (!verifyExtraCompiler((*it).toQString(), inpf)) //verify continue; QString out = replaceExtraCompilerVariables(tmp_out.toQString(), inpf, QString(), NoShell); out = fileFixify(out, Option::output_dir, Option::output_dir); @@ -1052,7 +1051,7 @@ MakefileGenerator::writeProjectMakefile() writeSubTargets(t, targets, SubTargetsNoFlags); if(!project->isActiveConfig("no_autoqmake")) { - QString mkf = escapeDependencyPath(Option::fixPathToTargetOS(fileFixify(Option::output.fileName()))); + QString mkf = escapeDependencyPath(fileFixify(Option::output.fileName())); for(QList::Iterator it = targets.begin(); it != targets.end(); ++it) t << escapeDependencyPath((*it)->makefile) << ": " << mkf << endl; } @@ -1509,7 +1508,6 @@ MakefileGenerator::createObjectList(const ProStringList &sources) if (project->isActiveConfig("object_parallel_to_source")) { // The source paths are relative to the output dir, but we need source-relative paths QString sourceRelativePath = fileFixify(sfn, qmake_getpwd(), Option::output_dir); - sourceRelativePath = Option::fixPathToTargetOS(sourceRelativePath, false); if (sourceRelativePath.startsWith(".." + Option::dir_sep)) sourceRelativePath = fileFixify(sourceRelativePath, FileFixifyAbsolute); @@ -1732,7 +1730,7 @@ MakefileGenerator::verifyExtraCompiler(const ProString &comp, const QString &fil if((*input).isEmpty()) continue; QString inpf = (*input).toQString(); - QString in = fileFixify(Option::fixPathToTargetOS(inpf, false)); + QString in = fileFixify(inpf); if(in == file) { bool pass = project->test(verify.toKey(), QList() << ProStringList(replaceExtraCompilerVariables(tmp_out.toQString(), inpf, QString(), NoShell)) << @@ -1764,7 +1762,7 @@ MakefileGenerator::verifyExtraCompiler(const ProString &comp, const QString &fil if((*input).isEmpty()) continue; QString inpf = (*input).toQString(); - QString in = fileFixify(Option::fixPathToTargetOS(inpf, false)); + QString in = fileFixify(inpf); if(in == file) { QString out = replaceExtraCompilerVariables(tmp_out, inpf, QString(), NoShell); QString cmd = replaceExtraCompilerVariables(tmp_cmd, in, out, LocalShell); @@ -1832,8 +1830,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) for (ProStringList::ConstIterator it2 = comp_inputs.begin(); it2 != comp_inputs.end(); ++it2) { const ProStringList &tmp = project->values((*it2).toKey()); for (ProStringList::ConstIterator input = tmp.begin(); input != tmp.end(); ++input) { - QString in = Option::fixPathToTargetOS((*input).toQString(), false); - if(verifyExtraCompiler((*it), in)) + if (verifyExtraCompiler((*it), (*input).toQString())) tmp_inputs.append((*input)); } } @@ -2250,7 +2247,7 @@ QString MakefileGenerator::build_args(const QString &outdir) ret += buildArgs(); //output - QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName())); + QString ofile = fileFixify(Option::output.fileName()); if(!ofile.isEmpty() && ofile != project->first("QMAKE_MAKEFILE")) ret += " -o " + escapeFilePath(ofile); @@ -2579,7 +2576,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QListisEmpty("QMAKE_FAILED_REQUIREMENTS") && !project->isEmpty("QMAKE_INTERNAL_PRL_FILE")) { QStringList files = escapeFilePaths(fileFixify(Option::mkfile::project_files)); t << escapeDependencyPath(project->first("QMAKE_INTERNAL_PRL_FILE").toQString()) << ": \n\t" diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 4ee18c46ab..3a76d898ed 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -716,10 +716,9 @@ UnixMakefileGenerator::defaultInstall(const QString &t) const QString root = "$(INSTALL_ROOT)"; ProStringList &uninst = project->values(ProKey(t + ".uninstall")); QString ret, destdir = project->first("DESTDIR").toQString(); - QString targetdir = Option::fixPathToTargetOS(project->first("target.path").toQString(), false); if(!destdir.isEmpty() && destdir.right(1) != Option::dir_sep) destdir += Option::dir_sep; - targetdir = fileFixify(targetdir, FileFixifyAbsolute); + QString targetdir = fileFixify(project->first("target.path").toQString(), FileFixifyAbsolute); if(targetdir.right(1) != Option::dir_sep) targetdir += Option::dir_sep; diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index ea9a03b174..c14395ae27 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -1056,7 +1056,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } t << fileVarGlue("QMAKE_DISTCLEAN","\t-$(DEL_FILE) "," ","\n"); { - QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName())); + QString ofile = fileFixify(Option::output.fileName()); if(!ofile.isEmpty()) t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << endl; } diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index 450f224654..ae888cb96d 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -252,8 +252,7 @@ QString NmakeMakefileGenerator::defaultInstall(const QString &t) const QString root = "$(INSTALL_ROOT)"; ProStringList &uninst = project->values(ProKey(t + ".uninstall")); - QString targetdir = Option::fixPathToTargetOS(project->first(ProKey(t + ".path")).toQString(), false); - targetdir = fileFixify(targetdir, FileFixifyAbsolute); + QString targetdir = fileFixify(project->first(ProKey(t + ".path")).toQString(), FileFixifyAbsolute); if(targetdir.right(1) != Option::dir_sep) targetdir += Option::dir_sep; diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index 69a3e9c783..5458e8f2c4 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -581,7 +581,7 @@ void Win32MakefileGenerator::writeCleanParts(QTextStream &t) } t << "\n\t-$(DEL_FILE) $(DESTDIR_TARGET)\n"; { - QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName())); + QString ofile = fileFixify(Option::output.fileName()); if(!ofile.isEmpty()) t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << endl; } @@ -803,8 +803,7 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t) const QString root = "$(INSTALL_ROOT)"; ProStringList &uninst = project->values(ProKey(t + ".uninstall")); QString ret; - QString targetdir = Option::fixPathToTargetOS(project->first(ProKey(t + ".path")).toQString(), false); - targetdir = fileFixify(targetdir, FileFixifyAbsolute); + QString targetdir = fileFixify(project->first(ProKey(t + ".path")).toQString(), FileFixifyAbsolute); if(targetdir.right(1) != Option::dir_sep) targetdir += Option::dir_sep; -- cgit v1.2.3 From 6c4d8ee83569f281613d5395c9ddc38bf5dc6dd9 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 24 Nov 2014 20:36:28 +0100 Subject: fix fixPathToTargetOS() nesting first replaceExtraCompilerVariables(..., NoShell), then fix the final result. Change-Id: If8cebeaa59f48d91b33b5a74e6a48a0d2d049643 Reviewed-by: Joerg Bornemann --- qmake/generators/mac/pbuilder_pbx.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index e1918f2c7a..36ec6ef742 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -771,8 +771,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) mkt << "\\\n\t"; ++added; const QString file_name = fileFixify(fn, Option::output_dir, Option::output_dir); - mkt << " " << escapeDependencyPath(replaceExtraCompilerVariables( - Option::fixPathToTargetOS(tmp_out.first().toQString(), false), file_name, QString(), NoShell)); + mkt << ' ' << escapeDependencyPath(Option::fixPathToTargetOS( + replaceExtraCompilerVariables(tmp_out.first().toQString(), file_name, QString(), NoShell))); } } } -- cgit v1.2.3 From 0812b5b31882f53bf7e92d9f69f0da70a5654f2d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 24 Nov 2014 21:11:00 +0100 Subject: untangle handling extra compiler .clean member it's easy when it is a simple list of files (or just absent). however, it can also contain expandos, and in this case it's definitely not a good idea to treat it partly (but not really) as a single shell command. Change-Id: I7ef32a56f276b06579fc7094357c5f7612eaf205 Reviewed-by: Joerg Bornemann --- qmake/generators/makefile.cpp | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 5c0fd046bc..f2decd71a5 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -1852,7 +1852,8 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) t << endl; if (config.indexOf("no_clean") == -1) { - QString tmp_clean = escapeFilePaths(project->values(ProKey(*it + ".clean"))).join(' '); + const ProStringList &raw_clean = project->values(ProKey(*it + ".clean")); + QString tmp_clean = escapeFilePaths(raw_clean).join(' '); QString tmp_clean_cmds = project->values(ProKey(*it + ".clean_commands")).join(' '); if(!tmp_inputs.isEmpty()) clean_targets += QString("compiler_" + (*it) + "_clean "); @@ -1871,28 +1872,31 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) wrote_clean = true; } if(!wrote_clean_cmds || !wrote_clean) { - ProStringList cleans; + QStringList q_raw_clean = raw_clean.toQStringList(); + QStringList cleans; const QString del_statement("-$(DEL_FILE)"); if(!wrote_clean) { - if(project->isActiveConfig("no_delete_multiple_files")) { - for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) { - QString tinp = (*input).toQString(); - cleans.append(" " + Option::fixPathToTargetOS(replaceExtraCompilerVariables(tmp_clean, tinp, - replaceExtraCompilerVariables(tmp_out, tinp, QString(), NoShell), TargetShell))); + QStringList dels; + for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) { + QString tinp = (*input).toQString(); + QString out = replaceExtraCompilerVariables(tmp_out, tinp, QString(), NoShell); + foreach (const QString &rc, q_raw_clean) { + dels << ' ' + escapeFilePath(Option::fixPathToTargetOS( + replaceExtraCompilerVariables(rc, tinp, out, NoShell), false)); } + } + if(project->isActiveConfig("no_delete_multiple_files")) { + cleans = dels; } else { - QString files, file; + QString files; const int commandlineLimit = 2047; // NT limit, expanded - for(int input = 0; input < tmp_inputs.size(); ++input) { - QString tinp = tmp_inputs.at(input).toQString(); - file = " " + replaceExtraCompilerVariables(tmp_clean, tinp, - replaceExtraCompilerVariables(tmp_out, tinp, QString(), NoShell), TargetShell); + foreach (const QString &file, dels) { if(del_statement.length() + files.length() + qMax(fixEnvVariables(file).length(), file.length()) > commandlineLimit) { cleans.append(files); files.clear(); } - files += Option::fixPathToTargetOS(file); + files += file; } if(!files.isEmpty()) cleans.append(files); -- cgit v1.2.3 From 217f21c4792034a3c9ba8ad8fcc6292fffef7154 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 24 Nov 2014 14:55:35 +0100 Subject: remove nonsensical path stripping we strip the path a few lines above already. Change-Id: If7524b8e744d2f1ab2f5a6920097d25671449829 Reviewed-by: Joerg Bornemann --- qmake/generators/win32/winmakefile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index 5458e8f2c4..ad6a19e5df 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -169,7 +169,7 @@ Win32MakefileGenerator::findLibraries() if(file.endsWith(".lib")) { file = file.left(file.length() - 4); if(!file.at(file.length()-1).isNumber()) { - ProString suffix = project->first(ProKey("QMAKE_" + file.section(Option::dir_sep, -1).toUpper() + "_SUFFIX")); + ProString suffix = project->first(ProKey("QMAKE_" + file.toUpper() + "_SUFFIX")); for(QList::Iterator dep_it = lib_dirs.begin(); dep_it != lib_dirs.end(); ++dep_it) { QString lib_tmpl(file + "%1" + suffix + ".lib"); int ver = findHighestVersion((*dep_it).local(), file); -- cgit v1.2.3 From 7e71eec3c82697cd3799fb58a4bb9fc4a8bc6d6e Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 20 Nov 2014 15:33:54 +0100 Subject: use relative paths for build dir references apart from being more readable, it has the side effect of being resistant to spaces in the build path. Change-Id: Id12603c3a96765913e747fba4070d49de0705315 Reviewed-by: Joerg Bornemann --- configure | 2 +- tools/configure/configureapp.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/configure b/configure index f74af093b9..973d18fe6a 100755 --- a/configure +++ b/configure @@ -3964,7 +3964,7 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ]; adjoutpath=`echo "$outpath" | sed 's/ /\\\\\\\\ /g'` adjqmakespec=`echo "$QMAKESPEC" | sed 's/ /\\\\\\\\ /g'` - echo "BUILD_PATH = $adjoutpath" >> "$mkfile" + echo "BUILD_PATH = .." >> "$mkfile" echo "SOURCE_PATH = $adjrelpath" >> "$mkfile" if [ -e "$relpath/.git" ]; then echo 'INC_PATH = $(BUILD_PATH)/include' >> "$mkfile" diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 0516ad7cd8..4c8adfaf30 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -3160,7 +3160,7 @@ void Configure::detectArch() // run qmake QString command = QString("%1 -spec %2 %3") - .arg(QDir::toNativeSeparators(buildPath + "/bin/qmake.exe"), + .arg(QDir::toNativeSeparators(QDir(newpwd).relativeFilePath(buildPath + "/bin/qmake.exe")), QDir::toNativeSeparators(qmakespec), QDir::toNativeSeparators(sourcePath + "/config.tests/arch/arch" + (data.isHost ? "_host" : "") + ".pro")); @@ -3268,7 +3268,7 @@ bool Configure::tryCompileProject(const QString &projectPath, const QString &ext // run qmake QString command = QString("%1 %2 %3 2>&1") - .arg(QDir::toNativeSeparators(buildPath + "/bin/qmake.exe"), + .arg(QDir::toNativeSeparators(QDir(newpwd).relativeFilePath(buildPath + "/bin/qmake.exe")), QDir::toNativeSeparators(sourcePath + "/config.tests/" + projectPath), extraOptions); @@ -4133,10 +4133,10 @@ void Configure::buildQmake() if (out.open(QFile::WriteOnly | QFile::Text)) { QTextStream stream(&out); stream << "#AutoGenerated by configure.exe" << endl - << "BUILD_PATH = " << QDir::toNativeSeparators(buildPath) << endl + << "BUILD_PATH = .." << endl << "SOURCE_PATH = " << QDir::toNativeSeparators(sourcePath) << endl << "INC_PATH = " << QDir::toNativeSeparators( - (QFile::exists(sourcePath + "/.git") ? buildPath : sourcePath) + (QFile::exists(sourcePath + "/.git") ? ".." : sourcePath) + "/include") << endl; stream << "QT_VERSION = " << dictionary["VERSION"] << endl; if (dictionary[ "QMAKESPEC" ] == QString("win32-g++")) { -- cgit v1.2.3 From b6f0060f60a5ce3367164c6450f1a6154baebac1 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 27 Nov 2014 14:12:40 +0100 Subject: support spaces in build and install dirs spaces in the source dir are not supported for now, as that requires some more profound refactoring of the bootstrap makefiles. Change-Id: Ie0c07a1558b8326f642f2ea144bc1cd85ee761af Reviewed-by: Joerg Bornemann --- bin/syncqt.pl | 1 + config.tests/unix/arch.test | 6 +++--- config.tests/unix/compile.test | 10 +++++----- configure | 2 +- configure.bat | 2 +- mkspecs/features/qt_config.prf | 16 +++++++++++----- mkspecs/features/qt_module_headers.prf | 2 +- mkspecs/features/qt_module_pris.prf | 29 +++++++++++++++-------------- mkspecs/features/testlib_defines.prf | 2 +- 9 files changed, 39 insertions(+), 31 deletions(-) diff --git a/bin/syncqt.pl b/bin/syncqt.pl index 4462cebe4e..1b9b197173 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -379,6 +379,7 @@ sub fixPaths { my $out = File::Spec->abs2rel(cleanupPath($file), cleanupPath($dir)); $out =~ s,\\,/,g; + $out = "\"$out\"" if ($out =~ / /); return $out; } diff --git a/config.tests/unix/arch.test b/config.tests/unix/arch.test index 56d71e6066..c50bd8b30a 100755 --- a/config.tests/unix/arch.test +++ b/config.tests/unix/arch.test @@ -23,14 +23,14 @@ while [ "$#" -gt 0 ]; do PARAM=$1 case $PARAM in -L*|-l*) - LFLAGS="$LFLAGS $PARAM" + LFLAGS="$LFLAGS \"$PARAM\"" ;; -I*) INC=`echo $PARAM | sed -e 's/^-I//'` - INCLUDEPATH="$INCLUDEPATH $INC" + INCLUDEPATH="$INCLUDEPATH \"$INC\"" ;; -D*) - CXXFLAGS="$CXXFLAGS $PARAM" + CXXFLAGS="$CXXFLAGS \"$PARAM\"" ;; *) ;; esac diff --git a/config.tests/unix/compile.test b/config.tests/unix/compile.test index 67325f2c20..103321e451 100755 --- a/config.tests/unix/compile.test +++ b/config.tests/unix/compile.test @@ -33,18 +33,18 @@ while [ "$#" -gt 0 ]; do shift ;; -F*|-m*|-x*) - LFLAGS="$LFLAGS $PARAM" - CXXFLAGS="$CXXFLAGS $PARAM" + LFLAGS="$LFLAGS \"$PARAM\"" + CXXFLAGS="$CXXFLAGS \"$PARAM\"" ;; -L*|-l*|-pthread) - LFLAGS="$LFLAGS $PARAM" + LFLAGS="$LFLAGS \"$PARAM\"" ;; -I*) INC=`echo $PARAM | sed -e 's/^-I//'` - INCLUDEPATH="$INCLUDEPATH $INC" + INCLUDEPATH="$INCLUDEPATH \"$INC\"" ;; -f*|-D*) - CXXFLAGS="$CXXFLAGS $PARAM" + CXXFLAGS="$CXXFLAGS \"$PARAM\"" ;; -Qoption) # Two-argument form for the Sun Compiler diff --git a/configure b/configure index 973d18fe6a..b83ca24369 100755 --- a/configure +++ b/configure @@ -4047,7 +4047,7 @@ fi #------------------------------------------------------------------------------- # Verify makespec #------------------------------------------------------------------------------- -QMAKE_OUTPUT=`$outpath/bin/qmake -E -nocache -spec "$XQMAKESPEC" "QT=" $DEV_NULL 2>&1` +QMAKE_OUTPUT=`"$outpath/bin/qmake" -E -nocache -spec "$XQMAKESPEC" "QT=" $DEV_NULL 2>&1` if [ $? != "0" ]; then echo "Failed to process makespec for platform '$XPLATFORM'" if [ "$OPT_VERBOSE" = "yes" ]; then diff --git a/configure.bat b/configure.bat index 6852ec7146..0f0638b3db 100644 --- a/configure.bat +++ b/configure.bat @@ -47,7 +47,7 @@ if not exist mkspecs ( md mkspecs if errorlevel 1 goto exit ) -perl %QTSRC%bin\syncqt.pl -minimal -module QtCore -outdir %QTDIR% %QTSRC% +perl %QTSRC%bin\syncqt.pl -minimal -module QtCore -outdir "%QTDIR%" %QTSRC% if errorlevel 1 goto exit if not exist tools\configure ( diff --git a/mkspecs/features/qt_config.prf b/mkspecs/features/qt_config.prf index 208681d98a..973a2182c9 100644 --- a/mkspecs/features/qt_config.prf +++ b/mkspecs/features/qt_config.prf @@ -5,16 +5,21 @@ QMAKE_QT_CONFIG = $$[QT_HOST_DATA/get]/mkspecs/qconfig.pri debug(1, "Cannot load qconfig.pri!") } else { debug(1, "Loaded .qconfig.pri from ($$QMAKE_QT_CONFIG)") - QMAKE_MODULE_PATH = $$split($$list($$(QMAKEMODULES)), $$DIRLIST_SEPARATOR) + dirs = $$(QMAKEMODULES) + QMAKE_MODULE_PATH = $$split(dirs, $$DIRLIST_SEPARATOR) QMAKE_MODULE_PATH += $$QMAKEMODULES - QMAKE_MODULE_PATH += $$split($$list($$[QMAKEMODULES]), $$DIRLIST_SEPARATOR) - QMAKE_MODULE_PATH += $$replace($$list($$split($$list($$[QMAKE_MKSPECS]), $$DIRLIST_SEPARATOR)), \ - \$, /modules) + dirs = $$[QMAKEMODULES] + QMAKE_MODULE_PATH += $$split(dirs, $$DIRLIST_SEPARATOR) + dirs = $$[QMAKE_MKSPECS] + dirs = $$split(dirs, $$DIRLIST_SEPARATOR) + QMAKE_MODULE_PATH += $$replace(dirs, \$, /modules) + unset(dirs) QMAKE_MODULE_PATH = $$unique(QMAKE_MODULE_PATH) QMAKE_MODULE_PATH = $$reverse(QMAKE_MODULE_PATH) for(dir, QMAKE_MODULE_PATH) { debug(1, "Loading modules from $${dir}") - for(mod, $$list($$files($$dir/qt_*.pri))) { + mods = $$files($$dir/qt_*.pri) + for (mod, mods) { # For installed Qt these paths will be common for all modules. # For uninstalled prefix builds these will vary per module, via the # forwarding module pri files. Keep qt_module_pris.prf in sync with this! @@ -28,6 +33,7 @@ QMAKE_QT_CONFIG = $$[QT_HOST_DATA/get]/mkspecs/qconfig.pri QT_MODULE_QML_BASE = $$[QT_INSTALL_QML] include($$mod) } + unset(mods) } QT_MODULES = $$unique(QT_MODULES) # In case modules appear in multiple places unset(QT_MODULE_INCLUDE_BASE) diff --git a/mkspecs/features/qt_module_headers.prf b/mkspecs/features/qt_module_headers.prf index 5015d58861..fc3ec75e82 100644 --- a/mkspecs/features/qt_module_headers.prf +++ b/mkspecs/features/qt_module_headers.prf @@ -21,7 +21,7 @@ load(qt_build_paths) QMAKE_SYNCQT += -module $$MODULE_INCNAME -version $$VERSION } QMAKE_SYNCQT += \ - -outdir $$MODULE_BASE_OUTDIR $$MODULE_SYNCQT_DIR + -outdir $$system_quote($$MODULE_BASE_OUTDIR) $$MODULE_SYNCQT_DIR !silent: message($$QMAKE_SYNCQT) system($$QMAKE_SYNCQT)|error("Failed to run: $$QMAKE_SYNCQT") } diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf index 74517a3fde..fd639b10ad 100644 --- a/mkspecs/features/qt_module_pris.prf +++ b/mkspecs/features/qt_module_pris.prf @@ -48,9 +48,10 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri module_libs = "\$\$QT_MODULE_LIB_BASE" unix:!static { host_build: \ - module_rpath = "QT.$${MODULE_ID}.rpath = $$[QT_HOST_LIBS]" + module_rpath = $$[QT_HOST_LIBS] else: \ - module_rpath = "QT.$${MODULE_ID}.rpath = $$[QT_INSTALL_LIBS/dev]" + module_rpath = $$[QT_INSTALL_LIBS/dev] + module_rpath = "QT.$${MODULE_ID}.rpath = $$val_escape(module_rpath)" } else { module_rpath = } @@ -93,7 +94,7 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri internal_module: \ MODULE_INCLUDES += $$MODULE_PRIVATE_INCLUDES split_incpath: \ - MODULE_FWD_PRI_CONT_SUFFIX += "QT.$${MODULE_ID}.includes += $$MODULE_SHADOW_INCLUDES" + MODULE_FWD_PRI_CONT_SUFFIX += "QT.$${MODULE_ID}.includes += $$val_escape(MODULE_SHADOW_INCLUDES)" MODULE_PRI_CONT = \ "QT.$${MODULE_ID}.VERSION = $${VERSION}" \ "QT.$${MODULE_ID}.MAJOR_VERSION = $$section(VERSION, ., 0, 0)" \ @@ -117,7 +118,7 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri $$module_rundep \ "QT.$${MODULE_ID}.module_config =$$join(module_build_type, " ", " ")" \ $$module_config \ - "QT.$${MODULE_ID}.DEFINES = $$MODULE_DEFINES" \ # assume sufficient quoting + "QT.$${MODULE_ID}.DEFINES = $$val_escape(MODULE_DEFINES)" \ "" \ "QT_MODULES += $$MODULE" write_file($$MODULE_PRI, MODULE_PRI_CONT)|error("Aborting.") @@ -147,18 +148,18 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri # Create a forwarding module .pri file MODULE_FWD_PRI_CONT = \ - "QT_MODULE_BIN_BASE = $$MODULE_BASE_OUTDIR/bin" \ - "QT_MODULE_INCLUDE_BASE = $$MODULE_BASE_INCDIR/include" \ - "QT_MODULE_IMPORT_BASE = $$MODULE_BASE_OUTDIR/imports" \ - "QT_MODULE_QML_BASE = $$MODULE_BASE_OUTDIR/qml" \ - "QT_MODULE_LIB_BASE = $$MODULE_BASE_OUTDIR/lib" \ - "QT_MODULE_HOST_LIB_BASE = $$MODULE_BASE_OUTDIR/lib" \ - "QT_MODULE_LIBEXEC_BASE = $$MODULE_BASE_OUTDIR/libexec" \ - "QT_MODULE_PLUGIN_BASE = $$MODULE_BASE_OUTDIR/plugins" \ - "include($$MODULE_PRI)" \ + "QT_MODULE_BIN_BASE = $$val_escape(MODULE_BASE_OUTDIR)/bin" \ + "QT_MODULE_INCLUDE_BASE = $$val_escape(MODULE_BASE_INCDIR)/include" \ + "QT_MODULE_IMPORT_BASE = $$val_escape(MODULE_BASE_OUTDIR)/imports" \ + "QT_MODULE_QML_BASE = $$val_escape(MODULE_BASE_OUTDIR)/qml" \ + "QT_MODULE_LIB_BASE = $$val_escape(MODULE_BASE_OUTDIR)/lib" \ + "QT_MODULE_HOST_LIB_BASE = $$val_escape(MODULE_BASE_OUTDIR)/lib" \ + "QT_MODULE_LIBEXEC_BASE = $$val_escape(MODULE_BASE_OUTDIR)/libexec" \ + "QT_MODULE_PLUGIN_BASE = $$val_escape(MODULE_BASE_OUTDIR)/plugins" \ + "include($$val_escape(MODULE_PRI))" \ "QT.$${MODULE_ID}.priority = 1" !internal_module: MODULE_FWD_PRI_CONT += \ - "include($$MODULE_PRIVATE_PRI)" \ + "include($$val_escape(MODULE_PRIVATE_PRI))" \ "QT.$${MODULE}_private.priority = 1" MODULE_FWD_PRI_CONT += $$MODULE_FWD_PRI_CONT_SUFFIX write_file($$MODULE_FWD_PRI, MODULE_FWD_PRI_CONT)|error("Aborting.") diff --git a/mkspecs/features/testlib_defines.prf b/mkspecs/features/testlib_defines.prf index 59540689d3..9176beb9dd 100644 --- a/mkspecs/features/testlib_defines.prf +++ b/mkspecs/features/testlib_defines.prf @@ -1 +1 @@ -DEFINES += QT_TESTCASE_BUILDDIR=\\\"$$OUT_PWD\\\" +DEFINES += QT_TESTCASE_BUILDDIR=$$shell_quote(\"$$OUT_PWD\") -- cgit v1.2.3 From cb95fff1c7dfcfc00b1bf93d18b80485aca9dd0c Mon Sep 17 00:00:00 2001 From: Jani Heikkinen Date: Mon, 16 Feb 2015 11:44:46 +0200 Subject: Fixed license headers Change-Id: Ibebe1318d1c2de97601aa07269705c87737083ee Reviewed-by: Oswald Buddenhagen --- bin/fixqt4headers.pl | 2 +- bin/syncqt.pl | 2 +- config.tests/mac/corewlan/corewlantest.mm | 2 +- config.tests/unix/ipc_posix/ipc.cpp | 2 +- config.tests/unix/ipc_sysv/ipc.cpp | 2 +- examples/widgets/graphicsview/boxes/basic.fsh | 2 +- examples/widgets/graphicsview/boxes/basic.vsh | 2 +- examples/widgets/graphicsview/boxes/dotted.fsh | 2 +- examples/widgets/graphicsview/boxes/fresnel.fsh | 2 +- examples/widgets/graphicsview/boxes/glass.fsh | 2 +- examples/widgets/graphicsview/boxes/granite.fsh | 2 +- examples/widgets/graphicsview/boxes/marble.fsh | 2 +- examples/widgets/graphicsview/boxes/reflection.fsh | 2 +- examples/widgets/graphicsview/boxes/refraction.fsh | 2 +- examples/widgets/graphicsview/boxes/wood.fsh | 2 +- examples/widgets/mac/qmaccocoaviewcontainer/main.mm | 2 +- examples/widgets/mac/qmacnativewidget/main.mm | 2 +- mkspecs/features/data/headersclean/tst_headersclean.cpp.in | 2 +- mkspecs/macx-ios-clang/rename_main.sh | 2 +- .../qtproject/qt5/android/accessibility/QtAccessibilityDelegate.java | 2 +- .../org/qtproject/qt5/android/accessibility/QtNativeAccessibility.java | 2 +- src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java | 2 +- src/android/jar/src/org/qtproject/qt5/android/QtEditText.java | 2 +- src/android/jar/src/org/qtproject/qt5/android/QtInputConnection.java | 2 +- src/android/jar/src/org/qtproject/qt5/android/QtLayout.java | 2 +- src/android/jar/src/org/qtproject/qt5/android/QtNative.java | 2 +- src/android/jar/src/org/qtproject/qt5/android/QtNativeLibrariesDir.java | 2 +- src/android/jar/src/org/qtproject/qt5/android/QtSurface.java | 2 +- src/corelib/io/qfilesystemwatcher_fsevents.mm | 2 +- src/corelib/io/qsettings_winrt.cpp | 2 +- src/corelib/io/qstandardpaths_ios.mm | 2 +- src/corelib/io/qurl_mac.mm | 2 +- src/corelib/kernel/qcore_mac_objc.mm | 2 +- src/corelib/tools/qbytearray_mac.mm | 2 +- src/corelib/tools/qbytearraylist.cpp | 2 +- src/corelib/tools/qbytearraylist.h | 2 +- src/corelib/tools/qdatetime_mac.mm | 2 +- src/corelib/tools/qlocale_mac.mm | 2 +- src/corelib/tools/qstring_mac.mm | 2 +- src/corelib/tools/qversionnumber.cpp | 2 +- src/corelib/tools/qversionnumber_p.h | 2 +- src/corelib/xml/make-parser.sh | 2 +- src/gui/accessible/qaccessiblecache_mac.mm | 2 +- src/gui/kernel/qplatformgraphicsbuffer.cpp | 2 +- src/gui/kernel/qplatformgraphicsbuffer.h | 2 +- src/gui/kernel/qplatformgraphicsbufferhelper.cpp | 2 +- src/gui/kernel/qplatformgraphicsbufferhelper.h | 2 +- src/gui/painting/qdrawhelper_neon_asm.S | 2 +- src/network/access/qnetworkreplynsurlconnectionimpl.mm | 2 +- src/network/socket/qtcpserver_p.h | 2 +- src/network/ssl/qsslcertificate_openssl.cpp | 2 +- src/network/ssl/qsslcertificate_qt.cpp | 2 +- src/network/ssl/qsslcertificate_winrt.cpp | 2 +- src/network/ssl/qsslkey_openssl.cpp | 2 +- src/network/ssl/qsslkey_winrt.cpp | 2 +- src/network/ssl/qsslsocket_winrt.cpp | 2 +- src/network/ssl/qsslsocket_winrt_p.h | 2 +- src/platformsupport/cglconvenience/cglconvenience.mm | 2 +- src/platformsupport/clipboard/qmacmime.mm | 2 +- src/platformsupport/eventdispatchers/qeventdispatcher_cf.mm | 2 +- src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm | 2 +- src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm | 2 +- .../jar/src/org/qtproject/qt5/android/bearer/QtNetworkReceiver.java | 2 +- src/plugins/bearer/corewlan/qcorewlanengine.mm | 2 +- src/plugins/platforms/cocoa/main.mm | 2 +- src/plugins/platforms/cocoa/qcocoaaccessibility.mm | 2 +- src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm | 2 +- src/plugins/platforms/cocoa/qcocoaapplication.mm | 2 +- src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm | 2 +- src/plugins/platforms/cocoa/qcocoaautoreleasepool.mm | 2 +- src/plugins/platforms/cocoa/qcocoabackingstore.mm | 2 +- src/plugins/platforms/cocoa/qcocoaclipboard.mm | 2 +- src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm | 2 +- src/plugins/platforms/cocoa/qcocoacursor.mm | 2 +- src/plugins/platforms/cocoa/qcocoadrag.mm | 2 +- src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm | 2 +- src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm | 2 +- src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm | 2 +- src/plugins/platforms/cocoa/qcocoaglcontext.mm | 2 +- src/plugins/platforms/cocoa/qcocoahelpers.mm | 2 +- src/plugins/platforms/cocoa/qcocoainputcontext.mm | 2 +- src/plugins/platforms/cocoa/qcocoaintegration.mm | 2 +- src/plugins/platforms/cocoa/qcocoaintrospection.mm | 2 +- src/plugins/platforms/cocoa/qcocoakeymapper.mm | 2 +- src/plugins/platforms/cocoa/qcocoamenuloader.mm | 2 +- src/plugins/platforms/cocoa/qcocoamimetypes.mm | 2 +- src/plugins/platforms/cocoa/qcocoanativeinterface.mm | 2 +- src/plugins/platforms/cocoa/qcocoaprintersupport.mm | 2 +- src/plugins/platforms/cocoa/qcocoaservices.mm | 2 +- src/plugins/platforms/cocoa/qcocoasystemsettings.mm | 2 +- src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm | 2 +- src/plugins/platforms/cocoa/qcocoatheme.mm | 2 +- src/plugins/platforms/cocoa/qcocoawindow.mm | 2 +- src/plugins/platforms/cocoa/qmacclipboard.mm | 2 +- src/plugins/platforms/cocoa/qmultitouch_mac.mm | 2 +- src/plugins/platforms/cocoa/qnsview.mm | 2 +- src/plugins/platforms/cocoa/qnsviewaccessibility.mm | 2 +- src/plugins/platforms/cocoa/qnswindowdelegate.mm | 2 +- src/plugins/platforms/cocoa/qpaintengine_mac.mm | 2 +- src/plugins/platforms/cocoa/qprintengine_mac.mm | 2 +- .../platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmscursor.cpp | 2 +- .../platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmscursor.h | 2 +- .../platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp | 2 +- .../platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.h | 2 +- .../eglfs/deviceintegration/eglfs_kms/qeglfskmsintegration.cpp | 2 +- .../platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsintegration.h | 2 +- .../platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsmain.cpp | 2 +- .../platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.cpp | 2 +- .../platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.h | 2 +- .../platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11main.cpp | 2 +- src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp | 2 +- src/plugins/platforms/eglfs/qeglfsoffscreenwindow.cpp | 2 +- src/plugins/platforms/eglfs/qeglfsoffscreenwindow.h | 2 +- src/plugins/platforms/ios/plugin.mm | 2 +- src/plugins/platforms/ios/qiosapplicationdelegate.mm | 2 +- src/plugins/platforms/ios/qiosapplicationstate.mm | 2 +- src/plugins/platforms/ios/qiosbackingstore.mm | 2 +- src/plugins/platforms/ios/qiosclipboard.mm | 2 +- src/plugins/platforms/ios/qioscontext.mm | 2 +- src/plugins/platforms/ios/qioseventdispatcher.mm | 2 +- src/plugins/platforms/ios/qiosglobal.mm | 2 +- src/plugins/platforms/ios/qiosinputcontext.mm | 2 +- src/plugins/platforms/ios/qiosintegration.mm | 2 +- src/plugins/platforms/ios/qiosmenu.h | 2 +- src/plugins/platforms/ios/qiosmenu.mm | 2 +- src/plugins/platforms/ios/qiosplatformaccessibility.mm | 2 +- src/plugins/platforms/ios/qiosscreen.mm | 2 +- src/plugins/platforms/ios/qiosservices.mm | 2 +- src/plugins/platforms/ios/qiostextresponder.h | 2 +- src/plugins/platforms/ios/qiostextresponder.mm | 2 +- src/plugins/platforms/ios/qiostheme.mm | 2 +- src/plugins/platforms/ios/qiosviewcontroller.mm | 2 +- src/plugins/platforms/ios/qioswindow.mm | 2 +- src/plugins/platforms/ios/quiaccessibilityelement.mm | 2 +- src/plugins/platforms/ios/quiview.mm | 2 +- src/plugins/platforms/ios/quiview_accessibility.mm | 2 +- src/plugins/platforms/windows/qwindowsscaling.h | 2 +- src/plugins/platforms/winrt/qwinrtfiledialoghelper.cpp | 2 +- src/plugins/platforms/winrt/qwinrtfiledialoghelper.h | 2 +- src/plugins/platforms/winrt/qwinrtfileengine.cpp | 2 +- src/plugins/platforms/winrt/qwinrtfileengine.h | 2 +- src/plugins/platforms/xcb/gl_integrations/qxcbglintegration.cpp | 2 +- src/plugins/platforms/xcb/gl_integrations/qxcbglintegration.h | 2 +- src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp | 2 +- src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.h | 2 +- src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationplugin.h | 2 +- .../platforms/xcb/gl_integrations/qxcbnativeinterfacehandler.cpp | 2 +- src/plugins/platforms/xcb/gl_integrations/qxcbnativeinterfacehandler.h | 2 +- src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglcontext.h | 2 +- src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglinclude.h | 2 +- .../platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp | 2 +- src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.h | 2 +- src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglmain.cpp | 2 +- .../xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp | 2 +- .../xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.h | 2 +- src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp | 2 +- src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.h | 2 +- .../platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp | 2 +- src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.h | 2 +- src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxmain.cpp | 2 +- .../xcb/gl_integrations/xcb_glx/qxcbglxnativeinterfacehandler.cpp | 2 +- .../xcb/gl_integrations/xcb_glx/qxcbglxnativeinterfacehandler.h | 2 +- src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp | 2 +- src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.h | 2 +- src/printsupport/dialogs/qpagesetupdialog_mac.mm | 2 +- src/printsupport/dialogs/qprintdialog_mac.mm | 2 +- src/testlib/qtestblacklist.cpp | 2 +- src/tools/moc/util/generate.sh | 2 +- src/tools/moc/util/licenseheader.txt | 2 +- src/tools/qlalr/examples/glsl/build.sh | 2 +- src/tools/qlalr/examples/glsl/glsl-lex.l | 2 +- src/tools/qlalr/examples/qparser/calc.l | 2 +- src/widgets/dialogs/qfiledialog.ui | 2 +- src/widgets/dialogs/qfiledialog_embedded.ui | 2 +- src/widgets/doc/snippets/macmainwindow.mm | 2 +- src/widgets/styles/qmacstyle_mac.mm | 2 +- src/widgets/util/qscroller_mac.mm | 2 +- src/widgets/widgets/qmaccocoaviewcontainer_mac.mm | 2 +- src/widgets/widgets/qmacnativewidget_mac.mm | 2 +- src/widgets/widgets/qmenu_mac.mm | 2 +- tests/auto/compilerwarnings/data/test_cpp.txt | 2 +- tests/auto/corelib/io/qurl/tst_qurl_mac.mm | 2 +- tests/auto/corelib/tools/qbytearray/tst_qbytearray_mac.mm | 2 +- tests/auto/corelib/tools/qdatetime/tst_qdatetime_mac.mm | 2 +- tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp | 2 +- tests/auto/corelib/tools/qstring/tst_qstring_mac.mm | 2 +- tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm | 2 +- tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm | 2 +- tests/auto/widgets/kernel/qwidget/tst_qwidget_mac_helpers.mm | 2 +- tests/auto/widgets/widgets/qmenu/tst_qmenu_mac.mm | 2 +- tests/manual/cocoa/qmaccocoaviewcontainer/TestMouseMovedNSView.m | 2 +- tests/manual/cocoa/qmaccocoaviewcontainer/main.mm | 2 +- tests/manual/cocoa/qsystemtrayicon/main.cpp | 2 +- tests/manual/cocoa/qt_on_cocoa/main.mm | 2 +- tests/manual/mkspecs/test.sh | 2 +- tests/manual/qopenglwindow/multiwindow/main.cpp | 2 +- tests/manual/xcb_gl_integration/main.cpp | 2 +- util/local_database/cldr2qlocalexml.py | 2 +- util/local_database/cldr2qtimezone.py | 2 +- util/local_database/dateconverter.py | 2 +- util/local_database/enumdata.py | 2 +- util/local_database/qlocalexml2cpp.py | 2 +- util/local_database/xpathlite.py | 2 +- util/unicode/writingSystems.sh | 2 +- 204 files changed, 204 insertions(+), 204 deletions(-) diff --git a/bin/fixqt4headers.pl b/bin/fixqt4headers.pl index d39f5f3ec8..b08deb0ba2 100755 --- a/bin/fixqt4headers.pl +++ b/bin/fixqt4headers.pl @@ -1,7 +1,7 @@ #!/usr/bin/env perl ############################################################################# ## -## Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +## Copyright (C) 2015 The Qt Company Ltd. ## Contact: http://www.qt.io/licensing/ ## ## This file is part of the porting tools of the Qt Toolkit. diff --git a/bin/syncqt.pl b/bin/syncqt.pl index 1b9b197173..3bee0175ff 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -1,7 +1,7 @@ #!/usr/bin/env perl ############################################################################# ## -## Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +## Copyright (C) 2015 The Qt Company Ltd. ## Contact: http://www.qt.io/licensing/ ## ## This file is part of the build configuration tools of the Qt Toolkit. diff --git a/config.tests/mac/corewlan/corewlantest.mm b/config.tests/mac/corewlan/corewlantest.mm index bcc3be94e1..c059c45547 100644 --- a/config.tests/mac/corewlan/corewlantest.mm +++ b/config.tests/mac/corewlan/corewlantest.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the config.tests of the Qt Toolkit. diff --git a/config.tests/unix/ipc_posix/ipc.cpp b/config.tests/unix/ipc_posix/ipc.cpp index ea5af37b71..e2d2d1dc73 100644 --- a/config.tests/unix/ipc_posix/ipc.cpp +++ b/config.tests/unix/ipc_posix/ipc.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the config.tests of the Qt Toolkit. diff --git a/config.tests/unix/ipc_sysv/ipc.cpp b/config.tests/unix/ipc_sysv/ipc.cpp index 94a907c1d8..8218285685 100644 --- a/config.tests/unix/ipc_sysv/ipc.cpp +++ b/config.tests/unix/ipc_sysv/ipc.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the config.tests of the Qt Toolkit. diff --git a/examples/widgets/graphicsview/boxes/basic.fsh b/examples/widgets/graphicsview/boxes/basic.fsh index 66496b1dbc..c34ee7e0d9 100644 --- a/examples/widgets/graphicsview/boxes/basic.fsh +++ b/examples/widgets/graphicsview/boxes/basic.fsh @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the demonstration applications of the Qt Toolkit. diff --git a/examples/widgets/graphicsview/boxes/basic.vsh b/examples/widgets/graphicsview/boxes/basic.vsh index 16f97236b7..30db2abdc8 100644 --- a/examples/widgets/graphicsview/boxes/basic.vsh +++ b/examples/widgets/graphicsview/boxes/basic.vsh @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the demonstration applications of the Qt Toolkit. diff --git a/examples/widgets/graphicsview/boxes/dotted.fsh b/examples/widgets/graphicsview/boxes/dotted.fsh index 8ae23868ee..97f2aa90ee 100644 --- a/examples/widgets/graphicsview/boxes/dotted.fsh +++ b/examples/widgets/graphicsview/boxes/dotted.fsh @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the demonstration applications of the Qt Toolkit. diff --git a/examples/widgets/graphicsview/boxes/fresnel.fsh b/examples/widgets/graphicsview/boxes/fresnel.fsh index 9c98c15940..8310aa62a2 100644 --- a/examples/widgets/graphicsview/boxes/fresnel.fsh +++ b/examples/widgets/graphicsview/boxes/fresnel.fsh @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the demonstration applications of the Qt Toolkit. diff --git a/examples/widgets/graphicsview/boxes/glass.fsh b/examples/widgets/graphicsview/boxes/glass.fsh index 2ca77cf97f..ac83415476 100644 --- a/examples/widgets/graphicsview/boxes/glass.fsh +++ b/examples/widgets/graphicsview/boxes/glass.fsh @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the demonstration applications of the Qt Toolkit. diff --git a/examples/widgets/graphicsview/boxes/granite.fsh b/examples/widgets/graphicsview/boxes/granite.fsh index fd09426f9d..68f2121681 100644 --- a/examples/widgets/graphicsview/boxes/granite.fsh +++ b/examples/widgets/graphicsview/boxes/granite.fsh @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the demonstration applications of the Qt Toolkit. diff --git a/examples/widgets/graphicsview/boxes/marble.fsh b/examples/widgets/graphicsview/boxes/marble.fsh index d5ad2bccc3..e1db3402b4 100644 --- a/examples/widgets/graphicsview/boxes/marble.fsh +++ b/examples/widgets/graphicsview/boxes/marble.fsh @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the demonstration applications of the Qt Toolkit. diff --git a/examples/widgets/graphicsview/boxes/reflection.fsh b/examples/widgets/graphicsview/boxes/reflection.fsh index 1633116bdc..4366534481 100644 --- a/examples/widgets/graphicsview/boxes/reflection.fsh +++ b/examples/widgets/graphicsview/boxes/reflection.fsh @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the demonstration applications of the Qt Toolkit. diff --git a/examples/widgets/graphicsview/boxes/refraction.fsh b/examples/widgets/graphicsview/boxes/refraction.fsh index de38c17a40..caf2c7ec8b 100644 --- a/examples/widgets/graphicsview/boxes/refraction.fsh +++ b/examples/widgets/graphicsview/boxes/refraction.fsh @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the demonstration applications of the Qt Toolkit. diff --git a/examples/widgets/graphicsview/boxes/wood.fsh b/examples/widgets/graphicsview/boxes/wood.fsh index 9946e6f830..f475ebd036 100644 --- a/examples/widgets/graphicsview/boxes/wood.fsh +++ b/examples/widgets/graphicsview/boxes/wood.fsh @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the demonstration applications of the Qt Toolkit. diff --git a/examples/widgets/mac/qmaccocoaviewcontainer/main.mm b/examples/widgets/mac/qmaccocoaviewcontainer/main.mm index d6674b6266..870ab65ff7 100644 --- a/examples/widgets/mac/qmaccocoaviewcontainer/main.mm +++ b/examples/widgets/mac/qmaccocoaviewcontainer/main.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtMacExtras module of the Qt Toolkit. diff --git a/examples/widgets/mac/qmacnativewidget/main.mm b/examples/widgets/mac/qmacnativewidget/main.mm index aa2c2690d1..b01db8051b 100644 --- a/examples/widgets/mac/qmacnativewidget/main.mm +++ b/examples/widgets/mac/qmacnativewidget/main.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/mkspecs/features/data/headersclean/tst_headersclean.cpp.in b/mkspecs/features/data/headersclean/tst_headersclean.cpp.in index 357892e8c4..14655a2f98 100644 --- a/mkspecs/features/data/headersclean/tst_headersclean.cpp.in +++ b/mkspecs/features/data/headersclean/tst_headersclean.cpp.in @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/mkspecs/macx-ios-clang/rename_main.sh b/mkspecs/macx-ios-clang/rename_main.sh index 20f35df68d..b7916e1d56 100755 --- a/mkspecs/macx-ios-clang/rename_main.sh +++ b/mkspecs/macx-ios-clang/rename_main.sh @@ -2,7 +2,7 @@ ############################################################################# ## -## Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +## Copyright (C) 2015 The Qt Company Ltd. ## Contact: http://www.qt.io/licensing/ ## ## This file is the build configuration utility of the Qt Toolkit. diff --git a/src/android/accessibility/jar/src/org/qtproject/qt5/android/accessibility/QtAccessibilityDelegate.java b/src/android/accessibility/jar/src/org/qtproject/qt5/android/accessibility/QtAccessibilityDelegate.java index 0d82d73b5b..56e7543415 100644 --- a/src/android/accessibility/jar/src/org/qtproject/qt5/android/accessibility/QtAccessibilityDelegate.java +++ b/src/android/accessibility/jar/src/org/qtproject/qt5/android/accessibility/QtAccessibilityDelegate.java @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the Android port of the Qt Toolkit. diff --git a/src/android/accessibility/jar/src/org/qtproject/qt5/android/accessibility/QtNativeAccessibility.java b/src/android/accessibility/jar/src/org/qtproject/qt5/android/accessibility/QtNativeAccessibility.java index b3bea7c5e6..bfda2d55b7 100644 --- a/src/android/accessibility/jar/src/org/qtproject/qt5/android/accessibility/QtNativeAccessibility.java +++ b/src/android/accessibility/jar/src/org/qtproject/qt5/android/accessibility/QtNativeAccessibility.java @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the Android port of the Qt Toolkit. diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java index 156f61b0c1..dc80689f63 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2014 BogDan Vatra -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the Android port of the Qt Toolkit. diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtEditText.java b/src/android/jar/src/org/qtproject/qt5/android/QtEditText.java index 0fe15bc0e2..c01b0693d9 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtEditText.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtEditText.java @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Copyright (C) 2012 BogDan Vatra ** Contact: http://www.qt.io/licensing/ ** diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtInputConnection.java b/src/android/jar/src/org/qtproject/qt5/android/QtInputConnection.java index b6d97706b7..0f3e9083d4 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtInputConnection.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtInputConnection.java @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Copyright (C) 2012 BogDan Vatra ** Contact: http://www.qt.io/licensing/ ** diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtLayout.java b/src/android/jar/src/org/qtproject/qt5/android/QtLayout.java index 061d08d882..09fef4a705 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtLayout.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtLayout.java @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Copyright (C) 2012 BogDan Vatra ** Contact: http://www.qt.io/licensing/ ** diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java index 73ba2c349f..8e35840a20 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2014 BogDan Vatra -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the Android port of the Qt Toolkit. diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNativeLibrariesDir.java b/src/android/jar/src/org/qtproject/qt5/android/QtNativeLibrariesDir.java index 25c032e8be..a7dd96d609 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtNativeLibrariesDir.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtNativeLibrariesDir.java @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Copyright (C) 2012 BogDan Vatra ** Contact: http://www.qt.io/licensing/ ** diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtSurface.java b/src/android/jar/src/org/qtproject/qt5/android/QtSurface.java index cd5f90ff0b..74433d2b65 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtSurface.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtSurface.java @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2014 BogDan Vatra -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the Android port of the Qt Toolkit. diff --git a/src/corelib/io/qfilesystemwatcher_fsevents.mm b/src/corelib/io/qfilesystemwatcher_fsevents.mm index 1076b8f5b4..8a028c91e1 100644 --- a/src/corelib/io/qfilesystemwatcher_fsevents.mm +++ b/src/corelib/io/qfilesystemwatcher_fsevents.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/io/qsettings_winrt.cpp b/src/corelib/io/qsettings_winrt.cpp index bf8b157d00..02c3c7624e 100644 --- a/src/corelib/io/qsettings_winrt.cpp +++ b/src/corelib/io/qsettings_winrt.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/io/qstandardpaths_ios.mm b/src/corelib/io/qstandardpaths_ios.mm index 98e939cbda..27d28526c2 100644 --- a/src/corelib/io/qstandardpaths_ios.mm +++ b/src/corelib/io/qstandardpaths_ios.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/io/qurl_mac.mm b/src/corelib/io/qurl_mac.mm index f051dfbd32..a1fa7e4fc4 100644 --- a/src/corelib/io/qurl_mac.mm +++ b/src/corelib/io/qurl_mac.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/kernel/qcore_mac_objc.mm b/src/corelib/kernel/qcore_mac_objc.mm index 53a15ce0bc..a215557aed 100644 --- a/src/corelib/kernel/qcore_mac_objc.mm +++ b/src/corelib/kernel/qcore_mac_objc.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** - ** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). + ** Copyright (C) 2015 The Qt Company Ltd. ** Copyright (C) 2014 Petroules Corporation. ** Contact: http://www.qt.io/licensing/ ** diff --git a/src/corelib/tools/qbytearray_mac.mm b/src/corelib/tools/qbytearray_mac.mm index e05319f47f..b90c2de836 100644 --- a/src/corelib/tools/qbytearray_mac.mm +++ b/src/corelib/tools/qbytearray_mac.mm @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2014 Samuel Gaist -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/tools/qbytearraylist.cpp b/src/corelib/tools/qbytearraylist.cpp index 79c2f25868..6a2fa534a5 100644 --- a/src/corelib/tools/qbytearraylist.cpp +++ b/src/corelib/tools/qbytearraylist.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Copyright (C) 2014 by Southwest Research Institute (R) ** Contact: http://www.qt.io/licensing/ ** diff --git a/src/corelib/tools/qbytearraylist.h b/src/corelib/tools/qbytearraylist.h index 822d53f0f0..9cd241a87b 100644 --- a/src/corelib/tools/qbytearraylist.h +++ b/src/corelib/tools/qbytearraylist.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Copyright (C) 2014 by Southwest Research Institute (R) ** Contact: http://www.qt.io/licensing/ ** diff --git a/src/corelib/tools/qdatetime_mac.mm b/src/corelib/tools/qdatetime_mac.mm index c5fd7a0142..c87fc3d9ca 100644 --- a/src/corelib/tools/qdatetime_mac.mm +++ b/src/corelib/tools/qdatetime_mac.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Copyright (C) 2014 Petroules Corporation. ** Contact: http://www.qt.io/licensing/ ** diff --git a/src/corelib/tools/qlocale_mac.mm b/src/corelib/tools/qlocale_mac.mm index 4532f4b391..b581e33aef 100644 --- a/src/corelib/tools/qlocale_mac.mm +++ b/src/corelib/tools/qlocale_mac.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/tools/qstring_mac.mm b/src/corelib/tools/qstring_mac.mm index add4ed1328..c958710b3b 100644 --- a/src/corelib/tools/qstring_mac.mm +++ b/src/corelib/tools/qstring_mac.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/tools/qversionnumber.cpp b/src/corelib/tools/qversionnumber.cpp index 10e3f57140..660f40b107 100644 --- a/src/corelib/tools/qversionnumber.cpp +++ b/src/corelib/tools/qversionnumber.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Copyright (C) 2014 Keith Gardner ** Contact: http://www.qt.io/licensing/ ** diff --git a/src/corelib/tools/qversionnumber_p.h b/src/corelib/tools/qversionnumber_p.h index 4d42995ef7..2da3103be3 100644 --- a/src/corelib/tools/qversionnumber_p.h +++ b/src/corelib/tools/qversionnumber_p.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Copyright (C) 2014 Keith Gardner ** Contact: http://www.qt.io/licensing/ ** diff --git a/src/corelib/xml/make-parser.sh b/src/corelib/xml/make-parser.sh index 79a52f6e9e..2514661994 100755 --- a/src/corelib/xml/make-parser.sh +++ b/src/corelib/xml/make-parser.sh @@ -1,7 +1,7 @@ #!/bin/sh ############################################################################# ## -## Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +## Copyright (C) 2015 The Qt Company Ltd. ## Contact: http://www.qt.io/licensing/ ## ## This file is the build configuration utility of the Qt Toolkit. diff --git a/src/gui/accessible/qaccessiblecache_mac.mm b/src/gui/accessible/qaccessiblecache_mac.mm index 717496ed2b..b0266ee25f 100644 --- a/src/gui/accessible/qaccessiblecache_mac.mm +++ b/src/gui/accessible/qaccessiblecache_mac.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtGui module of the Qt Toolkit. diff --git a/src/gui/kernel/qplatformgraphicsbuffer.cpp b/src/gui/kernel/qplatformgraphicsbuffer.cpp index 91c2ba23c9..84fe673bcf 100644 --- a/src/gui/kernel/qplatformgraphicsbuffer.cpp +++ b/src/gui/kernel/qplatformgraphicsbuffer.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtGui module of the Qt Toolkit. diff --git a/src/gui/kernel/qplatformgraphicsbuffer.h b/src/gui/kernel/qplatformgraphicsbuffer.h index 9ad991e796..e13ab783c2 100644 --- a/src/gui/kernel/qplatformgraphicsbuffer.h +++ b/src/gui/kernel/qplatformgraphicsbuffer.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtGui module of the Qt Toolkit. diff --git a/src/gui/kernel/qplatformgraphicsbufferhelper.cpp b/src/gui/kernel/qplatformgraphicsbufferhelper.cpp index 5a77d31e3f..7da95ffcec 100644 --- a/src/gui/kernel/qplatformgraphicsbufferhelper.cpp +++ b/src/gui/kernel/qplatformgraphicsbufferhelper.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtPlatformSupport module of the Qt Toolkit. diff --git a/src/gui/kernel/qplatformgraphicsbufferhelper.h b/src/gui/kernel/qplatformgraphicsbufferhelper.h index a719bbf90d..ded7810608 100644 --- a/src/gui/kernel/qplatformgraphicsbufferhelper.h +++ b/src/gui/kernel/qplatformgraphicsbufferhelper.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtPlatformSupport module of the Qt Toolkit. diff --git a/src/gui/painting/qdrawhelper_neon_asm.S b/src/gui/painting/qdrawhelper_neon_asm.S index c64a7a4651..42a2084bbd 100644 --- a/src/gui/painting/qdrawhelper_neon_asm.S +++ b/src/gui/painting/qdrawhelper_neon_asm.S @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtGui module of the Qt Toolkit. diff --git a/src/network/access/qnetworkreplynsurlconnectionimpl.mm b/src/network/access/qnetworkreplynsurlconnectionimpl.mm index 081a6b7bf6..2c9ef0ac56 100644 --- a/src/network/access/qnetworkreplynsurlconnectionimpl.mm +++ b/src/network/access/qnetworkreplynsurlconnectionimpl.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtNetwork module of the Qt Toolkit. diff --git a/src/network/socket/qtcpserver_p.h b/src/network/socket/qtcpserver_p.h index 53a59aa19c..415a0e190a 100644 --- a/src/network/socket/qtcpserver_p.h +++ b/src/network/socket/qtcpserver_p.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtNetwork module of the Qt Toolkit. diff --git a/src/network/ssl/qsslcertificate_openssl.cpp b/src/network/ssl/qsslcertificate_openssl.cpp index 581543d476..0ef845bf55 100644 --- a/src/network/ssl/qsslcertificate_openssl.cpp +++ b/src/network/ssl/qsslcertificate_openssl.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtNetwork module of the Qt Toolkit. diff --git a/src/network/ssl/qsslcertificate_qt.cpp b/src/network/ssl/qsslcertificate_qt.cpp index 076d34bd68..2d1dd68198 100644 --- a/src/network/ssl/qsslcertificate_qt.cpp +++ b/src/network/ssl/qsslcertificate_qt.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtNetwork module of the Qt Toolkit. diff --git a/src/network/ssl/qsslcertificate_winrt.cpp b/src/network/ssl/qsslcertificate_winrt.cpp index b8b97e9808..fd7c612631 100644 --- a/src/network/ssl/qsslcertificate_winrt.cpp +++ b/src/network/ssl/qsslcertificate_winrt.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtNetwork module of the Qt Toolkit. diff --git a/src/network/ssl/qsslkey_openssl.cpp b/src/network/ssl/qsslkey_openssl.cpp index 66995206fc..8741ab524f 100644 --- a/src/network/ssl/qsslkey_openssl.cpp +++ b/src/network/ssl/qsslkey_openssl.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtNetwork module of the Qt Toolkit. diff --git a/src/network/ssl/qsslkey_winrt.cpp b/src/network/ssl/qsslkey_winrt.cpp index c47e12ea00..eb1e56538f 100644 --- a/src/network/ssl/qsslkey_winrt.cpp +++ b/src/network/ssl/qsslkey_winrt.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtNetwork module of the Qt Toolkit. diff --git a/src/network/ssl/qsslsocket_winrt.cpp b/src/network/ssl/qsslsocket_winrt.cpp index b8248818bc..aba3ea8170 100644 --- a/src/network/ssl/qsslsocket_winrt.cpp +++ b/src/network/ssl/qsslsocket_winrt.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtNetwork module of the Qt Toolkit. diff --git a/src/network/ssl/qsslsocket_winrt_p.h b/src/network/ssl/qsslsocket_winrt_p.h index 16ca3c2add..2d16c68505 100644 --- a/src/network/ssl/qsslsocket_winrt_p.h +++ b/src/network/ssl/qsslsocket_winrt_p.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtNetwork module of the Qt Toolkit. diff --git a/src/platformsupport/cglconvenience/cglconvenience.mm b/src/platformsupport/cglconvenience/cglconvenience.mm index d0663078f5..6b0a91e13f 100644 --- a/src/platformsupport/cglconvenience/cglconvenience.mm +++ b/src/platformsupport/cglconvenience/cglconvenience.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/platformsupport/clipboard/qmacmime.mm b/src/platformsupport/clipboard/qmacmime.mm index a1a91e5347..ffa548bf83 100644 --- a/src/platformsupport/clipboard/qmacmime.mm +++ b/src/platformsupport/clipboard/qmacmime.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/platformsupport/eventdispatchers/qeventdispatcher_cf.mm b/src/platformsupport/eventdispatchers/qeventdispatcher_cf.mm index fe3dfba635..bd0f89ba2f 100644 --- a/src/platformsupport/eventdispatchers/qeventdispatcher_cf.mm +++ b/src/platformsupport/eventdispatchers/qeventdispatcher_cf.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm index 58c275c0a8..f7165bec91 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm index 123a2c4c79..48ec78951d 100644 --- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm +++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtGui module of the Qt Toolkit. diff --git a/src/plugins/bearer/android/jar/src/org/qtproject/qt5/android/bearer/QtNetworkReceiver.java b/src/plugins/bearer/android/jar/src/org/qtproject/qt5/android/bearer/QtNetworkReceiver.java index 9304d5c7dd..f356a4b746 100644 --- a/src/plugins/bearer/android/jar/src/org/qtproject/qt5/android/bearer/QtNetworkReceiver.java +++ b/src/plugins/bearer/android/jar/src/org/qtproject/qt5/android/bearer/QtNetworkReceiver.java @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm index aa4179d5c3..9530dd83d0 100644 --- a/src/plugins/bearer/corewlan/qcorewlanengine.mm +++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/main.mm b/src/plugins/platforms/cocoa/main.mm index c6e46ac28d..eed2ad7dc5 100644 --- a/src/plugins/platforms/cocoa/main.mm +++ b/src/plugins/platforms/cocoa/main.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibility.mm b/src/plugins/platforms/cocoa/qcocoaaccessibility.mm index 5ea61c5e4c..a42c877fc6 100644 --- a/src/plugins/platforms/cocoa/qcocoaaccessibility.mm +++ b/src/plugins/platforms/cocoa/qcocoaaccessibility.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm index fc84905374..b91831bad8 100644 --- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm +++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qcocoaapplication.mm b/src/plugins/platforms/cocoa/qcocoaapplication.mm index a91be37786..adaabc3c15 100644 --- a/src/plugins/platforms/cocoa/qcocoaapplication.mm +++ b/src/plugins/platforms/cocoa/qcocoaapplication.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm index b011a39f09..2c71d07256 100644 --- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm +++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qcocoaautoreleasepool.mm b/src/plugins/platforms/cocoa/qcocoaautoreleasepool.mm index 9e9bb19556..2c240c2570 100644 --- a/src/plugins/platforms/cocoa/qcocoaautoreleasepool.mm +++ b/src/plugins/platforms/cocoa/qcocoaautoreleasepool.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qcocoabackingstore.mm b/src/plugins/platforms/cocoa/qcocoabackingstore.mm index 5805475e3f..a90db00d42 100644 --- a/src/plugins/platforms/cocoa/qcocoabackingstore.mm +++ b/src/plugins/platforms/cocoa/qcocoabackingstore.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qcocoaclipboard.mm b/src/plugins/platforms/cocoa/qcocoaclipboard.mm index f8ebc3591b..f908aba028 100644 --- a/src/plugins/platforms/cocoa/qcocoaclipboard.mm +++ b/src/plugins/platforms/cocoa/qcocoaclipboard.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm index 72723a3fb3..8843e009a2 100644 --- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtGui module of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qcocoacursor.mm b/src/plugins/platforms/cocoa/qcocoacursor.mm index 749fe908b7..06e957cd86 100644 --- a/src/plugins/platforms/cocoa/qcocoacursor.mm +++ b/src/plugins/platforms/cocoa/qcocoacursor.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm index 3e321e1446..a80b32a0b8 100644 --- a/src/plugins/platforms/cocoa/qcocoadrag.mm +++ b/src/plugins/platforms/cocoa/qcocoadrag.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm index 7f92a899c3..52b2e23345 100644 --- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm +++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm index e378b9cef7..903da2498c 100644 --- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtGui module of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm index 61303c7514..933034bb6f 100644 --- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtGui module of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm index 8c0300ecbb..e89bc662b7 100644 --- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm +++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm index c148b29f1c..ac43ee6d31 100644 --- a/src/plugins/platforms/cocoa/qcocoahelpers.mm +++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qcocoainputcontext.mm b/src/plugins/platforms/cocoa/qcocoainputcontext.mm index 5bde2a0f82..0eafae1f2d 100644 --- a/src/plugins/platforms/cocoa/qcocoainputcontext.mm +++ b/src/plugins/platforms/cocoa/qcocoainputcontext.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index b5f1045ef0..d3071be636 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qcocoaintrospection.mm b/src/plugins/platforms/cocoa/qcocoaintrospection.mm index 8bbbc886b7..c8e7d9d39e 100644 --- a/src/plugins/platforms/cocoa/qcocoaintrospection.mm +++ b/src/plugins/platforms/cocoa/qcocoaintrospection.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qcocoakeymapper.mm b/src/plugins/platforms/cocoa/qcocoakeymapper.mm index 3b901ececb..c2d206fb45 100644 --- a/src/plugins/platforms/cocoa/qcocoakeymapper.mm +++ b/src/plugins/platforms/cocoa/qcocoakeymapper.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qcocoamenuloader.mm b/src/plugins/platforms/cocoa/qcocoamenuloader.mm index b9a8c90b87..c3d117ac11 100644 --- a/src/plugins/platforms/cocoa/qcocoamenuloader.mm +++ b/src/plugins/platforms/cocoa/qcocoamenuloader.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qcocoamimetypes.mm b/src/plugins/platforms/cocoa/qcocoamimetypes.mm index 0b9e13a370..5c88bb75cb 100644 --- a/src/plugins/platforms/cocoa/qcocoamimetypes.mm +++ b/src/plugins/platforms/cocoa/qcocoamimetypes.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm index cf8820acfc..cd885796f5 100644 --- a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm +++ b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qcocoaprintersupport.mm b/src/plugins/platforms/cocoa/qcocoaprintersupport.mm index 5a6c8c171e..602d0fb4bd 100644 --- a/src/plugins/platforms/cocoa/qcocoaprintersupport.mm +++ b/src/plugins/platforms/cocoa/qcocoaprintersupport.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtPrintSupport module of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qcocoaservices.mm b/src/plugins/platforms/cocoa/qcocoaservices.mm index e1a0ba1fcf..6f3f6c4e1d 100644 --- a/src/plugins/platforms/cocoa/qcocoaservices.mm +++ b/src/plugins/platforms/cocoa/qcocoaservices.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm index 1d00bbb481..4ef9000d67 100644 --- a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm +++ b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm index 1904a43276..000a47c7b4 100755 --- a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm +++ b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Copyright (C) 2012 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Christoph Schleifenbaum ** Contact: http://www.qt.io/licensing/ ** diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm index 7b2f1ee3af..11749e14de 100644 --- a/src/plugins/platforms/cocoa/qcocoatheme.mm +++ b/src/plugins/platforms/cocoa/qcocoatheme.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index bbf487c309..64e599ae08 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qmacclipboard.mm b/src/plugins/platforms/cocoa/qmacclipboard.mm index b550e1a79f..3d88a8d5df 100644 --- a/src/plugins/platforms/cocoa/qmacclipboard.mm +++ b/src/plugins/platforms/cocoa/qmacclipboard.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qmultitouch_mac.mm b/src/plugins/platforms/cocoa/qmultitouch_mac.mm index fd59c1f27a..6e7ebcc37c 100644 --- a/src/plugins/platforms/cocoa/qmultitouch_mac.mm +++ b/src/plugins/platforms/cocoa/qmultitouch_mac.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index aa36a5d909..5625d19ed7 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qnsviewaccessibility.mm b/src/plugins/platforms/cocoa/qnsviewaccessibility.mm index 0bf3440247..93f0817aad 100644 --- a/src/plugins/platforms/cocoa/qnsviewaccessibility.mm +++ b/src/plugins/platforms/cocoa/qnsviewaccessibility.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.mm b/src/plugins/platforms/cocoa/qnswindowdelegate.mm index 13a968f302..015274cac7 100644 --- a/src/plugins/platforms/cocoa/qnswindowdelegate.mm +++ b/src/plugins/platforms/cocoa/qnswindowdelegate.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qpaintengine_mac.mm b/src/plugins/platforms/cocoa/qpaintengine_mac.mm index 16eb281a2f..1131fb5fc6 100644 --- a/src/plugins/platforms/cocoa/qpaintengine_mac.mm +++ b/src/plugins/platforms/cocoa/qpaintengine_mac.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/cocoa/qprintengine_mac.mm b/src/plugins/platforms/cocoa/qprintengine_mac.mm index ecc00bc20a..348b537691 100644 --- a/src/plugins/platforms/cocoa/qprintengine_mac.mm +++ b/src/plugins/platforms/cocoa/qprintengine_mac.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmscursor.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmscursor.cpp index 618846f8ba..cd92c49ff1 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmscursor.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmscursor.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmscursor.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmscursor.h index 7d92b84c8a..68bc72a03f 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmscursor.h +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmscursor.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp index b377f08575..30fcf8143f 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.h index f73c15caa4..29a1332c9a 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.h +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsintegration.cpp index 2ac2030dc7..4598f21d92 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsintegration.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsintegration.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsintegration.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsintegration.h index ec877e3279..9a160d2570 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsintegration.h +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsintegration.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsmain.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsmain.cpp index bae330a772..64a0bedb2c 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsmain.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsmain.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the qmake spec of the Qt Toolkit. diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.cpp index 53b6e88c8c..45287ae36e 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.h index e2b52b8942..cc2d6942d6 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.h +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11main.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11main.cpp index cb21d1f8d1..64069e7dbc 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11main.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the qmake spec of the Qt Toolkit. diff --git a/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp b/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp index 719d34f8a6..7d1007e7ef 100644 --- a/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/eglfs/qeglfsoffscreenwindow.cpp b/src/plugins/platforms/eglfs/qeglfsoffscreenwindow.cpp index 1adfb4bc67..0c07aa64be 100644 --- a/src/plugins/platforms/eglfs/qeglfsoffscreenwindow.cpp +++ b/src/plugins/platforms/eglfs/qeglfsoffscreenwindow.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/eglfs/qeglfsoffscreenwindow.h b/src/plugins/platforms/eglfs/qeglfsoffscreenwindow.h index efdc009f04..9b8eaacd51 100644 --- a/src/plugins/platforms/eglfs/qeglfsoffscreenwindow.h +++ b/src/plugins/platforms/eglfs/qeglfsoffscreenwindow.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/ios/plugin.mm b/src/plugins/platforms/ios/plugin.mm index 1090482f20..41fe712f60 100644 --- a/src/plugins/platforms/ios/plugin.mm +++ b/src/plugins/platforms/ios/plugin.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/ios/qiosapplicationdelegate.mm b/src/plugins/platforms/ios/qiosapplicationdelegate.mm index 32392671ee..74092d02ce 100644 --- a/src/plugins/platforms/ios/qiosapplicationdelegate.mm +++ b/src/plugins/platforms/ios/qiosapplicationdelegate.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/ios/qiosapplicationstate.mm b/src/plugins/platforms/ios/qiosapplicationstate.mm index bd81b44b6b..92799f80c1 100644 --- a/src/plugins/platforms/ios/qiosapplicationstate.mm +++ b/src/plugins/platforms/ios/qiosapplicationstate.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/ios/qiosbackingstore.mm b/src/plugins/platforms/ios/qiosbackingstore.mm index f9623c5660..acec95b0d3 100644 --- a/src/plugins/platforms/ios/qiosbackingstore.mm +++ b/src/plugins/platforms/ios/qiosbackingstore.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/ios/qiosclipboard.mm b/src/plugins/platforms/ios/qiosclipboard.mm index 0666c4efe7..192ee67689 100644 --- a/src/plugins/platforms/ios/qiosclipboard.mm +++ b/src/plugins/platforms/ios/qiosclipboard.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/ios/qioscontext.mm b/src/plugins/platforms/ios/qioscontext.mm index 9c0f4d9306..c7541fc51b 100644 --- a/src/plugins/platforms/ios/qioscontext.mm +++ b/src/plugins/platforms/ios/qioscontext.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/ios/qioseventdispatcher.mm b/src/plugins/platforms/ios/qioseventdispatcher.mm index 87f658608a..f4567f36f4 100644 --- a/src/plugins/platforms/ios/qioseventdispatcher.mm +++ b/src/plugins/platforms/ios/qioseventdispatcher.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/ios/qiosglobal.mm b/src/plugins/platforms/ios/qiosglobal.mm index 8360df0d7f..ef24abbfd9 100644 --- a/src/plugins/platforms/ios/qiosglobal.mm +++ b/src/plugins/platforms/ios/qiosglobal.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/ios/qiosinputcontext.mm b/src/plugins/platforms/ios/qiosinputcontext.mm index 0a62dc9b13..22847b0612 100644 --- a/src/plugins/platforms/ios/qiosinputcontext.mm +++ b/src/plugins/platforms/ios/qiosinputcontext.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/ios/qiosintegration.mm b/src/plugins/platforms/ios/qiosintegration.mm index 0dea043409..33328e0490 100644 --- a/src/plugins/platforms/ios/qiosintegration.mm +++ b/src/plugins/platforms/ios/qiosintegration.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/ios/qiosmenu.h b/src/plugins/platforms/ios/qiosmenu.h index f18af65fd5..f65a90fb40 100644 --- a/src/plugins/platforms/ios/qiosmenu.h +++ b/src/plugins/platforms/ios/qiosmenu.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/ios/qiosmenu.mm b/src/plugins/platforms/ios/qiosmenu.mm index bdab23f59a..40f0082b9d 100644 --- a/src/plugins/platforms/ios/qiosmenu.mm +++ b/src/plugins/platforms/ios/qiosmenu.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/ios/qiosplatformaccessibility.mm b/src/plugins/platforms/ios/qiosplatformaccessibility.mm index 5124d8ebd8..bfe91df7bd 100644 --- a/src/plugins/platforms/ios/qiosplatformaccessibility.mm +++ b/src/plugins/platforms/ios/qiosplatformaccessibility.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm index de1d8a29c7..324133074b 100644 --- a/src/plugins/platforms/ios/qiosscreen.mm +++ b/src/plugins/platforms/ios/qiosscreen.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/ios/qiosservices.mm b/src/plugins/platforms/ios/qiosservices.mm index de59b20a92..cd5ff425cd 100644 --- a/src/plugins/platforms/ios/qiosservices.mm +++ b/src/plugins/platforms/ios/qiosservices.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/ios/qiostextresponder.h b/src/plugins/platforms/ios/qiostextresponder.h index f87559ccec..4cb8a9c815 100644 --- a/src/plugins/platforms/ios/qiostextresponder.h +++ b/src/plugins/platforms/ios/qiostextresponder.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/ios/qiostextresponder.mm b/src/plugins/platforms/ios/qiostextresponder.mm index bafab3db67..f0cb021da0 100644 --- a/src/plugins/platforms/ios/qiostextresponder.mm +++ b/src/plugins/platforms/ios/qiostextresponder.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/ios/qiostheme.mm b/src/plugins/platforms/ios/qiostheme.mm index 29cd897b71..edeabf66dc 100644 --- a/src/plugins/platforms/ios/qiostheme.mm +++ b/src/plugins/platforms/ios/qiostheme.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/ios/qiosviewcontroller.mm b/src/plugins/platforms/ios/qiosviewcontroller.mm index db55562a8a..02c3a2d28d 100644 --- a/src/plugins/platforms/ios/qiosviewcontroller.mm +++ b/src/plugins/platforms/ios/qiosviewcontroller.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index be8efdc79e..fd04ecf474 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/ios/quiaccessibilityelement.mm b/src/plugins/platforms/ios/quiaccessibilityelement.mm index c983655c51..2cecfc1126 100644 --- a/src/plugins/platforms/ios/quiaccessibilityelement.mm +++ b/src/plugins/platforms/ios/quiaccessibilityelement.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/ios/quiview.mm b/src/plugins/platforms/ios/quiview.mm index 22d406cbdc..9470d1844e 100644 --- a/src/plugins/platforms/ios/quiview.mm +++ b/src/plugins/platforms/ios/quiview.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/ios/quiview_accessibility.mm b/src/plugins/platforms/ios/quiview_accessibility.mm index 739aaea769..496ee7605e 100644 --- a/src/plugins/platforms/ios/quiview_accessibility.mm +++ b/src/plugins/platforms/ios/quiview_accessibility.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/windows/qwindowsscaling.h b/src/plugins/platforms/windows/qwindowsscaling.h index 02489f0a13..39e554bbe2 100644 --- a/src/plugins/platforms/windows/qwindowsscaling.h +++ b/src/plugins/platforms/windows/qwindowsscaling.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/winrt/qwinrtfiledialoghelper.cpp b/src/plugins/platforms/winrt/qwinrtfiledialoghelper.cpp index a08054d032..6cd99c38ef 100644 --- a/src/plugins/platforms/winrt/qwinrtfiledialoghelper.cpp +++ b/src/plugins/platforms/winrt/qwinrtfiledialoghelper.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/winrt/qwinrtfiledialoghelper.h b/src/plugins/platforms/winrt/qwinrtfiledialoghelper.h index e1315d646c..13abf6e2b8 100644 --- a/src/plugins/platforms/winrt/qwinrtfiledialoghelper.h +++ b/src/plugins/platforms/winrt/qwinrtfiledialoghelper.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/winrt/qwinrtfileengine.cpp b/src/plugins/platforms/winrt/qwinrtfileengine.cpp index 664002a085..f4e307eb07 100644 --- a/src/plugins/platforms/winrt/qwinrtfileengine.cpp +++ b/src/plugins/platforms/winrt/qwinrtfileengine.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/winrt/qwinrtfileengine.h b/src/plugins/platforms/winrt/qwinrtfileengine.h index ef698dc4f2..30357759fb 100644 --- a/src/plugins/platforms/winrt/qwinrtfileengine.h +++ b/src/plugins/platforms/winrt/qwinrtfileengine.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegration.cpp index a454a8a048..75237ad268 100644 --- a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegration.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegration.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegration.h b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegration.h index de2bf6113f..c71c668f31 100644 --- a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegration.h +++ b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegration.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp index efa5c87ad5..10411e72e2 100644 --- a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.h b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.h index 272e01988a..466488c8de 100644 --- a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.h +++ b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationplugin.h b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationplugin.h index fe7daec068..f9a25cc12a 100644 --- a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationplugin.h +++ b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationplugin.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/xcb/gl_integrations/qxcbnativeinterfacehandler.cpp b/src/plugins/platforms/xcb/gl_integrations/qxcbnativeinterfacehandler.cpp index 19b3fc0bc3..8416be66fb 100644 --- a/src/plugins/platforms/xcb/gl_integrations/qxcbnativeinterfacehandler.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/qxcbnativeinterfacehandler.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/xcb/gl_integrations/qxcbnativeinterfacehandler.h b/src/plugins/platforms/xcb/gl_integrations/qxcbnativeinterfacehandler.h index bc18eaec1d..b562109e12 100644 --- a/src/plugins/platforms/xcb/gl_integrations/qxcbnativeinterfacehandler.h +++ b/src/plugins/platforms/xcb/gl_integrations/qxcbnativeinterfacehandler.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglcontext.h b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglcontext.h index 8790451789..9b903d8212 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglcontext.h +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglcontext.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglinclude.h b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglinclude.h index 1d651a428d..ec59cbc7c9 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglinclude.h +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglinclude.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp index 16d32b3235..a456317801 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.h b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.h index 1f7fd4fc94..3f7134c1a1 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.h +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglmain.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglmain.cpp index e34057a22c..72b471be67 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglmain.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglmain.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp index 1187733b23..891f187238 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.h b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.h index 2e9be95300..92a48fc144 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.h +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp index 9e5b67438c..a26280b399 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.h b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.h index cce39eaf7b..dfb32332bc 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.h +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp index cb56f67282..ce72cb64d0 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.h b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.h index 8aa3dbb983..4366d07b42 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.h +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxmain.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxmain.cpp index d814892660..9d2fb54e5a 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxmain.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxmain.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxnativeinterfacehandler.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxnativeinterfacehandler.cpp index d416b5ee1a..045185e40c 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxnativeinterfacehandler.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxnativeinterfacehandler.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxnativeinterfacehandler.h b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxnativeinterfacehandler.h index 88a3fa26ce..d671bc1995 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxnativeinterfacehandler.h +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxnativeinterfacehandler.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp index b866a321c2..99b2337395 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.h b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.h index 6155c46632..9ff67ff94f 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.h +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. diff --git a/src/printsupport/dialogs/qpagesetupdialog_mac.mm b/src/printsupport/dialogs/qpagesetupdialog_mac.mm index a9fd072c63..498394f1fc 100644 --- a/src/printsupport/dialogs/qpagesetupdialog_mac.mm +++ b/src/printsupport/dialogs/qpagesetupdialog_mac.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtGui module of the Qt Toolkit. diff --git a/src/printsupport/dialogs/qprintdialog_mac.mm b/src/printsupport/dialogs/qprintdialog_mac.mm index 4e843dfd0e..bc28350f6b 100644 --- a/src/printsupport/dialogs/qprintdialog_mac.mm +++ b/src/printsupport/dialogs/qprintdialog_mac.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtGui module of the Qt Toolkit. diff --git a/src/testlib/qtestblacklist.cpp b/src/testlib/qtestblacklist.cpp index 9bef6c1b13..1cf2ee09e3 100644 --- a/src/testlib/qtestblacklist.cpp +++ b/src/testlib/qtestblacklist.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtTest module of the Qt Toolkit. diff --git a/src/tools/moc/util/generate.sh b/src/tools/moc/util/generate.sh index 40677b42bd..0b1e8d6ebb 100755 --- a/src/tools/moc/util/generate.sh +++ b/src/tools/moc/util/generate.sh @@ -1,7 +1,7 @@ #!/bin/sh ############################################################################# ## -## Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +## Copyright (C) 2015 The Qt Company Ltd. ## Contact: http://www.qt.io/licensing/ ## ## This file is the build configuration utility of the Qt Toolkit. diff --git a/src/tools/moc/util/licenseheader.txt b/src/tools/moc/util/licenseheader.txt index e5deadc7df..75cc5f6607 100644 --- a/src/tools/moc/util/licenseheader.txt +++ b/src/tools/moc/util/licenseheader.txt @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the tools applications of the Qt Toolkit. diff --git a/src/tools/qlalr/examples/glsl/build.sh b/src/tools/qlalr/examples/glsl/build.sh index df44839643..5b16f6de12 100644 --- a/src/tools/qlalr/examples/glsl/build.sh +++ b/src/tools/qlalr/examples/glsl/build.sh @@ -1,7 +1,7 @@ #!/bin/sh ############################################################################# ## -## Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +## Copyright (C) 2015 The Qt Company Ltd. ## Contact: http://www.qt.io/licensing/ ## ## This file is the build configuration utility of the Qt Toolkit. diff --git a/src/tools/qlalr/examples/glsl/glsl-lex.l b/src/tools/qlalr/examples/glsl/glsl-lex.l index ac19187cf9..41a5984ca9 100644 --- a/src/tools/qlalr/examples/glsl/glsl-lex.l +++ b/src/tools/qlalr/examples/glsl/glsl-lex.l @@ -2,7 +2,7 @@ %{ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QLALR tool of the Qt Toolkit. diff --git a/src/tools/qlalr/examples/qparser/calc.l b/src/tools/qlalr/examples/qparser/calc.l index 28ff226384..15375a830e 100644 --- a/src/tools/qlalr/examples/qparser/calc.l +++ b/src/tools/qlalr/examples/qparser/calc.l @@ -4,7 +4,7 @@ %{ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QLALR tool of the Qt Toolkit. diff --git a/src/widgets/dialogs/qfiledialog.ui b/src/widgets/dialogs/qfiledialog.ui index cc633cab3f..7bbfb0a10b 100644 --- a/src/widgets/dialogs/qfiledialog.ui +++ b/src/widgets/dialogs/qfiledialog.ui @@ -2,7 +2,7 @@ ********************************************************************* ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. diff --git a/src/widgets/dialogs/qfiledialog_embedded.ui b/src/widgets/dialogs/qfiledialog_embedded.ui index f31f12d4f7..6263902474 100644 --- a/src/widgets/dialogs/qfiledialog_embedded.ui +++ b/src/widgets/dialogs/qfiledialog_embedded.ui @@ -2,7 +2,7 @@ ********************************************************************* ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. diff --git a/src/widgets/doc/snippets/macmainwindow.mm b/src/widgets/doc/snippets/macmainwindow.mm index eef1f41e5f..e1df77089c 100755 --- a/src/widgets/doc/snippets/macmainwindow.mm +++ b/src/widgets/doc/snippets/macmainwindow.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the demonstration applications of the Qt Toolkit. diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index 2b24934f34..3973534d83 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. diff --git a/src/widgets/util/qscroller_mac.mm b/src/widgets/util/qscroller_mac.mm index 52ac66208d..9120c43075 100644 --- a/src/widgets/util/qscroller_mac.mm +++ b/src/widgets/util/qscroller_mac.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. diff --git a/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm b/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm index b0f49aa42b..5a02be7ee1 100644 --- a/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm +++ b/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. diff --git a/src/widgets/widgets/qmacnativewidget_mac.mm b/src/widgets/widgets/qmacnativewidget_mac.mm index 0f511dcfb2..cfd66b8eac 100644 --- a/src/widgets/widgets/qmacnativewidget_mac.mm +++ b/src/widgets/widgets/qmacnativewidget_mac.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. diff --git a/src/widgets/widgets/qmenu_mac.mm b/src/widgets/widgets/qmenu_mac.mm index d9c4a1ce55..a42879fc73 100644 --- a/src/widgets/widgets/qmenu_mac.mm +++ b/src/widgets/widgets/qmenu_mac.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. diff --git a/tests/auto/compilerwarnings/data/test_cpp.txt b/tests/auto/compilerwarnings/data/test_cpp.txt index bab20b0227..242857da8e 100644 --- a/tests/auto/compilerwarnings/data/test_cpp.txt +++ b/tests/auto/compilerwarnings/data/test_cpp.txt @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/tests/auto/corelib/io/qurl/tst_qurl_mac.mm b/tests/auto/corelib/io/qurl/tst_qurl_mac.mm index 5686d35729..45c1681b22 100644 --- a/tests/auto/corelib/io/qurl/tst_qurl_mac.mm +++ b/tests/auto/corelib/io/qurl/tst_qurl_mac.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/tests/auto/corelib/tools/qbytearray/tst_qbytearray_mac.mm b/tests/auto/corelib/tools/qbytearray/tst_qbytearray_mac.mm index 8b3de5feaa..c2b76cc41a 100644 --- a/tests/auto/corelib/tools/qbytearray/tst_qbytearray_mac.mm +++ b/tests/auto/corelib/tools/qbytearray/tst_qbytearray_mac.mm @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2014 Samuel Gaist -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime_mac.mm b/tests/auto/corelib/tools/qdatetime/tst_qdatetime_mac.mm index 0ecc879e91..6bdaa94e49 100644 --- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime_mac.mm +++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime_mac.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Copyright (C) 2014 Petroules Corporation. ** Contact: http://www.qt.io/licensing/ ** diff --git a/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp b/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp index 1fdfc68d12..6961426f59 100644 --- a/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp +++ b/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/tests/auto/corelib/tools/qstring/tst_qstring_mac.mm b/tests/auto/corelib/tools/qstring/tst_qstring_mac.mm index 96f133ca2c..f4b748e62a 100644 --- a/tests/auto/corelib/tools/qstring/tst_qstring_mac.mm +++ b/tests/auto/corelib/tools/qstring/tst_qstring_mac.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm index c7c0ff3851..b004e985bd 100644 --- a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm +++ b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm b/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm index 431d1e4343..6e4ad29190 100644 --- a/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm +++ b/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget_mac_helpers.mm b/tests/auto/widgets/kernel/qwidget/tst_qwidget_mac_helpers.mm index f74322ad68..c67682fd85 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget_mac_helpers.mm +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget_mac_helpers.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. diff --git a/tests/auto/widgets/widgets/qmenu/tst_qmenu_mac.mm b/tests/auto/widgets/widgets/qmenu/tst_qmenu_mac.mm index f59c6fd9c1..b1708d8669 100644 --- a/tests/auto/widgets/widgets/qmenu/tst_qmenu_mac.mm +++ b/tests/auto/widgets/widgets/qmenu/tst_qmenu_mac.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/tests/manual/cocoa/qmaccocoaviewcontainer/TestMouseMovedNSView.m b/tests/manual/cocoa/qmaccocoaviewcontainer/TestMouseMovedNSView.m index 2cfa286687..8dea62050c 100644 --- a/tests/manual/cocoa/qmaccocoaviewcontainer/TestMouseMovedNSView.m +++ b/tests/manual/cocoa/qmaccocoaviewcontainer/TestMouseMovedNSView.m @@ -1,6 +1,6 @@ /**************************************************************************** ** - ** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). + ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/tests/manual/cocoa/qmaccocoaviewcontainer/main.mm b/tests/manual/cocoa/qmaccocoaviewcontainer/main.mm index 44f8a28e81..17d5a75273 100644 --- a/tests/manual/cocoa/qmaccocoaviewcontainer/main.mm +++ b/tests/manual/cocoa/qmaccocoaviewcontainer/main.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** - ** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). + ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/tests/manual/cocoa/qsystemtrayicon/main.cpp b/tests/manual/cocoa/qsystemtrayicon/main.cpp index 7ca9187082..dece8e8e5d 100644 --- a/tests/manual/cocoa/qsystemtrayicon/main.cpp +++ b/tests/manual/cocoa/qsystemtrayicon/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/tests/manual/cocoa/qt_on_cocoa/main.mm b/tests/manual/cocoa/qt_on_cocoa/main.mm index b94618dffe..5dd546479e 100644 --- a/tests/manual/cocoa/qt_on_cocoa/main.mm +++ b/tests/manual/cocoa/qt_on_cocoa/main.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/tests/manual/mkspecs/test.sh b/tests/manual/mkspecs/test.sh index b2ab1702b0..f2c64e7633 100755 --- a/tests/manual/mkspecs/test.sh +++ b/tests/manual/mkspecs/test.sh @@ -1,7 +1,7 @@ #!/bin/bash ############################################################################# ## -## Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +## Copyright (C) 2015 The Qt Company Ltd. ## Contact: http://www.qt.io/licensing/ ## ## This file is part of the test suite of the Qt Toolkit. diff --git a/tests/manual/qopenglwindow/multiwindow/main.cpp b/tests/manual/qopenglwindow/multiwindow/main.cpp index 0f6388b1b7..47616ded0f 100644 --- a/tests/manual/qopenglwindow/multiwindow/main.cpp +++ b/tests/manual/qopenglwindow/multiwindow/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/tests/manual/xcb_gl_integration/main.cpp b/tests/manual/xcb_gl_integration/main.cpp index 1b00005934..e891654586 100644 --- a/tests/manual/xcb_gl_integration/main.cpp +++ b/tests/manual/xcb_gl_integration/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/util/local_database/cldr2qlocalexml.py b/util/local_database/cldr2qlocalexml.py index a2b7df3667..2377aa0771 100755 --- a/util/local_database/cldr2qlocalexml.py +++ b/util/local_database/cldr2qlocalexml.py @@ -1,7 +1,7 @@ #!/usr/bin/env python ############################################################################# ## -## Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +## Copyright (C) 2015 The Qt Company Ltd. ## Contact: http://www.qt.io/licensing/ ## ## This file is part of the test suite of the Qt Toolkit. diff --git a/util/local_database/cldr2qtimezone.py b/util/local_database/cldr2qtimezone.py index 964941559b..4bf4c83bb9 100755 --- a/util/local_database/cldr2qtimezone.py +++ b/util/local_database/cldr2qtimezone.py @@ -1,7 +1,7 @@ #!/usr/bin/env python ############################################################################# ## -## Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +## Copyright (C) 2015 The Qt Company Ltd. ## Contact: http://www.qt.io/licensing/ ## ## This file is part of the test suite of the Qt Toolkit. diff --git a/util/local_database/dateconverter.py b/util/local_database/dateconverter.py index 74afd602a1..3e45a07d31 100755 --- a/util/local_database/dateconverter.py +++ b/util/local_database/dateconverter.py @@ -1,7 +1,7 @@ #!/usr/bin/env python ############################################################################# ## -## Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +## Copyright (C) 2015 The Qt Company Ltd. ## Contact: http://www.qt.io/licensing/ ## ## This file is part of the test suite of the Qt Toolkit. diff --git a/util/local_database/enumdata.py b/util/local_database/enumdata.py index 53d2f73a22..b9f8077a59 100644 --- a/util/local_database/enumdata.py +++ b/util/local_database/enumdata.py @@ -1,7 +1,7 @@ #!/usr/bin/env python ############################################################################# ## -## Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +## Copyright (C) 2015 The Qt Company Ltd. ## Contact: http://www.qt.io/licensing/ ## ## This file is part of the test suite of the Qt Toolkit. diff --git a/util/local_database/qlocalexml2cpp.py b/util/local_database/qlocalexml2cpp.py index 1df99b11cd..1164075778 100755 --- a/util/local_database/qlocalexml2cpp.py +++ b/util/local_database/qlocalexml2cpp.py @@ -1,7 +1,7 @@ #!/usr/bin/env python ############################################################################# ## -## Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +## Copyright (C) 2015 The Qt Company Ltd. ## Contact: http://www.qt.io/licensing/ ## ## This file is part of the test suite of the Qt Toolkit. diff --git a/util/local_database/xpathlite.py b/util/local_database/xpathlite.py index 66693af0eb..20034a5b5e 100644 --- a/util/local_database/xpathlite.py +++ b/util/local_database/xpathlite.py @@ -1,7 +1,7 @@ #!/usr/bin/env python ############################################################################# ## -## Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +## Copyright (C) 2015 The Qt Company Ltd. ## Contact: http://www.qt.io/licensing/ ## ## This file is part of the test suite of the Qt Toolkit. diff --git a/util/unicode/writingSystems.sh b/util/unicode/writingSystems.sh index 0829b3876a..8902d97d71 100755 --- a/util/unicode/writingSystems.sh +++ b/util/unicode/writingSystems.sh @@ -2,7 +2,7 @@ #!/bin/sh ############################################################################# ## -## Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +## Copyright (C) 2015 The Qt Company Ltd. ## Contact: http://www.qt.io/licensing/ ## ## This file is the build configuration utility of the Qt Toolkit. -- cgit v1.2.3 From 64d7bb9f555afb9e02cdf92d36f75655e7df2f1d Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Tue, 17 Feb 2015 17:18:27 +0300 Subject: xcb: Check for the presence of XInput 2.2 before selecting touch events Change-Id: I5309f9cdaadb87e0a577a0701d2c100d29525424 Reviewed-by: Laszlo Agocs Reviewed-by: Shawn Rutledge --- src/plugins/platforms/xcb/qxcbconnection.h | 10 +++++--- src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 32 +++++++++++++----------- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index 17600839e7..2a4cfea62d 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -404,11 +404,15 @@ public: void xi2Select(xcb_window_t window); #endif #ifdef XCB_USE_XINPUT21 - bool isUsingXInput21() { return m_xi2Enabled && m_xi2Minor >= 1; } + bool isUsingXInput21() const { return m_xi2Enabled && m_xi2Minor >= 1; } #else - bool isUsingXInput21() { return false; } + bool isUsingXInput21() const { return false; } +#endif +#ifdef XCB_USE_XINPUT22 + bool isUsingXInput22() const { return m_xi2Enabled && m_xi2Minor >= 2; } +#else + bool isUsingXInput22() const { return false; } #endif - void sync(); diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp index c63a9c88bc..f225518cb9 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp @@ -274,21 +274,23 @@ void QXcbConnection::xi2Select(xcb_window_t window) unsigned char *xiBitMask = reinterpret_cast(&bitMask); #ifdef XCB_USE_XINPUT22 - bitMask |= XI_TouchBeginMask; - bitMask |= XI_TouchUpdateMask; - bitMask |= XI_TouchEndMask; - XIEventMask mask; - mask.mask_len = sizeof(bitMask); - mask.mask = xiBitMask; - if (!m_touchDevices.isEmpty()) { - mask.deviceid = XIAllMasterDevices; - Status result = XISelectEvents(xDisplay, window, &mask, 1); - // If we select for touch events on the master pointer, XInput2 - // will not synthesize mouse events. This means Qt must do it, - // which is also preferable, since Qt can control better when - // to do so. - if (m_xi2Minor >= 2 && result == Success) - has_touch_without_mouse_emulation = true; + if (isUsingXInput22()) { + bitMask |= XI_TouchBeginMask; + bitMask |= XI_TouchUpdateMask; + bitMask |= XI_TouchEndMask; + XIEventMask mask; + mask.mask_len = sizeof(bitMask); + mask.mask = xiBitMask; + if (!m_touchDevices.isEmpty()) { + mask.deviceid = XIAllMasterDevices; + Status result = XISelectEvents(xDisplay, window, &mask, 1); + // If we select for touch events on the master pointer, XInput2 + // will not synthesize mouse events. This means Qt must do it, + // which is also preferable, since Qt can control better when + // to do so. + if (result == Success) + has_touch_without_mouse_emulation = true; + } } #endif // XCB_USE_XINPUT22 -- cgit v1.2.3 From fa93d0ceec5cabee3141668bcde9bc98d8105c8c Mon Sep 17 00:00:00 2001 From: Tobias Koenig Date: Sun, 13 Apr 2014 14:10:26 +0200 Subject: Haiku: Initial version of QPA plugin for Haiku Change-Id: Ib4d1d75a11602af8423970e12c7cc594576e1c4d Reviewed-by: Augustin Cavalier Reviewed-by: Maurice Kalinowski --- src/plugins/platforms/haiku/haiku.json | 3 + src/plugins/platforms/haiku/haiku.pro | 42 +++ src/plugins/platforms/haiku/main.cpp | 47 +++ src/plugins/platforms/haiku/main.h | 47 +++ src/plugins/platforms/haiku/qhaikuapplication.cpp | 71 ++++ src/plugins/platforms/haiku/qhaikuapplication.h | 50 +++ src/plugins/platforms/haiku/qhaikubuffer.cpp | 73 ++++ src/plugins/platforms/haiku/qhaikubuffer.h | 62 ++++ src/plugins/platforms/haiku/qhaikuclipboard.cpp | 140 ++++++++ src/plugins/platforms/haiku/qhaikuclipboard.h | 64 ++++ src/plugins/platforms/haiku/qhaikucursor.cpp | 92 +++++ src/plugins/platforms/haiku/qhaikucursor.h | 59 ++++ src/plugins/platforms/haiku/qhaikuintegration.cpp | 133 +++++++ src/plugins/platforms/haiku/qhaikuintegration.h | 72 ++++ src/plugins/platforms/haiku/qhaikukeymapper.cpp | 180 ++++++++++ src/plugins/platforms/haiku/qhaikukeymapper.h | 53 +++ .../platforms/haiku/qhaikurasterbackingstore.cpp | 92 +++++ .../platforms/haiku/qhaikurasterbackingstore.h | 64 ++++ src/plugins/platforms/haiku/qhaikurasterwindow.cpp | 270 ++++++++++++++ src/plugins/platforms/haiku/qhaikurasterwindow.h | 88 +++++ src/plugins/platforms/haiku/qhaikuscreen.cpp | 137 ++++++++ src/plugins/platforms/haiku/qhaikuscreen.h | 66 ++++ src/plugins/platforms/haiku/qhaikuservices.cpp | 82 +++++ src/plugins/platforms/haiku/qhaikuservices.h | 52 +++ src/plugins/platforms/haiku/qhaikuutils.cpp | 110 ++++++ src/plugins/platforms/haiku/qhaikuutils.h | 51 +++ src/plugins/platforms/haiku/qhaikuwindow.cpp | 388 +++++++++++++++++++++ src/plugins/platforms/haiku/qhaikuwindow.h | 122 +++++++ src/plugins/platforms/platforms.pro | 4 + 29 files changed, 2714 insertions(+) create mode 100644 src/plugins/platforms/haiku/haiku.json create mode 100644 src/plugins/platforms/haiku/haiku.pro create mode 100644 src/plugins/platforms/haiku/main.cpp create mode 100644 src/plugins/platforms/haiku/main.h create mode 100644 src/plugins/platforms/haiku/qhaikuapplication.cpp create mode 100644 src/plugins/platforms/haiku/qhaikuapplication.h create mode 100644 src/plugins/platforms/haiku/qhaikubuffer.cpp create mode 100644 src/plugins/platforms/haiku/qhaikubuffer.h create mode 100644 src/plugins/platforms/haiku/qhaikuclipboard.cpp create mode 100644 src/plugins/platforms/haiku/qhaikuclipboard.h create mode 100644 src/plugins/platforms/haiku/qhaikucursor.cpp create mode 100644 src/plugins/platforms/haiku/qhaikucursor.h create mode 100644 src/plugins/platforms/haiku/qhaikuintegration.cpp create mode 100644 src/plugins/platforms/haiku/qhaikuintegration.h create mode 100644 src/plugins/platforms/haiku/qhaikukeymapper.cpp create mode 100644 src/plugins/platforms/haiku/qhaikukeymapper.h create mode 100644 src/plugins/platforms/haiku/qhaikurasterbackingstore.cpp create mode 100644 src/plugins/platforms/haiku/qhaikurasterbackingstore.h create mode 100644 src/plugins/platforms/haiku/qhaikurasterwindow.cpp create mode 100644 src/plugins/platforms/haiku/qhaikurasterwindow.h create mode 100644 src/plugins/platforms/haiku/qhaikuscreen.cpp create mode 100644 src/plugins/platforms/haiku/qhaikuscreen.h create mode 100644 src/plugins/platforms/haiku/qhaikuservices.cpp create mode 100644 src/plugins/platforms/haiku/qhaikuservices.h create mode 100644 src/plugins/platforms/haiku/qhaikuutils.cpp create mode 100644 src/plugins/platforms/haiku/qhaikuutils.h create mode 100644 src/plugins/platforms/haiku/qhaikuwindow.cpp create mode 100644 src/plugins/platforms/haiku/qhaikuwindow.h diff --git a/src/plugins/platforms/haiku/haiku.json b/src/plugins/platforms/haiku/haiku.json new file mode 100644 index 0000000000..cfc06df640 --- /dev/null +++ b/src/plugins/platforms/haiku/haiku.json @@ -0,0 +1,3 @@ +{ + "Keys": [ "haiku" ] +} diff --git a/src/plugins/platforms/haiku/haiku.pro b/src/plugins/platforms/haiku/haiku.pro new file mode 100644 index 0000000000..87f31997a3 --- /dev/null +++ b/src/plugins/platforms/haiku/haiku.pro @@ -0,0 +1,42 @@ +TARGET = qhaiku +PLUGIN_TYPE = platforms +PLUGIN_CLASS_NAME = QHaikuIntegrationPlugin +load(qt_plugin) + +QT += platformsupport-private core-private gui-private + +SOURCES = \ + main.cpp \ + qhaikuapplication.cpp \ + qhaikubuffer.cpp \ + qhaikuclipboard.cpp \ + qhaikucursor.cpp \ + qhaikuintegration.cpp \ + qhaikukeymapper.cpp \ + qhaikurasterbackingstore.cpp \ + qhaikurasterwindow.cpp \ + qhaikuscreen.cpp \ + qhaikuservices.cpp \ + qhaikuutils.cpp \ + qhaikuwindow.cpp + +HEADERS = \ + main.h \ + qhaikuapplication.h \ + qhaikubuffer.h \ + qhaikuclipboard.h \ + qhaikucursor.h \ + qhaikuintegration.h \ + qhaikukeymapper.h \ + qhaikurasterbackingstore.h \ + qhaikurasterwindow.h \ + qhaikuscreen.h \ + qhaikuservices.h \ + qhaikuutils.h \ + qhaikuwindow.h + +LIBS += -lbe + +OTHER_FILES += haiku.json + +include (../../../platformsupport/fontdatabases/fontdatabases.pri) diff --git a/src/plugins/platforms/haiku/main.cpp b/src/plugins/platforms/haiku/main.cpp new file mode 100644 index 0000000000..2892a2d292 --- /dev/null +++ b/src/plugins/platforms/haiku/main.cpp @@ -0,0 +1,47 @@ +/*************************************************************************** +** +** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "main.h" +#include "qhaikuintegration.h" + +QT_BEGIN_NAMESPACE + +QPlatformIntegration *QHaikuIntegrationPlugin::create(const QString& system, const QStringList& paramList) +{ + if (!system.compare(QLatin1String("haiku"), Qt::CaseInsensitive)) + return new QHaikuIntegration(paramList); + + return Q_NULLPTR; +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/haiku/main.h b/src/plugins/platforms/haiku/main.h new file mode 100644 index 0000000000..fbf0bee527 --- /dev/null +++ b/src/plugins/platforms/haiku/main.h @@ -0,0 +1,47 @@ +/*************************************************************************** +** +** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +QT_BEGIN_NAMESPACE + +class QHaikuIntegrationPlugin : public QPlatformIntegrationPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.2" FILE "haiku.json") + +public: + QPlatformIntegration *create(const QString&, const QStringList&) Q_DECL_OVERRIDE; +}; + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/haiku/qhaikuapplication.cpp b/src/plugins/platforms/haiku/qhaikuapplication.cpp new file mode 100644 index 0000000000..0ee2628c5b --- /dev/null +++ b/src/plugins/platforms/haiku/qhaikuapplication.cpp @@ -0,0 +1,71 @@ +/*************************************************************************** +** +** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qhaikuapplication.h" + +#include +#include + +#include +#include + +QHaikuApplication::QHaikuApplication(const char *signature) + : BApplication(signature) +{ +} + +bool QHaikuApplication::QuitRequested() +{ + QEvent quitEvent(QEvent::Quit); + QCoreApplication::sendEvent(QCoreApplication::instance(), &quitEvent); + return true; +} + +void QHaikuApplication::RefsReceived(BMessage* message) +{ + uint32 type; + int32 count; + + const status_t status = message->GetInfo("refs", &type, &count); + if (status == B_OK && type == B_REF_TYPE) { + entry_ref ref; + for (int32 i = 0; i < count; ++i) { + if (message->FindRef("refs", i, &ref) == B_OK) { + const BPath path(&ref); + QCoreApplication::postEvent(QCoreApplication::instance(), new QFileOpenEvent(QFile::decodeName(path.Path()))); + } + } + } + + BApplication::RefsReceived(message); +} diff --git a/src/plugins/platforms/haiku/qhaikuapplication.h b/src/plugins/platforms/haiku/qhaikuapplication.h new file mode 100644 index 0000000000..51148a54df --- /dev/null +++ b/src/plugins/platforms/haiku/qhaikuapplication.h @@ -0,0 +1,50 @@ +/*************************************************************************** +** +** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHAIKUAPPLICATION_H +#define QHAIKUAPPLICATION_H + +#include + +#include + +class QHaikuApplication : public BApplication +{ +public: + explicit QHaikuApplication(const char *signature); + + bool QuitRequested() Q_DECL_OVERRIDE; + void RefsReceived(BMessage* message) Q_DECL_OVERRIDE; +}; + +#endif diff --git a/src/plugins/platforms/haiku/qhaikubuffer.cpp b/src/plugins/platforms/haiku/qhaikubuffer.cpp new file mode 100644 index 0000000000..160fa559d0 --- /dev/null +++ b/src/plugins/platforms/haiku/qhaikubuffer.cpp @@ -0,0 +1,73 @@ +/*************************************************************************** +** +** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qhaikubuffer.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +QHaikuBuffer::QHaikuBuffer() + : m_buffer(Q_NULLPTR) +{ +} + +QHaikuBuffer::QHaikuBuffer(BBitmap *buffer) + : m_buffer(buffer) +{ + // wrap buffer in an image + m_image = QImage(static_cast(m_buffer->Bits()), m_buffer->Bounds().right, m_buffer->Bounds().bottom, m_buffer->BytesPerRow(), QImage::Format_RGB32); +} + +BBitmap* QHaikuBuffer::nativeBuffer() const +{ + return m_buffer; +} + +const QImage *QHaikuBuffer::image() const +{ + return (m_buffer != Q_NULLPTR) ? &m_image : Q_NULLPTR; +} + +QImage *QHaikuBuffer::image() +{ + return (m_buffer != Q_NULLPTR) ? &m_image : Q_NULLPTR; +} + +QRect QHaikuBuffer::rect() const +{ + return m_image.rect(); +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/haiku/qhaikubuffer.h b/src/plugins/platforms/haiku/qhaikubuffer.h new file mode 100644 index 0000000000..f45aca7306 --- /dev/null +++ b/src/plugins/platforms/haiku/qhaikubuffer.h @@ -0,0 +1,62 @@ +/*************************************************************************** +** +** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHAIKUBUFFER_H +#define QHAIKUBUFFER_H + +#include + +class BBitmap; + +QT_BEGIN_NAMESPACE + +class QHaikuBuffer +{ +public: + QHaikuBuffer(); + QHaikuBuffer(BBitmap *buffer); + + BBitmap* nativeBuffer() const; + const QImage *image() const; + QImage *image(); + + QRect rect() const; + +private: + BBitmap *m_buffer; + QImage m_image; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/platforms/haiku/qhaikuclipboard.cpp b/src/plugins/platforms/haiku/qhaikuclipboard.cpp new file mode 100644 index 0000000000..f3aa9dc36e --- /dev/null +++ b/src/plugins/platforms/haiku/qhaikuclipboard.cpp @@ -0,0 +1,140 @@ +/*************************************************************************** +** +** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#if !defined(QT_NO_CLIPBOARD) + +#include "qhaikuclipboard.h" + +#include +#include + +#include + +QHaikuClipboard::QHaikuClipboard() +{ + if (be_clipboard) + be_clipboard->StartWatching(BMessenger(this)); +} + +QHaikuClipboard::~QHaikuClipboard() +{ + if (be_clipboard) + be_clipboard->StopWatching(BMessenger(this)); +} + +QMimeData *QHaikuClipboard::mimeData(QClipboard::Mode mode) +{ + QMimeData *mimeData = new QMimeData(); + + if (mode != QClipboard::Clipboard) + return mimeData; + + if (!be_clipboard->Lock()) + return mimeData; + + const BMessage *clipboard = be_clipboard->Data(); + if (clipboard) { + char *name = Q_NULLPTR; + uint32 type = 0; + int32 count = 0; + + for (int i = 0; clipboard->GetInfo(B_MIME_TYPE, i, &name, &type, &count) == B_OK; i++) { + const void *data = Q_NULLPTR; + int32 dataLen = 0; + + const status_t status = clipboard->FindData(name, B_MIME_TYPE, &data, &dataLen); + if (dataLen && (status == B_OK)) { + const QString format = QString::fromLatin1(name); + if (format == QStringLiteral("text/plain")) { + mimeData->setText(QString::fromLocal8Bit(reinterpret_cast(data), dataLen)); + } else if (format == QStringLiteral("text/html")) { + mimeData->setHtml(QString::fromLocal8Bit(reinterpret_cast(data), dataLen)); + } else { + mimeData->setData(format, QByteArray(reinterpret_cast(data), dataLen)); + } + } + } + } + + be_clipboard->Unlock(); + + return mimeData; +} + +void QHaikuClipboard::setMimeData(QMimeData *mimeData, QClipboard::Mode mode) +{ + if (mode != QClipboard::Clipboard) + return; + + if (!be_clipboard->Lock()) + return; + + be_clipboard->Clear(); + if (mimeData) { + BMessage *clipboard = be_clipboard->Data(); + if (clipboard) { + const QStringList formats = mimeData->formats(); + Q_FOREACH (const QString &format, formats) { + const QByteArray data = mimeData->data(format).data(); + clipboard->AddData(format.toUtf8(), B_MIME_TYPE, data, data.count()); + } + } + } + + if (be_clipboard->Commit() != B_OK) + qWarning("Unable to store mime data on clipboard"); + + be_clipboard->Unlock(); +} + +bool QHaikuClipboard::supportsMode(QClipboard::Mode mode) const +{ + return (mode == QClipboard::Clipboard); +} + +bool QHaikuClipboard::ownsMode(QClipboard::Mode mode) const +{ + Q_UNUSED(mode); + + return false; +} + +void QHaikuClipboard::MessageReceived(BMessage* message) +{ + if (message->what == B_CLIPBOARD_CHANGED) + emitChanged(QClipboard::Clipboard); + + BHandler::MessageReceived(message); +} + +#endif diff --git a/src/plugins/platforms/haiku/qhaikuclipboard.h b/src/plugins/platforms/haiku/qhaikuclipboard.h new file mode 100644 index 0000000000..0dc2bfdd3b --- /dev/null +++ b/src/plugins/platforms/haiku/qhaikuclipboard.h @@ -0,0 +1,64 @@ +/*************************************************************************** +** +** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHAIKUCLIPBOARD_H +#define QHAIKUCLIPBOARD_H + +#if !defined(QT_NO_CLIPBOARD) + +#include + +#include + +QT_BEGIN_NAMESPACE + +class QHaikuClipboard : public QPlatformClipboard, public BHandler +{ +public: + QHaikuClipboard(); + ~QHaikuClipboard(); + + QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard) Q_DECL_OVERRIDE; + void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard) Q_DECL_OVERRIDE; + bool supportsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE; + bool ownsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE; + + // override from BHandler to catch change notifications from Haiku clipboard + void MessageReceived(BMessage* message) Q_DECL_OVERRIDE; +}; + +QT_END_NAMESPACE + +#endif + +#endif diff --git a/src/plugins/platforms/haiku/qhaikucursor.cpp b/src/plugins/platforms/haiku/qhaikucursor.cpp new file mode 100644 index 0000000000..7ac677f597 --- /dev/null +++ b/src/plugins/platforms/haiku/qhaikucursor.cpp @@ -0,0 +1,92 @@ +/*************************************************************************** +** +** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qhaikucursor.h" + +#include "qhaikurasterwindow.h" + +#include + +QHaikuCursor::QHaikuCursor() +{ + m_cursorIds.insert(Qt::ArrowCursor, B_CURSOR_ID_SYSTEM_DEFAULT); + m_cursorIds.insert(Qt::UpArrowCursor, B_CURSOR_ID_RESIZE_NORTH); + m_cursorIds.insert(Qt::CrossCursor, B_CURSOR_ID_CROSS_HAIR); + m_cursorIds.insert(Qt::WaitCursor, B_CURSOR_ID_PROGRESS); + m_cursorIds.insert(Qt::IBeamCursor, B_CURSOR_ID_I_BEAM); + m_cursorIds.insert(Qt::SizeVerCursor, B_CURSOR_ID_RESIZE_NORTH_SOUTH); + m_cursorIds.insert(Qt::SizeHorCursor, B_CURSOR_ID_RESIZE_EAST_WEST); + m_cursorIds.insert(Qt::SizeBDiagCursor, B_CURSOR_ID_RESIZE_NORTH_EAST_SOUTH_WEST); + m_cursorIds.insert(Qt::SizeFDiagCursor, B_CURSOR_ID_RESIZE_NORTH_WEST_SOUTH_EAST); + m_cursorIds.insert(Qt::SizeAllCursor, B_CURSOR_ID_MOVE); + m_cursorIds.insert(Qt::BlankCursor, B_CURSOR_ID_NO_CURSOR); + m_cursorIds.insert(Qt::SplitVCursor, B_CURSOR_ID_RESIZE_NORTH_SOUTH); + m_cursorIds.insert(Qt::SplitHCursor, B_CURSOR_ID_RESIZE_EAST_WEST); + m_cursorIds.insert(Qt::PointingHandCursor, B_CURSOR_ID_FOLLOW_LINK); + m_cursorIds.insert(Qt::ForbiddenCursor, B_CURSOR_ID_NOT_ALLOWED); + m_cursorIds.insert(Qt::OpenHandCursor, B_CURSOR_ID_GRAB); + m_cursorIds.insert(Qt::ClosedHandCursor, B_CURSOR_ID_GRABBING); + m_cursorIds.insert(Qt::WhatsThisCursor, B_CURSOR_ID_HELP); + m_cursorIds.insert(Qt::BusyCursor, B_CURSOR_ID_PROGRESS); +} + +#ifndef QT_NO_CURSOR +void QHaikuCursor::changeCursor(QCursor *windowCursor, QWindow *window) +{ + if (!window) + return; + + BWindow *haikuWindow = reinterpret_cast(window->winId()); + + // We expect that every BWindow has exactly one BView as child, + // so we can use CurrentFocus to retrieve it and call SetViewCursor + // to change the cursor for the whole window. + if (!windowCursor) { + BView *view = haikuWindow->CurrentFocus(); + if (view) { + view->SetViewCursor(B_CURSOR_SYSTEM_DEFAULT); + } + } else { + const Qt::CursorShape shape = windowCursor->shape(); + if (!m_cursors.contains(shape)) + m_cursors.insert(shape, new BCursor(m_cursorIds.value(shape))); + + BView *view = haikuWindow->CurrentFocus(); + if (view) { + view->LockLooper(); + view->SetViewCursor(m_cursors.value(shape)); + view->UnlockLooper(); + } + } +} +#endif diff --git a/src/plugins/platforms/haiku/qhaikucursor.h b/src/plugins/platforms/haiku/qhaikucursor.h new file mode 100644 index 0000000000..61450b84b9 --- /dev/null +++ b/src/plugins/platforms/haiku/qhaikucursor.h @@ -0,0 +1,59 @@ +/*************************************************************************** +** +** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHAIKUCURSOR_H +#define QHAIKUCURSOR_H + +#include + +#include + +QT_BEGIN_NAMESPACE + +class QHaikuCursor : public QPlatformCursor +{ +public: + QHaikuCursor(); + +#ifndef QT_NO_CURSOR + void changeCursor(QCursor *windowCursor, QWindow *window) Q_DECL_OVERRIDE; +#endif + +private: + QHash m_cursorIds; + QHash m_cursors; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/platforms/haiku/qhaikuintegration.cpp b/src/plugins/platforms/haiku/qhaikuintegration.cpp new file mode 100644 index 0000000000..715a965adb --- /dev/null +++ b/src/plugins/platforms/haiku/qhaikuintegration.cpp @@ -0,0 +1,133 @@ +/*************************************************************************** +** +** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qhaikuintegration.h" + +#include "qhaikuapplication.h" +#include "qhaikuclipboard.h" +#include "qhaikurasterbackingstore.h" +#include "qhaikurasterwindow.h" +#include "qhaikuscreen.h" +#include "qhaikuservices.h" + +#include +#include +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +static long int startApplicationThread(void *data) +{ + QHaikuApplication *app = static_cast(data); + app->LockLooper(); + return app->Run(); +} + +QHaikuIntegration::QHaikuIntegration(const QStringList ¶meters) + : m_clipboard(new QHaikuClipboard) +{ + Q_UNUSED(parameters); + + const QString signature = QStringLiteral("application/x-vnd.Qt.%1").arg(QFileInfo(QCoreApplication::applicationFilePath()).fileName()); + + QHaikuApplication *app = new QHaikuApplication(signature.toLocal8Bit()); + be_app = app; + + const thread_id applicationThreadId = spawn_thread(startApplicationThread, "app_thread", 1, static_cast(app)); + resume_thread(applicationThreadId); + app->UnlockLooper(); + + m_screen = new QHaikuScreen; + + m_services = new QHaikuServices; + + // notify system about available screen + screenAdded(m_screen); +} + +QHaikuIntegration::~QHaikuIntegration() +{ + destroyScreen(m_screen); + m_screen = Q_NULLPTR; + + delete m_services; + m_services = Q_NULLPTR; + + delete m_clipboard; + m_clipboard = Q_NULLPTR; + + be_app->LockLooper(); + be_app->Quit(); +} + +bool QHaikuIntegration::hasCapability(QPlatformIntegration::Capability capability) const +{ + return QPlatformIntegration::hasCapability(capability); +} + +QPlatformFontDatabase *QHaikuIntegration::fontDatabase() const +{ + return QPlatformIntegration::fontDatabase(); +} + +QPlatformServices *QHaikuIntegration::services() const +{ + return m_services; +} + +QPlatformClipboard *QHaikuIntegration::clipboard() const +{ + return m_clipboard; +} + +QPlatformWindow *QHaikuIntegration::createPlatformWindow(QWindow *window) const +{ + QPlatformWindow *platformWindow = new QHaikuRasterWindow(window); + platformWindow->requestActivateWindow(); + return platformWindow; +} + +QPlatformBackingStore *QHaikuIntegration::createPlatformBackingStore(QWindow *window) const +{ + return new QHaikuRasterBackingStore(window); +} + +QAbstractEventDispatcher *QHaikuIntegration::createEventDispatcher() const +{ + return createUnixEventDispatcher(); +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/haiku/qhaikuintegration.h b/src/plugins/platforms/haiku/qhaikuintegration.h new file mode 100644 index 0000000000..feb48b2bdf --- /dev/null +++ b/src/plugins/platforms/haiku/qhaikuintegration.h @@ -0,0 +1,72 @@ +/*************************************************************************** +** +** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHAIKUINTEGRATION_H +#define QHAIKUINTEGRATION_H + +#include + +QT_BEGIN_NAMESPACE + +class QHaikuClipboard; +class QHaikuScreen; +class QHaikuServices; + +class QHaikuIntegration : public QPlatformIntegration +{ +public: + explicit QHaikuIntegration(const QStringList ¶mList); + ~QHaikuIntegration(); + + bool hasCapability(QPlatformIntegration::Capability cap) const Q_DECL_OVERRIDE; + + QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE; + QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE; + QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE; + + QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE; + QPlatformServices *services() const Q_DECL_OVERRIDE; + +#ifndef QT_NO_CLIPBOARD + QPlatformClipboard *clipboard() const Q_DECL_OVERRIDE; +#endif + +private: + QHaikuClipboard *m_clipboard; + QHaikuScreen *m_screen; + QHaikuServices *m_services; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/platforms/haiku/qhaikukeymapper.cpp b/src/plugins/platforms/haiku/qhaikukeymapper.cpp new file mode 100644 index 0000000000..7d148ae307 --- /dev/null +++ b/src/plugins/platforms/haiku/qhaikukeymapper.cpp @@ -0,0 +1,180 @@ +/*************************************************************************** +** +** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qhaikukeymapper.h" + +QT_BEGIN_NAMESPACE + +uint32 Haiku_ScanCodes[] = { + Qt::Key_Escape, 0x01, + Qt::Key_F1, 0x02, + Qt::Key_F2, 0x03, + Qt::Key_F3, 0x04, + Qt::Key_F4, 0x05, + Qt::Key_F5, 0x06, + Qt::Key_F6, 0x07, + Qt::Key_F7, 0x08, + Qt::Key_F8, 0x09, + Qt::Key_F9, 0x0A, + Qt::Key_F10, 0x0B, + Qt::Key_F11, 0x0C, + Qt::Key_F12, 0x0D, + Qt::Key_Print, 0x0E, + Qt::Key_Pause, 0x22, + Qt::Key_AsciiTilde, 0x11, + Qt::Key_1, 0x12, + Qt::Key_2, 0x13, + Qt::Key_3, 0x14, + Qt::Key_4, 0x15, + Qt::Key_5, 0x16, + Qt::Key_6, 0x17, + Qt::Key_7, 0x18, + Qt::Key_8, 0x19, + Qt::Key_9, 0x1A, + Qt::Key_0, 0x1B, + Qt::Key_Minus, 0x1C, + Qt::Key_Plus, 0x1D, + Qt::Key_Backspace, 0x1E, + Qt::Key_Insert, 0x1F, + Qt::Key_Home, 0x20, + Qt::Key_PageUp, 0x21, + Qt::Key_Slash, 0x23, + Qt::Key_Asterisk, 0x24, + Qt::Key_Minus, 0x25, + Qt::Key_Tab, 0x26, + Qt::Key_Q, 0x27, + Qt::Key_W, 0x28, + Qt::Key_E, 0x29, + Qt::Key_R, 0x2A, + Qt::Key_T, 0x2B, + Qt::Key_Y, 0x2C, + Qt::Key_U, 0x2D, + Qt::Key_I, 0x2E, + Qt::Key_O, 0x2F, + Qt::Key_P, 0x30, + Qt::Key_BracketLeft, 0x31, + Qt::Key_BracketRight, 0x32, + Qt::Key_Backslash, 0x33, + Qt::Key_Delete, 0x34, + Qt::Key_End, 0x35, + Qt::Key_PageDown, 0x36, + Qt::Key_Home, 0x37, // numpad + Qt::Key_Up, 0x38, // numpad + Qt::Key_PageUp, 0x39, // numpad + Qt::Key_Plus, 0x3A, // numpad + Qt::Key_A, 0x3C, + Qt::Key_S, 0x3D, + Qt::Key_D, 0x3E, + Qt::Key_F, 0x3F, + Qt::Key_G, 0x40, + Qt::Key_H, 0x41, + Qt::Key_J, 0x42, + Qt::Key_K, 0x43, + Qt::Key_L, 0x44, + Qt::Key_Colon, 0x45, + Qt::Key_QuoteDbl, 0x46, + Qt::Key_Return, 0x47, + Qt::Key_Left, 0x48, // numpad + Qt::Key_5, 0x49, // numpad ??? + Qt::Key_Right, 0x4A, // numpad + Qt::Key_Z, 0x4C, + Qt::Key_X, 0x4D, + Qt::Key_C, 0x4E, + Qt::Key_V, 0x4F, + Qt::Key_B, 0x50, + Qt::Key_N, 0x51, + Qt::Key_M, 0x51, + Qt::Key_Less, 0x52, + Qt::Key_Greater, 0x54, + Qt::Key_Question, 0x55, + Qt::Key_Up, 0x57, // cursor + Qt::Key_End, 0x58, // numpad + Qt::Key_Down, 0x59, // numpad + Qt::Key_PageDown, 0x5A, // numpad + Qt::Key_Enter, 0x5B, // numpad + Qt::Key_Space, 0x5E, + Qt::Key_Left, 0x61, // cursor + Qt::Key_Down, 0x62, // cursor + Qt::Key_Right, 0x63, // cursor + Qt::Key_Insert, 0x64, // cursor + Qt::Key_Delete, 0x65, // numpad + 0, 0x00 +}; + +uint32 Haiku_ScanCodes_Numlock[] = { + Qt::Key_7, 0x37, + Qt::Key_8, 0x38, + Qt::Key_9, 0x39, + Qt::Key_Plus, 0x3A, + Qt::Key_4, 0x48, + Qt::Key_5, 0x49, + Qt::Key_6, 0x4A, + Qt::Key_1, 0x58, + Qt::Key_2, 0x59, + Qt::Key_3, 0x5A, + Qt::Key_Enter, 0x5B, + Qt::Key_Comma, 0x65, + 0, 0x00 +}; + +uint32 QHaikuKeyMapper::translateKeyCode(uint32 key, bool numlockActive) +{ + uint32 code = 0; + int i = 0; + + if (numlockActive) { + while (Haiku_ScanCodes_Numlock[i]) { + if (key == Haiku_ScanCodes_Numlock[i + 1]) { + code = Haiku_ScanCodes_Numlock[i]; + break; + } + i += 2; + } + + if (code > 0) + return code; + } + + i = 0; + while (Haiku_ScanCodes[i]) { + if (key == Haiku_ScanCodes[i + 1]) { + code = Haiku_ScanCodes[i]; + break; + } + i += 2; + } + + return code; +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/haiku/qhaikukeymapper.h b/src/plugins/platforms/haiku/qhaikukeymapper.h new file mode 100644 index 0000000000..dba56e1a64 --- /dev/null +++ b/src/plugins/platforms/haiku/qhaikukeymapper.h @@ -0,0 +1,53 @@ +/*************************************************************************** +** +** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHAIKUKEYMAPPER_H +#define QHAIKUKEYMAPPER_H + +#include + +#include + +QT_BEGIN_NAMESPACE + +class QHaikuKeyMapper +{ +public: + QHaikuKeyMapper(); + + static uint32 translateKeyCode(uint32 key, bool numlockActive); +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/platforms/haiku/qhaikurasterbackingstore.cpp b/src/plugins/platforms/haiku/qhaikurasterbackingstore.cpp new file mode 100644 index 0000000000..caede56b1f --- /dev/null +++ b/src/plugins/platforms/haiku/qhaikurasterbackingstore.cpp @@ -0,0 +1,92 @@ +/*************************************************************************** +** +** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qhaikurasterbackingstore.h" +#include "qhaikurasterwindow.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +QHaikuRasterBackingStore::QHaikuRasterBackingStore(QWindow *window) + : QPlatformBackingStore(window) + , m_bitmap(Q_NULLPTR) +{ +} + +QHaikuRasterBackingStore::~QHaikuRasterBackingStore() +{ + delete m_bitmap; + m_bitmap = Q_NULLPTR; +} + +QPaintDevice *QHaikuRasterBackingStore::paintDevice() +{ + if (!m_bufferSize.isEmpty() && m_bitmap) + return m_buffer.image(); + + return Q_NULLPTR; +} + +void QHaikuRasterBackingStore::flush(QWindow *window, const QRegion ®ion, const QPoint &offset) +{ + Q_UNUSED(region); + Q_UNUSED(offset); + + if (!window) + return; + + QHaikuRasterWindow *targetWindow = static_cast(window->handle()); + + BView *view = targetWindow->nativeViewHandle(); + + view->LockLooper(); + view->DrawBitmap(m_bitmap); + view->UnlockLooper(); +} + +void QHaikuRasterBackingStore::resize(const QSize &size, const QRegion &staticContents) +{ + Q_UNUSED(staticContents); + + if (m_bufferSize == size) + return; + + delete m_bitmap; + m_bitmap = new BBitmap(BRect(0, 0, size.width(), size.height()), B_RGB32, false, true); + m_buffer = QHaikuBuffer(m_bitmap); + m_bufferSize = size; +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/haiku/qhaikurasterbackingstore.h b/src/plugins/platforms/haiku/qhaikurasterbackingstore.h new file mode 100644 index 0000000000..641664fb23 --- /dev/null +++ b/src/plugins/platforms/haiku/qhaikurasterbackingstore.h @@ -0,0 +1,64 @@ +/*************************************************************************** +** +** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHAIKURASTERWINDOWSURFACE_H +#define QHAIKURASTERWINDOWSURFACE_H + +#include + +#include "qhaikubuffer.h" + +QT_BEGIN_NAMESPACE + +class BBitmap; +class QHaikuRasterWindow; + +class QHaikuRasterBackingStore : public QPlatformBackingStore +{ +public: + explicit QHaikuRasterBackingStore(QWindow *window); + ~QHaikuRasterBackingStore(); + + QPaintDevice *paintDevice() Q_DECL_OVERRIDE; + void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) Q_DECL_OVERRIDE; + void resize(const QSize &size, const QRegion &staticContents) Q_DECL_OVERRIDE; + +private: + BBitmap *m_bitmap; + QHaikuBuffer m_buffer; + QSize m_bufferSize; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/platforms/haiku/qhaikurasterwindow.cpp b/src/plugins/platforms/haiku/qhaikurasterwindow.cpp new file mode 100644 index 0000000000..659700f269 --- /dev/null +++ b/src/plugins/platforms/haiku/qhaikurasterwindow.cpp @@ -0,0 +1,270 @@ +/*************************************************************************** +** +** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qhaikurasterwindow.h" + +#include "qhaikukeymapper.h" + +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +Q_DECLARE_METATYPE(QEvent::Type) +Q_DECLARE_METATYPE(Qt::MouseButtons) +Q_DECLARE_METATYPE(Qt::MouseEventSource) +Q_DECLARE_METATYPE(Qt::KeyboardModifiers) +Q_DECLARE_METATYPE(Qt::Orientation) + +HaikuViewProxy::HaikuViewProxy(BWindow *window, QObject *parent) + : QObject(parent) + , BView(BRect(0, 0, window->Bounds().right, window->Bounds().bottom), 0, B_FOLLOW_ALL_SIDES, B_WILL_DRAW | B_FRAME_EVENTS) +{ +} + +void HaikuViewProxy::MessageReceived(BMessage *message) +{ + switch (message->what) { + case B_MOUSE_WHEEL_CHANGED: + { + float deltaX = 0; + if (message->FindFloat("be:wheel_delta_x", &deltaX) != B_OK) + deltaX = 0; + + float deltaY = 0; + if (message->FindFloat("be:wheel_delta_y", &deltaY) != B_OK) + deltaY = 0; + + if (deltaX != 0 || deltaY != 0) { + BPoint localPos; + uint32 keyState = 0; + GetMouse(&localPos, &keyState); + const Qt::KeyboardModifiers keyboardModifiers = keyStateToModifiers(modifiers()); + + const BPoint globalPos = ConvertToScreen(localPos); + const QPoint globalPosition = QPoint(globalPos.x, globalPos.y); + const QPoint localPosition = QPoint(localPos.x, localPos.y); + + if (deltaX != 0) + Q_EMIT wheelEvent(localPosition, globalPosition, (deltaX * -120), Qt::Horizontal, keyboardModifiers); + + if (deltaY != 0) + Q_EMIT wheelEvent(localPosition, globalPosition, (deltaY * -120), Qt::Vertical, keyboardModifiers); + } + break; + } + default: + BView::MessageReceived(message); + break; + } + +} + +void HaikuViewProxy::Draw(BRect updateRect) +{ + BView::Draw(updateRect); + + Q_EMIT drawRequest(QRect(updateRect.left, updateRect.top, updateRect.Width(), updateRect.Height())); +} + +void HaikuViewProxy::MouseDown(BPoint localPos) +{ + BPoint dummyPos; + uint32 keyState = 0; + GetMouse(&dummyPos, &keyState); + + const Qt::MouseButtons mouseButtons = keyStateToMouseButtons(keyState); + const Qt::KeyboardModifiers keyboardModifiers = keyStateToModifiers(modifiers()); + const Qt::MouseEventSource source = Qt::MouseEventNotSynthesized; + + const BPoint globalPos = ConvertToScreen(localPos); + const QPoint globalPosition = QPoint(globalPos.x, globalPos.y); + const QPoint localPosition = QPoint(localPos.x, localPos.y); + + Q_EMIT mouseEvent(localPosition, globalPosition, mouseButtons, keyboardModifiers, source); +} + +void HaikuViewProxy::MouseUp(BPoint localPos) +{ + BPoint dummyPos; + uint32 keyState = 0; + GetMouse(&dummyPos, &keyState); + + const Qt::MouseButtons mouseButtons = keyStateToMouseButtons(keyState); + const Qt::KeyboardModifiers keyboardModifiers = keyStateToModifiers(modifiers()); + const Qt::MouseEventSource source = Qt::MouseEventNotSynthesized; + + const BPoint globalPos = ConvertToScreen(localPos); + const QPoint globalPosition = QPoint(globalPos.x, globalPos.y); + const QPoint localPosition = QPoint(localPos.x, localPos.y); + + Q_EMIT mouseEvent(localPosition, globalPosition, mouseButtons, keyboardModifiers, source); +} + +void HaikuViewProxy::MouseMoved(BPoint pos, uint32 code, const BMessage *dragMessage) +{ + switch (code) { + case B_INSIDE_VIEW: + { + BPoint dummyPos; + uint32 keyState = 0; + GetMouse(&dummyPos, &keyState); + + const Qt::MouseButtons mouseButtons = keyStateToMouseButtons(keyState); + const Qt::KeyboardModifiers keyboardModifiers = keyStateToModifiers(modifiers()); + const Qt::MouseEventSource source = Qt::MouseEventNotSynthesized; + + const BPoint globalPos = ConvertToScreen(pos); + const QPoint globalPosition = QPoint(globalPos.x, globalPos.y); + const QPoint localPosition = QPoint(pos.x, pos.y); + + Q_EMIT mouseEvent(localPosition, globalPosition, mouseButtons, keyboardModifiers, source); + } + break; + case B_ENTERED_VIEW: + Q_EMIT enteredView(); + break; + case B_EXITED_VIEW: + Q_EMIT exitedView(); + break; + } + + BView::MouseMoved(pos, code, dragMessage); +} + +void HaikuViewProxy::KeyDown(const char*, int32) +{ + handleKeyEvent(QEvent::KeyPress, Window()->CurrentMessage()); +} + +void HaikuViewProxy::KeyUp(const char*, int32) +{ + handleKeyEvent(QEvent::KeyRelease, Window()->CurrentMessage()); +} + +Qt::MouseButtons HaikuViewProxy::keyStateToMouseButtons(uint32 keyState) const +{ + Qt::MouseButtons mouseButtons(Qt::NoButton); + if (keyState & B_PRIMARY_MOUSE_BUTTON) + mouseButtons |= Qt::LeftButton; + if (keyState & B_SECONDARY_MOUSE_BUTTON) + mouseButtons |= Qt::RightButton; + if (keyState & B_TERTIARY_MOUSE_BUTTON) + mouseButtons |= Qt::MiddleButton; + + return mouseButtons; +} + +Qt::KeyboardModifiers HaikuViewProxy::keyStateToModifiers(uint32 keyState) const +{ + Qt::KeyboardModifiers modifiers(Qt::NoModifier); + + if (keyState & B_SHIFT_KEY) + modifiers |= Qt::ShiftModifier; + if (keyState & B_CONTROL_KEY) + modifiers |= Qt::AltModifier; + if (keyState & B_COMMAND_KEY) + modifiers |= Qt::ControlModifier; + + return modifiers; +} + +void HaikuViewProxy::handleKeyEvent(QEvent::Type type, BMessage *message) +{ + int32 key = 0; + uint32 code = 0; + const char *bytes = Q_NULLPTR; + QString text; + + if (message) { + if (message->FindString("bytes", &bytes) == B_OK) { + text = QString::fromLocal8Bit(bytes, strlen(bytes)); + } + + if (message->FindInt32("key", &key) == B_OK) { + code = QHaikuKeyMapper::translateKeyCode(key, (modifiers() & B_NUM_LOCK)); + } + } + + const Qt::KeyboardModifiers keyboardModifiers = keyStateToModifiers(modifiers()); + + Q_EMIT keyEvent(type, code, keyboardModifiers, text); +} + + +QHaikuRasterWindow::QHaikuRasterWindow(QWindow *window) + : QHaikuWindow(window) +{ + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + + HaikuViewProxy *haikuView = new HaikuViewProxy(m_window); + connect(haikuView, SIGNAL(mouseEvent(QPoint,QPoint,Qt::MouseButtons,Qt::KeyboardModifiers,Qt::MouseEventSource)), + this, SLOT(haikuMouseEvent(QPoint,QPoint,Qt::MouseButtons,Qt::KeyboardModifiers,Qt::MouseEventSource))); + connect(haikuView, SIGNAL(wheelEvent(QPoint,QPoint,int,Qt::Orientation,Qt::KeyboardModifiers)), + this, SLOT(haikuWheelEvent(QPoint,QPoint,int,Qt::Orientation,Qt::KeyboardModifiers))); + connect(haikuView, SIGNAL(keyEvent(QEvent::Type,int,Qt::KeyboardModifiers,QString)), + this, SLOT(haikuKeyEvent(QEvent::Type,int,Qt::KeyboardModifiers,QString))); + connect(haikuView, SIGNAL(enteredView()), this, SLOT(haikuEnteredView())); + connect(haikuView, SIGNAL(exitedView()), this, SLOT(haikuExitedView())); + connect(haikuView, SIGNAL(drawRequest(QRect)), this, SLOT(haikuDrawRequest(QRect))); + + m_view = haikuView; + + m_window->LockLooper(); + m_window->AddChild(m_view); + m_view->MakeFocus(); + m_window->UnlockLooper(); +} + +QHaikuRasterWindow::~QHaikuRasterWindow() +{ + m_window->LockLooper(); + m_view->RemoveSelf(); + m_window->UnlockLooper(); + + delete m_view; + m_view = Q_NULLPTR; +} + +BView* QHaikuRasterWindow::nativeViewHandle() const +{ + return m_view; +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/haiku/qhaikurasterwindow.h b/src/plugins/platforms/haiku/qhaikurasterwindow.h new file mode 100644 index 0000000000..feacc44478 --- /dev/null +++ b/src/plugins/platforms/haiku/qhaikurasterwindow.h @@ -0,0 +1,88 @@ +/*************************************************************************** +** +** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHAIKURASTERWINDOW_H +#define QHAIKURASTERWINDOW_H + +#include "qhaikuwindow.h" + +#include + +QT_BEGIN_NAMESPACE + +class HaikuViewProxy : public QObject, public BView +{ + Q_OBJECT + +public: + explicit HaikuViewProxy(BWindow *window, QObject *parent = Q_NULLPTR); + + void MessageReceived(BMessage *message) Q_DECL_OVERRIDE; + void Draw(BRect updateRect) Q_DECL_OVERRIDE; + void MouseDown(BPoint pos) Q_DECL_OVERRIDE; + void MouseUp(BPoint pos) Q_DECL_OVERRIDE; + void MouseMoved(BPoint pos, uint32 code, const BMessage *dragMessage) Q_DECL_OVERRIDE; + void KeyDown(const char *bytes, int32 numBytes) Q_DECL_OVERRIDE; + void KeyUp(const char *bytes, int32 numBytes) Q_DECL_OVERRIDE; + +Q_SIGNALS: + void mouseEvent(const QPoint &localPosition, const QPoint &globalPosition, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source); + void wheelEvent(const QPoint &localPosition, const QPoint &globalPosition, int delta, Qt::Orientation orientation, Qt::KeyboardModifiers modifiers); + void keyEvent(QEvent::Type type, int key, Qt::KeyboardModifiers modifiers, const QString &text); + void enteredView(); + void exitedView(); + void drawRequest(const QRect &rect); + +private: + Qt::MouseButtons keyStateToMouseButtons(uint32 keyState) const; + Qt::KeyboardModifiers keyStateToModifiers(uint32 keyState) const; + void handleKeyEvent(QEvent::Type type, BMessage *message); +}; + +class QHaikuRasterWindow : public QHaikuWindow +{ + Q_OBJECT + +public: + explicit QHaikuRasterWindow(QWindow *window); + ~QHaikuRasterWindow(); + + BView* nativeViewHandle() const; + +private: + HaikuViewProxy *m_view; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/platforms/haiku/qhaikuscreen.cpp b/src/plugins/platforms/haiku/qhaikuscreen.cpp new file mode 100644 index 0000000000..c21bfc4c93 --- /dev/null +++ b/src/plugins/platforms/haiku/qhaikuscreen.cpp @@ -0,0 +1,137 @@ +/*************************************************************************** +** +** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qhaikuscreen.h" + +#include "qhaikucursor.h" +#include "qhaikuutils.h" + +#include + +#include +#include +#include + +QHaikuScreen::QHaikuScreen() + : m_screen(new BScreen(B_MAIN_SCREEN_ID)) + , m_cursor(new QHaikuCursor) +{ + Q_ASSERT(m_screen->IsValid()); +} + +QHaikuScreen::~QHaikuScreen() +{ + delete m_cursor; + m_cursor = Q_NULLPTR; + + delete m_screen; + m_screen = Q_NULLPTR; +} + +QPixmap QHaikuScreen::grabWindow(WId winId, int x, int y, int width, int height) const +{ + if (width == 0 || height == 0) + return QPixmap(); + + BScreen screen(Q_NULLPTR); + BBitmap *bitmap = Q_NULLPTR; + screen.GetBitmap(&bitmap); + + const BRect frame = (winId ? ((BWindow*)winId)->Frame() : screen.Frame()); + + const int absoluteX = frame.left + x; + const int absoluteY = frame.top + y; + + if (width < 0) + width = frame.Width() - x; + if (height < 0) + height = frame.Height() - y; + + const QImage::Format format = QHaikuUtils::colorSpaceToImageFormat(bitmap->ColorSpace()); + + // get image of complete screen + QImage image((uchar*)bitmap->Bits(), screen.Frame().Width() + 1, screen.Frame().Height() + 1, bitmap->BytesPerRow(), format); + + // extract the area of the requested window + QRect grabRect(absoluteX, absoluteY, width, height); + image = image.copy(grabRect); + + delete bitmap; + + return QPixmap::fromImage(image); +} + +QRect QHaikuScreen::geometry() const +{ + const BRect frame = m_screen->Frame(); + return QRect(frame.left, frame.top, frame.right - frame.left, frame.bottom - frame.top); +} + +int QHaikuScreen::depth() const +{ + switch (format()) { + case QImage::Format_Invalid: + return 0; + break; + case QImage::Format_MonoLSB: + return 1; + break; + case QImage::Format_Indexed8: + return 8; + break; + case QImage::Format_RGB16: + case QImage::Format_RGB555: + return 16; + break; + case QImage::Format_RGB888: + return 24; + break; + case QImage::Format_RGB32: + case QImage::Format_ARGB32: + default: + return 32; + break; + } +} + +QImage::Format QHaikuScreen::format() const +{ + return QHaikuUtils::colorSpaceToImageFormat(m_screen->ColorSpace()); +} + +QPlatformCursor *QHaikuScreen::cursor() const +{ + return m_cursor; +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/haiku/qhaikuscreen.h b/src/plugins/platforms/haiku/qhaikuscreen.h new file mode 100644 index 0000000000..50729d5760 --- /dev/null +++ b/src/plugins/platforms/haiku/qhaikuscreen.h @@ -0,0 +1,66 @@ +/*************************************************************************** +** +** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHAIKUSCREEN_H +#define QHAIKUSCREEN_H + +#include + +class BScreen; +class QHaikuCursor; + +QT_BEGIN_NAMESPACE + +class QHaikuScreen : public QPlatformScreen +{ +public: + QHaikuScreen(); + ~QHaikuScreen(); + + QPixmap grabWindow(WId window, int x, int y, int width, int height) const Q_DECL_OVERRIDE; + + QRect geometry() const Q_DECL_OVERRIDE; + int depth() const Q_DECL_OVERRIDE; + QImage::Format format() const Q_DECL_OVERRIDE; + + QPlatformCursor *cursor() const Q_DECL_OVERRIDE; + +private: + BScreen *m_screen; + + QHaikuCursor *m_cursor; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/platforms/haiku/qhaikuservices.cpp b/src/plugins/platforms/haiku/qhaikuservices.cpp new file mode 100644 index 0000000000..2c07686b56 --- /dev/null +++ b/src/plugins/platforms/haiku/qhaikuservices.cpp @@ -0,0 +1,82 @@ +/*************************************************************************** +** +** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qhaikuservices.h" + +#include +#include +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +bool QHaikuServices::openUrl(const QUrl &url) +{ + const QMimeDatabase mimeDatabase; + + const QMimeType mimeType = mimeDatabase.mimeTypeForUrl(url); + if (!mimeType.isValid()) + return false; + + const QByteArray mimeTypeName = mimeType.name().toLatin1(); + QByteArray urlData = url.toString().toLocal8Bit(); + char *rawUrlData = urlData.data(); + + if (be_roster->Launch(mimeTypeName.constData(), 1, &rawUrlData) != B_OK) + return false; + + return true; +} + +bool QHaikuServices::openDocument(const QUrl &url) +{ + const QByteArray localPath = QFile::encodeName(url.toLocalFile()); + + entry_ref ref; + if (get_ref_for_path(localPath.constData(), &ref) != B_OK) + return false; + + if (be_roster->Launch(&ref) != B_OK) + return false; + + return true; +} + +QByteArray QHaikuServices::desktopEnvironment() const +{ + return QByteArray("Haiku"); +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/haiku/qhaikuservices.h b/src/plugins/platforms/haiku/qhaikuservices.h new file mode 100644 index 0000000000..d38b4481de --- /dev/null +++ b/src/plugins/platforms/haiku/qhaikuservices.h @@ -0,0 +1,52 @@ +/*************************************************************************** +** +** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHAIKUSERVICES_H +#define QHAIKUSERVICES_H + +#include + +QT_BEGIN_NAMESPACE + +class QHaikuServices : public QPlatformServices +{ +public: + bool openUrl(const QUrl &url) Q_DECL_OVERRIDE; + bool openDocument(const QUrl &url) Q_DECL_OVERRIDE; + + QByteArray desktopEnvironment() const Q_DECL_OVERRIDE; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/platforms/haiku/qhaikuutils.cpp b/src/plugins/platforms/haiku/qhaikuutils.cpp new file mode 100644 index 0000000000..f634034864 --- /dev/null +++ b/src/plugins/platforms/haiku/qhaikuutils.cpp @@ -0,0 +1,110 @@ +/*************************************************************************** +** +** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qhaikuutils.h" + +color_space QHaikuUtils::imageFormatToColorSpace(QImage::Format format) +{ + color_space colorSpace = B_NO_COLOR_SPACE; + switch (format) { + case QImage::Format_Invalid: + colorSpace = B_NO_COLOR_SPACE; + break; + case QImage::Format_MonoLSB: + colorSpace = B_GRAY1; + break; + case QImage::Format_Indexed8: + colorSpace = B_CMAP8; + break; + case QImage::Format_RGB32: + colorSpace = B_RGB32; + break; + case QImage::Format_ARGB32: + colorSpace = B_RGBA32; + break; + case QImage::Format_RGB16: + colorSpace = B_RGB16; + break; + case QImage::Format_RGB555: + colorSpace = B_RGB15; + break; + case QImage::Format_RGB888: + colorSpace = B_RGB24; + break; + default: + qWarning("Cannot convert image format %d to color space", format); + Q_ASSERT(false); + break; + } + + return colorSpace; +} + +QImage::Format QHaikuUtils::colorSpaceToImageFormat(color_space colorSpace) +{ + QImage::Format format = QImage::Format_Invalid; + switch (colorSpace) { + case B_NO_COLOR_SPACE: + format = QImage::Format_Invalid; + break; + case B_GRAY1: + format = QImage::Format_MonoLSB; + break; + case B_CMAP8: + format = QImage::Format_Indexed8; + break; + case B_RGB32: + format = QImage::Format_RGB32; + break; + case B_RGBA32: + format = QImage::Format_ARGB32; + break; + case B_RGB16: + format = QImage::Format_RGB16; + break; + case B_RGB15: + format = QImage::Format_RGB555; + break; + case B_RGB24: + format = QImage::Format_RGB888; + break; + default: + qWarning("Cannot convert color space %d to image format", colorSpace); + Q_ASSERT(false); + break; + } + + return format; +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/haiku/qhaikuutils.h b/src/plugins/platforms/haiku/qhaikuutils.h new file mode 100644 index 0000000000..a0d129fcbf --- /dev/null +++ b/src/plugins/platforms/haiku/qhaikuutils.h @@ -0,0 +1,51 @@ +/*************************************************************************** +** +** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHAIKUUTILS_H +#define QHAIKUUTILS_H + +#include + +#include + +QT_BEGIN_NAMESPACE + +namespace QHaikuUtils +{ + color_space imageFormatToColorSpace(QImage::Format format); + QImage::Format colorSpaceToImageFormat(color_space colorSpace); +} + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/platforms/haiku/qhaikuwindow.cpp b/src/plugins/platforms/haiku/qhaikuwindow.cpp new file mode 100644 index 0000000000..5768e1cb40 --- /dev/null +++ b/src/plugins/platforms/haiku/qhaikuwindow.cpp @@ -0,0 +1,388 @@ +/*************************************************************************** +** +** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qhaikuwindow.h" + +#include "private/qguiapplication_p.h" + +#include +#include +#include +#include + +#include +#include + +QT_BEGIN_NAMESPACE + +enum { + DefaultWindowWidth = 160, + DefaultWindowHeight = 160 +}; + +HaikuWindowProxy::HaikuWindowProxy(QWindow *window, const QRect &rect, QObject *parent) + : QObject(parent) + , BWindow(BRect(rect.x(), rect.y(), rect.right() - 1, rect.bottom() - 1), + window->title().toUtf8(), B_NO_BORDER_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, 0) + , m_qtCalledZoom(false) + , m_zoomInProgress(false) +{ +} + +void HaikuWindowProxy::FrameMoved(BPoint pos) +{ + Q_EMIT moved(QPoint(pos.x, pos.y)); +} + +void HaikuWindowProxy::FrameResized(float width, float height) +{ + Q_EMIT resized(QSize(static_cast(width), static_cast(height)), m_zoomInProgress); + + m_zoomInProgress = false; +} + +void HaikuWindowProxy::WindowActivated(bool activated) +{ + Q_EMIT windowActivated(activated); +} + +void HaikuWindowProxy::Minimize(bool minimize) +{ + BWindow::Minimize(minimize); + + Q_EMIT minimized(minimize); +} + +void HaikuWindowProxy::Zoom(BPoint pos, float width, float height) +{ + m_zoomInProgress = true; + BWindow::Zoom(pos, width, height); + + // Only notify about Zoom invocations from the Haiku windowing system + if (!m_qtCalledZoom) + Q_EMIT zoomed(); +} + +bool HaikuWindowProxy::QuitRequested() +{ + Q_EMIT quitRequested(); + + // Return false to prevent Haiku windowing system to clean up + // the BWindow and BView instances. We will do that ourself when + // Qt invokes the dtor of QHaikuWindow + return false; +} + +void HaikuWindowProxy::zoomByQt() +{ + m_qtCalledZoom = true; + BWindow::Zoom(); + m_qtCalledZoom = false; +} + +QHaikuWindow::QHaikuWindow(QWindow *window) + : QPlatformWindow(window) + , m_window(Q_NULLPTR) + , m_windowState(Qt::WindowNoState) +{ + const QRect rect = initialGeometry(window, window->geometry(), DefaultWindowWidth, DefaultWindowHeight); + + HaikuWindowProxy *haikuWindow = new HaikuWindowProxy(window, rect, Q_NULLPTR); + connect(haikuWindow, SIGNAL(moved(QPoint)), SLOT(haikuWindowMoved(QPoint))); + connect(haikuWindow, SIGNAL(resized(QSize,bool)), SLOT(haikuWindowResized(QSize,bool))); + connect(haikuWindow, SIGNAL(windowActivated(bool)), SLOT(haikuWindowActivated(bool))); + connect(haikuWindow, SIGNAL(minimized(bool)), SLOT(haikuWindowMinimized(bool))); + connect(haikuWindow, SIGNAL(zoomed()), SLOT(haikuWindowZoomed())); + connect(haikuWindow, SIGNAL(quitRequested()), SLOT(haikuWindowQuitRequested()), Qt::BlockingQueuedConnection); + + m_window = haikuWindow; + + if (!m_window) + qFatal("QHaikuWindow: failed to create window"); + + setWindowFlags(window->flags()); +} + +QHaikuWindow::~QHaikuWindow() +{ + m_window->LockLooper(); + m_window->Quit(); + + m_window = Q_NULLPTR; +} + +void QHaikuWindow::setGeometry(const QRect &rect) +{ + QPlatformWindow::setGeometry(rect); + + m_window->MoveTo(rect.x(), rect.y()); + m_window->ResizeTo(rect.width(), rect.height()); +} + +QMargins QHaikuWindow::frameMargins() const +{ + const BRect decoratorFrame = m_window->DecoratorFrame(); + const BRect frame = m_window->Frame(); + + return QMargins(frame.left - decoratorFrame.left, + frame.top - decoratorFrame.top, + decoratorFrame.right - frame.right, + decoratorFrame.bottom - frame.bottom); +} + +void QHaikuWindow::setVisible(bool visible) +{ + if (visible) { + m_window->Show(); + } else { + m_window->Hide(); + } + + window()->requestActivate(); + + QWindowSystemInterface::handleExposeEvent(window(), window()->geometry()); +} + +bool QHaikuWindow::isExposed() const +{ + return !m_window->IsHidden(); +} + +bool QHaikuWindow::isActive() const +{ + return m_window->IsActive(); +} + +WId QHaikuWindow::winId() const +{ + return (WId)static_cast(m_window); +} + +BWindow* QHaikuWindow::nativeHandle() const +{ + return m_window; +} + +void QHaikuWindow::requestActivateWindow() +{ + m_window->Activate(true); +} + +void QHaikuWindow::setWindowState(Qt::WindowState state) +{ + if (m_windowState == state) + return; + + const Qt::WindowState oldState = m_windowState; + + m_windowState = state; + + if (m_windowState == Qt::WindowMaximized) { + m_window->zoomByQt(); + } else if (m_windowState == Qt::WindowMinimized) { + m_window->Minimize(true); + } else if (m_windowState == Qt::WindowNoState) { + if (oldState == Qt::WindowMaximized) + m_window->zoomByQt(); // undo zoom + + if (oldState == Qt::WindowMinimized) + m_window->Minimize(false); // undo minimize + } +} + +void QHaikuWindow::setWindowFlags(Qt::WindowFlags flags) +{ + const Qt::WindowType type = static_cast(static_cast(flags & Qt::WindowType_Mask)); + + const bool isPopup = (type == Qt::Popup); + const bool isSplashScreen = (type == Qt::SplashScreen); + const bool isDialog = ((type == Qt::Dialog) || (type == Qt::Sheet) || (type == Qt::MSWindowsFixedSizeDialogHint)); + const bool isTool = ((type == Qt::Tool) || (type == Qt::Drawer)); + const bool isToolTip = (type == Qt::ToolTip); + + window_look wlook = B_TITLED_WINDOW_LOOK; + window_feel wfeel = B_NORMAL_WINDOW_FEEL; + uint32 wflag = (B_NO_WORKSPACE_ACTIVATION | B_NOT_ANCHORED_ON_ACTIVATE); + + if (isTool) { + wlook = B_FLOATING_WINDOW_LOOK; + wflag |= B_WILL_ACCEPT_FIRST_CLICK; + } + + if (isSplashScreen) { + wlook = B_NO_BORDER_WINDOW_LOOK; + } + + if (isPopup) { + wlook = B_NO_BORDER_WINDOW_LOOK; + wflag |= (B_WILL_ACCEPT_FIRST_CLICK | B_AVOID_FRONT | B_AVOID_FOCUS); + flags |= Qt::WindowStaysOnTopHint; + } + + if (isDialog) { + if (window()->modality() == Qt::WindowModal) + wfeel = B_MODAL_SUBSET_WINDOW_FEEL; + else if (window()->modality() == Qt::ApplicationModal) + wfeel = B_MODAL_APP_WINDOW_FEEL; + } + + if (isToolTip) { + wlook = B_NO_BORDER_WINDOW_LOOK; + wflag |= (B_WILL_ACCEPT_FIRST_CLICK | B_AVOID_FOCUS); + flags |= Qt::WindowStaysOnTopHint; + } + + if (flags & Qt::FramelessWindowHint) + wlook = B_NO_BORDER_WINDOW_LOOK; + + if (flags & Qt::MSWindowsFixedSizeDialogHint) + wflag |= (B_NOT_RESIZABLE | B_NOT_ZOOMABLE); + + if (flags & Qt::CustomizeWindowHint) { + if (!(flags & Qt::WindowMinimizeButtonHint)) + wflag |= B_NOT_MINIMIZABLE; + if (!(flags & Qt::WindowMaximizeButtonHint)) + wflag |= B_NOT_ZOOMABLE; + if (!(flags & Qt::WindowCloseButtonHint)) + wflag |= B_NOT_CLOSABLE; + } + + if (flags & Qt::WindowStaysOnTopHint) + wfeel = B_FLOATING_ALL_WINDOW_FEEL; + + m_window->SetLook(wlook); + m_window->SetFeel(wfeel); + m_window->SetFlags(wflag); +} + +void QHaikuWindow::setWindowTitle(const QString &title) +{ + m_window->SetTitle(title.toLocal8Bit().constData()); +} + +void QHaikuWindow::propagateSizeHints() +{ + m_window->SetSizeLimits(window()->minimumSize().width(), + window()->maximumSize().width(), + window()->minimumSize().height(), + window()->maximumSize().height()); + + m_window->SetZoomLimits(window()->maximumSize().width(), + window()->maximumSize().height()); +} + +void QHaikuWindow::haikuWindowMoved(const QPoint &pos) +{ + const QRect newGeometry(pos, geometry().size()); + + QPlatformWindow::setGeometry(newGeometry); + QWindowSystemInterface::setSynchronousWindowsSystemEvents(true); + QWindowSystemInterface::handleGeometryChange(window(), newGeometry); + QWindowSystemInterface::handleExposeEvent(window(), newGeometry); + QWindowSystemInterface::setSynchronousWindowsSystemEvents(false); +} + +void QHaikuWindow::haikuWindowResized(const QSize &size, bool zoomInProgress) +{ + const QRect newGeometry(geometry().topLeft(), size); + + QPlatformWindow::setGeometry(newGeometry); + QWindowSystemInterface::setSynchronousWindowsSystemEvents(true); + QWindowSystemInterface::handleGeometryChange(window(), newGeometry); + QWindowSystemInterface::handleExposeEvent(window(), newGeometry); + QWindowSystemInterface::setSynchronousWindowsSystemEvents(false); + + if ((m_windowState == Qt::WindowMaximized) && !zoomInProgress) { + // the user has resized the window while maximized -> reset maximized flag + m_windowState = Qt::WindowNoState; + + QWindowSystemInterface::handleWindowStateChanged(window(), m_windowState); + } +} + +void QHaikuWindow::haikuWindowActivated(bool activated) +{ + QWindowSystemInterface::handleWindowActivated(activated ? window() : Q_NULLPTR); +} + +void QHaikuWindow::haikuWindowMinimized(bool minimize) +{ + m_windowState = (minimize ? Qt::WindowMinimized : Qt::WindowNoState); + + QWindowSystemInterface::handleWindowStateChanged(window(), m_windowState); +} + +void QHaikuWindow::haikuWindowZoomed() +{ + m_windowState = (m_windowState == Qt::WindowMaximized ? Qt::WindowNoState : Qt::WindowMaximized); + + QWindowSystemInterface::handleWindowStateChanged(window(), m_windowState); +} + +void QHaikuWindow::haikuWindowQuitRequested() +{ + QWindowSystemInterface::handleCloseEvent(window()); +} + +void QHaikuWindow::haikuMouseEvent(const QPoint &localPosition, const QPoint &globalPosition, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source) +{ + QWindowSystemInterface::handleMouseEvent(window(), localPosition, globalPosition, + buttons, modifiers, source); +} + +void QHaikuWindow::haikuWheelEvent(const QPoint &localPosition, const QPoint &globalPosition, int delta, Qt::Orientation orientation, Qt::KeyboardModifiers modifiers) +{ + QWindowSystemInterface::handleWheelEvent(window(), localPosition, globalPosition, delta, orientation, modifiers); +} + +void QHaikuWindow::haikuKeyEvent(QEvent::Type type, int key, Qt::KeyboardModifiers modifiers, const QString &text) +{ + QWindowSystemInterface::handleKeyEvent(window(), type, key, modifiers, text); +} + +void QHaikuWindow::haikuEnteredView() +{ + QWindowSystemInterface::handleEnterEvent(window()); +} + +void QHaikuWindow::haikuExitedView() +{ + QWindowSystemInterface::handleLeaveEvent(window()); +} + +void QHaikuWindow::haikuDrawRequest(const QRect &rect) +{ + QWindowSystemInterface::handleExposeEvent(window(), QRegion(rect)); +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/haiku/qhaikuwindow.h b/src/plugins/platforms/haiku/qhaikuwindow.h new file mode 100644 index 0000000000..a8035e7814 --- /dev/null +++ b/src/plugins/platforms/haiku/qhaikuwindow.h @@ -0,0 +1,122 @@ +/*************************************************************************** +** +** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHAIKUWINDOW_H +#define QHAIKUWINDOW_H + +#include + +#include + +QT_BEGIN_NAMESPACE + +class HaikuWindowProxy : public QObject, public BWindow +{ + Q_OBJECT + +public: + explicit HaikuWindowProxy(QWindow *window, const QRect &rect, QObject *parent = Q_NULLPTR); + + void FrameMoved(BPoint pos) Q_DECL_OVERRIDE; + void FrameResized(float width, float height) Q_DECL_OVERRIDE; + void WindowActivated(bool activated) Q_DECL_OVERRIDE; + void Minimize(bool minimize) Q_DECL_OVERRIDE; + void Zoom(BPoint pos, float width, float height) Q_DECL_OVERRIDE; + bool QuitRequested() Q_DECL_OVERRIDE; + + void zoomByQt(); + +Q_SIGNALS: + void moved(const QPoint &pos); + void resized(const QSize &size, bool zoomInProgress); + void windowActivated(bool activated); + void minimized(bool minimize); + void zoomed(); + void quitRequested(); + +private: + bool m_qtCalledZoom; + bool m_zoomInProgress; +}; + +class QHaikuWindow : public QObject, public QPlatformWindow +{ + Q_OBJECT + +public: + explicit QHaikuWindow(QWindow *window); + virtual ~QHaikuWindow(); + + void setGeometry(const QRect &rect) Q_DECL_OVERRIDE; + QMargins frameMargins() const Q_DECL_OVERRIDE; + void setVisible(bool visible) Q_DECL_OVERRIDE; + + bool isExposed() const Q_DECL_OVERRIDE; + bool isActive() const Q_DECL_OVERRIDE; + + WId winId() const Q_DECL_OVERRIDE; + BWindow* nativeHandle() const; + + void requestActivateWindow() Q_DECL_OVERRIDE; + void setWindowState(Qt::WindowState state) Q_DECL_OVERRIDE; + void setWindowFlags(Qt::WindowFlags flags) Q_DECL_OVERRIDE; + + void setWindowTitle(const QString &title) Q_DECL_OVERRIDE; + + void propagateSizeHints() Q_DECL_OVERRIDE; + +protected: + HaikuWindowProxy *m_window; + +private Q_SLOTS: + void haikuWindowMoved(const QPoint &pos); + void haikuWindowResized(const QSize &size, bool zoomInProgress); + void haikuWindowActivated(bool activated); + void haikuWindowMinimized(bool minimize); + void haikuWindowZoomed(); + void haikuWindowQuitRequested(); + + void haikuMouseEvent(const QPoint &localPosition, const QPoint &globalPosition, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source); + void haikuWheelEvent(const QPoint &localPosition, const QPoint &globalPosition, int delta, Qt::Orientation orientation, Qt::KeyboardModifiers modifiers); + void haikuKeyEvent(QEvent::Type type, int key, Qt::KeyboardModifiers modifiers, const QString &text); + void haikuEnteredView(); + void haikuExitedView(); + void haikuDrawRequest(const QRect &rect); + +private: + Qt::WindowState m_windowState; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/platforms/platforms.pro b/src/plugins/platforms/platforms.pro index 4e1b7e3026..22d443733e 100644 --- a/src/plugins/platforms/platforms.pro +++ b/src/plugins/platforms/platforms.pro @@ -36,3 +36,7 @@ contains(QT_CONFIG, directfb) { } contains(QT_CONFIG, linuxfb): SUBDIRS += linuxfb + +haiku { + SUBDIRS += haiku +} -- cgit v1.2.3 From 3769f7c974e7df8d240e90cbaafae60626053d26 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 3 Oct 2014 21:11:26 +0200 Subject: QDate/QTime: mark some functions constexpr Change-Id: Icbac388337d561f61a9a53163c3ddfc748935a2f Reviewed-by: Thiago Macieira --- src/corelib/tools/qdatetime.h | 54 +++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h index 3affc7e9aa..784aced71a 100644 --- a/src/corelib/tools/qdatetime.h +++ b/src/corelib/tools/qdatetime.h @@ -59,13 +59,13 @@ public: StandaloneFormat }; private: - QDate(qint64 julianDay) : jd(julianDay) {} + Q_DECL_CONSTEXPR QDate(qint64 julianDay) : jd(julianDay) {} public: - QDate() { jd = nullJd(); } + Q_DECL_CONSTEXPR QDate() : jd(nullJd()) {} QDate(int y, int m, int d); - bool isNull() const { return !isValid(); } - bool isValid() const { return jd >= minJd() && jd <= maxJd(); } + Q_DECL_CONSTEXPR bool isNull() const { return !isValid(); } + Q_DECL_CONSTEXPR bool isValid() const { return jd >= minJd() && jd <= maxJd(); } int year() const; int month() const; @@ -100,12 +100,12 @@ QT_DEPRECATED inline bool setYMD(int y, int m, int d) QDate addYears(int years) const Q_REQUIRED_RESULT; qint64 daysTo(const QDate &) const; - bool operator==(const QDate &other) const { return jd == other.jd; } - bool operator!=(const QDate &other) const { return jd != other.jd; } - bool operator<(const QDate &other) const { return jd < other.jd; } - bool operator<=(const QDate &other) const { return jd <= other.jd; } - bool operator>(const QDate &other) const { return jd > other.jd; } - bool operator>=(const QDate &other) const { return jd >= other.jd; } + Q_DECL_CONSTEXPR bool operator==(const QDate &other) const { return jd == other.jd; } + Q_DECL_CONSTEXPR bool operator!=(const QDate &other) const { return jd != other.jd; } + Q_DECL_CONSTEXPR bool operator< (const QDate &other) const { return jd < other.jd; } + Q_DECL_CONSTEXPR bool operator<=(const QDate &other) const { return jd <= other.jd; } + Q_DECL_CONSTEXPR bool operator> (const QDate &other) const { return jd > other.jd; } + Q_DECL_CONSTEXPR bool operator>=(const QDate &other) const { return jd >= other.jd; } static QDate currentDate(); #ifndef QT_NO_DATESTRING @@ -115,15 +115,15 @@ QT_DEPRECATED inline bool setYMD(int y, int m, int d) static bool isValid(int y, int m, int d); static bool isLeapYear(int year); - static inline QDate fromJulianDay(qint64 jd) + static Q_DECL_CONSTEXPR inline QDate fromJulianDay(qint64 jd) { return jd >= minJd() && jd <= maxJd() ? QDate(jd) : QDate() ; } - inline qint64 toJulianDay() const { return jd; } + Q_DECL_CONSTEXPR inline qint64 toJulianDay() const { return jd; } private: // using extra parentheses around min to avoid expanding it if it is a macro - static inline qint64 nullJd() { return (std::numeric_limits::min)(); } - static inline qint64 minJd() { return Q_INT64_C(-784350574879); } - static inline qint64 maxJd() { return Q_INT64_C( 784354017364); } + static Q_DECL_CONSTEXPR inline qint64 nullJd() { return (std::numeric_limits::min)(); } + static Q_DECL_CONSTEXPR inline qint64 minJd() { return Q_INT64_C(-784350574879); } + static Q_DECL_CONSTEXPR inline qint64 maxJd() { return Q_INT64_C( 784354017364); } qint64 jd; @@ -138,20 +138,20 @@ Q_DECLARE_TYPEINFO(QDate, Q_MOVABLE_TYPE); class Q_CORE_EXPORT QTime { - QTime(int ms) : mds(ms) + Q_DECL_CONSTEXPR QTime(int ms) : mds(ms) #if defined(Q_OS_WINCE) , startTick(NullTime) #endif {} public: - QTime(): mds(NullTime) + Q_DECL_CONSTEXPR QTime(): mds(NullTime) #if defined(Q_OS_WINCE) , startTick(NullTime) #endif {} QTime(int h, int m, int s = 0, int ms = 0); - bool isNull() const { return mds == NullTime; } + Q_DECL_CONSTEXPR bool isNull() const { return mds == NullTime; } bool isValid() const; int hour() const; @@ -169,15 +169,15 @@ public: QTime addMSecs(int ms) const Q_REQUIRED_RESULT; int msecsTo(const QTime &) const; - bool operator==(const QTime &other) const { return mds == other.mds; } - bool operator!=(const QTime &other) const { return mds != other.mds; } - bool operator<(const QTime &other) const { return mds < other.mds; } - bool operator<=(const QTime &other) const { return mds <= other.mds; } - bool operator>(const QTime &other) const { return mds > other.mds; } - bool operator>=(const QTime &other) const { return mds >= other.mds; } + Q_DECL_CONSTEXPR bool operator==(const QTime &other) const { return mds == other.mds; } + Q_DECL_CONSTEXPR bool operator!=(const QTime &other) const { return mds != other.mds; } + Q_DECL_CONSTEXPR bool operator< (const QTime &other) const { return mds < other.mds; } + Q_DECL_CONSTEXPR bool operator<=(const QTime &other) const { return mds <= other.mds; } + Q_DECL_CONSTEXPR bool operator> (const QTime &other) const { return mds > other.mds; } + Q_DECL_CONSTEXPR bool operator>=(const QTime &other) const { return mds >= other.mds; } - static inline QTime fromMSecsSinceStartOfDay(int msecs) { return QTime(msecs); } - inline int msecsSinceStartOfDay() const { return mds == NullTime ? 0 : mds; } + static Q_DECL_CONSTEXPR inline QTime fromMSecsSinceStartOfDay(int msecs) { return QTime(msecs); } + Q_DECL_CONSTEXPR inline int msecsSinceStartOfDay() const { return mds == NullTime ? 0 : mds; } static QTime currentTime(); #ifndef QT_NO_DATESTRING @@ -191,7 +191,7 @@ public: int elapsed() const; private: enum TimeFlag { NullTime = -1 }; - inline int ds() const { return mds == -1 ? 0 : mds; } + Q_DECL_CONSTEXPR inline int ds() const { return mds == -1 ? 0 : mds; } int mds; #if defined(Q_OS_WINCE) int startTick; -- cgit v1.2.3 From 2d9c2a0b08d0c5f268faeb9b46ecd961456d042e Mon Sep 17 00:00:00 2001 From: Rainer Keller Date: Thu, 5 Feb 2015 13:40:51 +0100 Subject: Testlib: Add function to extract files from resources to disk Change-Id: I7ae1cdfea751a759298cf277e36cfef7a9c46edb Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/testlib/qtestcase.cpp | 54 +++++++++++++++++++++++++++++++++++++++++++++++ src/testlib/qtestcase.h | 4 ++++ 2 files changed, 58 insertions(+) diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 16dade9154..acac632410 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -48,6 +48,8 @@ #include #include #include +#include +#include #include #include @@ -2755,6 +2757,58 @@ static inline bool isWindowsBuildDirectory(const QString &dirName) } #endif +/* ! + Extract a directory from resources to disk. The content is extracted + recursively to a temporary folder. The extracted content is not removed + automatically. + + \a dirName is the name of the directory to extract from resources. + + Returns the path where the data was extracted or an empty string in case of + errors. + */ +QString QTest::qExtractTestData(const QString &dirName) +{ + QTemporaryDir temporaryDir; + temporaryDir.setAutoRemove(false); + + if (!temporaryDir.isValid()) + return QString(); + + const QString dataPath = temporaryDir.path(); + const QString resourcePath = QLatin1Char(':') + dirName; + const QFileInfo fileInfo(resourcePath); + + if (!fileInfo.isDir()) { + qWarning("Resource path '%s' is not a directory.", qPrintable(resourcePath)); + return QString(); + } + + QDirIterator it(resourcePath, QDirIterator::Subdirectories); + if (!it.hasNext()) { + qWarning("Resource directory '%s' is empty.", qPrintable(resourcePath)); + return QString(); + } + + while (it.hasNext()) { + it.next(); + + QFileInfo fileInfo = it.fileInfo(); + + if (!fileInfo.isDir()) { + const QString destination = dataPath + QLatin1Char('/') + fileInfo.filePath().mid(resourcePath.length()); + QFileInfo destinationFileInfo(destination); + QDir().mkpath(destinationFileInfo.path()); + if (!QFile::copy(fileInfo.filePath(), destination)) { + qWarning("Failed to copy '%s'.", qPrintable(fileInfo.filePath())); + return QString(); + } + } + } + + return dataPath; +} + /*! \internal */ diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h index 9bfef80bac..45290de6de 100644 --- a/src/testlib/qtestcase.h +++ b/src/testlib/qtestcase.h @@ -209,6 +209,9 @@ do {\ QTest::qFindTestData(basepath, __FILE__, __LINE__) #endif +# define QEXTRACTTESTDATA(resourcePath) \ + QTest::qExtractTestData(resourcePath) + class QObject; class QTestData; @@ -245,6 +248,7 @@ namespace QTest Q_TESTLIB_EXPORT void ignoreMessage(QtMsgType type, const QRegularExpression &messagePattern); #endif + Q_TESTLIB_EXPORT QString qExtractTestData(const QString &dirName); Q_TESTLIB_EXPORT QString qFindTestData(const char* basepath, const char* file = 0, int line = 0, const char* builddir = 0); Q_TESTLIB_EXPORT QString qFindTestData(const QString& basepath, const char* file = 0, int line = 0, const char* builddir = 0); -- cgit v1.2.3 From 72d5c84407ad0eb1c4e660343ec456280e874595 Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Thu, 22 Jan 2015 13:31:19 +0300 Subject: Doc: Fix QTextStream::readLine() snippet The old snippet is incomplete because it misses an extra check in the loop body that the line is not null. Use the new readLine() overload to keep it simple. Change-Id: Ie9f13291ca6ff6f546b81f100ce58d747f0dd12f Reviewed-by: Oswald Buddenhagen --- src/corelib/doc/snippets/code/src_corelib_io_qtextstream.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/doc/snippets/code/src_corelib_io_qtextstream.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qtextstream.cpp index 3d04f5b526..c76a0f1f3b 100644 --- a/src/corelib/doc/snippets/code/src_corelib_io_qtextstream.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_io_qtextstream.cpp @@ -51,9 +51,9 @@ if (data.open(QFile::WriteOnly | QFile::Truncate)) { //! [1] QTextStream stream(stdin); QString line; -do { - line = stream.readLine(); -} while (!line.isNull()); +while (stream.readLine(&line)) { + ... +} //! [1] -- cgit v1.2.3 From fd18d13612dd74ddd8747fd28905ad791eb4f4ff Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 12 Feb 2015 13:35:03 +0100 Subject: Use qrc for test data in QFileInfo test on all platforms To make the test compatible with cross-compilation, we need to bundle test data in qrc, and then extract files to the file system during initialization. We did this for Android before, but the change is required on many platforms and since it will also work on desktop platforms, we consistently just do it this way everywhere. Change-Id: I7f65bd9e1dd6f217e6adffda44a40da7599cfe72 Reviewed-by: Christian Stromme --- .../auto/corelib/io/qfileinfo/android_testdata.qrc | 8 ----- tests/auto/corelib/io/qfileinfo/qfileinfo.pro | 9 ++--- tests/auto/corelib/io/qfileinfo/testdata.qrc | 8 +++++ tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp | 39 ++++++---------------- 4 files changed, 21 insertions(+), 43 deletions(-) delete mode 100644 tests/auto/corelib/io/qfileinfo/android_testdata.qrc create mode 100644 tests/auto/corelib/io/qfileinfo/testdata.qrc diff --git a/tests/auto/corelib/io/qfileinfo/android_testdata.qrc b/tests/auto/corelib/io/qfileinfo/android_testdata.qrc deleted file mode 100644 index ce545cc21c..0000000000 --- a/tests/auto/corelib/io/qfileinfo/android_testdata.qrc +++ /dev/null @@ -1,8 +0,0 @@ - - - resources/file1 - resources/file1.ext1 - resources/file1.ext1.ext2 - tst_qfileinfo.cpp - - diff --git a/tests/auto/corelib/io/qfileinfo/qfileinfo.pro b/tests/auto/corelib/io/qfileinfo/qfileinfo.pro index 3fd58b4958..aa5a9d92f1 100644 --- a/tests/auto/corelib/io/qfileinfo/qfileinfo.pro +++ b/tests/auto/corelib/io/qfileinfo/qfileinfo.pro @@ -2,13 +2,8 @@ CONFIG += testcase TARGET = tst_qfileinfo QT = core-private testlib SOURCES = tst_qfileinfo.cpp -RESOURCES += qfileinfo.qrc - -TESTDATA += qfileinfo.qrc qfileinfo.pro tst_qfileinfo.cpp resources/file1 resources/file1.ext1 resources/file1.ext1.ext2 +RESOURCES += qfileinfo.qrc \ + testdata.qrc win32*:!wince*:!winrt:LIBS += -ladvapi32 -lnetapi32 DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 - -android:!android-no-sdk: { - RESOURCES += android_testdata.qrc -} diff --git a/tests/auto/corelib/io/qfileinfo/testdata.qrc b/tests/auto/corelib/io/qfileinfo/testdata.qrc new file mode 100644 index 0000000000..d2974bae77 --- /dev/null +++ b/tests/auto/corelib/io/qfileinfo/testdata.qrc @@ -0,0 +1,8 @@ + + + resources/file1 + resources/file1.ext1 + resources/file1.ext1.ext2 + tst_qfileinfo.cpp + + diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp index 0c71675e1a..05546eb2b7 100644 --- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp @@ -265,40 +265,22 @@ private slots: private: const QString m_currentDir; + QString m_dataPath; QString m_sourceFile; + QString m_proFile; QString m_resourcesDir; QTemporaryDir m_dir; }; void tst_QFileInfo::initTestCase() { -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK) - QString dataPath = QStandardPaths::writableLocation(QStandardPaths::CacheLocation); - QString resourceSourcePath = QStringLiteral(":/android_testdata"); - QDirIterator it(resourceSourcePath, QDirIterator::Subdirectories); - while (it.hasNext()) { - it.next(); - - QFileInfo fileInfo = it.fileInfo(); - if (!fileInfo.isDir()) { - QString destination = dataPath + QLatin1Char('/') + fileInfo.filePath().mid(resourceSourcePath.length()); - QFileInfo destinationFileInfo(destination); - if (!destinationFileInfo.exists()) { - QDir().mkpath(destinationFileInfo.path()); - if (!QFile::copy(fileInfo.filePath(), destination)) - qWarning("Failed to copy %s", qPrintable(fileInfo.filePath())); - } - } - } - m_sourceFile = dataPath + QStringLiteral("/tst_qfileinfo.cpp"); - m_resourcesDir = dataPath + QStringLiteral("/resources"); -#else - m_sourceFile = QFINDTESTDATA("tst_qfileinfo.cpp"); - m_resourcesDir = QFINDTESTDATA("resources"); -#endif + m_dataPath = QEXTRACTTESTDATA("/testdata"); + QVERIFY(!m_dataPath.isEmpty()); + + m_sourceFile = m_dataPath + QStringLiteral("/tst_qfileinfo.cpp"); + m_resourcesDir = m_dataPath + QStringLiteral("/resources"); + m_proFile = m_dataPath + QStringLiteral("/tst_qfileinfo.pro"); - QVERIFY(!m_sourceFile.isEmpty()); - QVERIFY(!m_resourcesDir.isEmpty()); QVERIFY(m_dir.isValid()); QVERIFY(QDir::setCurrent(m_dir.path())); } @@ -306,6 +288,7 @@ void tst_QFileInfo::initTestCase() void tst_QFileInfo::cleanupTestCase() { QDir::setCurrent(m_currentDir); // Release temporary directory so that it can be deleted on Windows + QDir(m_dataPath).removeRecursively(); } // Testing get/set functions @@ -1622,7 +1605,7 @@ void tst_QFileInfo::isExecutable() QFileInfo fi(appPath); QCOMPARE(fi.isExecutable(), true); - QCOMPARE(QFileInfo(QFINDTESTDATA("qfileinfo.pro")).isExecutable(), false); + QCOMPARE(QFileInfo(m_proFile).isExecutable(), false); #ifdef Q_OS_UNIX QFile::remove("link.lnk"); @@ -1634,7 +1617,7 @@ void tst_QFileInfo::isExecutable() QFile::remove("link.lnk"); // Symlink to .pro file - QFile proFile(QFINDTESTDATA("qfileinfo.pro")); + QFile proFile(m_proFile); QVERIFY(proFile.link("link.lnk")); QCOMPARE(QFileInfo("link.lnk").isExecutable(), false); QFile::remove("link.lnk"); -- cgit v1.2.3 From 765a8343d74a7cf9cae8e5da52946734d8ad2e30 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 28 Jan 2015 09:54:49 +0100 Subject: qdoc: Reduce size of Node class The Node class represents every entity to be documented. By changing some of its data members from enum to uchar, it's size has been reduced from 176 bytes to 160 bytes. Change-Id: Idd43866a435f1b0f1ac932870597631b5bbde523 Task-number: QTBUG-43715 Reviewed-by: Thiago Macieira --- src/tools/qdoc/node.cpp | 44 ++++++++++++++++++++++---------------------- src/tools/qdoc/node.h | 38 +++++++++++++++++++------------------- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/tools/qdoc/node.cpp b/src/tools/qdoc/node.cpp index b00276a58c..e34119b5e6 100644 --- a/src/tools/qdoc/node.cpp +++ b/src/tools/qdoc/node.cpp @@ -206,11 +206,11 @@ void Node::setDoc(const Doc& doc, bool replace) parent's child list. */ Node::Node(Type type, InnerNode *parent, const QString& name) - : nodeType_(type), - access_(Public), - safeness_(UnspecifiedSafeness), - pageType_(NoPageType), - status_(Commendable), + : nodeType_((unsigned char) type), + access_((unsigned char) Public), + safeness_((unsigned char) UnspecifiedSafeness), + pageType_((unsigned char) NoPageType), + status_((unsigned char) Commendable), indexNodeFlag_(false), parent_(parent), relatesTo_(0), @@ -279,14 +279,14 @@ Node::Node(Type type, InnerNode *parent, const QString& name) */ QString Node::pageTypeString() const { - return pageTypeString(pageType_); + return pageTypeString((PageType) pageType_); } /*! Returns the page type \a t as a string, for use as an attribute value in XML or HTML. */ -QString Node::pageTypeString(unsigned t) +QString Node::pageTypeString(unsigned char t) { switch ((PageType)t) { case Node::ApiPage: @@ -323,7 +323,7 @@ QString Node::nodeTypeString() const Returns the node type \a t as a string for use as an attribute value in XML or HTML. */ -QString Node::nodeTypeString(unsigned t) +QString Node::nodeTypeString(unsigned char t) { switch ((Type)t) { case Namespace: @@ -383,7 +383,7 @@ QString Node::nodeSubtypeString() const attribute value in XML or HTML. This is only useful in the case where the node type is Document. */ -QString Node::nodeSubtypeString(unsigned t) +QString Node::nodeSubtypeString(unsigned char t) { switch ((SubType)t) { case Example: @@ -413,21 +413,21 @@ QString Node::nodeSubtypeString(unsigned t) void Node::setPageType(const QString& t) { if ((t == "API") || (t == "api")) - pageType_ = ApiPage; + pageType_ = (unsigned char) ApiPage; else if (t == "howto") - pageType_ = HowToPage; + pageType_ = (unsigned char) HowToPage; else if (t == "overview") - pageType_ = OverviewPage; + pageType_ = (unsigned char) OverviewPage; else if (t == "tutorial") - pageType_ = TutorialPage; + pageType_ = (unsigned char) TutorialPage; else if (t == "faq") - pageType_ = FAQPage; + pageType_ = (unsigned char) FAQPage; else if (t == "article") - pageType_ = ArticlePage; + pageType_ = (unsigned char) ArticlePage; else if (t == "example") - pageType_ = ExamplePage; + pageType_ = (unsigned char) ExamplePage; else if (t == "ditamap") - pageType_ = DitaMapPage; + pageType_ = (unsigned char) DitaMapPage; } /*! Converts the boolean value \a b to an enum representation @@ -502,7 +502,7 @@ void Node::setSince(const QString &since) */ QString Node::accessString() const { - switch (access_) { + switch ((Access) access_) { case Protected: return "protected"; case Private: @@ -578,9 +578,9 @@ Node::Status Node::inheritedStatus() const */ Node::ThreadSafeness Node::threadSafeness() const { - if (parent_ && safeness_ == parent_->inheritedThreadSafeness()) + if (parent_ && (ThreadSafeness) safeness_ == parent_->inheritedThreadSafeness()) return UnspecifiedSafeness; - return safeness_; + return (ThreadSafeness) safeness_; } /*! @@ -590,9 +590,9 @@ Node::ThreadSafeness Node::threadSafeness() const */ Node::ThreadSafeness Node::inheritedThreadSafeness() const { - if (parent_ && safeness_ == UnspecifiedSafeness) + if (parent_ && (ThreadSafeness) safeness_ == UnspecifiedSafeness) return parent_->inheritedThreadSafeness(); - return safeness_; + return (ThreadSafeness) safeness_; } #if 0 diff --git a/src/tools/qdoc/node.h b/src/tools/qdoc/node.h index 610ab0875e..671aedfd1e 100644 --- a/src/tools/qdoc/node.h +++ b/src/tools/qdoc/node.h @@ -171,22 +171,22 @@ public: bool hasFileNameBase() const { return !fileNameBase_.isEmpty(); } void setFileNameBase(const QString& t) { fileNameBase_ = t; } - void setAccess(Access access) { access_ = access; } + void setAccess(Access access) { access_ = (unsigned char) access; } void setLocation(const Location& location) { loc_ = location; } void setDoc(const Doc& doc, bool replace = false); void setStatus(Status status) { - if (status_ == Obsolete && status == Deprecated) + if (status_ == (unsigned char) Obsolete && status == Deprecated) return; - status_ = status; + status_ = (unsigned char) status; } - void setThreadSafeness(ThreadSafeness safeness) { safeness_ = safeness; } + void setThreadSafeness(ThreadSafeness safeness) { safeness_ = (unsigned char) safeness; } void setSince(const QString &since); void setRelates(InnerNode* pseudoParent); void setPhysicalModuleName(const QString &name) { physicalModuleName_ = name; } void setUrl(const QString& url) { url_ = url; } void setTemplateStuff(const QString &templateStuff) { templateStuff_ = templateStuff; } void setReconstitutedBrief(const QString &t) { reconstitutedBrief_ = t; } - void setPageType(PageType t) { pageType_ = t; } + void setPageType(PageType t) { pageType_ = (unsigned char) t; } void setPageType(const QString& t); void setParent(InnerNode* n) { parent_ = n; } void setIndexNodeFlag() { indexNodeFlag_ = true; } @@ -245,7 +245,7 @@ public: virtual Tree* tree() const; virtual void findChildren(const QString& , NodeList& nodes) const { nodes.clear(); } bool isIndexNode() const { return indexNodeFlag_; } - Type type() const { return nodeType_; } + Type type() const { return (Type) nodeType_; } virtual SubType subType() const { return NoSubType; } bool match(const NodeTypeList& types) const; InnerNode* parent() const { return parent_; } @@ -264,21 +264,21 @@ public: const QMap >& links() const { return linkMap_; } void setLink(LinkType linkType, const QString &link, const QString &desc); - Access access() const { return access_; } - bool isPrivate() const { return access_ == Private; } + Access access() const { return (Access) access_; } + bool isPrivate() const { return (Access) access_ == Private; } QString accessString() const; const Location& location() const { return loc_; } const Doc& doc() const { return doc_; } bool hasDoc() const { return !doc_.isEmpty(); } - Status status() const { return status_; } + Status status() const { return (Status) status_; } Status inheritedStatus() const; - bool isObsolete() const { return (status_ == Obsolete); } + bool isObsolete() const { return (status_ == (unsigned char) Obsolete); } ThreadSafeness threadSafeness() const; ThreadSafeness inheritedThreadSafeness() const; QString since() const { return since_; } QString templateStuff() const { return templateStuff_; } const QString& reconstitutedBrief() const { return reconstitutedBrief_; } - PageType pageType() const { return pageType_; } + PageType pageType() const { return (PageType) pageType_; } QString pageTypeString() const; QString nodeTypeString() const; QString nodeSubtypeString() const; @@ -311,9 +311,9 @@ public: static FlagValue toFlagValue(bool b); static bool fromFlagValue(FlagValue fv, bool defaultValue); - static QString pageTypeString(unsigned t); - static QString nodeTypeString(unsigned t); - static QString nodeSubtypeString(unsigned t); + static QString pageTypeString(unsigned char t); + static QString nodeTypeString(unsigned char t); + static QString nodeSubtypeString(unsigned char t); static int incPropertyGroupCount(); static void clearPropertyGroupCount(); static void initialize(); @@ -324,11 +324,11 @@ protected: private: - Type nodeType_; - Access access_; - ThreadSafeness safeness_; - PageType pageType_; - Status status_; + unsigned char nodeType_; + unsigned char access_; + unsigned char safeness_; + unsigned char pageType_; + unsigned char status_; bool indexNodeFlag_; InnerNode* parent_; -- cgit v1.2.3 From 7f12b9da186f6e44f1897679339d3abc290c9534 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Thu, 29 Jan 2015 14:06:34 +0100 Subject: qdoc: Omit output subdirectory from paths written to .qhp When writing the help project file, all the files can be assumed to be in the same subdirectory, defined by the qhp virtualFolder variable in the documentation config. Since commit 77165553, the output subdirectory is stored for each documentation node, which caused the subdir to be written to paths in .qhp as well. The result was duplication of the subdir in paths passed to Assistant, giving page not found errors. Change-Id: I69fd74874f9d8eac6957287941193917728476fd Reviewed-by: Martin Smith Reviewed-by: Venugopal Shivashankar --- src/tools/qdoc/helpprojectwriter.cpp | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/tools/qdoc/helpprojectwriter.cpp b/src/tools/qdoc/helpprojectwriter.cpp index 49465304f0..5eab0155bb 100644 --- a/src/tools/qdoc/helpprojectwriter.cpp +++ b/src/tools/qdoc/helpprojectwriter.cpp @@ -224,7 +224,7 @@ QStringList HelpProjectWriter::keywordDetails(const Node *node) const details << node->name(); details << node->name(); } - details << gen_->fullDocumentLocation(node,Generator::useOutputSubdirs()); + details << gen_->fullDocumentLocation(node, false); return details; } @@ -293,12 +293,12 @@ bool HelpProjectWriter::generateSection(HelpProject &project, QStringList details; details << keyword->string() << keyword->string() - << gen_->fullDocumentLocation(node,Generator::useOutputSubdirs()) + + << gen_->fullDocumentLocation(node, false) + QLatin1Char('#') + Doc::canonicalTitle(keyword->string()); project.keywords.append(details); } else - node->doc().location().warning(tr("Bad keyword in %1").arg(gen_->fullDocumentLocation(node,Generator::useOutputSubdirs()))); + node->doc().location().warning(tr("Bad keyword in %1").arg(gen_->fullDocumentLocation(node, false))); } } project.keywords.append(keywordDetails(node)); @@ -325,7 +325,7 @@ bool HelpProjectWriter::generateSection(HelpProject &project, details << item.name(); // "name" details << item.name(); // "id" } - details << gen_->fullDocumentLocation(node,Generator::useOutputSubdirs()); + details << gen_->fullDocumentLocation(node, false); project.keywords.append(details); } } @@ -343,13 +343,13 @@ bool HelpProjectWriter::generateSection(HelpProject &project, QStringList details; details << keyword->string() << keyword->string() - << gen_->fullDocumentLocation(node, Generator::useOutputSubdirs()) + + << gen_->fullDocumentLocation(node, false) + QLatin1Char('#') + Doc::canonicalTitle(keyword->string()); project.keywords.append(details); } else cn->doc().location().warning( - tr("Bad keyword in %1").arg(gen_->fullDocumentLocation(node,Generator::useOutputSubdirs())) + tr("Bad keyword in %1").arg(gen_->fullDocumentLocation(node, false)) ); } } @@ -397,7 +397,7 @@ bool HelpProjectWriter::generateSection(HelpProject &project, // Use the location of any associated enum node in preference // to that of the typedef. if (enumNode) - typedefDetails[2] = gen_->fullDocumentLocation(enumNode,Generator::useOutputSubdirs()); + typedefDetails[2] = gen_->fullDocumentLocation(enumNode, false); project.keywords.append(typedefDetails); } @@ -424,12 +424,12 @@ bool HelpProjectWriter::generateSection(HelpProject &project, QStringList details; details << keyword->string() << keyword->string() - << gen_->fullDocumentLocation(node,Generator::useOutputSubdirs()) + + << gen_->fullDocumentLocation(node, false) + QLatin1Char('#') + Doc::canonicalTitle(keyword->string()); project.keywords.append(details); } else docNode->doc().location().warning( - tr("Bad keyword in %1").arg(gen_->fullDocumentLocation(node,Generator::useOutputSubdirs())) + tr("Bad keyword in %1").arg(gen_->fullDocumentLocation(node, false)) ); } } @@ -554,7 +554,7 @@ void HelpProjectWriter::writeSection(QXmlStreamWriter &writer, const QString &pa void HelpProjectWriter::addMembers(HelpProject &project, QXmlStreamWriter &writer, const Node *node) { - QString href = gen_->fullDocumentLocation(node,Generator::useOutputSubdirs()); + QString href = gen_->fullDocumentLocation(node, false); href = href.left(href.size()-5); if (href.isEmpty()) return; @@ -583,7 +583,7 @@ void HelpProjectWriter::addMembers(HelpProject &project, QXmlStreamWriter &write void HelpProjectWriter::writeNode(HelpProject &project, QXmlStreamWriter &writer, const Node *node) { - QString href = gen_->fullDocumentLocation(node,Generator::useOutputSubdirs()); + QString href = gen_->fullDocumentLocation(node, false); QString objName = node->name(); switch (node->type()) { @@ -700,7 +700,7 @@ void HelpProjectWriter::generateProject(HelpProject &project) node = qdb_->findNodeByNameAndType(QStringList("index.html"), Node::Document); QString indexPath; if (node) - indexPath = gen_->fullDocumentLocation(node,Generator::useOutputSubdirs()); + indexPath = gen_->fullDocumentLocation(node, false); else indexPath = "index.html"; writer.writeAttribute("ref", indexPath); @@ -742,8 +742,7 @@ void HelpProjectWriter::generateProject(HelpProject &project) const Node *page = qdb_->findNodeForTarget(atom->string(), 0); writer.writeStartElement("section"); - QString indexPath = gen_->fullDocumentLocation(page, - Generator::useOutputSubdirs()); + QString indexPath = gen_->fullDocumentLocation(page, false); writer.writeAttribute("ref", indexPath); writer.writeAttribute("title", atom->string()); @@ -768,7 +767,7 @@ void HelpProjectWriter::generateProject(HelpProject &project) if (!name.isEmpty()) { writer.writeStartElement("section"); QString indexPath = gen_->fullDocumentLocation(qdb_->findNodeForTarget(subproject.indexTitle, 0), - Generator::useOutputSubdirs()); + false); writer.writeAttribute("ref", indexPath); writer.writeAttribute("title", subproject.title); } -- cgit v1.2.3 From c38b6a3fde3da8f768d83818cc12ee34b717370b Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Wed, 18 Feb 2015 11:37:09 +0000 Subject: Disable constexpr support for QNX Even though the compiler on QNX supports C++11, the stdlib it ships with is missing constexpr on many important functions. This is required to make qtbase compile on QNX 6.6. Change-Id: I59a4263483b1d94b9d2dceb947876e445f9662af Reviewed-by: Rafael Roquetto --- src/corelib/global/qcompilerdetection.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 8ef8b79902..fa8a529d0c 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -903,6 +903,11 @@ # undef Q_COMPILER_UNICODE_STRINGS # undef Q_COMPILER_NOEXCEPT # endif +# if defined(_HAS_DINKUM_CLIB) && !defined(_HAS_CONSTEXPR) +// The libcpp is missing constexpr keywords on important functions like std::numeric_limits<>::min() +// Disable constexpr support on QNX even if the compiler supports it +# undef Q_COMPILER_CONSTEXPR +# endif # endif // Q_OS_QNX # if (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) && defined(__GNUC_LIBSTD__) \ && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402) -- cgit v1.2.3 From b1ccf65102550bfd9eabd0311a2af4e1abedfcce Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 18 Feb 2015 14:03:11 +0100 Subject: qdoc: Let qdoc ignore Q_ENUM and Q_FLAG Q_ENUM and Q_FLAG were not listed in the Cpp.ignoredirectives variable in qt-cpp-defines.qdocconf. This never used to cause parsing errors in qdoc, but now it does. The cause for this change was not determined at the time of this fix, which is to add Q_ENUM and Q_FLAG to the ignore directives list. Change-Id: I717c9101f7706097869f23b53eeca8cb1a0fee0a Task-number: QTBUG-44510 Reviewed-by: Olivier Goffart (Woboq GmbH) --- doc/global/qt-cpp-defines.qdocconf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/global/qt-cpp-defines.qdocconf b/doc/global/qt-cpp-defines.qdocconf index 0d9dfd8716..3491e00402 100644 --- a/doc/global/qt-cpp-defines.qdocconf +++ b/doc/global/qt-cpp-defines.qdocconf @@ -140,7 +140,9 @@ Cpp.ignoredirectives += \ QT_DEPRECATED_X \ Q_DISABLE_COPY \ Q_DUMMY_COMPARISON_OPERATOR \ + Q_ENUM \ Q_ENUMS \ + Q_FLAG \ Q_FLAGS \ Q_INTERFACES \ Q_PRIVATE_PROPERTY \ -- cgit v1.2.3 From edb2ad9117ee1598f18ad79fd2493ca53b0c9513 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Thu, 19 Feb 2015 15:44:03 +0100 Subject: Fix compilation on Android Commit 81a45e1f13fdf56129aed952a6e3479e16c14a2c replaced QSets with QLists in QTimeZone, but forgot to adapt the Android code. This commit fixes it. Change-Id: I8704a39c44a9dc74147a4bb99a6f5d1bea53afa1 Reviewed-by: Marc Mutz Reviewed-by: Thiago Macieira Reviewed-by: Alex Blasche --- src/corelib/tools/qtimezoneprivate_android.cpp | 6 +++--- src/corelib/tools/qtimezoneprivate_p.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/corelib/tools/qtimezoneprivate_android.cpp b/src/corelib/tools/qtimezoneprivate_android.cpp index f7f4aaab06..6178fe935a 100644 --- a/src/corelib/tools/qtimezoneprivate_android.cpp +++ b/src/corelib/tools/qtimezoneprivate_android.cpp @@ -262,9 +262,9 @@ QByteArray QAndroidTimeZonePrivate::systemTimeZoneId() const return systemTZid; } -QSet QAndroidTimeZonePrivate::availableTimeZoneIds() const +QList QAndroidTimeZonePrivate::availableTimeZoneIds() const { - QSet availableTimeZoneIdList; + QList availableTimeZoneIdList; QJNIObjectPrivate androidAvailableIdList = QJNIObjectPrivate::callStaticObjectMethod("java.util.TimeZone", "getAvailableIDs", "()[Ljava/lang/String;"); QJNIEnvironmentPrivate jniEnv; @@ -277,7 +277,7 @@ QSet QAndroidTimeZonePrivate::availableTimeZoneIds() const for (int i=0; iGetObjectArrayElement( static_cast( androidAvailableIdList.object() ), i ); androidTZ = androidTZobject; - availableTimeZoneIdList.insert( androidTZ.toString().toUtf8() ); + availableTimeZoneIdList.append( androidTZ.toString().toUtf8() ); jniEnv->DeleteLocalRef(androidTZobject); } diff --git a/src/corelib/tools/qtimezoneprivate_p.h b/src/corelib/tools/qtimezoneprivate_p.h index 64827950e2..803ba1f57a 100644 --- a/src/corelib/tools/qtimezoneprivate_p.h +++ b/src/corelib/tools/qtimezoneprivate_p.h @@ -470,7 +470,7 @@ public: QByteArray systemTimeZoneId() const Q_DECL_OVERRIDE; - QSet availableTimeZoneIds() const Q_DECL_OVERRIDE; + QList availableTimeZoneIds() const Q_DECL_OVERRIDE; private: void init(const QByteArray &zoneId); -- cgit v1.2.3 From fe7c2662b5a6a458459bf11b8d06a2b34318918d Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 30 Jan 2015 10:21:46 +0100 Subject: qdoc: Mark Genus of each Node object MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The concept of Genus was introduced to allow link commands (\l) to specify what kind of entity should be accepted as the link target. Possible values were CPP, QML, DOC, and DONTCARE. This became necessary when we started seeing more cases where the same name was used for a C++ class and a QML type. The Genus for an entity was returned by a member function of the specific subclass of Node that represents that entity. For example, QmlTypeNode::genus() returns QML, while Class::genus() returns CPP. Now we are seeing an increasing need to document Javascript. Rather than add subclasses of all the QmlXxxNode classes to represent the javascript entities, the Qml Node subclasses will be used. JS is added to the Genus enum to mark Nodes that represent javascript entities. But this requires storing the Genus value in the node, rather than just having a member function in each subclass return it. Now there are two member functions in the Node base class, genus() and setGenus(), and the value is stored in the Node. This doesn't increase the size, because there was a byte available. Change-Id: Ifcee78595f4288792e09bb255d2e8c01ebafac46 Task-number: QTBUG-43715 Reviewed-by: Topi Reiniö --- src/tools/qdoc/cppcodeparser.cpp | 12 +++++++++++- src/tools/qdoc/cppcodeparser.h | 16 +++++++++++----- src/tools/qdoc/node.cpp | 17 ++++++++++++++--- src/tools/qdoc/node.h | 34 ++++++++++++++-------------------- 4 files changed, 50 insertions(+), 29 deletions(-) diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp index a03f9dad2e..2f26dd1f64 100644 --- a/src/tools/qdoc/cppcodeparser.cpp +++ b/src/tools/qdoc/cppcodeparser.cpp @@ -295,7 +295,17 @@ const QSet& CppCodeParser::topicCommands() << COMMAND_QMLMETHOD << COMMAND_QMLATTACHEDMETHOD << COMMAND_QMLBASICTYPE - << COMMAND_QMLMODULE; + << COMMAND_QMLMODULE + << COMMAND_JSTYPE + << COMMAND_JSPROPERTY + << COMMAND_JSPROPERTYGROUP + << COMMAND_JSATTACHEDPROPERTY + << COMMAND_JSSIGNAL + << COMMAND_JSATTACHEDSIGNAL + << COMMAND_JSMETHOD + << COMMAND_JSATTACHEDMETHOD + << COMMAND_JSBASICTYPE + << COMMAND_JSMODULE; } return topicCommands_; } diff --git a/src/tools/qdoc/cppcodeparser.h b/src/tools/qdoc/cppcodeparser.h index 63f9ff9991..9c775da538 100644 --- a/src/tools/qdoc/cppcodeparser.h +++ b/src/tools/qdoc/cppcodeparser.h @@ -234,11 +234,17 @@ protected: #define COMMAND_LICENSEDESCRIPTION Doc::alias("licensedescription") #define COMMAND_RELEASEDATE Doc::alias("releasedate") #define COMMAND_QTVARIABLE Doc::alias("qtvariable") -#define COMMAND_JSTYPE Doc::alias("jstype") -#define COMMAND_JSPROPERTY Doc::alias("jsproperty") -#define COMMAND_JSMETHOD Doc::alias("jsmethod") -#define COMMAND_JSSIGNAL Doc::alias("jssignal") -#define COMMAND_JSMODULE Doc::alias("jsmodule") +// Some of these are not used currenmtly, but they are included now for completeness. +#define COMMAND_JSTYPE Doc::alias("jstype") +#define COMMAND_JSPROPERTY Doc::alias("jsproperty") +#define COMMAND_JSPROPERTYGROUP Doc::alias("jspropertygroup") +#define COMMAND_JSATTACHEDPROPERTY Doc::alias("jsattachedproperty") +#define COMMAND_JSSIGNAL Doc::alias("jssignal") +#define COMMAND_JSATTACHEDSIGNAL Doc::alias("jsattachedsignal") +#define COMMAND_JSMETHOD Doc::alias("jsmethod") +#define COMMAND_JSATTACHEDMETHOD Doc::alias("jsattachedmethod") +#define COMMAND_JSBASICTYPE Doc::alias("jsbasictype") +#define COMMAND_JSMODULE Doc::alias("jsmodule") QT_END_NAMESPACE diff --git a/src/tools/qdoc/node.cpp b/src/tools/qdoc/node.cpp index e34119b5e6..1ade3e2aca 100644 --- a/src/tools/qdoc/node.cpp +++ b/src/tools/qdoc/node.cpp @@ -1454,6 +1454,7 @@ LeafNode::LeafNode(InnerNode* parent, Type type, const QString& name) NamespaceNode::NamespaceNode(InnerNode *parent, const QString& name) : InnerNode(Namespace, parent, name), tree_(0) { + setGenus(Node::CPP); setPageType(ApiPage); } @@ -1471,6 +1472,7 @@ ClassNode::ClassNode(InnerNode *parent, const QString& name) abstract_ = false; wrapper_ = false; qmlelement = 0; + setGenus(Node::CPP); setPageType(ApiPage); } @@ -1651,6 +1653,7 @@ QmlTypeNode* ClassNode::findQmlBaseNode() DocNode::DocNode(InnerNode* parent, const QString& name, SubType subtype, Node::PageType ptype) : InnerNode(Document, parent, name), nodeSubtype_(subtype) { + setGenus(Node::DOC); switch (subtype) { case Page: setPageType(ptype); @@ -1735,7 +1738,7 @@ QString DocNode::subTitle() const EnumNode::EnumNode(InnerNode *parent, const QString& name) : LeafNode(Enum, parent, name), ft(0) { - // nothing. + setGenus(Node::CPP); } /*! @@ -1780,6 +1783,7 @@ QString EnumNode::itemValue(const QString &name) const TypedefNode::TypedefNode(InnerNode *parent, const QString& name) : LeafNode(Typedef, parent, name), ae(0) { + setGenus(Node::CPP); } /*! @@ -1869,7 +1873,7 @@ FunctionNode::FunctionNode(InnerNode *parent, const QString& name) rf(0), ap(0) { - // nothing. + setGenus(Node::CPP); } /*! @@ -1889,10 +1893,13 @@ FunctionNode::FunctionNode(Type type, InnerNode *parent, const QString& name, bo rf(0), ap(0) { + setGenus(Node::QML); if (type == QmlMethod || type == QmlSignal) { if (name.startsWith("__")) setStatus(Internal); } + else if (type == Function) + setGenus(Node::CPP); } /*! @@ -2079,7 +2086,7 @@ PropertyNode::PropertyNode(InnerNode *parent, const QString& name) rev(-1), overrides(0) { - // nothing. + setGenus(Node::CPP); } /*! @@ -2156,6 +2163,7 @@ QmlTypeNode::QmlTypeNode(InnerNode *parent, const QString& name) } setTitle(name.mid(i)); setPageType(Node::ApiPage); + setGenus(Node::QML); } /*! @@ -2281,6 +2289,7 @@ QmlBasicTypeNode::QmlBasicTypeNode(InnerNode *parent, : InnerNode(QmlBasicType, parent, name) { setTitle(name); + setGenus(Node::QML); } /*! @@ -2291,6 +2300,7 @@ QmlPropertyGroupNode::QmlPropertyGroupNode(QmlTypeNode* parent, const QString& n : InnerNode(QmlPropertyGroup, parent, name) { idNumber_ = -1; + setGenus(Node::QML); } /*! @@ -2328,6 +2338,7 @@ QmlPropertyNode::QmlPropertyNode(InnerNode* parent, isAlias_ = true; if (name.startsWith("__")) setStatus(Internal); + setGenus(Node::QML); } /*! diff --git a/src/tools/qdoc/node.h b/src/tools/qdoc/node.h index 671aedfd1e..8de6015214 100644 --- a/src/tools/qdoc/node.h +++ b/src/tools/qdoc/node.h @@ -170,6 +170,8 @@ public: const QString& fileNameBase() const { return fileNameBase_; } bool hasFileNameBase() const { return !fileNameBase_.isEmpty(); } void setFileNameBase(const QString& t) { fileNameBase_ = t; } + Node::Genus genus() const { return (Genus) genus_; } + void setGenus(Genus t) { genus_ = (unsigned char) t; } void setAccess(Access access) { access_ = (unsigned char) access; } void setLocation(const Location& location) { loc_ = location; } @@ -225,7 +227,6 @@ public: virtual bool hasClasses() const { return false; } virtual void setAbstract(bool ) { } virtual void setWrapper() { } - virtual Node::Genus genus() const { return DontCare; } virtual QString title() const { return name(); } virtual QString fullTitle() const { return name(); } virtual QString subTitle() const { return QString(); } @@ -325,6 +326,7 @@ protected: private: unsigned char nodeType_; + unsigned char genus_; unsigned char access_; unsigned char safeness_; unsigned char pageType_; @@ -439,7 +441,6 @@ public: virtual bool isNamespace() const Q_DECL_OVERRIDE { return true; } virtual Tree* tree() const Q_DECL_OVERRIDE { return (parent() ? parent()->tree() : tree_); } virtual bool isCppNode() const Q_DECL_OVERRIDE { return true; } - virtual Node::Genus genus() const Q_DECL_OVERRIDE { return Node::CPP; } void setTree(Tree* t) { tree_ = t; } private: @@ -472,7 +473,6 @@ public: virtual bool isClass() const Q_DECL_OVERRIDE { return true; } virtual bool isCppNode() const Q_DECL_OVERRIDE { return true; } virtual bool isWrapper() const Q_DECL_OVERRIDE { return wrapper_; } - virtual Node::Genus genus() const Q_DECL_OVERRIDE { return Node::CPP; } virtual QString obsoleteLink() const Q_DECL_OVERRIDE { return obsoleteLink_; } virtual void setObsoleteLink(const QString& t) Q_DECL_OVERRIDE { obsoleteLink_ = t; } virtual void setWrapper() Q_DECL_OVERRIDE { wrapper_ = true; } @@ -537,7 +537,6 @@ public: virtual bool isExampleFile() const Q_DECL_OVERRIDE { return (parent() && parent()->isExample()); } virtual bool isExternalPage() const Q_DECL_OVERRIDE { return nodeSubtype_ == ExternalPage; } virtual bool isDocNode() const Q_DECL_OVERRIDE { return true; } - virtual Node::Genus genus() const Q_DECL_OVERRIDE { return Node::DOC; } protected: SubType nodeSubtype_; @@ -603,7 +602,7 @@ public: virtual QString logicalModuleIdentifier() const Q_DECL_OVERRIDE; virtual QmlModuleNode* logicalModule() const Q_DECL_OVERRIDE { return logicalModule_; } virtual void setQmlModule(QmlModuleNode* t) Q_DECL_OVERRIDE { logicalModule_ = t; } - virtual Node::Genus genus() const Q_DECL_OVERRIDE { return Node::QML; } + const ImportList& importList() const { return importList_; } void setImportList(const ImportList& il) { importList_ = il; } const QString& qmlBaseName() const { return qmlBaseName_; } @@ -641,7 +640,6 @@ public: virtual ~QmlBasicTypeNode() { } virtual bool isQmlNode() const Q_DECL_OVERRIDE { return true; } virtual bool isQmlBasicType() const Q_DECL_OVERRIDE { return true; } - virtual Node::Genus genus() const Q_DECL_OVERRIDE { return Node::QML; } }; class QmlPropertyGroupNode : public InnerNode @@ -663,8 +661,6 @@ public: } virtual QString idNumber() Q_DECL_OVERRIDE; virtual bool isQmlPropertyGroup() const Q_DECL_OVERRIDE { return true; } - virtual Node::Genus genus() const Q_DECL_OVERRIDE { return Node::QML; } - virtual QString element() const Q_DECL_OVERRIDE { return parent()->name(); } private: @@ -682,7 +678,6 @@ public: bool attached); virtual ~QmlPropertyNode() { } - virtual Node::Genus genus() const Q_DECL_OVERRIDE { return Node::QML; } virtual void setDataType(const QString& dataType) Q_DECL_OVERRIDE { type_ = dataType; } void setStored(bool stored) { stored_ = toFlagValue(stored); } void setDesignable(bool designable) { designable_ = toFlagValue(designable); } @@ -747,7 +742,6 @@ public: EnumNode(InnerNode* parent, const QString& name); virtual ~EnumNode() { } - virtual Node::Genus genus() const Q_DECL_OVERRIDE { return Node::CPP; } virtual bool isCppNode() const Q_DECL_OVERRIDE { return true; } void addItem(const EnumItem& item); void setFlagsType(TypedefNode* typedeff); @@ -770,7 +764,6 @@ public: TypedefNode(InnerNode* parent, const QString& name); virtual ~TypedefNode() { } - virtual Node::Genus genus() const Q_DECL_OVERRIDE { return Node::CPP; } virtual bool isCppNode() const Q_DECL_OVERRIDE { return true; } const EnumNode* associatedEnum() const { return ae; } @@ -879,9 +872,6 @@ public: (type() == QmlSignalHandler)); } virtual bool isCppNode() const Q_DECL_OVERRIDE { return !isQmlNode(); } - virtual Node::Genus genus() const Q_DECL_OVERRIDE { - return (isQmlNode() ? Node::QML : Node::CPP); - } virtual bool isQtQuickNode() const Q_DECL_OVERRIDE { return parent()->isQtQuickNode(); } virtual QString qmlTypeName() const Q_DECL_OVERRIDE { return parent()->qmlTypeName(); } virtual QString logicalModuleName() const Q_DECL_OVERRIDE { @@ -926,7 +916,6 @@ public: PropertyNode(InnerNode* parent, const QString& name); virtual ~PropertyNode() { } - virtual Node::Genus genus() const Q_DECL_OVERRIDE { return Node::CPP; } virtual bool isCppNode() const Q_DECL_OVERRIDE { return true; } virtual void setDataType(const QString& dataType) Q_DECL_OVERRIDE { type_ = dataType; } void addFunction(FunctionNode* function, FunctionRole role); @@ -1015,7 +1004,6 @@ public: VariableNode(InnerNode* parent, const QString &name); virtual ~VariableNode() { } - virtual Node::Genus genus() const Q_DECL_OVERRIDE { return Node::CPP; } virtual bool isCppNode() const Q_DECL_OVERRIDE { return true; } void setLeftType(const QString &leftType) { lt = leftType; } void setRightType(const QString &rightType) { rt = rightType; } @@ -1035,7 +1023,7 @@ private: inline VariableNode::VariableNode(InnerNode* parent, const QString &name) : LeafNode(Variable, parent, name), sta(false) { - // nothing. + setGenus(Node::CPP); } class DitaMapNode : public DocNode @@ -1089,7 +1077,9 @@ class GroupNode : public CollectionNode { public: GroupNode(InnerNode* parent, const QString& name) - : CollectionNode(Node::Group, parent, name) { } + : CollectionNode(Node::Group, parent, name) { + setGenus(Node::DOC); + } virtual ~GroupNode() { } virtual bool isGroup() const Q_DECL_OVERRIDE { return true; } @@ -1099,7 +1089,9 @@ class ModuleNode : public CollectionNode { public: ModuleNode(InnerNode* parent, const QString& name) - : CollectionNode(Node::Module, parent, name) { } + : CollectionNode(Node::Module, parent, name) { + setGenus(Node::CPP); + } virtual ~ModuleNode() { } virtual bool isModule() const Q_DECL_OVERRIDE { return true; } @@ -1115,7 +1107,9 @@ class QmlModuleNode : public CollectionNode { public: QmlModuleNode(InnerNode* parent, const QString& name) - : CollectionNode(Node::QmlModule, parent, name) { } + : CollectionNode(Node::QmlModule, parent, name) { + setGenus(Node::QML); + } virtual ~QmlModuleNode() { } virtual bool isQmlNode() const Q_DECL_OVERRIDE { return true; } -- cgit v1.2.3 From 62a2f46d290c67343366cb4f707830fe7d8b3d63 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 13 Feb 2015 13:00:22 +0100 Subject: qdoc: Support documentation of JavaScript MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This update provides the actual support for documenting JavaScript. It has been tested with JavaScript commands in qdoc comments in .qdoc files but not in .js files. Currently, we have the use case of needing to document JavaScript using qdoc comments in .qdoc files. For each qdoc command for QML, i.e. \qmltype, \qmlproperty, etc, there is now a corresponding JavaScript command, i.e. \jstype, \jsproperty, etc. Some of these might not be needed, but they are all provided. Briefly, document JavaScript in a .qdoc file the same way you would document QML in a .qdoc file, but instead of using the \qmlxxx commands, use \jsxxx commands. Change-Id: Ib68a5f66c16472af87d9f776db162332ca13fbb7 Task-number: QTBUG-43715 Reviewed-by: Topi Reiniö --- src/tools/qdoc/codemarker.cpp | 2 +- src/tools/qdoc/codeparser.cpp | 10 +- src/tools/qdoc/cppcodemarker.cpp | 30 ++-- src/tools/qdoc/cppcodeparser.cpp | 172 +++++++++++-------- src/tools/qdoc/cppcodeparser.h | 5 +- src/tools/qdoc/doc.cpp | 3 - src/tools/qdoc/generator.cpp | 89 ++++++---- src/tools/qdoc/generator.h | 6 +- src/tools/qdoc/helpprojectwriter.cpp | 39 +++-- src/tools/qdoc/helpprojectwriter.h | 2 +- src/tools/qdoc/htmlgenerator.cpp | 196 +++++++++------------ src/tools/qdoc/htmlgenerator.h | 2 +- src/tools/qdoc/node.cpp | 258 ++++++++++++---------------- src/tools/qdoc/node.h | 164 ++++++++---------- src/tools/qdoc/puredocparser.cpp | 12 +- src/tools/qdoc/qdocdatabase.cpp | 147 ++++++++-------- src/tools/qdoc/qdocdatabase.h | 52 +++--- src/tools/qdoc/qdocindexfiles.cpp | 319 +++++++++++++++++++++++++---------- src/tools/qdoc/qmlcodeparser.cpp | 25 ++- src/tools/qdoc/qmlvisitor.cpp | 127 ++++---------- src/tools/qdoc/tree.cpp | 259 +++++++++++++++------------- src/tools/qdoc/tree.h | 44 +++-- 22 files changed, 1022 insertions(+), 941 deletions(-) diff --git a/src/tools/qdoc/codemarker.cpp b/src/tools/qdoc/codemarker.cpp index b63e4a2d4f..6a1675aeb5 100644 --- a/src/tools/qdoc/codemarker.cpp +++ b/src/tools/qdoc/codemarker.cpp @@ -394,7 +394,7 @@ void CodeMarker::insert(FastSection &fastSection, if (p->type() == Node::QmlPropertyGroup) p = p->parent(); if (p != fastSection.parent_) { - if (!p->isQmlType() || !p->isAbstract()) { + if ((!p->isQmlType() && !p->isJsType()) || !p->isAbstract()) { inheritedMember = true; } } diff --git a/src/tools/qdoc/codeparser.cpp b/src/tools/qdoc/codeparser.cpp index 571b456f30..4f35672f82 100644 --- a/src/tools/qdoc/codeparser.cpp +++ b/src/tools/qdoc/codeparser.cpp @@ -218,7 +218,8 @@ const QSet& CodeParser::commonMetaCommands() << COMMAND_SUBTITLE << COMMAND_THREADSAFE << COMMAND_TITLE - << COMMAND_WRAPPER; + << COMMAND_WRAPPER + << COMMAND_INJSMODULE; } return commonMetaCommands_; } @@ -251,6 +252,9 @@ void CodeParser::processCommonMetaCommand(const Location& location, else if (command == COMMAND_INQMLMODULE) { qdb_->addToQmlModule(arg.first,node); } + else if (command == COMMAND_INJSMODULE) { + qdb_->addToJsModule(arg.first, node); + } else if (command == COMMAND_MAINCLASS) { node->setStatus(Node::Main); } @@ -297,14 +301,14 @@ void CodeParser::processCommonMetaCommand(const Location& location, } else if (command == COMMAND_TITLE) { node->setTitle(arg.first); - if (!node->isDocNode() && !node->isCollectionNode()) + if (!node->isDocumentNode() && !node->isCollectionNode()) location.warning(tr("Ignored '\\%1'").arg(COMMAND_SUBTITLE)); else if (node->isExample()) qdb_->addExampleNode(static_cast(node)); } else if (command == COMMAND_SUBTITLE) { node->setSubTitle(arg.first); - if (!node->isDocNode() && !node->isCollectionNode()) + if (!node->isDocumentNode() && !node->isCollectionNode()) location.warning(tr("Ignored '\\%1'").arg(COMMAND_SUBTITLE)); } else if (command == COMMAND_QTVARIABLE) { diff --git a/src/tools/qdoc/cppcodemarker.cpp b/src/tools/qdoc/cppcodemarker.cpp index e609e5920f..400c4808ed 100644 --- a/src/tools/qdoc/cppcodemarker.cpp +++ b/src/tools/qdoc/cppcodemarker.cpp @@ -135,7 +135,7 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node, name = "<@name>" + name + ""; if ((style == Detailed) && !node->parent()->name().isEmpty() && - (node->type() != Node::Property) && !node->isQmlNode()) + (node->type() != Node::Property) && !node->isQmlNode() && !node->isJsNode()) name.prepend(taggedNode(node->parent()) + "::"); switch (node->type()) { @@ -307,14 +307,14 @@ QString CppCodeMarker::markedUpQmlItem(const Node* node, bool summary) QString name = taggedQmlNode(node); if (summary) name = linkTag(node,name); - else if (node->type() == Node::QmlProperty) { + else if (node->isQmlProperty() || node->isJsProperty()) { const QmlPropertyNode* pn = static_cast(node); if (pn->isAttached()) name.prepend(pn->element() + QLatin1Char('.')); } name = "<@name>" + name + ""; QString synopsis; - if (node->type() == Node::QmlProperty) { + if (node->isQmlProperty() || node->isJsProperty()) { const QmlPropertyNode* pn = static_cast(node); synopsis = name + " : " + typified(pn->dataType()); } @@ -1134,10 +1134,10 @@ QList
CppCodeMarker::qmlSections(QmlTypeNode* qmlTypeNode, SynopsisStyl ++c; continue; } - if ((*c)->type() == Node::QmlPropertyGroup) { + if ((*c)->isQmlPropertyGroup() || (*c)->isJsPropertyGroup()) { insert(qmlproperties, *c, style, status); } - else if ((*c)->type() == Node::QmlProperty) { + else if ((*c)->isQmlProperty() || (*c)->isJsProperty()) { const QmlPropertyNode* pn = static_cast(*c); if (pn->isAttached()) insert(qmlattachedproperties,*c,style, status); @@ -1145,17 +1145,17 @@ QList
CppCodeMarker::qmlSections(QmlTypeNode* qmlTypeNode, SynopsisStyl insert(qmlproperties,*c,style, status); } } - else if ((*c)->type() == Node::QmlSignal) { + else if ((*c)->isQmlSignal() || (*c)->isJsSignal()) { const FunctionNode* sn = static_cast(*c); if (sn->isAttached()) insert(qmlattachedsignals,*c,style, status); else insert(qmlsignals,*c,style, status); } - else if ((*c)->type() == Node::QmlSignalHandler) { + else if ((*c)->isQmlSignalHandler() || (*c)->isJsSignalHandler()) { insert(qmlsignalhandlers,*c,style, status); } - else if ((*c)->type() == Node::QmlMethod) { + else if ((*c)->isQmlMethod() || (*c)->isJsMethod()) { const FunctionNode* mn = static_cast(*c); if (mn->isAttached()) insert(qmlattachedmethods,*c,style, status); @@ -1199,27 +1199,27 @@ QList
CppCodeMarker::qmlSections(QmlTypeNode* qmlTypeNode, SynopsisStyl ++c; continue; } - if ((*c)->type() == Node::QmlPropertyGroup) { + if ((*c)->isQmlPropertyGroup() || (*c)->isJsPropertyGroup()) { insert(qmlproperties,*c,style, status); } - else if ((*c)->type() == Node::QmlProperty) { + else if ((*c)->isQmlProperty() || (*c)->isJsProperty()) { const QmlPropertyNode* pn = static_cast(*c); if (pn->isAttached()) insert(qmlattachedproperties,*c,style, status); else insert(qmlproperties,*c,style, status); } - else if ((*c)->type() == Node::QmlSignal) { + else if ((*c)->isQmlSignal() || (*c)->isJsSignal()) { const FunctionNode* sn = static_cast(*c); if (sn->isAttached()) insert(qmlattachedsignals,*c,style, status); else insert(qmlsignals,*c,style, status); } - else if ((*c)->type() == Node::QmlSignalHandler) { + else if ((*c)->isQmlSignalHandler() || (*c)->isJsSignalHandler()) { insert(qmlsignalhandlers,*c,style, status); } - else if ((*c)->type() == Node::QmlMethod) { + else if ((*c)->isQmlMethod() || (*c)->isJsMethod()) { const FunctionNode* mn = static_cast(*c); if (mn->isAttached()) insert(qmlattachedmethods,*c,style, status); @@ -1271,11 +1271,11 @@ QList
CppCodeMarker::qmlSections(QmlTypeNode* qmlTypeNode, SynopsisStyl } NodeList::ConstIterator c = current->childNodes().constBegin(); while (c != current->childNodes().constEnd()) { - if ((*c)->type() == Node::QmlPropertyGroup) { + if ((*c)->isQmlPropertyGroup() || (*c)->isJsPropertyGroup()) { const QmlPropertyGroupNode* qpgn = static_cast(*c); NodeList::ConstIterator p = qpgn->childNodes().constBegin(); while (p != qpgn->childNodes().constEnd()) { - if ((*p)->type() == Node::QmlProperty) { + if ((*p)->isQmlProperty() || (*c)->isJsProperty()) { QString key = (*p)->name(); key = sortName(*p, &key); all.memberMap.insert(key,*p); diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp index 2f26dd1f64..405be6f500 100644 --- a/src/tools/qdoc/cppcodeparser.cpp +++ b/src/tools/qdoc/cppcodeparser.cpp @@ -285,7 +285,6 @@ const QSet& CppCodeParser::topicCommands() << COMMAND_PROPERTY << COMMAND_TYPEDEF << COMMAND_VARIABLE - << COMMAND_QMLCLASS << COMMAND_QMLTYPE << COMMAND_QMLPROPERTY << COMMAND_QMLPROPERTYGROUP @@ -446,37 +445,56 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc, } } else if (command == COMMAND_EXTERNALPAGE) { - DocNode* dn = new DocNode(qdb_->primaryTreeRoot(), arg.first, Node::ExternalPage, Node::ArticlePage); + DocumentNode* dn = new DocumentNode(qdb_->primaryTreeRoot(), + arg.first, + Node::ExternalPage, + Node::ArticlePage); dn->setLocation(doc.startLocation()); return dn; } else if (command == COMMAND_FILE) { - DocNode* dn = new DocNode(qdb_->primaryTreeRoot(), arg.first, Node::File, Node::NoPageType); + DocumentNode* dn = new DocumentNode(qdb_->primaryTreeRoot(), + arg.first, + Node::File, + Node::NoPageType); dn->setLocation(doc.startLocation()); return dn; } else if (command == COMMAND_HEADERFILE) { - DocNode* dn = new DocNode(qdb_->primaryTreeRoot(), arg.first, Node::HeaderFile, Node::ApiPage); + DocumentNode* dn = new DocumentNode(qdb_->primaryTreeRoot(), + arg.first, + Node::HeaderFile, + Node::ApiPage); dn->setLocation(doc.startLocation()); return dn; } else if (command == COMMAND_GROUP) { - GroupNode* gn = qdb_->addGroup(arg.first); - gn->setLocation(doc.startLocation()); - gn->markSeen(); - return gn; + CollectionNode* cn = qdb_->addGroup(arg.first); + cn->setLocation(doc.startLocation()); + cn->markSeen(); + return cn; } else if (command == COMMAND_MODULE) { - ModuleNode* mn = qdb_->addModule(arg.first); - mn->setLocation(doc.startLocation()); - mn->markSeen(); - return mn; + CollectionNode* cn = qdb_->addModule(arg.first); + cn->setLocation(doc.startLocation()); + cn->markSeen(); + return cn; } else if (command == COMMAND_QMLMODULE) { - QmlModuleNode* qmn = qdb_->addQmlModule(arg.first); - qmn->setLocation(doc.startLocation()); - qmn->markSeen(); - return qmn; + QStringList blankSplit = arg.first.split(QLatin1Char(' ')); + CollectionNode* cn = qdb_->addQmlModule(blankSplit[0]); + cn->setLogicalModuleInfo(blankSplit); + cn->setLocation(doc.startLocation()); + cn->markSeen(); + return cn; + } + else if (command == COMMAND_JSMODULE) { + QStringList blankSplit = arg.first.split(QLatin1Char(' ')); + CollectionNode* cn = qdb_->addJsModule(blankSplit[0]); + cn->setLogicalModuleInfo(blankSplit); + cn->setLocation(doc.startLocation()); + cn->markSeen(); + return cn; } else if (command == COMMAND_PAGE) { Node::PageType ptype = Node::ArticlePage; @@ -508,66 +526,41 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc, tr("Also used here: %1").arg(other)); } #endif - DocNode* dn = 0; + DocumentNode* dn = 0; if (ptype == Node::DitaMapPage) dn = new DitaMapNode(qdb_->primaryTreeRoot(), args[0]); else - dn = new DocNode(qdb_->primaryTreeRoot(), args[0], Node::Page, ptype); + dn = new DocumentNode(qdb_->primaryTreeRoot(), args[0], Node::Page, ptype); dn->setLocation(doc.startLocation()); return dn; } else if (command == COMMAND_DITAMAP) { - DocNode* dn = new DitaMapNode(qdb_->primaryTreeRoot(), arg.first); + DocumentNode* dn = new DitaMapNode(qdb_->primaryTreeRoot(), arg.first); dn->setLocation(doc.startLocation()); return dn; } - else if ((command == COMMAND_QMLCLASS) || (command == COMMAND_QMLTYPE)) { - if (command == COMMAND_QMLCLASS) - doc.startLocation().warning(tr("\\qmlclass is deprecated; use \\qmltype instead")); - ClassNode* classNode = 0; - QStringList names = arg.first.split(QLatin1Char(' ')); - if (names.size() > 1) { - if (names[1] != "0") - doc.startLocation().warning(tr("\\qmltype no longer has a 2nd argument; " - "use '\\instantiates ' in \\qmltype " - "comments instead")); - else - doc.startLocation().warning(tr("The 0 arg is no longer used for indicating " - "that the QML type does not instantiate a " - "C++ class")); - /* - If the second argument of the \\qmlclass command - is 0 we should ignore the C++ class. The second - argument should only be 0 when you are documenting - QML in a .qdoc file. - */ - if (names[1] != "0") - classNode = qdb_->findClassNode(names[1].split("::")); - } - -#if 0 - const Node* n = qdb_->checkForCollision(names[0]); - if (n) { - QString other = n->doc().location().fileName(); - doc.location().warning(tr("Name/title collision detected: '%1' in '\\%2'") - .arg(names[0]).arg(command), - tr("Also used here: %1").arg(other)); - } -#endif - QmlTypeNode* qcn = new QmlTypeNode(qdb_->primaryTreeRoot(), names[0]); - qcn->setClassNode(classNode); + else if ((command == COMMAND_QMLTYPE) || (command == COMMAND_JSTYPE)) { + QmlTypeNode* qcn = new QmlTypeNode(qdb_->primaryTreeRoot(), arg.first); + if (command == COMMAND_JSTYPE) + qcn->setGenus(Node::JS); qcn->setLocation(doc.startLocation()); return qcn; } - else if (command == COMMAND_QMLBASICTYPE) { + else if ((command == COMMAND_QMLBASICTYPE) || (command == COMMAND_JSBASICTYPE)) { QmlBasicTypeNode* n = new QmlBasicTypeNode(qdb_->primaryTreeRoot(), arg.first); + if (command == COMMAND_JSBASICTYPE) + n->setGenus(Node::JS); n->setLocation(doc.startLocation()); return n; } else if ((command == COMMAND_QMLSIGNAL) || (command == COMMAND_QMLMETHOD) || (command == COMMAND_QMLATTACHEDSIGNAL) || - (command == COMMAND_QMLATTACHEDMETHOD)) { + (command == COMMAND_QMLATTACHEDMETHOD) || + (command == COMMAND_JSSIGNAL) || + (command == COMMAND_JSMETHOD) || + (command == COMMAND_JSATTACHEDSIGNAL) || + (command == COMMAND_JSATTACHEDMETHOD)) { QString module; QString qmlTypeName; QString type; @@ -576,16 +569,20 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc, if (qmlType) { bool attached = false; Node::Type nodeType = Node::QmlMethod; - if (command == COMMAND_QMLSIGNAL) + if ((command == COMMAND_QMLSIGNAL) || + (command == COMMAND_JSSIGNAL)) nodeType = Node::QmlSignal; - else if (command == COMMAND_QMLATTACHEDSIGNAL) { + else if ((command == COMMAND_QMLATTACHEDSIGNAL) || + (command == COMMAND_JSATTACHEDSIGNAL)) { nodeType = Node::QmlSignal; attached = true; } - else if (command == COMMAND_QMLMETHOD) { + else if ((command == COMMAND_QMLMETHOD) || + (command == COMMAND_JSMETHOD)) { // do nothing } - else if (command == COMMAND_QMLATTACHEDMETHOD) + else if ((command == COMMAND_QMLATTACHEDMETHOD) || + (command == COMMAND_JSATTACHEDMETHOD)) attached = true; else return 0; // never get here. @@ -595,8 +592,14 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc, nodeType, attached, command); - if (fn) + if (fn) { fn->setLocation(doc.startLocation()); + if ((command == COMMAND_JSSIGNAL) || + (command == COMMAND_JSMETHOD) || + (command == COMMAND_JSATTACHEDSIGNAL) || + (command == COMMAND_JSATTACHEDMETHOD)) + fn->setGenus(Node::JS); + } return fn; } } @@ -741,7 +744,10 @@ bool CppCodeParser::splitQmlMethodArg(const QString& arg, Currently, this function is called only for \e{qmlproperty} and \e{qmlattachedproperty}. */ -void CppCodeParser::processQmlProperties(const Doc& doc, NodeList& nodes, DocList& docs) +void CppCodeParser::processQmlProperties(const Doc& doc, + NodeList& nodes, + DocList& docs, + bool jsProps) { QString arg; QString type; @@ -756,14 +762,18 @@ void CppCodeParser::processQmlProperties(const Doc& doc, NodeList& nodes, DocLis Topic qmlPropertyGroupTopic; const TopicList& topics = doc.topicsUsed(); for (int i=0; i 1) { qmlPropertyGroupTopic = topics.at(0); - qmlPropertyGroupTopic.topic = COMMAND_QMLPROPERTYGROUP; + if (jsProps) + qmlPropertyGroupTopic.topic = COMMAND_JSPROPERTYGROUP; + else + qmlPropertyGroupTopic.topic = COMMAND_QMLPROPERTYGROUP; arg = qmlPropertyGroupTopic.args; if (splitQmlPropertyArg(arg, type, module, qmlTypeName, property)) { int i = property.indexOf('.'); @@ -790,6 +800,8 @@ void CppCodeParser::processQmlProperties(const Doc& doc, NodeList& nodes, DocLis if (qmlType) { qpgn = new QmlPropertyGroupNode(qmlType, property); qpgn->setLocation(doc.startLocation()); + if (jsProps) + qpgn->setGenus(Node::JS); nodes.append(qpgn); docs.append(doc); } @@ -801,8 +813,10 @@ void CppCodeParser::processQmlProperties(const Doc& doc, NodeList& nodes, DocLis } topic = topics.at(i).topic; arg = topics.at(i).args; - if ((topic == COMMAND_QMLPROPERTY) || (topic == COMMAND_QMLATTACHEDPROPERTY)) { - bool attached = (topic == COMMAND_QMLATTACHEDPROPERTY); + if ((topic == COMMAND_QMLPROPERTY) || (topic == COMMAND_QMLATTACHEDPROPERTY) || + (topic == COMMAND_JSPROPERTY) || (topic == COMMAND_JSATTACHEDPROPERTY)) { + bool attached = ((topic == COMMAND_QMLATTACHEDPROPERTY) || + (topic == COMMAND_JSATTACHEDPROPERTY)); if (splitQmlPropertyArg(arg, type, module, qmlTypeName, property)) { qmlType = qdb_->findQmlType(module, qmlTypeName); if (qmlType) { @@ -813,10 +827,14 @@ void CppCodeParser::processQmlProperties(const Doc& doc, NodeList& nodes, DocLis else if (qpgn) { qpn = new QmlPropertyNode(qpgn, property, type, attached); qpn->setLocation(doc.startLocation()); + if (jsProps) + qpn->setGenus(Node::JS); } else { qpn = new QmlPropertyNode(qmlType, property, type, attached); qpn->setLocation(doc.startLocation()); + if (jsProps) + qpn->setGenus(Node::JS); nodes.append(qpn); docs.append(doc); } @@ -941,14 +959,14 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc, else if (command == COMMAND_QMLINHERITS) { if (node->name() == arg) doc.location().warning(tr("%1 tries to inherit itself").arg(arg)); - else if (node->isQmlType()) { + else if (node->isQmlType() || node->isJsType()) { QmlTypeNode* qmlType = static_cast(node); qmlType->setQmlBaseName(arg); QmlTypeNode::addInheritedBy(arg,node); } } else if (command == COMMAND_QMLINSTANTIATES) { - if (node->isQmlType()) { + if (node->isQmlType() || node->isJsType()) { ClassNode* classNode = qdb_->findClassNode(arg.split("::")); if (classNode) node->setClassNode(classNode); @@ -993,7 +1011,7 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc, } } else if (command == COMMAND_QMLABSTRACT) { - if (node->isQmlType()) + if (node->isQmlType() || node->isJsType()) node->setAbstract(true); } else { @@ -2095,6 +2113,7 @@ bool CppCodeParser::matchDocsAndStuff() Doc doc(start_loc,end_loc,comment,metacommandsAllowed, topicCommandsAllowed); QString topic; bool isQmlPropertyTopic = false; + bool isJsPropertyTopic = false; const TopicList& topics = doc.topicsUsed(); if (!topics.isEmpty()) { @@ -2104,6 +2123,11 @@ bool CppCodeParser::matchDocsAndStuff() (topic == COMMAND_QMLATTACHEDPROPERTY)) { isQmlPropertyTopic = true; } + else if ((topic == COMMAND_JSPROPERTY) || + (topic == COMMAND_JSPROPERTYGROUP) || + (topic == COMMAND_JSATTACHEDPROPERTY)) { + isJsPropertyTopic = true; + } } NodeList nodes; DocList docs; @@ -2140,9 +2164,9 @@ bool CppCodeParser::matchDocsAndStuff() .arg(COMMAND_FN).arg(COMMAND_PAGE)); } } - else if (isQmlPropertyTopic) { + else if (isQmlPropertyTopic || isJsPropertyTopic) { Doc nodeDoc = doc; - processQmlProperties(nodeDoc, nodes, docs); + processQmlProperties(nodeDoc, nodes, docs, isJsPropertyTopic); } else { ArgList args; @@ -2326,7 +2350,7 @@ void CppCodeParser::instantiateIteratorMacro(const QString &container, matchDeclList(QDocDatabase::qdocDB()->primaryTreeRoot()); } -void CppCodeParser::createExampleFileNodes(DocNode *dn) +void CppCodeParser::createExampleFileNodes(DocumentNode *dn) { QString examplePath = dn->name(); QString proFileName = examplePath + QLatin1Char('/') + examplePath.split(QLatin1Char('/')).last() + ".pro"; @@ -2394,13 +2418,13 @@ void CppCodeParser::createExampleFileNodes(DocNode *dn) } foreach (const QString &exampleFile, exampleFiles) { - new DocNode(dn, + new DocumentNode(dn, exampleFile.mid(sizeOfBoringPartOfName), Node::File, Node::NoPageType); } foreach (const QString &imageFile, imageFiles) { - new DocNode(dn, + new DocumentNode(dn, imageFile.mid(sizeOfBoringPartOfName), Node::Image, Node::NoPageType); diff --git a/src/tools/qdoc/cppcodeparser.h b/src/tools/qdoc/cppcodeparser.h index 9c775da538..dc5c8ca8bd 100644 --- a/src/tools/qdoc/cppcodeparser.h +++ b/src/tools/qdoc/cppcodeparser.h @@ -81,7 +81,7 @@ protected: virtual Node* processTopicCommand(const Doc& doc, const QString& command, const ArgLocPair& arg); - void processQmlProperties(const Doc& doc, NodeList& nodes, DocList& docs); + void processQmlProperties(const Doc& doc, NodeList& nodes, DocList& docs, bool jsProps); bool splitQmlPropertyGroupArg(const QString& arg, QString& module, QString& element, @@ -148,7 +148,7 @@ protected: void instantiateIteratorMacro(const QString &container, const QString &includeFile, const QString ¯oDef); - void createExampleFileNodes(DocNode *dn); + void createExampleFileNodes(DocumentNode *dn); protected: QMap nodeTypeMap; @@ -203,7 +203,6 @@ protected: #define COMMAND_TYPEDEF Doc::alias("typedef") #define COMMAND_VARIABLE Doc::alias("variable") #define COMMAND_QMLABSTRACT Doc::alias("qmlabstract") -#define COMMAND_QMLCLASS Doc::alias("qmlclass") #define COMMAND_QMLTYPE Doc::alias("qmltype") #define COMMAND_QMLPROPERTY Doc::alias("qmlproperty") #define COMMAND_QMLPROPERTYGROUP Doc::alias("qmlpropertygroup") diff --git a/src/tools/qdoc/doc.cpp b/src/tools/qdoc/doc.cpp index f42f778d12..7965ea898f 100644 --- a/src/tools/qdoc/doc.cpp +++ b/src/tools/qdoc/doc.cpp @@ -2821,9 +2821,6 @@ QString DocParser::slashed(const QString& str) return QLatin1Char('/') + result + QLatin1Char('/'); } -#define COMMAND_BRIEF Doc::alias("brief") -#define COMMAND_QMLBRIEF Doc::alias("qmlbrief") - /*! Parse the qdoc comment \a source. Build up a list of all the topic commands found including their arguments. This constructor is used diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp index 587a7bc7ab..0ecd5ed6e3 100644 --- a/src/tools/qdoc/generator.cpp +++ b/src/tools/qdoc/generator.cpp @@ -310,7 +310,7 @@ QString Generator::fileBase(const Node *node) const return node->fileNameBase(); QString base; - if (node->isDocNode()) { + if (node->isDocumentNode()) { base = node->name(); if (base.endsWith(".html") && !node->isExampleFile()) base.truncate(base.length() - 5); @@ -326,7 +326,8 @@ QString Generator::fileBase(const Node *node) const base.append(QLatin1String("-example")); } } - else if (node->isQmlType() || node->isQmlBasicType()) { + else if (node->isQmlType() || node->isQmlBasicType() || + node->isJsType() || node->isJsBasicType()) { base = node->name(); if (!node->logicalModuleName().isEmpty()) { base.prepend(node->logicalModuleName() + QLatin1Char('-')); @@ -336,7 +337,10 @@ QString Generator::fileBase(const Node *node) const we prepend a prefix (by default, "qml-") to the file name of QML element doc files. */ - base.prepend(outputPrefix(QLatin1String("QML"))); + if (node->isQmlType() || node->isQmlBasicType()) + base.prepend(outputPrefix(QLatin1String("QML"))); + else + base.prepend(outputPrefix(QLatin1String("JS"))); } else if (node->isCollectionNode()) { base = node->name(); @@ -346,6 +350,9 @@ QString Generator::fileBase(const Node *node) const if (node->isQmlModule()) { base.append("-qmlmodule"); } + else if (node->isJsModule()) { + base.append("-jsmodule"); + } else if (node->isModule()) { base.append("-module"); } @@ -356,7 +363,7 @@ QString Generator::fileBase(const Node *node) const forever { const Node *pp = p->parent(); base.prepend(p->name()); - if (!pp || pp->name().isEmpty() || pp->isDocNode()) + if (!pp || pp->name().isEmpty() || pp->isDocumentNode()) break; base.prepend(QLatin1Char('-')); p = pp; @@ -456,21 +463,27 @@ QString Generator::fullDocumentLocation(const Node *node, bool useSubdir) else return QString(); } - else if (node->isQmlType() || node->isQmlBasicType()) { + else if (node->isQmlType() || node->isQmlBasicType() || + node->isJsType() || node->isJsBasicType()) { QString fb = fileBase(node); if (fb.startsWith(Generator::outputPrefix(QLatin1String("QML")))) return fb + QLatin1Char('.') + currentGenerator()->fileExtension(); + else if (fb.startsWith(Generator::outputPrefix(QLatin1String("JS")))) + return fb + QLatin1Char('.') + currentGenerator()->fileExtension(); else { QString mq; if (!node->logicalModuleName().isEmpty()) { mq = node->logicalModuleName().replace(QChar('.'),QChar('-')); mq = mq.toLower() + QLatin1Char('-'); } - return fdl+ Generator::outputPrefix(QLatin1String("QML")) + mq + - fileBase(node) + QLatin1Char('.') + currentGenerator()->fileExtension(); + QLatin1String prefix = QLatin1String("QML"); + if (node->isJsType() || node->isJsBasicType()) + prefix = QLatin1String("JS"); + return fdl+ Generator::outputPrefix(prefix) + mq + fileBase(node) + + QLatin1Char('.') + currentGenerator()->fileExtension(); } } - else if (node->isDocNode() || node->isCollectionNode()) { + else if (node->isDocumentNode() || node->isCollectionNode()) { parentName = fileBase(node) + QLatin1Char('.') + currentGenerator()->fileExtension(); } else if (fileBase(node).isEmpty()) @@ -482,7 +495,7 @@ QString Generator::fullDocumentLocation(const Node *node, bool useSubdir) parentName = fullDocumentLocation(node->relates()); } else if ((parentNode = node->parent())) { - if (parentNode->type() == Node::QmlPropertyGroup) { + if (parentNode->isQmlPropertyGroup() || parentNode->isJsPropertyGroup()) { parentNode = parentNode->parent(); parentName = fullDocumentLocation(parentNode); } @@ -683,7 +696,7 @@ void Generator::generateBody(const Node *node, CodeMarker *marker) bool quiet = false; if (node->type() == Node::Document) { - const DocNode *dn = static_cast(node); + const DocumentNode *dn = static_cast(node); if ((dn->subType() == Node::File) || (dn->subType() == Node::Image)) { quiet = true; } @@ -808,8 +821,8 @@ void Generator::generateBody(const Node *node, CodeMarker *marker) } } - if (node->isDocNode()) { - const DocNode *dn = static_cast(node); + if (node->isDocumentNode()) { + const DocumentNode *dn = static_cast(node); if (dn->isExample()) { generateExampleFiles(dn, marker); } @@ -829,7 +842,7 @@ void Generator::generateClassLikeNode(InnerNode* /* classe */, CodeMarker* /* ma { } -void Generator::generateExampleFiles(const DocNode *dn, CodeMarker *marker) +void Generator::generateExampleFiles(const DocumentNode *dn, CodeMarker *marker) { if (dn->childNodes().isEmpty()) return; @@ -837,7 +850,7 @@ void Generator::generateExampleFiles(const DocNode *dn, CodeMarker *marker) generateFileList(dn, marker, Node::Image, QString("Images:")); } -void Generator::generateDocNode(DocNode* /* dn */, CodeMarker* /* marker */) +void Generator::generateDocumentNode(DocumentNode* /* dn */, CodeMarker* /* marker */) { } @@ -852,7 +865,7 @@ void Generator::generateCollectionNode(CollectionNode* , CodeMarker* ) by the example. The images are copied into a subtree of \c{...doc/html/images/used-in-examples/...} */ -void Generator::generateFileList(const DocNode* dn, +void Generator::generateFileList(const DocumentNode* dn, CodeMarker* marker, Node::SubType subtype, const QString& tag) @@ -973,8 +986,8 @@ void Generator::generateInnerNode(InnerNode* node) if (node->isInternal() && !showInternal_) return; - if (node->isDocNode()) { - DocNode* docNode = static_cast(node); + if (node->isDocumentNode()) { + DocumentNode* docNode = static_cast(node); if (docNode->subType() == Node::ExternalPage) return; if (docNode->subType() == Node::Image) @@ -984,7 +997,7 @@ void Generator::generateInnerNode(InnerNode* node) qDebug("PAGE %s HAS CHILDREN", qPrintable(docNode->title())); } } - else if (node->isQmlPropertyGroup()) + else if (node->isQmlPropertyGroup() || node->isJsPropertyGroup()) return; /* @@ -998,44 +1011,44 @@ void Generator::generateInnerNode(InnerNode* node) generateClassLikeNode(node, marker); endSubPage(); } - if (node->isQmlType()) { + if (node->isQmlType() || node->isJsType()) { beginSubPage(node, fileName(node)); QmlTypeNode* qcn = static_cast(node); generateQmlTypePage(qcn, marker); endSubPage(); } - else if (node->isDocNode()) { + else if (node->isDocumentNode()) { beginSubPage(node, fileName(node)); - generateDocNode(static_cast(node), marker); + generateDocumentNode(static_cast(node), marker); endSubPage(); } - else if (node->isQmlBasicType()) { + else if (node->isQmlBasicType() || node->isJsBasicType()) { beginSubPage(node, fileName(node)); QmlBasicTypeNode* qbtn = static_cast(node); generateQmlBasicTypePage(qbtn, marker); endSubPage(); } else if (node->isCollectionNode()) { - CollectionNode* cn = static_cast(node); /* - A collection node is one of: group, module, - or QML module. + A collection node collects: groups, C++ modules, + QML modules or JavaScript modules. Don't output an HTML page for the collection - node unless the \group, \module, or \qmlmodule - command was actually seen by qdoc in the qdoc - comment for the node. + node unless the \group, \module, \qmlmodule or + \jsmodule command was actually seen by qdoc in + the qdoc comment for the node. A key prerequisite in this case is the call to - mergeCollections(cn). We don't know if this - collection (group, module, or QML module) has - members in other modules. We know at this point - that cn's members list contains only members in - the current module. Therefore, before outputting - the page for cn, we must search for members of - cn in the other modules and add them to the - members list. + mergeCollections(cn). We must determine whether + this group, module, QML module, or JavaScript + module has members in other modules. We know at + this point that cn's members list contains only + members in the current module. Therefore, before + outputting the page for cn, we must search for + members of cn in the other modules and add them + to the members list. */ + CollectionNode* cn = static_cast(node); if (cn->wasSeen()) { qdb_->mergeCollections(cn); beginSubPage(node, fileName(node)); @@ -1652,8 +1665,10 @@ void Generator::initialize(const Config &config) foreach (const QString &prefix, prefixes) outputPrefixes[prefix] = config.getString(CONFIG_OUTPUTPREFIXES + Config::dot + prefix); } - else + else { outputPrefixes[QLatin1String("QML")] = QLatin1String("qml-"); + outputPrefixes[QLatin1String("JS")] = QLatin1String("js-"); + } noLinkErrors_ = config.getBool(CONFIG_NOLINKERRORS); autolinkErrors_ = config.getBool(CONFIG_AUTOLINKERRORS); } diff --git a/src/tools/qdoc/generator.h b/src/tools/qdoc/generator.h index 98c6a71496..3165e8d449 100644 --- a/src/tools/qdoc/generator.h +++ b/src/tools/qdoc/generator.h @@ -116,7 +116,7 @@ protected: virtual void generateClassLikeNode(InnerNode* inner, CodeMarker* marker); virtual void generateQmlTypePage(QmlTypeNode* , CodeMarker* ) { } virtual void generateQmlBasicTypePage(QmlBasicTypeNode* , CodeMarker* ) { } - virtual void generateDocNode(DocNode* dn, CodeMarker* marker); + virtual void generateDocumentNode(DocumentNode* dn, CodeMarker* marker); virtual void generateCollectionNode(CollectionNode* cn, CodeMarker* marker); virtual void generateInheritedBy(const ClassNode *classe, CodeMarker *marker); virtual void generateInherits(const ClassNode *classe, CodeMarker *marker); @@ -149,8 +149,8 @@ protected: CodeMarker *marker, bool generate, int& numGeneratedAtoms); - void generateExampleFiles(const DocNode *dn, CodeMarker *marker); - void generateFileList(const DocNode* dn, + void generateExampleFiles(const DocumentNode *dn, CodeMarker *marker); + void generateFileList(const DocumentNode* dn, CodeMarker* marker, Node::SubType subtype, const QString& tag); diff --git a/src/tools/qdoc/helpprojectwriter.cpp b/src/tools/qdoc/helpprojectwriter.cpp index 5eab0155bb..90b1d9cfe3 100644 --- a/src/tools/qdoc/helpprojectwriter.cpp +++ b/src/tools/qdoc/helpprojectwriter.cpp @@ -196,7 +196,7 @@ QStringList HelpProjectWriter::keywordDetails(const Node *node) const { QStringList details; - if (node->type() == Node::QmlProperty) { + if (node->isQmlProperty() || node->isJsProperty()) { // "name" details << node->name(); // "id" @@ -215,8 +215,12 @@ QStringList HelpProjectWriter::keywordDetails(const Node *node) const details << node->name(); details << "QML." + node->name(); } - else if (node->isDocNode()) { - const DocNode *fake = static_cast(node); + else if (node->isJsType() || node->isJsBasicType()) { + details << node->name(); + details << "JS." + node->name(); + } + else if (node->isDocumentNode()) { + const DocumentNode *fake = static_cast(node); details << fake->fullTitle(); details << fake->fullTitle(); } @@ -246,8 +250,8 @@ bool HelpProjectWriter::generateSection(HelpProject &project, return false; QString objName; - if (node->isDocNode()) { - const DocNode *fake = static_cast(node); + if (node->isDocumentNode()) { + const DocumentNode *fake = static_cast(node); objName = fake->fullTitle(); } else @@ -269,7 +273,7 @@ bool HelpProjectWriter::generateSection(HelpProject &project, else { // Accept only fake nodes with subtypes contained in the selector's // mask. - const DocNode *docNode = static_cast(node); + const DocumentNode *docNode = static_cast(node); if (subproject.selectors[node->type()].contains(docNode->subType()) && docNode->subType() != Node::ExternalPage && !docNode->fullTitle().isEmpty()) { @@ -412,7 +416,7 @@ bool HelpProjectWriter::generateSection(HelpProject &project, // Document nodes (such as manual pages) contain subtypes, titles and other // attributes. case Node::Document: { - const DocNode *docNode = static_cast(node); + const DocumentNode *docNode = static_cast(node); if (docNode->subType() != Node::ExternalPage && docNode->subType() != Node::Image && !docNode->fullTitle().isEmpty()) { @@ -481,17 +485,17 @@ void HelpProjectWriter::generateSections(HelpProject &project, continue; if (childNode->type() == Node::Document) { - childMap[static_cast(childNode)->fullTitle()] = childNode; + childMap[static_cast(childNode)->fullTitle()] = childNode; } - else if (childNode->type() == Node::QmlPropertyGroup) { + else if (childNode->isQmlPropertyGroup() || childNode->isJsPropertyGroup()) { /* - Don't visit QML property group nodes, + Don't visit QML/JS property group nodes, but visit their children, which are all - QML property nodes. + QML/JS property nodes. This is probably not correct anymore, - because The Qml Property Group is an - actual documented thing. + because The Qml/Js Property Group is + an actual documented thing. */ const InnerNode* inner = static_cast(childNode); foreach (const Node* n, inner->childNodes()) { @@ -566,7 +570,8 @@ void HelpProjectWriter::addMembers(HelpProject &project, QXmlStreamWriter &write // Do not generate a 'List of all members' for namespaces or header files, // but always generate it for derived classes and QML classes if (!node->isNamespace() && !node->isHeaderFile() && - (derivedClass || node->isQmlType() || !project.memberStatus[node].isEmpty())) { + (derivedClass || node->isQmlType() || node->isJsType() || + !project.memberStatus[node].isEmpty())) { QString membersPath = href + QStringLiteral("-members.html"); writeSection(writer, membersPath, tr("List of all members")); } @@ -615,7 +620,7 @@ void HelpProjectWriter::writeNode(HelpProject &project, QXmlStreamWriter &writer case Node::Document: { // Document nodes (such as manual pages) contain subtypes, titles and other // attributes. - const DocNode *docNode = static_cast(node); + const DocumentNode *docNode = static_cast(node); writer.writeStartElement("section"); writer.writeAttribute("ref", href); @@ -652,7 +657,7 @@ void HelpProjectWriter::generateProject(HelpProject &project) qdb_->setLocalSearch(); if (!project.indexRoot.isEmpty()) - rootNode = qdb_->findDocNodeByTitle(project.indexRoot); + rootNode = qdb_->findDocumentNodeByTitle(project.indexRoot); else rootNode = qdb_->primaryTreeRoot(); @@ -695,7 +700,7 @@ void HelpProjectWriter::generateProject(HelpProject &project) writer.writeStartElement("toc"); writer.writeStartElement("section"); - const Node* node = qdb_->findDocNodeByTitle(project.indexTitle); + const Node* node = qdb_->findDocumentNodeByTitle(project.indexTitle); if (node == 0) node = qdb_->findNodeByNameAndType(QStringList("index.html"), Node::Document); QString indexPath; diff --git a/src/tools/qdoc/helpprojectwriter.h b/src/tools/qdoc/helpprojectwriter.h index d344f23808..efc2596296 100644 --- a/src/tools/qdoc/helpprojectwriter.h +++ b/src/tools/qdoc/helpprojectwriter.h @@ -50,7 +50,7 @@ struct SubProject { QString title; QString indexTitle; - QHash > selectors; + QHash > selectors; bool sortPages; QString type; QHash nodes; diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index f4ada7132f..8eb96bff17 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -513,7 +513,10 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark case Atom::BriefLeft: // Do not output the brief for QML nodes, doc nodes or collections // (groups, modules, qml module nodes) - if (relative->isQmlType() || relative->isDocNode() || relative->isCollectionNode()) { + if (relative->isQmlType() || + relative->isDocumentNode() || + relative->isCollectionNode() || + relative->isJsType()) { skipAhead = skipAtoms(atom, Atom::BriefRight); break; } @@ -549,7 +552,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark } break; case Atom::BriefRight: - if (!relative->isDocNode()) + if (!relative->isDocumentNode()) out() << "

\n"; break; case Atom::C: @@ -660,9 +663,9 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark break; case Atom::AnnotatedList: { - GroupNode* gn = qdb_->getGroup(atom->string()); - if (gn) - generateList(gn, marker, atom->string()); + CollectionNode* cn = qdb_->getCollection(atom->string(), Node::DOC); + if (cn) + generateList(cn, marker, atom->string()); } break; case Atom::GeneratedList: @@ -685,10 +688,10 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark else if (atom->string().contains("classesbymodule")) { QString physicalModuleName = atom->string().mid(atom->string().indexOf("classesbymodule") + 15).trimmed(); QDocDatabase* qdb = QDocDatabase::qdocDB(); - ModuleNode* mn = qdb->findModule(physicalModuleName); - if (mn) { + CollectionNode* cn = qdb->findModule(physicalModuleName); + if (cn) { NodeMap m; - mn->getMemberClasses(m); + cn->getMemberClasses(m); if (!m.isEmpty()) { generateAnnotatedList(relative, marker, m); } @@ -751,7 +754,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark Remove permanently if it is not missed. */ else if (atom->string() == "relatedinline") { - const DocNode *dn = static_cast(relative); + const DocumentNode *dn = static_cast(relative); if (dn && !dn->members().isEmpty()) { // Reverse the list into the original scan order. // Should be sorted. But on what? It may not be a @@ -1537,7 +1540,11 @@ void HtmlGenerator::generateQmlTypePage(QmlTypeNode* qcn, CodeMarker* marker) Generator::setQmlTypeContext(qcn); SubTitleSize subTitleSize = LargeSubTitle; QList
::const_iterator s; - QString htmlTitle = qcn->fullTitle() + " QML Type"; + QString htmlTitle = qcn->fullTitle(); + if (qcn->isJsType()) + htmlTitle += " JavaScript Type"; + else + htmlTitle += " QML Type"; generateHeader(htmlTitle, qcn, marker); QList
sections = marker->qmlSections(qcn, CodeMarker::Summary); @@ -1609,7 +1616,11 @@ void HtmlGenerator::generateQmlBasicTypePage(QmlBasicTypeNode* qbtn, CodeMarker* { SubTitleSize subTitleSize = LargeSubTitle; QList
::const_iterator s; - QString htmlTitle = qbtn->fullTitle() + " QML Basic Type"; + QString htmlTitle = qbtn->fullTitle(); + if (qbtn->isJsType()) + htmlTitle += " JavaScript Basic Type"; + else + htmlTitle += " QML Basic Type"; marker = CodeMarker::markerForLanguage(QLatin1String("QML")); @@ -1636,7 +1647,7 @@ void HtmlGenerator::generateQmlBasicTypePage(QmlBasicTypeNode* qbtn, CodeMarker* Generate the HTML page for an entity that doesn't map to any underlying parsable C++ class or QML component. */ -void HtmlGenerator::generateDocNode(DocNode* dn, CodeMarker* marker) +void HtmlGenerator::generateDocumentNode(DocumentNode* dn, CodeMarker* marker) { /* If the document node is a page node, and if the page type @@ -1805,7 +1816,7 @@ void HtmlGenerator::generateCollectionNode(CollectionNode* cn, CodeMarker* marke if (cn->isGroup()) generateAnnotatedList(cn, marker, cn->members()); - else if (cn->isQmlModule()) + else if (cn->isQmlModule() || cn->isJsModule()) generateAnnotatedList(cn, marker, cn->members()); sections = marker->sections(cn, CodeMarker::Detailed, CodeMarker::Okay); @@ -1872,7 +1883,8 @@ void HtmlGenerator::generateNavigationBar(const QString &title, << Atom(Atom::String, cn->name()) << Atom(Atom::ListItemRight); } - else if (node->isQmlType() || node->isQmlBasicType()) { + else if (node->isQmlType() || node->isQmlBasicType() || + node->isJsType() || node->isJsBasicType()) { if (!qmltypespage.isEmpty()) navigationbar << Atom(Atom::ListItemLeft) << Atom(Atom::NavLink, qmltypespage) @@ -2133,10 +2145,10 @@ void HtmlGenerator::generateRequisites(InnerNode *inner, CodeMarker *marker) if (inner->type() == Node::Class || inner->type() == Node::Namespace) { //add the QT variable to the map if (!inner->physicalModuleName().isEmpty()) { - ModuleNode* moduleNode = qdb_->findModule(inner->physicalModuleName()); - if (moduleNode && !moduleNode->qtVariable().isEmpty()) { + CollectionNode* cn = qdb_->findModule(inner->physicalModuleName()); + if (cn && !cn->qtVariable().isEmpty()) { text.clear(); - text << "QT += " + moduleNode->qtVariable(); + text << "QT += " + cn->qtVariable(); requisites.insert(qtVariableText, text); } } @@ -2243,9 +2255,13 @@ void HtmlGenerator::generateQmlRequisites(QmlTypeNode *qcn, CodeMarker *marker) //add the module name and version to the map QString logicalModuleVersion; - QmlModuleNode* qmn = qdb_->findQmlModule(qcn->logicalModuleName()); - if (qmn) - logicalModuleVersion = qmn->logicalModuleVersion(); + CollectionNode* collection = 0; + if (qcn->isJsNode()) + qdb_->findJsModule(qcn->logicalModuleName()); + else + qdb_->findQmlModule(qcn->logicalModuleName()); + if (collection) + logicalModuleVersion = collection->logicalModuleVersion(); else logicalModuleVersion = qcn->logicalModuleVersion(); text.clear(); @@ -2419,7 +2435,10 @@ void HtmlGenerator::generateTableOfContents(const Node *node, } } } - else if (sections && (node->isClass() || node->isNamespace() || node->isQmlType())) { + else if (sections && (node->isClass() || + node->isNamespace() || + node->isQmlType() || + node->isJsType())) { QList
::ConstIterator s = sections->constBegin(); while (s != sections->constEnd()) { if (!s->members.isEmpty()) { @@ -2848,7 +2867,7 @@ void HtmlGenerator::generateAnnotatedList(const Node *relative, generateFullName(node, relative); out() << "

"; - if (!node->isDocNode()) { + if (!node->isDocumentNode()) { Text brief = node->doc().trimmedBriefText(node->name()); if (!brief.isEmpty()) { out() << "

"; @@ -3025,7 +3044,7 @@ void HtmlGenerator::generateCompactList(ListType listType, } QStringList pieces; - if (it.value()->isQmlType()) + if (it.value()->isQmlType() || it.value()->isJsType()) pieces << it.value()->name(); else pieces = it.value()->fullName(relative).split("::"); @@ -3136,30 +3155,20 @@ void HtmlGenerator::generateQmlItem(const Node *node, void HtmlGenerator::generateList(const Node* relative, CodeMarker* marker, const QString& selector) { - NodeList nl; - CollectionList cl; - QRegExp singleDigit("\\b([0-9])\\b"); - - if (selector == "overviews") { - CNMap groups; - qdb_->mergeCollections(Node::Group, groups, relative); - cl = groups.values(); - foreach (CollectionNode* cn, cl) - nl.append(cn); - generateAnnotatedList(relative, marker, nl); - } - else if (selector == "cpp-modules") { - CNMap modules; - qdb_->mergeCollections(Node::Module, modules, relative); - cl = modules.values(); - foreach (CollectionNode* cn, cl) - nl.append(cn); - generateAnnotatedList(relative, marker, nl); - } - else if (selector == "qml-modules") { - CNMap qmlModules; - qdb_->mergeCollections(Node::QmlModule, qmlModules, relative); - cl = qmlModules.values(); + CNMap cnm; + Node::Genus genus = Node::DontCare; + if (selector == "overviews") + genus = Node::DOC; + else if (selector == "cpp-modules") + genus = Node::CPP; + else if (selector == "qml-modules") + genus = Node::QML; + else if (selector == "js-modules") + genus = Node::JS; + if (genus != Node::DontCare) { + NodeList nl; + qdb_->mergeCollections(genus, cnm, relative); + CollectionList cl = cnm.values(); foreach (CollectionNode* cn, cl) nl.append(cn); generateAnnotatedList(relative, marker, nl); @@ -3167,69 +3176,19 @@ void HtmlGenerator::generateList(const Node* relative, CodeMarker* marker, const else { /* \generatelist {selector} is only allowed in a - comment where the topic is \group, \module, or - \qmlmodule. + comment where the topic is \group, \module, + \qmlmodule, or \jsmodule */ if (!relative || !relative->isCollectionNode()) { - relative->doc().location().warning(tr("\\generatelist {%1} is only allowed in \\group, \\module, and \\qmlmodule comments.").arg(selector)); + relative->doc().location().warning(tr("\\generatelist {%1} is only allowed in \\group, " + "\\module, \\qmlmodule, and \\jsmodule comments.").arg(selector)); return; } - if (selector == "related") { - Node* n = const_cast(relative); - CollectionNode* cn = static_cast(n); - qdb_->mergeCollections(cn); - generateAnnotatedList(cn, marker, cn->members()); - } - else { - Node* n = const_cast(relative); - CollectionNode* cn = static_cast(n); - qdb_->mergeCollections(cn); - generateAnnotatedList(cn, marker, cn->members()); - } - } - -#if 0 - QStringList keys = groups.uniqueKeys(); - foreach (const QString &key, keys) { - GroupNode* gn = static_cast(groups.value(key)); - if (gn) { - out() << QString("

%2

\n").arg( - linkForNode(gn, relative)).arg( - protectEnc(gn->fullTitle())); -#if 0 - if (gn->members().isEmpty()) - continue; - - NodeMap nm; - foreach (Node* member, gn->members()) { - if (member->isInternal() || member->isExample() || member->isExternalPage() || - member->isObsolete()) - continue; - // not interested either in individual (Qt Designer etc.) manual chapters - if (member->links().contains(Node::ContentsLink)) - continue; - QString sortKey = member->fullTitle().toLower(); - if (sortKey.startsWith("the ")) - sortKey.remove(0, 4); - sortKey.replace(singleDigit, "0\\1"); - nm.insert(sortKey, member); - } - - out() << "
    \n"; - QStringList titles = nm.keys(); - foreach (const QString &t, titles) { - Node* member = nm.value(t); - QString title = member->fullTitle(); - if (title.startsWith("The ")) - title.remove(0, 4); - out() << "
  • " - << protectEnc(title) << "
  • \n"; - } - out() << "
\n"; -#endif - } + Node* n = const_cast(relative); + CollectionNode* cn = static_cast(n); + qdb_->mergeCollections(cn); + generateAnnotatedList(cn, marker, cn->members()); } -#endif } void HtmlGenerator::generateSection(const NodeList& nl, @@ -3507,8 +3466,8 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, par1 = QStringRef(); const Node* n = qdb_->findTypeNode(arg.toString(), relative); html += QLatin1String(""); - if (n && n->isQmlBasicType()) { - if (relative && relative->isQmlType()) + if (n && (n->isQmlBasicType() || n->isJsBasicType())) { + if (relative && (relative->isQmlType() || relative->isJsType())) addLink(linkForNode(n,relative), arg, &html); else html += arg; @@ -3778,9 +3737,9 @@ QString HtmlGenerator::fileBase(const Node *node) const QString HtmlGenerator::fileName(const Node *node) { if (node->type() == Node::Document) { - if (static_cast(node)->subType() == Node::ExternalPage) + if (static_cast(node)->subType() == Node::ExternalPage) return node->name(); - if (static_cast(node)->subType() == Node::Image) + if (static_cast(node)->subType() == Node::Image) return node->name(); } return Generator::fileName(node); @@ -3938,13 +3897,15 @@ QString HtmlGenerator::linkForNode(const Node *node, const Node *relative) return QString(); QString fn = fileName(node); - if (node && node->parent() && node->parent()->isQmlType() && node->parent()->isAbstract()) { + if (node && node->parent() && + (node->parent()->isQmlType() || node->parent()->isJsType()) + && node->parent()->isAbstract()) { if (Generator::qmlTypeContext()) fn = fileName(Generator::qmlTypeContext()); } QString link = fn; - if (!node->isInnerNode() || node->type() == Node::QmlPropertyGroup) { + if (!node->isInnerNode() || node->isQmlPropertyGroup() || node->isJsPropertyGroup()) { QString ref = refForNode(node); if (relative && fn == fileName(relative) && ref == refForNode(relative)) return QString(); @@ -4107,7 +4068,7 @@ const QPair HtmlGenerator::anchorForNode(const Node *node) anchorPair.first = Generator::fileName(node); if (node->type() == Node::Document) { - const DocNode *docNode = static_cast(node); + const DocumentNode *docNode = static_cast(node); anchorPair.second = docNode->title(); } @@ -4418,7 +4379,10 @@ void HtmlGenerator::generateInstantiatedBy(ClassNode* cn, CodeMarker* marker) text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK); text << Atom(Atom::String, cn->name()); text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK); - text << " is instantiated by QML Type "; + if (qcn->isQmlType()) + text << " is instantiated by QML Type "; + else + text << " is instantiated by Javascript Type "; text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn)); text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK); text << Atom(Atom::String, qcn->name()); @@ -4917,9 +4881,9 @@ void HtmlGenerator::writeDitaRefs(const DitaRefList& ditarefs) xmlWriter().writeStartElement("topicref"); xmlWriter().writeAttribute("navtitle",t->navtitle()); if (t->href().isEmpty()) { - const DocNode* fn = qdb_->findDocNodeByTitle(t->navtitle()); - if (fn) - xmlWriter().writeAttribute("href",fileName(fn)); + const DocumentNode* dn = qdb_->findDocumentNodeByTitle(t->navtitle()); + if (dn) + xmlWriter().writeAttribute("href",fileName(dn)); } else xmlWriter().writeAttribute("href",t->href()); diff --git a/src/tools/qdoc/htmlgenerator.h b/src/tools/qdoc/htmlgenerator.h index 44408c0eb2..0c7a4af5ff 100644 --- a/src/tools/qdoc/htmlgenerator.h +++ b/src/tools/qdoc/htmlgenerator.h @@ -98,7 +98,7 @@ protected: virtual void generateClassLikeNode(InnerNode* inner, CodeMarker* marker) Q_DECL_OVERRIDE; virtual void generateQmlTypePage(QmlTypeNode* qcn, CodeMarker* marker) Q_DECL_OVERRIDE; virtual void generateQmlBasicTypePage(QmlBasicTypeNode* qbtn, CodeMarker* marker) Q_DECL_OVERRIDE; - virtual void generateDocNode(DocNode* dn, CodeMarker* marker) Q_DECL_OVERRIDE; + virtual void generateDocumentNode(DocumentNode* dn, CodeMarker* marker) Q_DECL_OVERRIDE; virtual void generateCollectionNode(CollectionNode* cn, CodeMarker* marker) Q_DECL_OVERRIDE; virtual QString fileExtension() const Q_DECL_OVERRIDE; virtual QString refForNode(const Node *node); diff --git a/src/tools/qdoc/node.cpp b/src/tools/qdoc/node.cpp index 1ade3e2aca..f65b4ec942 100644 --- a/src/tools/qdoc/node.cpp +++ b/src/tools/qdoc/node.cpp @@ -149,7 +149,7 @@ QString Node::plainFullName(const Node* relative) const */ QString Node::fullName(const Node* relative) const { - if (isDocNode()) + if (isDocumentNode()) return title(); else if (isClass()) { const ClassNode* cn = static_cast(this); @@ -624,17 +624,18 @@ QString Node::guid() const } /*! - If this node is a QML class node, return a pointer to it. - If it is a child of a QML class node, return a pointer to - the QML class node. Otherwise, return 0; + If this node is a QML or JS type node, return a pointer to + it. If it is a child of a QML or JS type node, return the + pointer to its parent QMLor JS type node. Otherwise return + 0; */ QmlTypeNode* Node::qmlTypeNode() { - if (isQmlNode()) { + if (isQmlNode() || isJsNode()) { Node* n = this; - while (n && !n->isQmlType()) + while (n && !(n->isQmlType() || n->isJsType())) n = n->parent(); - if (n && n->isQmlType()) + if (n && (n->isQmlType() || n->isJsType())) return static_cast(n); } return 0; @@ -716,10 +717,10 @@ Node *InnerNode::findChildNode(const QString& name, Node::Genus genus) const Node *node = childMap.value(name); if (node && !node->isQmlPropertyGroup()) // mws asks: Why not property group? return node; - if (isQmlType()) { + if (isQmlType() || isJsType()) { for (int i=0; iisQmlPropertyGroup()) { + if (n->isQmlPropertyGroup() || isJsPropertyGroup()) { node = static_cast(n)->findChildNode(name, genus); if (node) return node; @@ -754,7 +755,7 @@ void InnerNode::findChildren(const QString& name, NodeList& nodes) const if (!t.isEmpty()) nodes.append(t); } - if (!nodes.isEmpty() || !isQmlNode()) + if (!nodes.isEmpty() || !(isQmlNode() || isJsNode())) return; int i = name.indexOf(QChar('.')); if (i < 0) @@ -764,7 +765,7 @@ void InnerNode::findChildren(const QString& name, NodeList& nodes) const if (t.isEmpty()) return; foreach (Node* n, t) { - if (n->isQmlPropertyGroup()) { + if (n->isQmlPropertyGroup() || n->isJsPropertyGroup()) { n->findChildren(name, nodes); if (!nodes.isEmpty()) break; @@ -772,45 +773,6 @@ void InnerNode::findChildren(const QString& name, NodeList& nodes) const } } -#if 0 -/*! - Find the node in this node's children that has the given \a name. If - this node is a QML class node, be sure to also look in the children - of its property group nodes. Return the matching node or 0. This is - not a recearsive search. - - If \a qml is true, only match a node for which node->isQmlNode() - returns \c true. If \a qml is false, only match a node for which - node->isQmlNode() returns \c false. - */ -Node* InnerNode::findChildNode(const QString& name, bool qml) const -{ - NodeList nodes = childMap.values(name); - if (!nodes.isEmpty()) { - for (int i=0; iisQmlNode()) - return node; - } - else if (node->isQmlNode()) - return node; - } - } - if (qml && isQmlType()) { - for (int i=0; iisQmlPropertyGroup()) { - node = static_cast(node)->findChildNode(name); - if (node) - return node; - } - } - } - return primaryFunctionMap.value(name); -} -#endif - /*! This function is like findChildNode(), but if a node with the specified \a name is found but it is not of the @@ -831,63 +793,6 @@ Node* InnerNode::findChildNode(const QString& name, Type type) return 0; } -#if 0 -/*! - */ -void InnerNode::findNodes(const QString& name, NodeList& n) -{ - n.clear(); - Node* node = 0; - NodeList nodes = childMap.values(name); - /* - If this node's child map contains no nodes named - name, then if this node is a QML class, search each of its - property group nodes for a node named name. If a match is - found, append it to the output list and return immediately. - */ - if (nodes.isEmpty()) { - if (isQmlType()) { - for (int i=0; iisQmlPropertyGroup()) { - node = static_cast(node)->findChildNode(name); - if (node) { - n.append(node); - return; - } - } - } - } - } - else { - /* - If the childMap does contain one or more nodes named - name, traverse the list of matching nodes. Append each - matching node that is not a property group node to the - output list. Search each property group node for a node - named name and append that node to the output list. - This is overkill, I think, but should produce a useful - list. - */ - for (int i=0; iisQmlPropertyGroup()) - n.append(node); - else { - node = static_cast(node)->findChildNode(name); - if (node) - n.append(node); - } - } - } - if (!n.isEmpty()) - return; - node = primaryFunctionMap.value(name); - if (node) - n.append(node); -} -#endif - /*! Find a function node that is a child of this nose, such that the function node has the specified \a name. @@ -1642,15 +1547,15 @@ QmlTypeNode* ClassNode::findQmlBaseNode() } /*! - \class DocNode + \class DocumentNode */ /*! - The type of a DocNode is Document, and it has a \a subtype, - which specifies the type of DocNode. The page type for + The type of a DocumentNode is Document, and it has a \a subtype, + which specifies the type of DocumentNode. The page type for the page index is set here. */ -DocNode::DocNode(InnerNode* parent, const QString& name, SubType subtype, Node::PageType ptype) +DocumentNode::DocumentNode(InnerNode* parent, const QString& name, SubType subtype, Node::PageType ptype) : InnerNode(Document, parent, name), nodeSubtype_(subtype) { setGenus(Node::DOC); @@ -1669,14 +1574,14 @@ DocNode::DocNode(InnerNode* parent, const QString& name, SubType subtype, Node:: } } -/*! \fn QString DocNode::title() const +/*! \fn QString DocumentNode::title() const Returns the document node's title. This is used for the page title. */ /*! Sets the document node's \a title. This is used for the page title. */ -void DocNode::setTitle(const QString &title) +void DocumentNode::setTitle(const QString &title) { title_ = title; parent()->addChild(this, title); @@ -1687,7 +1592,7 @@ void DocNode::setTitle(const QString &title) just title(), but for some SubType values is different from title() */ -QString DocNode::fullTitle() const +QString DocumentNode::fullTitle() const { if (nodeSubtype_ == File) { if (title().isEmpty()) @@ -1715,7 +1620,7 @@ QString DocNode::fullTitle() const /*! Returns the subtitle. */ -QString DocNode::subTitle() const +QString DocumentNode::subTitle() const { if (!subtitle_.isEmpty()) return subtitle_; @@ -2205,29 +2110,6 @@ void QmlTypeNode::subclasses(const QString& base, NodeList& subs) } } -/*! - This function splits \a arg on the blank character to get a - QML module name and version number. If the version number is - present, it spilts the version number on the '.' character to - get a major version number and a minor vrsion number. If the - version number is present, both the major and minor version - numbers should be there, but the minor version number is not - absolutely necessary. - */ -void QmlModuleNode::setQmlModuleInfo(const QString& arg) -{ - QStringList blankSplit = arg.split(QLatin1Char(' ')); - logicalModuleName_ = blankSplit[0]; - if (blankSplit.size() > 1) { - QStringList dotSplit = blankSplit[1].split(QLatin1Char('.')); - logicalModuleVersionMajor_ = dotSplit[0]; - if (dotSplit.size() > 1) - logicalModuleVersionMinor_ = dotSplit[1]; - else - logicalModuleVersionMinor_ = "0"; - } -} - QmlTypeNode* QmlTypeNode::qmlBaseNode() { if (!qmlBaseNode_ && !qmlBaseName_.isEmpty()) { @@ -2389,7 +2271,7 @@ PropertyNode* QmlPropertyNode::findCorrespondingCppProperty() { PropertyNode* pn; Node* n = parent(); - while (n && !n->isQmlType()) + while (n && !(n->isQmlType() || n->isJsType())) n = n->parent(); if (n) { QmlTypeNode* qcn = static_cast(n); @@ -2454,12 +2336,12 @@ QString Node::fullDocumentName() const if (!n->name().isEmpty() && !n->isQmlPropertyGroup()) pieces.insert(0, n->name()); - if (n->isQmlType() && !n->logicalModuleName().isEmpty()) { + if ((n->isQmlType() || n->isJsType()) && !n->logicalModuleName().isEmpty()) { pieces.insert(0, n->logicalModuleName()); break; } - if (n->isDocNode()) + if (n->isDocumentNode()) break; // Examine the parent node if one exists. @@ -2471,10 +2353,10 @@ QString Node::fullDocumentName() const // Create a name based on the type of the ancestor node. QString concatenator = "::"; - if (n->isQmlType()) + if (n->isQmlType() || n->isJsType()) concatenator = QLatin1Char('.'); - if (n->isDocNode()) + if (n->isDocumentNode()) concatenator = QLatin1Char('#'); return pieces.join(concatenator); @@ -2655,6 +2537,8 @@ QString Node::idForNode() const str = "namespace-member-" + func->name(); else if (parent_->isQmlType()) str = "qml-method-" + parent_->name().toLower() + "-" + func->name(); + else if (parent_->isJsType()) + str = "js-method-" + parent_->name().toLower() + "-" + func->name(); else if (parent_->type() == Document) { qDebug() << "qdoc internal error: Node subtype not handled:" << parent_->subType() << func->name(); @@ -2669,10 +2553,16 @@ QString Node::idForNode() const } break; case Node::QmlType: - str = "qml-class-" + name(); + if (genus() == QML) + str = "qml-class-" + name(); + else + str = "js-type-" + name(); break; case Node::QmlBasicType: - str = "qml-basic-type-" + name(); + if (genus() == QML) + str = "qml-basic-type-" + name(); + else + str = "js-basic-type-" + name(); break; case Node::Document: { @@ -2713,32 +2603,52 @@ QString Node::idForNode() const str.replace(QLatin1Char('/'), QLatin1Char('-')); break; case Node::QmlModule: - str = "qml-module-" + name(); + if (genus() == QML) + str = "qml-module-" + name(); + else + str = "js-module-" + name(); break; case Node::QmlProperty: + if (genus() == QML) + str = "qml-"; + else + str = "js-"; if (isAttached()) - str = "qml-attached-property-" + name(); + str += "attached-property-" + name(); else - str = "qml-property-" + name(); + str += "property-" + name(); break; case Node::QmlPropertyGroup: { Node* n = const_cast(this); - str = "qml-propertygroup-" + n->name(); + if (genus() == QML) + str = "qml-propertygroup-" + n->name(); + else + str = "js-propertygroup-" + n->name(); } break; case Node::Property: str = "property-" + name(); break; case Node::QmlSignal: - str = "qml-signal-" + name(); + if (genus() == QML) + str = "qml-signal-" + name(); + else + str = "js-signal-" + name(); break; case Node::QmlSignalHandler: - str = "qml-signal-handler-" + name(); + if (genus() == QML) + str = "qml-signal-handler-" + name(); + else + str = "js-signal-handler-" + name(); break; case Node::QmlMethod: func = static_cast(this); - str = "qml-method-" + parent_->name().toLower() + "-" + func->name(); + if (genus() == QML) + str = "qml-method-"; + else + str = "js-method-"; + str += parent_->name().toLower() + "-" + func->name(); if (func->overloadNumber() != 1) str += QLatin1Char('-') + QString::number(func->overloadNumber()); break; @@ -2884,4 +2794,48 @@ void CollectionNode::setTitle(const QString& title) parent()->addChild(this, title); } +/*! + This function splits \a arg on the blank character to get a + logical module name and version number. If the version number + is present, it spilts the version number on the '.' character + to get a major version number and a minor vrsion number. If + the version number is present, both the major and minor version + numbers should be there, but the minor version number is not + absolutely necessary. + */ +void CollectionNode::setLogicalModuleInfo(const QString& arg) +{ + QStringList blankSplit = arg.split(QLatin1Char(' ')); + logicalModuleName_ = blankSplit[0]; + if (blankSplit.size() > 1) { + QStringList dotSplit = blankSplit[1].split(QLatin1Char('.')); + logicalModuleVersionMajor_ = dotSplit[0]; + if (dotSplit.size() > 1) + logicalModuleVersionMinor_ = dotSplit[1]; + else + logicalModuleVersionMinor_ = "0"; + } +} + +/*! + This function accepts the logical module \a info as a string + list. If the logical module info contains the version number, + it spilts the version number on the '.' character to get the + major and minor vrsion numbers. Both major and minor version + numbers should be provided, but the minor version number is + not strictly necessary. + */ +void CollectionNode::setLogicalModuleInfo(const QStringList& info) +{ + logicalModuleName_ = info[0]; + if (info.size() > 1) { + QStringList dotSplit = info[1].split(QLatin1Char('.')); + logicalModuleVersionMajor_ = dotSplit[0]; + if (dotSplit.size() > 1) + logicalModuleVersionMinor_ = dotSplit[1]; + else + logicalModuleVersionMinor_ = "0"; + } +} + QT_END_NAMESPACE diff --git a/src/tools/qdoc/node.h b/src/tools/qdoc/node.h index 8de6015214..8e25aac9c1 100644 --- a/src/tools/qdoc/node.h +++ b/src/tools/qdoc/node.h @@ -55,7 +55,6 @@ class QmlTypeNode; class QDocDatabase; class FunctionNode; class PropertyNode; -class QmlModuleNode; class CollectionNode; class QmlPropertyNode; @@ -194,14 +193,21 @@ public: void setIndexNodeFlag() { indexNodeFlag_ = true; } virtual void setOutputFileName(const QString& ) { } + bool isQmlNode() const { return genus() == QML; } + bool isJsNode() const { return genus() == JS; } + bool isCppNode() const { return genus() == CPP; } + virtual bool isInnerNode() const = 0; - virtual bool isDocNode() const { return false; } virtual bool isCollectionNode() const { return false; } + virtual bool isDocumentNode() const { return false; } virtual bool isGroup() const { return false; } virtual bool isModule() const { return false; } virtual bool isQmlModule() const { return false; } + virtual bool isJsModule() const { return false; } virtual bool isQmlType() const { return false; } + virtual bool isJsType() const { return false; } virtual bool isQmlBasicType() const { return false; } + virtual bool isJsBasicType() const { return false; } virtual bool isExample() const { return false; } virtual bool isExampleFile() const { return false; } virtual bool isHeaderFile() const { return false; } @@ -210,11 +216,19 @@ public: virtual bool isFunction() const { return false; } virtual bool isNamespace() const { return false; } virtual bool isClass() const { return false; } - virtual bool isQmlNode() const { return false; } - virtual bool isCppNode() const { return false; } virtual bool isQtQuickNode() const { return false; } virtual bool isAbstract() const { return false; } + virtual bool isProperty() const { return false; } + virtual bool isQmlProperty() const { return false; } + virtual bool isJsProperty() const { return false; } virtual bool isQmlPropertyGroup() const { return false; } + virtual bool isJsPropertyGroup() const { return false; } + virtual bool isQmlSignal() const { return false; } + virtual bool isJsSignal() const { return false; } + virtual bool isQmlSignalHandler() const { return false; } + virtual bool isJsSignalHandler() const { return false; } + virtual bool isQmlMethod() const { return false; } + virtual bool isJsMethod() const { return false; } virtual bool isAttached() const { return false; } virtual bool isAlias() const { return false; } virtual bool isWrapper() const; @@ -294,9 +308,10 @@ public: virtual QString logicalModuleName() const { return QString(); } virtual QString logicalModuleVersion() const { return QString(); } virtual QString logicalModuleIdentifier() const { return QString(); } - virtual void setQmlModuleInfo(const QString& ) { } - virtual QmlModuleNode* logicalModule() const { return 0; } - virtual void setQmlModule(QmlModuleNode* ) { } + virtual void setLogicalModuleInfo(const QString& ) { } + virtual void setLogicalModuleInfo(const QStringList& ) { } + virtual CollectionNode* logicalModule() const { return 0; } + virtual void setQmlModule(CollectionNode* ) { } virtual ClassNode* classNode() { return 0; } virtual void setClassNode(ClassNode* ) { } virtual const Node* applyModuleName(const Node* ) const { return 0; } @@ -440,7 +455,6 @@ public: virtual ~NamespaceNode() { } virtual bool isNamespace() const Q_DECL_OVERRIDE { return true; } virtual Tree* tree() const Q_DECL_OVERRIDE { return (parent() ? parent()->tree() : tree_); } - virtual bool isCppNode() const Q_DECL_OVERRIDE { return true; } void setTree(Tree* t) { tree_ = t; } private: @@ -471,7 +485,6 @@ public: ClassNode(InnerNode* parent, const QString& name); virtual ~ClassNode() { } virtual bool isClass() const Q_DECL_OVERRIDE { return true; } - virtual bool isCppNode() const Q_DECL_OVERRIDE { return true; } virtual bool isWrapper() const Q_DECL_OVERRIDE { return wrapper_; } virtual QString obsoleteLink() const Q_DECL_OVERRIDE { return obsoleteLink_; } virtual void setObsoleteLink(const QString& t) Q_DECL_OVERRIDE { obsoleteLink_ = t; } @@ -511,16 +524,17 @@ private: QmlTypeNode* qmlelement; }; -class DocNode : public InnerNode +class DocumentNode : public InnerNode { public: - DocNode(InnerNode* parent, + DocumentNode(InnerNode* parent, const QString& name, SubType subType, PageType ptype); - virtual ~DocNode() { } + virtual ~DocumentNode() { } + virtual bool isDocumentNode() const Q_DECL_OVERRIDE { return true; } virtual void setTitle(const QString &title) Q_DECL_OVERRIDE; virtual void setSubTitle(const QString &subTitle) Q_DECL_OVERRIDE { subtitle_ = subTitle; } @@ -536,7 +550,6 @@ public: virtual bool isExample() const Q_DECL_OVERRIDE { return (subType() == Node::Example); } virtual bool isExampleFile() const Q_DECL_OVERRIDE { return (parent() && parent()->isExample()); } virtual bool isExternalPage() const Q_DECL_OVERRIDE { return nodeSubtype_ == ExternalPage; } - virtual bool isDocNode() const Q_DECL_OVERRIDE { return true; } protected: SubType nodeSubtype_; @@ -544,11 +557,11 @@ protected: QString subtitle_; }; -class ExampleNode : public DocNode +class ExampleNode : public DocumentNode { public: ExampleNode(InnerNode* parent, const QString& name) - : DocNode(parent, name, Node::Example, Node::ExamplePage) { } + : DocumentNode(parent, name, Node::Example, Node::ExamplePage) { } virtual ~ExampleNode() { } virtual QString imageFileName() const Q_DECL_OVERRIDE { return imageFileName_; } virtual void setImageFileName(const QString& ifn) Q_DECL_OVERRIDE { imageFileName_ = ifn; } @@ -582,8 +595,8 @@ class QmlTypeNode : public InnerNode public: QmlTypeNode(InnerNode* parent, const QString& name); virtual ~QmlTypeNode(); - virtual bool isQmlNode() const Q_DECL_OVERRIDE { return true; } - virtual bool isQmlType() const Q_DECL_OVERRIDE { return true; } + virtual bool isQmlType() const Q_DECL_OVERRIDE { return genus() == Node::QML; } + virtual bool isJsType() const Q_DECL_OVERRIDE { return genus() == Node::JS; } virtual bool isQtQuickNode() const Q_DECL_OVERRIDE { return (logicalModuleName() == QLatin1String("QtQuick")); } @@ -600,8 +613,8 @@ public: virtual QString logicalModuleName() const Q_DECL_OVERRIDE; virtual QString logicalModuleVersion() const Q_DECL_OVERRIDE; virtual QString logicalModuleIdentifier() const Q_DECL_OVERRIDE; - virtual QmlModuleNode* logicalModule() const Q_DECL_OVERRIDE { return logicalModule_; } - virtual void setQmlModule(QmlModuleNode* t) Q_DECL_OVERRIDE { logicalModule_ = t; } + virtual CollectionNode* logicalModule() const Q_DECL_OVERRIDE { return logicalModule_; } + virtual void setQmlModule(CollectionNode* t) Q_DECL_OVERRIDE { logicalModule_ = t; } const ImportList& importList() const { return importList_; } void setImportList(const ImportList& il) { importList_ = il; } @@ -627,7 +640,7 @@ private: ClassNode* cnode_; QString qmlBaseName_; QString obsoleteLink_; - QmlModuleNode* logicalModule_; + CollectionNode* logicalModule_; QmlTypeNode* qmlBaseNode_; ImportList importList_; }; @@ -638,8 +651,8 @@ public: QmlBasicTypeNode(InnerNode* parent, const QString& name); virtual ~QmlBasicTypeNode() { } - virtual bool isQmlNode() const Q_DECL_OVERRIDE { return true; } - virtual bool isQmlBasicType() const Q_DECL_OVERRIDE { return true; } + virtual bool isQmlBasicType() const Q_DECL_OVERRIDE { return (genus() == Node::QML); } + virtual bool isJsBasicType() const Q_DECL_OVERRIDE { return (genus() == Node::JS); } }; class QmlPropertyGroupNode : public InnerNode @@ -647,7 +660,6 @@ class QmlPropertyGroupNode : public InnerNode public: QmlPropertyGroupNode(QmlTypeNode* parent, const QString& name); virtual ~QmlPropertyGroupNode() { } - virtual bool isQmlNode() const Q_DECL_OVERRIDE { return true; } virtual bool isQtQuickNode() const Q_DECL_OVERRIDE { return parent()->isQtQuickNode(); } virtual QString qmlTypeName() const Q_DECL_OVERRIDE { return parent()->qmlTypeName(); } virtual QString logicalModuleName() const Q_DECL_OVERRIDE { @@ -660,7 +672,8 @@ public: return parent()->logicalModuleIdentifier(); } virtual QString idNumber() Q_DECL_OVERRIDE; - virtual bool isQmlPropertyGroup() const Q_DECL_OVERRIDE { return true; } + virtual bool isQmlPropertyGroup() const Q_DECL_OVERRIDE { return genus() == Node::QML; } + virtual bool isJsPropertyGroup() const Q_DECL_OVERRIDE { return genus() == Node::JS; } virtual QString element() const Q_DECL_OVERRIDE { return parent()->name(); } private: @@ -690,11 +703,12 @@ public: bool isStored() const { return fromFlagValue(stored_,true); } bool isDesignable() const { return fromFlagValue(designable_,false); } bool isWritable(); + virtual bool isQmlProperty() const Q_DECL_OVERRIDE { return genus() == QML; } + virtual bool isJsProperty() const Q_DECL_OVERRIDE { return genus() == JS; } virtual bool isDefault() const Q_DECL_OVERRIDE { return isdefault_; } virtual bool isReadOnly() const Q_DECL_OVERRIDE { return fromFlagValue(readOnly_,false); } virtual bool isAlias() const Q_DECL_OVERRIDE { return isAlias_; } virtual bool isAttached() const Q_DECL_OVERRIDE { return attached_; } - virtual bool isQmlNode() const Q_DECL_OVERRIDE { return true; } virtual bool isQtQuickNode() const Q_DECL_OVERRIDE { return parent()->isQtQuickNode(); } virtual QString qmlTypeName() const Q_DECL_OVERRIDE { return parent()->qmlTypeName(); } virtual QString logicalModuleName() const Q_DECL_OVERRIDE { @@ -742,7 +756,6 @@ public: EnumNode(InnerNode* parent, const QString& name); virtual ~EnumNode() { } - virtual bool isCppNode() const Q_DECL_OVERRIDE { return true; } void addItem(const EnumItem& item); void setFlagsType(TypedefNode* typedeff); bool hasItem(const QString &name) const { return names.contains(name); } @@ -764,7 +777,6 @@ public: TypedefNode(InnerNode* parent, const QString& name); virtual ~TypedefNode() { } - virtual bool isCppNode() const Q_DECL_OVERRIDE { return true; } const EnumNode* associatedEnum() const { return ae; } private: @@ -853,6 +865,12 @@ public: bool isOverload() const { return ove; } bool isReimp() const Q_DECL_OVERRIDE { return reimp; } bool isFunction() const Q_DECL_OVERRIDE { return true; } + virtual bool isQmlSignal() const Q_DECL_OVERRIDE { return genus() == Node::QML; } + virtual bool isJsSignal() const Q_DECL_OVERRIDE { return genus() == Node::JS; } + virtual bool isQmlSignalHandler() const Q_DECL_OVERRIDE { return genus() == Node::QML; } + virtual bool isJsSignalHandler() const Q_DECL_OVERRIDE { return genus() == Node::JS; } + virtual bool isQmlMethod() const Q_DECL_OVERRIDE { return genus() == Node::QML; } + virtual bool isJsMethod() const Q_DECL_OVERRIDE { return genus() == Node::JS; } int overloadNumber() const; const QList& parameters() const { return params; } QStringList parameterNames() const; @@ -866,12 +884,6 @@ public: QString signature(bool values = false) const; virtual QString element() const Q_DECL_OVERRIDE { return parent()->name(); } virtual bool isAttached() const Q_DECL_OVERRIDE { return attached_; } - virtual bool isQmlNode() const Q_DECL_OVERRIDE { - return ((type() == QmlSignal) || - (type() == QmlMethod) || - (type() == QmlSignalHandler)); - } - virtual bool isCppNode() const Q_DECL_OVERRIDE { return !isQmlNode(); } virtual bool isQtQuickNode() const Q_DECL_OVERRIDE { return parent()->isQtQuickNode(); } virtual QString qmlTypeName() const Q_DECL_OVERRIDE { return parent()->qmlTypeName(); } virtual QString logicalModuleName() const Q_DECL_OVERRIDE { @@ -916,8 +928,8 @@ public: PropertyNode(InnerNode* parent, const QString& name); virtual ~PropertyNode() { } - virtual bool isCppNode() const Q_DECL_OVERRIDE { return true; } virtual void setDataType(const QString& dataType) Q_DECL_OVERRIDE { type_ = dataType; } + virtual bool isProperty() const Q_DECL_OVERRIDE { return true; } void addFunction(FunctionNode* function, FunctionRole role); void addSignal(FunctionNode* function, FunctionRole role); void setStored(bool stored) { stored_ = toFlagValue(stored); } @@ -1004,7 +1016,6 @@ public: VariableNode(InnerNode* parent, const QString &name); virtual ~VariableNode() { } - virtual bool isCppNode() const Q_DECL_OVERRIDE { return true; } void setLeftType(const QString &leftType) { lt = leftType; } void setRightType(const QString &rightType) { rt = rightType; } void setStatic(bool statique) { sta = statique; } @@ -1026,11 +1037,11 @@ inline VariableNode::VariableNode(InnerNode* parent, const QString &name) setGenus(Node::CPP); } -class DitaMapNode : public DocNode +class DitaMapNode : public DocumentNode { public: DitaMapNode(InnerNode* parent, const QString& name) - : DocNode(parent, name, Node::Page, Node::DitaMapPage) { } + : DocumentNode(parent, name, Node::Page, Node::DitaMapPage) { } virtual ~DitaMapNode() { } const DitaRefList& map() const { return doc().ditamap(); } @@ -1039,13 +1050,23 @@ public: class CollectionNode : public InnerNode { public: - CollectionNode(Type type, InnerNode* parent, const QString& name) - : InnerNode(type, parent, name), seen_(false) { + CollectionNode(Type type, + InnerNode* parent, + const QString& name, + Genus genus) : InnerNode(type, parent, name), seen_(false) + { setPageType(Node::OverviewPage); + setGenus(genus); } virtual ~CollectionNode() { } virtual bool isCollectionNode() const Q_DECL_OVERRIDE { return true; } + virtual bool isGroup() const Q_DECL_OVERRIDE { return genus() == Node::DOC; } + virtual bool isModule() const Q_DECL_OVERRIDE { return genus() == Node::CPP; } + virtual bool isQmlModule() const Q_DECL_OVERRIDE { return genus() == Node::QML; } + virtual bool isJsModule() const Q_DECL_OVERRIDE { return genus() == Node::JS; } + virtual QString qtVariable() const Q_DECL_OVERRIDE { return qtVariable_; } + virtual void setQtVariable(const QString& v) Q_DECL_OVERRIDE { qtVariable_ = v; } virtual void addMember(Node* node) Q_DECL_OVERRIDE; virtual bool hasMembers() const Q_DECL_OVERRIDE; virtual bool hasNamespaces() const Q_DECL_OVERRIDE; @@ -1060,6 +1081,16 @@ class CollectionNode : public InnerNode virtual void setTitle(const QString &title) Q_DECL_OVERRIDE; virtual void setSubTitle(const QString &subTitle) Q_DECL_OVERRIDE { subtitle_ = subTitle; } + virtual QString logicalModuleName() const Q_DECL_OVERRIDE { return logicalModuleName_; } + virtual QString logicalModuleVersion() const Q_DECL_OVERRIDE { + return logicalModuleVersionMajor_ + "." + logicalModuleVersionMinor_; + } + virtual QString logicalModuleIdentifier() const Q_DECL_OVERRIDE { + return logicalModuleName_ + logicalModuleVersionMajor_; + } + virtual void setLogicalModuleInfo(const QString& arg) Q_DECL_OVERRIDE; + virtual void setLogicalModuleInfo(const QStringList& info) Q_DECL_OVERRIDE; + const NodeList& members() const { return members_; } void printMembers(const QString& title); @@ -1071,61 +1102,6 @@ class CollectionNode : public InnerNode QString title_; QString subtitle_; NodeList members_; -}; - -class GroupNode : public CollectionNode -{ - public: - GroupNode(InnerNode* parent, const QString& name) - : CollectionNode(Node::Group, parent, name) { - setGenus(Node::DOC); - } - virtual ~GroupNode() { } - - virtual bool isGroup() const Q_DECL_OVERRIDE { return true; } -}; - -class ModuleNode : public CollectionNode -{ - public: - ModuleNode(InnerNode* parent, const QString& name) - : CollectionNode(Node::Module, parent, name) { - setGenus(Node::CPP); - } - virtual ~ModuleNode() { } - - virtual bool isModule() const Q_DECL_OVERRIDE { return true; } - virtual bool isCppNode() const Q_DECL_OVERRIDE { return true; } - virtual void setQtVariable(const QString& v) Q_DECL_OVERRIDE { qtVariable_ = v; } - virtual QString qtVariable() const Q_DECL_OVERRIDE { return qtVariable_; } - - private: - QString qtVariable_; -}; - -class QmlModuleNode : public CollectionNode -{ - public: - QmlModuleNode(InnerNode* parent, const QString& name) - : CollectionNode(Node::QmlModule, parent, name) { - setGenus(Node::QML); - } - virtual ~QmlModuleNode() { } - - virtual bool isQmlNode() const Q_DECL_OVERRIDE { return true; } - virtual bool isQmlModule() const Q_DECL_OVERRIDE { return true; } - virtual QString logicalModuleName() const Q_DECL_OVERRIDE { return logicalModuleName_; } - virtual QString logicalModuleVersion() const Q_DECL_OVERRIDE { - return logicalModuleVersionMajor_ + "." + logicalModuleVersionMinor_; - } - virtual QString logicalModuleIdentifier() const Q_DECL_OVERRIDE { - return logicalModuleName_ + logicalModuleVersionMajor_; - } - virtual void setQmlModuleInfo(const QString& ) Q_DECL_OVERRIDE; - virtual void setQtVariable(const QString& v) Q_DECL_OVERRIDE { qtVariable_ = v; } - virtual QString qtVariable() const Q_DECL_OVERRIDE { return qtVariable_; } - - private: QString logicalModuleName_; QString logicalModuleVersionMajor_; QString logicalModuleVersionMinor_; diff --git a/src/tools/qdoc/puredocparser.cpp b/src/tools/qdoc/puredocparser.cpp index 1d270e7150..7029431460 100644 --- a/src/tools/qdoc/puredocparser.cpp +++ b/src/tools/qdoc/puredocparser.cpp @@ -133,6 +133,7 @@ bool PureDocParser::processQdocComments() QString topic; bool isQmlPropertyTopic = false; + bool isJsPropertyTopic = false; const TopicList& topics = doc.topicsUsed(); if (!topics.isEmpty()) { @@ -142,8 +143,13 @@ bool PureDocParser::processQdocComments() (topic == COMMAND_QMLATTACHEDPROPERTY)) { isQmlPropertyTopic = true; } + else if ((topic == COMMAND_JSPROPERTY) || + (topic == COMMAND_JSPROPERTYGROUP) || + (topic == COMMAND_JSATTACHEDPROPERTY)) { + isJsPropertyTopic = true; + } } - if (isQmlPropertyTopic && topics.size() > 1) { + if ((isQmlPropertyTopic || isJsPropertyTopic) && topics.size() > 1) { qDebug() << "MULTIPLE TOPICS:" << doc.location().fileName() << doc.location().lineNo(); for (int i=0; igetCollections(nt); - if (!cnm.isEmpty()) { - CNMap::const_iterator i = cnm.begin(); - while (i != cnm.end()) { - if (!i.value()->isInternal()) - cnmm.insert(i.key(), i.value()); - ++i; - } - } - } -} - /*! Print the list of module names ordered according to how many successful searches each tree had. @@ -633,29 +608,30 @@ void QDocDatabase::initializeDB() */ /*! - \fn const GroupMap& QDocDatabase::groups() + \fn const CNMap& QDocDatabase::groups() Returns a const reference to the collection of all group nodes in the primary tree. */ /*! - \fn const ModuleMap& QDocDatabase::modules() + \fn const CNMap& QDocDatabase::modules() Returns a const reference to the collection of all module nodes in the primary tree. */ /*! - \fn const QmlModuleMap& QDocDatabase::qmlModules() + \fn const CNMap& QDocDatabase::qmlModules() Returns a const reference to the collection of all QML module nodes in the primary tree. */ -/*! \fn GroupNode* QDocDatabase::getGroup(const QString& name) - Find the group node named \a name and return a pointer - to it. If a matching node is not found, return 0. - */ +/*! + \fn const CNMap& QDocDatabase::jsModules() + Returns a const reference to the collection of all + JovaScript module nodes in the primary tree. +*/ -/*! \fn GroupNode* QDocDatabase::findGroup(const QString& name) +/*! \fn CollectionNode* QDocDatabase::findGroup(const QString& name) Find the group node named \a name and return a pointer to it. If a matching node is not found, add a new group node named \a name and return a pointer to that one. @@ -664,7 +640,7 @@ void QDocDatabase::initializeDB() and the new group node is marked \e{not seen}. */ -/*! \fn ModuleNode* QDocDatabase::findModule(const QString& name) +/*! \fn CollectionNode* QDocDatabase::findModule(const QString& name) Find the module node named \a name and return a pointer to it. If a matching node is not found, add a new module node named \a name and return a pointer to that one. @@ -673,16 +649,19 @@ void QDocDatabase::initializeDB() and the new module node is marked \e{not seen}. */ -/*! \fn QmlModuleNode* QDocDatabase::findQmlModule(const QString& name) +/*! \fn CollectionNode* QDocDatabase::findQmlModule(const QString& name, bool javaScript) Find the QML module node named \a name and return a pointer to it. If a matching node is not found, add a new QML module node named \a name and return a pointer to that one. - If a new QML module node is added, its parent is the tree root, - and the new QML module node is marked \e{not seen}. + If \a javaScript is set, the return collection must be a + JavaScript module. + + If a new QML or JavaScript module node is added, its parent + is the tree root, and the new node is marked \e{not seen}. */ -/*! \fn GroupNode* QDocDatabase::addGroup(const QString& name) +/*! \fn CollectionNode* QDocDatabase::addGroup(const QString& name) Looks up the group named \a name in the primary tree. If a match is found, a pointer to the node is returned. Otherwise, a new group node named \a name is created and @@ -690,7 +669,7 @@ void QDocDatabase::initializeDB() is returned. */ -/*! \fn ModuleNode* QDocDatabase::addModule(const QString& name) +/*! \fn CollectionNode* QDocDatabase::addModule(const QString& name) Looks up the module named \a name in the primary tree. If a match is found, a pointer to the node is returned. Otherwise, a new module node named \a name is created and @@ -698,7 +677,7 @@ void QDocDatabase::initializeDB() is returned. */ -/*! \fn QmlModuleNode* QDocDatabase::addQmlModule(const QString& name) +/*! \fn CollectionNode* QDocDatabase::addQmlModule(const QString& name) Looks up the QML module named \a name in the primary tree. If a match is found, a pointer to the node is returned. Otherwise, a new QML module node named \a name is created @@ -706,7 +685,15 @@ void QDocDatabase::initializeDB() node is returned. */ -/*! \fn GroupNode* QDocDatabase::addToGroup(const QString& name, Node* node) +/*! \fn CollectionNode* QDocDatabase::addJsModule(const QString& name) + Looks up the JavaScript module named \a name in the primary + tree. If a match is found, a pointer to the node is returned. + Otherwise, a new JavaScript module node named \a name is + created and inserted into the collection, and the pointer to + that node is returned. + */ + +/*! \fn CollectionNode* QDocDatabase::addToGroup(const QString& name, Node* node) Looks up the group node named \a name in the collection of all group nodes. If a match is not found, a new group node named \a name is created and inserted into the collection. @@ -716,7 +703,7 @@ void QDocDatabase::initializeDB() the group node. */ -/*! \fn ModuleNode* QDocDatabase::addToModule(const QString& name, Node* node) +/*! \fn CollectionNode* QDocDatabase::addToModule(const QString& name, Node* node) Looks up the module node named \a name in the collection of all module nodes. If a match is not found, a new module node named \a name is created and inserted into the collection. @@ -724,12 +711,18 @@ void QDocDatabase::initializeDB() \a node is not changed by this function. Returns the module node. */ -/*! \fn QmlModuleNode* QDocDatabase::addToQmlModule(const QString& name, Node* node) +/*! \fn Collection* QDocDatabase::addToQmlModule(const QString& name, Node* node) Looks up the QML module named \a name. If it isn't there, create it. Then append \a node to the QML module's member list. The parent of \a node is not changed by this function. */ +/*! \fn Collection* QDocDatabase::addToJsModule(const QString& name, Node* node) + Looks up the JavaScript module named \a name. If it isn't there, + create it. Then append \a node to the JavaScript module's member + list. The parent of \a node is not changed by this function. + */ + /*! Looks up the QML type node identified by the qualified Qml type \a name and returns a pointer to the QML type node. @@ -761,7 +754,7 @@ QmlTypeNode* QDocDatabase::findQmlType(const QString& qmid, const QString& name) QStringList path(name); Node* n = forest_.findNodeByNameAndType(path, Node::QmlType); - if (n && n->isQmlType()) + if (n && (n->isQmlType() || n->isJsType())) return static_cast(n); return 0; } @@ -1009,7 +1002,8 @@ void QDocDatabase::findAllClasses(InnerNode* node) serviceClasses_.insert(serviceName, *c); } } - else if (((*c)->isQmlType() || (*c)->isQmlBasicType())&& !(*c)->doc().isEmpty()) { + else if (((*c)->isQmlType() || (*c)->isQmlBasicType() || + (*c)->isJsType() || (*c)->isJsBasicType()) && !(*c)->doc().isEmpty()) { QString qmlTypeName = (*c)->name(); if (qmlTypeName.startsWith(QLatin1String("QML:"))) qmlTypes_.insert(qmlTypeName.mid(4),*c); @@ -1017,7 +1011,7 @@ void QDocDatabase::findAllClasses(InnerNode* node) qmlTypes_.insert(qmlTypeName,*c); //also add to the QML basic type map - if ((*c)->isQmlBasicType()) + if ((*c)->isQmlBasicType() || (*c)->isJsType()) qmlBasicTypes_.insert(qmlTypeName,*c); } else if ((*c)->isInnerNode()) { @@ -1121,7 +1115,7 @@ void QDocDatabase::findAllObsoleteThings(InnerNode* node) name = (*c)->parent()->name() + "::" + name; obsoleteClasses_.insert(name, *c); } - else if ((*c)->isQmlType()) { + else if ((*c)->isQmlType() || (*c)->isJsType()) { if (name.startsWith(QLatin1String("QML:"))) name = name.mid(4); name = (*c)->logicalModuleName() + "::" + name; @@ -1157,7 +1151,7 @@ void QDocDatabase::findAllObsoleteThings(InnerNode* node) ++p; } } - else if ((*c)->isQmlType()) { + else if ((*c)->isQmlType() || (*c)->isJsType()) { InnerNode* n = static_cast(*c); bool inserted = false; NodeList::const_iterator p = n->childNodes().constBegin(); @@ -1170,9 +1164,11 @@ void QDocDatabase::findAllObsoleteThings(InnerNode* node) case Node::QmlMethod: if ((*c)->parent()) { Node* parent = (*c)->parent(); - if (parent->type() == Node::QmlPropertyGroup && parent->parent()) + if ((parent->isQmlPropertyGroup() || + parent->isJsPropertyGroup()) && parent->parent()) parent = parent->parent(); - if (parent && parent->isQmlType() && !parent->name().isEmpty()) + if (parent && (parent->isQmlType() || parent->isJsType()) && + !parent->name().isEmpty()) name = parent->name() + "::" + name; } qmlTypesWithObsoleteMembers_.insert(name,*c); @@ -1241,7 +1237,7 @@ void QDocDatabase::findAllSince(InnerNode* node) nsmap.value().insert(className,(*child)); ncmap.value().insert(className,(*child)); } - else if ((*child)->isQmlType()) { + else if ((*child)->isQmlType() || (*child)->isJsType()) { // Insert QML elements into the since and element maps. QString className = (*child)->name(); if ((*child)->parent() && !(*child)->parent()->name().isEmpty()) { @@ -1250,7 +1246,7 @@ void QDocDatabase::findAllSince(InnerNode* node) nsmap.value().insert(className,(*child)); nqcmap.value().insert(className,(*child)); } - else if ((*child)->type() == Node::QmlProperty) { + else if ((*child)->isQmlProperty() || (*child)->isJsProperty()) { // Insert QML properties into the since map. QString propertyName = (*child)->name(); nsmap.value().insert(propertyName,(*child)); @@ -1380,7 +1376,7 @@ const Node* QDocDatabase::findNodeForTarget(const QString& target, const Node* r return n; relative = 0; } - node = findDocNodeByTitle(target); + node = findDocumentNodeByTitle(target); } return node; } @@ -1397,7 +1393,7 @@ void QDocDatabase::resolveQmlInheritance(InnerNode* root) NodeMap previousSearches; // Do we need recursion? foreach (Node* child, root->childNodes()) { - if (child->isQmlType()) { + if (child->isQmlType() || child->isJsType()) { QmlTypeNode* qcn = static_cast(child); if (qcn->qmlBaseNodeNotSet() && !qcn->qmlBaseName().isEmpty()) { QmlTypeNode* bqcn = static_cast(previousSearches.value(qcn->qmlBaseName())); @@ -1536,18 +1532,28 @@ Node* QDocDatabase::findNodeInOpenNamespace(QStringList& path, Node::Type type) } /*! - Finds all the collection nodes of type \a nt into the - collection node map \a cnn. Nodes that match \a relative - are not included. + Finds all the collection nodes of the specified \a genus + into the collection node map \a cnm. Nodes that match the + \a relative node are not included. */ -void QDocDatabase::mergeCollections(Node::Type nt, CNMap& cnm, const Node* relative) +void QDocDatabase::mergeCollections(Node::Genus genus, CNMap& cnm, const Node* relative) { - QRegExp singleDigit("\\b([0-9])\\b"); - CNMultiMap cnmm; - forest_.mergeCollectionMaps(nt, cnmm); cnm.clear(); + CNMultiMap cnmm; + foreach (Tree* t, searchOrder()) { + CNMap* m = t->getCollectionMap(genus); + if (m && !m->isEmpty()) { + CNMap::const_iterator i = m->begin(); + while (i != m->end()) { + if (!i.value()->isInternal()) + cnmm.insert(i.key(), i.value()); + ++i; + } + } + } if (cnmm.isEmpty()) return; + QRegExp singleDigit("\\b([0-9])\\b"); QStringList keys = cnmm.uniqueKeys(); foreach (const QString &key, keys) { QList values = cnmm.values(key); @@ -1580,19 +1586,16 @@ void QDocDatabase::mergeCollections(Node::Type nt, CNMap& cnm, const Node* relat /*! Finds all the collection nodes with the same name - and type as \a cn and merges their members into the - members list of \a cn. + and genus as \a c and merges their members into the + members list of \a c. */ -void QDocDatabase::mergeCollections(CollectionNode* cn) +void QDocDatabase::mergeCollections(CollectionNode* c) { - CollectionList cl; - forest_.getCorrespondingCollections(cn, cl); - if (!cl.empty()) { - foreach (CollectionNode* v, cl) { - if (v != cn) { - foreach (Node* t, v->members()) - cn->addMember(t); - } + foreach (Tree* t, searchOrder()) { + CollectionNode* cn = t->getCollection(c->name(), c->genus()); + if (cn && cn != c) { + foreach (Node* n, cn->members()) + c->addMember(n); } } } diff --git a/src/tools/qdoc/qdocdatabase.h b/src/tools/qdoc/qdocdatabase.h index ebee4aedd5..70307aa3ae 100644 --- a/src/tools/qdoc/qdocdatabase.h +++ b/src/tools/qdoc/qdocdatabase.h @@ -167,10 +167,10 @@ class QDocForest return 0; } - const DocNode* findDocNodeByTitle(const QString& title) + const DocumentNode* findDocumentNodeByTitle(const QString& title) { foreach (Tree* t, searchOrder()) { - const DocNode* n = t->findDocNodeByTitle(title); + const DocumentNode* n = t->findDocumentNodeByTitle(title); if (n) return n; } @@ -186,16 +186,6 @@ class QDocForest } return 0; } - void mergeCollectionMaps(Node::Type nt, CNMultiMap& cnmm); - void getCorrespondingCollections(CollectionNode* cn, CollectionList& cl) - { - foreach (Tree* t, searchOrder()) { - CollectionNode* ccn = t->getCorrespondingCollection(cn); - if (ccn) - cl.append(ccn); - } - } - void clearSearchOrder() { searchOrder_.clear(); } void clearLinkCounts() { @@ -230,28 +220,38 @@ class QDocDatabase ~QDocDatabase(); Tree* findTree(const QString& t) { return forest_.findTree(t); } + + CollectionNode* getCollection(const QString& name, Node::Genus genus) { + return primaryTree()->getCollection(name, genus); + } const CNMap& groups() { return primaryTree()->groups(); } const CNMap& modules() { return primaryTree()->modules(); } const CNMap& qmlModules() { return primaryTree()->qmlModules(); } + const CNMap& jsModules() { return primaryTree()->jsModules(); } - GroupNode* getGroup(const QString& name) { return primaryTree()->getGroup(name); } - GroupNode* findGroup(const QString& name) { return primaryTree()->findGroup(name); } - ModuleNode* findModule(const QString& name) { return primaryTree()->findModule(name); } - QmlModuleNode* findQmlModule(const QString& name) { return primaryTree()->findQmlModule(name); } + CollectionNode* findGroup(const QString& name) { return primaryTree()->findGroup(name); } + CollectionNode* findModule(const QString& name) { return primaryTree()->findModule(name); } + CollectionNode* findQmlModule(const QString& name) { return primaryTree()->findQmlModule(name); } + CollectionNode* findJsModule(const QString& name) { return primaryTree()->findJsModule(name); } - GroupNode* addGroup(const QString& name) { return primaryTree()->addGroup(name); } - ModuleNode* addModule(const QString& name) { return primaryTree()->addModule(name); } - QmlModuleNode* addQmlModule(const QString& name) { return primaryTree()->addQmlModule(name); } + CollectionNode* addGroup(const QString& name) { return primaryTree()->addGroup(name); } + CollectionNode* addModule(const QString& name) { return primaryTree()->addModule(name); } + CollectionNode* addQmlModule(const QString& name) { return primaryTree()->addQmlModule(name); } + CollectionNode* addJsModule(const QString& name) { return primaryTree()->addJsModule(name); } - GroupNode* addToGroup(const QString& name, Node* node) { + CollectionNode* addToGroup(const QString& name, Node* node) { return primaryTree()->addToGroup(name, node); } - ModuleNode* addToModule(const QString& name, Node* node) { + CollectionNode* addToModule(const QString& name, Node* node) { return primaryTree()->addToModule(name, node); } - QmlModuleNode* addToQmlModule(const QString& name, Node* node) { + CollectionNode* addToQmlModule(const QString& name, Node* node) { return primaryTree()->addToQmlModule(name, node); } + CollectionNode* addToJsModule(const QString& name, Node* node) { + return primaryTree()->addToJsModule(name, node); + } + void addExampleNode(ExampleNode* n) { primaryTree()->addExampleNode(n); } ExampleNodeMap& exampleNodeMap() { return primaryTree()->exampleNodeMap(); } @@ -336,8 +336,8 @@ class QDocDatabase } const Node* findTypeNode(const QString& type, const Node* relative); const Node* findNodeForTarget(const QString& target, const Node* relative); - const DocNode* findDocNodeByTitle(const QString& title) { - return forest_.findDocNodeByTitle(title); + const DocumentNode* findDocumentNodeByTitle(const QString& title) { + return forest_.findDocumentNodeByTitle(title); } Node* findNodeByNameAndType(const QStringList& path, Node::Type type) { return forest_.findNodeByNameAndType(path, type); @@ -386,8 +386,8 @@ class QDocDatabase void setLocalSearch() { forest_.searchOrder_ = QVector(1, primaryTree()); } void setSearchOrder(const QVector& searchOrder) { forest_.searchOrder_ = searchOrder; } void setSearchOrder(QStringList& t) { forest_.setSearchOrder(t); } - void mergeCollections(Node::Type nt, CNMap& cnm, const Node* relative); - void mergeCollections(CollectionNode* cn); + void mergeCollections(Node::Genus genus, CNMap& cnm, const Node* relative); + void mergeCollections(CollectionNode* c); void clearSearchOrder() { forest_.clearSearchOrder(); } void incrementLinkCount(const Node* t) { t->tree()->incrementLinkCount(); } void clearLinkCounts() { forest_.clearLinkCounts(); } diff --git a/src/tools/qdoc/qdocindexfiles.cpp b/src/tools/qdoc/qdocindexfiles.cpp index efc0eb1e0f..026c64b587 100644 --- a/src/tools/qdoc/qdocindexfiles.cpp +++ b/src/tools/qdoc/qdocindexfiles.cpp @@ -229,6 +229,29 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element, location = Location(name); node = qcn; } + else if (element.nodeName() == "jstype") { + QmlTypeNode* qcn = new QmlTypeNode(parent, name); + qcn->setGenus(Node::JS); + qcn->setTitle(element.attribute("title")); + QString logicalModuleName = element.attribute("js-module-name"); + if (!logicalModuleName.isEmpty()) + qdb_->addToQmlModule(logicalModuleName, qcn); + bool abstract = false; + if (element.attribute("abstract") == "true") + abstract = true; + qcn->setAbstract(abstract); + QString qmlFullBaseName = element.attribute("js-base-type"); + if (!qmlFullBaseName.isEmpty()) { + qcn->setQmlBaseName(qmlFullBaseName); + } + if (element.hasAttribute("location")) + name = element.attribute("location", QString()); + if (!indexUrl.isEmpty()) + location = Location(indexUrl + QLatin1Char('/') + name); + else if (!indexUrl.isNull()) + location = Location(name); + node = qcn; + } else if (element.nodeName() == "qmlbasictype") { QmlBasicTypeNode* qbtn = new QmlBasicTypeNode(parent, name); qbtn->setTitle(element.attribute("title")); @@ -240,6 +263,18 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element, location = Location(name); node = qbtn; } + else if (element.nodeName() == "jsbasictype") { + QmlBasicTypeNode* qbtn = new QmlBasicTypeNode(parent, name); + qbtn->setGenus(Node::JS); + qbtn->setTitle(element.attribute("title")); + if (element.hasAttribute("location")) + name = element.attribute("location", QString()); + if (!indexUrl.isEmpty()) + location = Location(indexUrl + QLatin1Char('/') + name); + else if (!indexUrl.isNull()) + location = Location(name); + node = qbtn; + } else if (element.nodeName() == "qmlpropertygroup") { QmlTypeNode* qcn = static_cast(parent); QmlPropertyGroupNode* qpgn = new QmlPropertyGroupNode(qcn, name); @@ -251,6 +286,18 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element, location = Location(name); node = qpgn; } + else if (element.nodeName() == "jspropertygroup") { + QmlTypeNode* qcn = static_cast(parent); + QmlPropertyGroupNode* qpgn = new QmlPropertyGroupNode(qcn, name); + qpgn->setGenus(Node::JS); + if (element.hasAttribute("location")) + name = element.attribute("location", QString()); + if (!indexUrl.isEmpty()) + location = Location(indexUrl + QLatin1Char('/') + name); + else if (!indexUrl.isNull()) + location = Location(name); + node = qpgn; + } else if (element.nodeName() == "qmlproperty") { QString type = element.attribute("type"); bool attached = false; @@ -271,6 +318,27 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element, qpn->setReadOnly(readonly); node = qpn; } + else if (element.nodeName() == "jsproperty") { + QString type = element.attribute("type"); + bool attached = false; + if (element.attribute("attached") == "true") + attached = true; + bool readonly = false; + if (element.attribute("writable") == "false") + readonly = true; + QmlPropertyNode* qpn = 0; + if (parent->isJsType()) { + QmlTypeNode* qcn = static_cast(parent); + qpn = new QmlPropertyNode(qcn, name, type, attached); + } + else if (parent->isJsPropertyGroup()) { + QmlPropertyGroupNode* qpgn = static_cast(parent); + qpn = new QmlPropertyNode(qpgn, name, type, attached); + } + qpn->setGenus(Node::JS); + qpn->setReadOnly(readonly); + node = qpn; + } else if ((element.nodeName() == "qmlmethod") || (element.nodeName() == "qmlsignal") || (element.nodeName() == "qmlsignalhandler")) { @@ -283,30 +351,58 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element, FunctionNode* fn = new FunctionNode(t, parent, name, attached); node = fn; } + else if ((element.nodeName() == "jsmethod") || + (element.nodeName() == "jssignal") || + (element.nodeName() == "jssignalhandler")) { + Node::Type t = Node::QmlMethod; + if (element.nodeName() == "jssignal") + t = Node::QmlSignal; + else if (element.nodeName() == "jssignalhandler") + t = Node::QmlSignalHandler; + bool attached = false; + FunctionNode* fn = new FunctionNode(t, parent, name, attached); + fn->setGenus(Node::JS); + node = fn; + } else if (element.nodeName() == "group") { - GroupNode* gn = qdb_->addGroup(name); - gn->setTitle(element.attribute("title")); - gn->setSubTitle(element.attribute("subtitle")); + CollectionNode* cn = qdb_->addGroup(name); + cn->setTitle(element.attribute("title")); + cn->setSubTitle(element.attribute("subtitle")); if (element.attribute("seen") == "true") - gn->markSeen(); - node = gn; + cn->markSeen(); + node = cn; } else if (element.nodeName() == "module") { - ModuleNode* mn = qdb_->addModule(name); - mn->setTitle(element.attribute("title")); - mn->setSubTitle(element.attribute("subtitle")); + CollectionNode* cn = qdb_->addModule(name); + cn->setTitle(element.attribute("title")); + cn->setSubTitle(element.attribute("subtitle")); if (element.attribute("seen") == "true") - mn->markSeen(); - node = mn; + cn->markSeen(); + node = cn; } else if (element.nodeName() == "qmlmodule") { - QString t = element.attribute("qml-module-name") + " " + element.attribute("qml-module-version"); - QmlModuleNode* qmn = qdb_->addQmlModule(t); - qmn->setTitle(element.attribute("title")); - qmn->setSubTitle(element.attribute("subtitle")); + QString t = element.attribute("qml-module-name"); + CollectionNode* cn = qdb_->addQmlModule(t); + QStringList info; + info << t << element.attribute("qml-module-version"); + cn->setLogicalModuleInfo(info); + cn->setTitle(element.attribute("title")); + cn->setSubTitle(element.attribute("subtitle")); if (element.attribute("seen") == "true") - qmn->markSeen(); - node = qmn; + cn->markSeen(); + node = cn; + } + else if (element.nodeName() == "jsmodule") { + QString t = element.attribute("js-module-name"); + CollectionNode* cn = qdb_->addJsModule(t); + QStringList info; + info << t << element.attribute("js-module-version"); + cn->setLogicalModuleInfo(info); + cn->setTitle(element.attribute("title")); + cn->setSubTitle(element.attribute("subtitle")); + if (element.attribute("seen") == "true") + cn->markSeen(); + node = cn; } else if (element.nodeName() == "page") { Node::SubType subtype; @@ -335,7 +431,7 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element, else return; - DocNode* docNode = new DocNode(parent, name, subtype, ptype); + DocumentNode* docNode = new DocumentNode(parent, name, subtype, ptype); docNode->setTitle(element.attribute("title")); if (element.hasAttribute("location")) @@ -492,7 +588,9 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element, if ((element.nodeName() != "page") && (element.nodeName() != "qmlclass") && - (element.nodeName() != "qmlbasictype")) { + (element.nodeName() != "qmlbasictype") && + (element.nodeName() != "jstype") && + (element.nodeName() != "jsbasictype")) { QString threadSafety = element.attribute("threadsafety"); if (threadSafety == "non-reentrant") node->setThreadSafeness(Node::NonReentrant); @@ -646,15 +744,21 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer, break; case Node::QmlType: { - nodeName = "qmlclass"; - QmlModuleNode* qmn = node->logicalModule(); - if (qmn) - logicalModuleName = qmn->logicalModuleName(); + if (node->isQmlNode()) + nodeName = "qmlclass"; + else + nodeName = "jstype"; + CollectionNode* cn = node->logicalModule(); + if (cn) + logicalModuleName = cn->logicalModuleName(); qmlFullBaseName = node->qmlFullBaseName(); } break; case Node::QmlBasicType: - nodeName = "qmlbasictype"; + if (node->isQmlNode()) + nodeName = "qmlbasictype"; + else + nodeName = "jsbasictype"; break; case Node::Document: nodeName = "page"; @@ -666,7 +770,10 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer, nodeName = "module"; break; case Node::QmlModule: - nodeName = "qmlmodule"; + if (node->isQmlNode()) + nodeName = "qmlmodule"; + else + nodeName = "jsmodule"; break; case Node::Enum: nodeName = "enum"; @@ -684,19 +791,34 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer, nodeName = "variable"; break; case Node::QmlProperty: - nodeName = "qmlproperty"; + if (node->isQmlNode()) + nodeName = "qmlproperty"; + else + nodeName = "jsProperty"; break; case Node::QmlPropertyGroup: - nodeName = "qmlpropertygroup"; + if (node->isQmlNode()) + nodeName = "qmlpropertygroup"; + else + nodeName = "jspropertygroup"; break; case Node::QmlSignal: - nodeName = "qmlsignal"; + if (node->isQmlNode()) + nodeName = "qmlsignal"; + else + nodeName = "jssignal"; break; case Node::QmlSignalHandler: - nodeName = "qmlsignalhandler"; + if (node->isQmlNode()) + nodeName = "qmlsignalhandler"; + else + nodeName = "jssignalhandler"; break; case Node::QmlMethod: - nodeName = "qmlmethod"; + if (node->isQmlNode()) + nodeName = "qmlmethod"; + else + nodeName = "jsmethod"; break; default: return false; @@ -711,16 +833,6 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer, access = "protected"; break; case Node::Private: -#if 0 - // Do not include private non-internal nodes in the index. - // (Internal public and protected nodes are marked as private - // by qdoc. We can check their internal status to determine - // whether they were really private to begin with.) - if (node->status() == Node::Internal && generateInternalNodes) - access = "internal"; - else - return false; -#endif { access = "private"; bool b = generateInternalNodes; @@ -741,7 +853,7 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer, QXmlStreamAttributes attributes; - if (!node->isDocNode() && !node->isGroup() && !node->isModule() && !node->isQmlModule()) { + if (!node->isDocumentNode() && !node->isCollectionNode()) { QString threadSafety; switch (node->threadSafeness()) { case Node::NonReentrant: @@ -791,13 +903,24 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer, if (node->isQmlModule()) { logicalModuleName = node->logicalModuleName(); logicalModuleVersion = node->logicalModuleVersion(); + if (!logicalModuleName.isEmpty()) { + writer.writeAttribute("qml-module-name", logicalModuleName); + if (node->isQmlModule()) + writer.writeAttribute("qml-module-version", logicalModuleVersion); + if (!qmlFullBaseName.isEmpty()) + writer.writeAttribute("qml-base-type", qmlFullBaseName); + } } - if (!logicalModuleName.isEmpty()) { - writer.writeAttribute("qml-module-name", logicalModuleName); - if (node->isQmlModule()) - writer.writeAttribute("qml-module-version", logicalModuleVersion); - if (!qmlFullBaseName.isEmpty()) - writer.writeAttribute("qml-base-type", qmlFullBaseName); + else if (node->isJsModule()) { + logicalModuleName = node->logicalModuleName(); + logicalModuleVersion = node->logicalModuleVersion(); + if (!logicalModuleName.isEmpty()) { + writer.writeAttribute("js-module-name", logicalModuleName); + if (node->isQmlModule()) + writer.writeAttribute("js-module-version", logicalModuleVersion); + if (!qmlFullBaseName.isEmpty()) + writer.writeAttribute("js-base-type", qmlFullBaseName); + } } QString href; @@ -816,12 +939,12 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer, } else href = node->name(); - if (node->isQmlNode()) { + if (node->isQmlNode() || node->isJsNode()) { InnerNode* p = node->parent(); if (p) { - if (p->isQmlPropertyGroup()) + if (p->isQmlPropertyGroup() || p->isJsPropertyGroup()) p = p->parent(); - if (p && p->isQmlType() && p->isAbstract()) + if (p && (p->isQmlType() || p->isJsType()) && p->isAbstract()) href.clear(); } } @@ -829,7 +952,7 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer, writer.writeAttribute("href", href); writer.writeAttribute("status", status); - if (!node->isDocNode() && !node->isGroup() && !node->isModule() && !node->isQmlModule()) { + if (!node->isDocumentNode() && !node->isCollectionNode()) { writer.writeAttribute("access", access); if (node->isAbstract()) writer.writeAttribute("abstract", "true"); @@ -898,7 +1021,7 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer, a title, and other attributes. */ bool writeModuleName = false; - const DocNode* docNode = static_cast(node); + const DocumentNode* docNode = static_cast(node); switch (docNode->subType()) { case Node::Example: writer.writeAttribute("subtype", "example"); @@ -935,22 +1058,22 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer, break; case Node::Group: { - const GroupNode* gn = static_cast(node); - writer.writeAttribute("seen", gn->wasSeen() ? "true" : "false"); - writer.writeAttribute("title", gn->title()); - if (!gn->subTitle().isEmpty()) - writer.writeAttribute("subtitle", gn->subTitle()); - if (!gn->physicalModuleName().isEmpty()) - writer.writeAttribute("module", gn->physicalModuleName()); - if (!gn->groupNames().isEmpty()) - writer.writeAttribute("groups", gn->groupNames().join(",")); + const CollectionNode* cn = static_cast(node); + writer.writeAttribute("seen", cn->wasSeen() ? "true" : "false"); + writer.writeAttribute("title", cn->title()); + if (!cn->subTitle().isEmpty()) + writer.writeAttribute("subtitle", cn->subTitle()); + if (!cn->physicalModuleName().isEmpty()) + writer.writeAttribute("module", cn->physicalModuleName()); + if (!cn->groupNames().isEmpty()) + writer.writeAttribute("groups", cn->groupNames().join(",")); /* This is not read back in, so it probably shouldn't be written out in the first place. */ - if (!gn->members().isEmpty()) { + if (!cn->members().isEmpty()) { QStringList names; - foreach (const Node* member, gn->members()) + foreach (const Node* member, cn->members()) names.append(member->name()); writer.writeAttribute("members", names.join(",")); } @@ -960,22 +1083,22 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer, break; case Node::Module: { - const ModuleNode* mn = static_cast(node); - writer.writeAttribute("seen", mn->wasSeen() ? "true" : "false"); - writer.writeAttribute("title", mn->title()); - if (!mn->subTitle().isEmpty()) - writer.writeAttribute("subtitle", mn->subTitle()); - if (!mn->physicalModuleName().isEmpty()) - writer.writeAttribute("module", mn->physicalModuleName()); - if (!mn->groupNames().isEmpty()) - writer.writeAttribute("groups", mn->groupNames().join(",")); + const CollectionNode* cn = static_cast(node); + writer.writeAttribute("seen", cn->wasSeen() ? "true" : "false"); + writer.writeAttribute("title", cn->title()); + if (!cn->subTitle().isEmpty()) + writer.writeAttribute("subtitle", cn->subTitle()); + if (!cn->physicalModuleName().isEmpty()) + writer.writeAttribute("module", cn->physicalModuleName()); + if (!cn->groupNames().isEmpty()) + writer.writeAttribute("groups", cn->groupNames().join(",")); /* This is not read back in, so it probably shouldn't be written out in the first place. */ - if (!mn->members().isEmpty()) { + if (!cn->members().isEmpty()) { QStringList names; - foreach (const Node* member, mn->members()) + foreach (const Node* member, cn->members()) names.append(member->name()); writer.writeAttribute("members", names.join(",")); } @@ -985,22 +1108,22 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer, break; case Node::QmlModule: { - const QmlModuleNode* qmn = static_cast(node); - writer.writeAttribute("seen", qmn->wasSeen() ? "true" : "false"); - writer.writeAttribute("title", qmn->title()); - if (!qmn->subTitle().isEmpty()) - writer.writeAttribute("subtitle", qmn->subTitle()); - if (!qmn->physicalModuleName().isEmpty()) - writer.writeAttribute("module", qmn->physicalModuleName()); - if (!qmn->groupNames().isEmpty()) - writer.writeAttribute("groups", qmn->groupNames().join(",")); + const CollectionNode* cn = static_cast(node); + writer.writeAttribute("seen", cn->wasSeen() ? "true" : "false"); + writer.writeAttribute("title", cn->title()); + if (!cn->subTitle().isEmpty()) + writer.writeAttribute("subtitle", cn->subTitle()); + if (!cn->physicalModuleName().isEmpty()) + writer.writeAttribute("module", cn->physicalModuleName()); + if (!cn->groupNames().isEmpty()) + writer.writeAttribute("groups", cn->groupNames().join(",")); /* This is not read back in, so it probably shouldn't be written out in the first place. */ - if (!qmn->members().isEmpty()) { + if (!cn->members().isEmpty()) { QStringList names; - foreach (const Node* member, qmn->members()) + foreach (const Node* member, cn->members()) names.append(member->name()); writer.writeAttribute("members", names.join(",")); } @@ -1195,7 +1318,7 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer, if (node->doc().hasTargets()) { bool external = false; if (node->type() == Node::Document) { - const DocNode* docNode = static_cast(node); + const DocumentNode* docNode = static_cast(node); if (docNode->subType() == Node::ExternalPage) external = true; } @@ -1295,9 +1418,17 @@ bool compareNodes(const Node* n1, const Node* n2) return false; } - if (n1->isDocNode() && n2->isDocNode()) { - const DocNode* f1 = static_cast(n1); - const DocNode* f2 = static_cast(n2); + if (n1->isDocumentNode() && n2->isDocumentNode()) { + const DocumentNode* f1 = static_cast(n1); + const DocumentNode* f2 = static_cast(n2); + if (f1->fullTitle() < f2->fullTitle()) + return true; + else if (f1->fullTitle() > f2->fullTitle()) + return false; + } + else if (n1->isCollectionNode() && n2->isCollectionNode()) { + const CollectionNode* f1 = static_cast(n1); + const CollectionNode* f2 = static_cast(n2); if (f1->fullTitle() < f2->fullTitle()) return true; else if (f1->fullTitle() > f2->fullTitle()) @@ -1321,7 +1452,7 @@ void QDocIndexFiles::generateIndexSections(QXmlStreamWriter& writer, Note that groups, modules, and QML modules are written after all the other nodes. */ - if (node->isGroup() || node->isModule() || node->isQmlModule()) + if (node->isGroup() || node->isModule() || node->isQmlModule() || node->isJsModule()) return; if (generateIndexSection(writer, node, generateInternalNodes)) { @@ -1374,6 +1505,16 @@ void QDocIndexFiles::generateIndexSections(QXmlStreamWriter& writer, ++g; } } + + const CNMap& jsModules = qdb_->jsModules(); + if (!jsModules.isEmpty()) { + CNMap::ConstIterator g = jsModules.constBegin(); + while (g != jsModules.constEnd()) { + if (generateIndexSection(writer, g.value(), generateInternalNodes)) + writer.writeEndElement(); + ++g; + } + } } writer.writeEndElement(); diff --git a/src/tools/qdoc/qmlcodeparser.cpp b/src/tools/qdoc/qmlcodeparser.cpp index 6e53f88d0f..4f5720a94d 100644 --- a/src/tools/qdoc/qmlcodeparser.cpp +++ b/src/tools/qdoc/qmlcodeparser.cpp @@ -76,6 +76,19 @@ QT_BEGIN_NAMESPACE #define COMMAND_QMLBASICTYPE Doc::alias("qmlbasictype") #define COMMAND_QMLMODULE Doc::alias("qmlmodule") +#define COMMAND_JSTYPE Doc::alias("jstype") +#define COMMAND_JSMODULE Doc::alias("jsmodule") +#define COMMAND_JSPROPERTY Doc::alias("jsproperty") +#define COMMAND_JSPROPERTYGROUP Doc::alias("jspropertygroup") +#define COMMAND_JSATTACHEDPROPERTY Doc::alias("jsattachedproperty") +#define COMMAND_INJSMODULE Doc::alias("injsmodule") +#define COMMAND_JSSIGNAL Doc::alias("jssignal") +#define COMMAND_JSATTACHEDSIGNAL Doc::alias("jsattachedsignal") +#define COMMAND_JSMETHOD Doc::alias("jsmethod") +#define COMMAND_JSATTACHEDMETHOD Doc::alias("jsattachedmethod") +#define COMMAND_JSBASICTYPE Doc::alias("jsbasictype") +#define COMMAND_JSMODULE Doc::alias("jsmodule") + /*! Constructs the QML code parser. */ @@ -205,7 +218,16 @@ const QSet& QmlCodeParser::topicCommands() << COMMAND_QMLATTACHEDSIGNAL << COMMAND_QMLMETHOD << COMMAND_QMLATTACHEDMETHOD - << COMMAND_QMLBASICTYPE; + << COMMAND_QMLBASICTYPE + << COMMAND_JSTYPE + << COMMAND_JSPROPERTY + << COMMAND_JSPROPERTYGROUP + << COMMAND_JSATTACHEDPROPERTY + << COMMAND_JSSIGNAL + << COMMAND_JSATTACHEDSIGNAL + << COMMAND_JSMETHOD + << COMMAND_JSATTACHEDMETHOD + << COMMAND_JSBASICTYPE; } return topicCommands_; } @@ -231,6 +253,7 @@ const QSet& QmlCodeParser::otherMetaCommands() << COMMAND_SINCE << COMMAND_QMLABSTRACT << COMMAND_INQMLMODULE + << COMMAND_INJSMODULE << COMMAND_WRAPPER; } return otherMetaCommands_; diff --git a/src/tools/qdoc/qmlvisitor.cpp b/src/tools/qdoc/qmlvisitor.cpp index 9da815eccf..6179e80085 100644 --- a/src/tools/qdoc/qmlvisitor.cpp +++ b/src/tools/qdoc/qmlvisitor.cpp @@ -72,6 +72,18 @@ QT_BEGIN_NAMESPACE #define COMMAND_QMLREADONLY Doc::alias(QLatin1String("readonly")) #define COMMAND_QMLBASICTYPE Doc::alias(QLatin1String("qmlbasictype")) +#define COMMAND_JSTYPE Doc::alias(QLatin1String("jstype")) +#define COMMAND_JSMODULE Doc::alias(QLatin1String("jsmodule")) +#define COMMAND_JSPROPERTY Doc::alias(QLatin1String("jsproperty")) +#define COMMAND_JSPROPERTYGROUP Doc::alias(QLatin1String("jspropertygroup")) +#define COMMAND_JSATTACHEDPROPERTY Doc::alias(QLatin1String("jsattachedproperty")) +#define COMMAND_INJSMODULE Doc::alias(QLatin1String("injsmodule")) +#define COMMAND_JSSIGNAL Doc::alias(QLatin1String("jssignal")) +#define COMMAND_JSATTACHEDSIGNAL Doc::alias(QLatin1String("jsattachedsignal")) +#define COMMAND_JSMETHOD Doc::alias(QLatin1String("jsmethod")) +#define COMMAND_JSATTACHEDMETHOD Doc::alias(QLatin1String("jsattachedmethod")) +#define COMMAND_JSBASICTYPE Doc::alias(QLatin1String("jsbasictype")) + /*! The constructor stores all the parameters in local data members. */ @@ -134,82 +146,6 @@ QQmlJS::AST::SourceLocation QmlDocVisitor::precedingComment(quint32 offset) cons return QQmlJS::AST::SourceLocation(); } -#if 0 - ArgList args; - QSet::iterator i = metacommands.begin(); - while (i != metacommands.end()) { - if (topics_.contains(*i)) { - topic = *i; - break; - } - ++i; - } - if (!topic.isEmpty()) { - args = doc.metaCommandArgs(topic); - if ((topic == COMMAND_QMLCLASS) || (topic == COMMAND_QMLTYPE)) { - // do nothing. - } - else if (topic == COMMAND_QMLPROPERTY) { - if (node->type() == Node::QmlProperty) { - QmlPropertyNode* qpn = static_cast(node); - qpn->setReadOnly(0); - if (qpn->dataType() == "alias") { - QStringList part = args[0].first.split(QLatin1Char(' ')); - qpn->setDataType(part[0]); - } - } - } - else if (topic == COMMAND_QMLPROPERTYGROUP) { - // zzz ? - } - else if (topic == COMMAND_QMLMODULE) { - } - else if (topic == COMMAND_QMLATTACHEDPROPERTY) { - if (node->type() == Node::QmlProperty) { - QmlPropertyNode* qpn = static_cast(node); - qpn->setReadOnly(0); - } - } - else if (topic == COMMAND_QMLSIGNAL) { - } - else if (topic == COMMAND_QMLATTACHEDSIGNAL) { - } - else if (topic == COMMAND_QMLMETHOD) { - } - else if (topic == COMMAND_QMLATTACHEDMETHOD) { - } - else if (topic == COMMAND_QMLBASICTYPE) { - } - } - - if (node->type() == Node::QmlProperty) { - QmlPropertyNode* qpn = static_cast(node); - for (int i=0; ihasQmlPropertyNode(qpa.name_); - if (n == 0) - n = new QmlPropertyNode(qpn, qpa.name_, qpa.type_, false); - n->setLocation(doc.location()); - n->setReadOnly(qpn->isReadOnly()); - if (qpn->isDefault()) - n->setDefault(); - } - else - qDebug() << " FAILED TO PARSE QML PROPERTY:" - << topicsUsed.at(i).topic << topicsUsed.at(i).args; - } - } - } - -#endif - /*! Finds the nearest unused qdoc comment above the QML entity represented by the \a node and processes the qdoc commands @@ -241,7 +177,8 @@ bool QmlDocVisitor::applyDocumentation(QQmlJS::AST::SourceLocation location, Nod nodes.append(node); if (topicsUsed.size() > 0) { for (int i=0; iname()) { @@ -257,7 +195,8 @@ bool QmlDocVisitor::applyDocumentation(QQmlJS::AST::SourceLocation location, Nod nodePassedIn->setDataType(qpa.type_); } else { - bool isAttached = (topic == COMMAND_QMLATTACHEDPROPERTY); + bool isAttached = (topic == COMMAND_QMLATTACHEDPROPERTY) || + (topic == COMMAND_JSATTACHEDPROPERTY); QmlPropertyNode* n = parent->hasQmlProperty(qpa.name_, isAttached); if (n == 0) n = new QmlPropertyNode(parent, qpa.name_, qpa.type_, isAttached); @@ -268,11 +207,14 @@ bool QmlDocVisitor::applyDocumentation(QQmlJS::AST::SourceLocation location, Nod n->setDefault(); if (isAttached) n->setReadOnly(0); + if ((topic == COMMAND_JSPROPERTY) || + (topic == COMMAND_JSATTACHEDPROPERTY)) + n->setGenus(Node::JS); nodes.append(n); } } else - qDebug() << " FAILED TO PARSE QML PROPERTY:" << topic << args; + qDebug() << " FAILED TO PARSE QML OR JS PROPERTY:" << topic << args; } } } @@ -357,33 +299,33 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation, QString command = *i; ArgList args = doc.metaCommandArgs(command); if (command == COMMAND_QMLABSTRACT) { - if (node->isQmlType()) { + if (node->isQmlType() || node->isJsType()) { node->setAbstract(true); } } else if (command == COMMAND_DEPRECATED) { node->setStatus(Node::Obsolete); } - else if (command == COMMAND_INQMLMODULE) { + else if ((command == COMMAND_INQMLMODULE) || (command == COMMAND_INJSMODULE)) { qdb->addToQmlModule(args[0].first,node); } else if (command == COMMAND_QMLINHERITS) { if (node->name() == args[0].first) doc.location().warning(tr("%1 tries to inherit itself").arg(args[0].first)); - else if (node->isQmlType()) { + else if (node->isQmlType() || node->isJsType()) { QmlTypeNode *qmlType = static_cast(node); qmlType->setQmlBaseName(args[0].first); QmlTypeNode::addInheritedBy(args[0].first,node); } } else if (command == COMMAND_QMLDEFAULT) { - if (node->type() == Node::QmlProperty) { + if (node->isQmlProperty() || node->isJsProperty()) { QmlPropertyNode* qpn = static_cast(node); qpn->setDefault(); } } else if (command == COMMAND_QMLREADONLY) { - if (node->type() == Node::QmlProperty) { + if (node->isQmlProperty() || node->isJsProperty()) { QmlPropertyNode* qpn = static_cast(node); qpn->setReadOnly(1); } @@ -532,7 +474,7 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiPublicMember *member) switch (member->type) { case QQmlJS::AST::UiPublicMember::Signal: { - if (current->isQmlType()) { + if (current->isQmlType() || current->isJsType()) { QmlTypeNode *qmlType = static_cast(current); if (qmlType) { @@ -555,13 +497,16 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiPublicMember *member) { QString type = member->memberType.toString(); QString name = member->name.toString(); - if (current->isQmlType()) { + if (current->isQmlType() || current->isJsType()) { QmlTypeNode *qmlType = static_cast(current); if (qmlType) { QString name = member->name.toString(); QmlPropertyNode* qmlPropNode = qmlType->hasQmlProperty(name); - if (qmlPropNode == 0) + if (qmlPropNode == 0) { qmlPropNode = new QmlPropertyNode(qmlType, name, type, false); + if (current->isJsType()) + qmlPropNode->setGenus(Node::JS); + } qmlPropNode->setReadOnly(member->isReadonlyMember); if (member->isDefaultMember) qmlPropNode->setDefault(); @@ -599,11 +544,13 @@ bool QmlDocVisitor::visit(QQmlJS::AST::FunctionDeclaration* fd) if (nestingLevel > 1) { return true; } - if (current->isQmlType()) { + if (current->isQmlType() || current->isJsType()) { QmlTypeNode* qmlType = static_cast(current); if (qmlType) { QString name = fd->name.toString(); FunctionNode* qmlMethod = new FunctionNode(Node::QmlMethod, current, name, false); + if (current->isJsType()) + qmlMethod->setGenus(Node::JS); int overloads = 0; NodeList::ConstIterator overloadIterator = current->childNodes().constBegin(); while (overloadIterator != current->childNodes().constEnd()) { @@ -652,7 +599,7 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiScriptBinding* ) if (nestingLevel > 1) { return true; } - if (current->isQmlType()) { + if (current->isQmlType() || current->isJsType()) { QString handler = sb->qualifiedId->name.toString(); if (handler.length() > 2 && handler.startsWith("on") && handler.at(2).isUpper()) { QmlTypeNode* qmlType = static_cast(current); diff --git a/src/tools/qdoc/tree.cpp b/src/tools/qdoc/tree.cpp index 3df60f7340..ed4b4e3979 100644 --- a/src/tools/qdoc/tree.cpp +++ b/src/tools/qdoc/tree.cpp @@ -225,7 +225,7 @@ const FunctionNode* Tree::findFunctionNode(const QStringList& path, if (!qcn) { QStringList p(path[1]); Node* n = findNodeByNameAndType(p, Node::QmlType); - if (n && n->isQmlType()) + if (n && (n->isQmlType() || n->isJsType())) qcn = static_cast(n); } if (qcn) @@ -253,7 +253,7 @@ const FunctionNode* Tree::findFunctionNode(const QStringList& path, else next = ((InnerNode*) node)->findChildNode(path.at(i), genus); - if (!next && node->type() == Node::Class && (findFlags & SearchBaseClasses)) { + if (!next && node->isClass() && (findFlags & SearchBaseClasses)) { NodeList baseClasses = allBaseClasses(static_cast(node)); foreach (const Node* baseClass, baseClasses) { if (i == path.size() - 1) @@ -489,7 +489,7 @@ void Tree::resolveCppToQmlLinks() { foreach (Node* child, root_.childNodes()) { - if (child->isQmlType()) { + if (child->isQmlType() || child->isJsType()) { QmlTypeNode* qcn = static_cast(child); ClassNode* cn = const_cast(qcn->classNode()); if (cn) @@ -694,7 +694,7 @@ const Node* Tree::findNodeForTarget(const QStringList& path, p = path.join(QString("::")); else if ((genus == Node::DontCare) || (genus == Node::DOC)) { p = path.at(0); - node = findDocNodeByTitle(p); + node = findDocumentNodeByTitle(p); if (node) { if (!target.isEmpty()) { ref = getRef(target, node); @@ -967,12 +967,12 @@ void Tree::resolveTargets(InnerNode* root) // need recursion foreach (Node* child, root->childNodes()) { if (child->type() == Node::Document) { - DocNode* node = static_cast(child); + DocumentNode* node = static_cast(child); QString key = node->title(); if (!key.isEmpty()) { if (key.contains(QChar(' '))) key = Doc::canonicalTitle(key); - QList nodes = docNodesByTitle_.values(key); + QList nodes = docNodesByTitle_.values(key); bool alreadyThere = false; if (!nodes.empty()) { for (int i=0; i< nodes.size(); ++i) { @@ -1095,9 +1095,9 @@ Tree::findUnambiguousTarget(const QString& target, QString& ref) const /*! This function searches for a node with the specified \a title. */ -const DocNode* Tree::findDocNodeByTitle(const QString& title) const +const DocumentNode* Tree::findDocumentNodeByTitle(const QString& title) const { - DocNodeMultiMap::const_iterator i; + DocumentNodeMultiMap::const_iterator i; if (title.contains(QChar(' '))) i = docNodesByTitle_.constFind(Doc::canonicalTitle(title)); else @@ -1108,7 +1108,7 @@ const DocNode* Tree::findDocNodeByTitle(const QString& title) const overkill. We should report the duplicate file and let that suffice. */ - DocNodeMultiMap::const_iterator j = i; + DocumentNodeMultiMap::const_iterator j = i; ++j; if (j != docNodesByTitle_.constEnd() && j.key() == i.key()) { QList internalLocations; @@ -1164,62 +1164,89 @@ QString Tree::refForAtom(const Atom* atom) */ /*! - Returns the collection node in this tree that has the same - name and type as \a cn. Returns 0 if no match is found. - - If the matching node is \a cn, return 0. + Returns a pointer to the collection map specified by \a genus. + Returns null if \a genus is not specified. */ -CollectionNode* Tree::getCorrespondingCollection(CollectionNode* cn) +CNMap* Tree::getCollectionMap(Node::Genus genus) { - CollectionNode* ccn = 0; - if (cn->isGroup()) - ccn = getGroup(cn->name()); - else if (cn->isModule()) - ccn = getModule(cn->name()); - else if (cn->isQmlModule()) - ccn = getQmlModule(cn->name()); - if (ccn == cn) - ccn = 0; - return ccn; -} - -/*! - Find the group node named \a name and return a pointer - to it. If a matching node is not found, return 0. - */ -GroupNode* Tree::getGroup(const QString& name) -{ - CNMap::const_iterator i = groups_.find(name); - if (i != groups_.end()) - return static_cast(i.value()); + switch (genus) { + case Node::DOC: + return &groups_; + case Node::CPP: + return &modules_; + case Node::QML: + return &qmlModules_; + case Node::JS: + return &jsModules_; + default: + break; + } return 0; } /*! - Find the module node named \a name and return a pointer - to it. If a matching node is not found, return 0. + Returns a pointer to the collection named \a name of the + specified \a genus in this tree. If there is no matching + collection in this tree, 0 is returned. */ -ModuleNode* Tree::getModule(const QString& name) +CollectionNode* Tree::getCollection(const QString& name, Node::Genus genus) { - CNMap::const_iterator i = modules_.find(name); - if (i != modules_.end()) - return static_cast(i.value()); + CNMap* m = getCollectionMap(genus); + if (m) { + CNMap::const_iterator i = m->find(name); + if (i != m->end()) + return i.value(); + } return 0; } /*! - Find the QML module node named \a name and return a pointer - to it. If a matching node is not found, return 0. + Find the group, module, QML module, or JavaScript module + named \a name and return a pointer to that collection node. + \a genus specifies which kind of collection node you want. + If a collection node with the specified \a name and \a genus + is not found, a new one is created, and the pointer to the + new one is returned. + + If a new collection node is created, its parent is the tree + root, and the new collection node is marked \e{not seen}. + + \a genus must be specified, i.e. it must not be \c{DontCare}. + If it is \c{DontCare}, 0 is returned, which is a programming + error. */ -QmlModuleNode* Tree::getQmlModule(const QString& name) +CollectionNode* Tree::findCollection(const QString& name, Node::Genus genus) { - CNMap::const_iterator i = qmlModules_.find(name); - if (i != qmlModules_.end()) - return static_cast(i.value()); - return 0; + CNMap* m = getCollectionMap(genus); + if (!m) // error + return 0; + CNMap::const_iterator i = m->find(name); + if (i != m->end()) + return i.value(); + Node::Type t = Node::NoType; + switch (genus) { + case Node::DOC: + t = Node::Group; + break; + case Node::CPP: + t = Node::Module; + break; + case Node::QML: + t = Node::QmlModule; + break; + case Node::JS: + t = Node::QmlModule; + break; + default: + break; + } + CollectionNode* cn = new CollectionNode(t, root(), name, genus); + cn->markNotSeen(); + m->insert(name, cn); + return cn; } -/*! +/*! \fn CollectionNode* Tree::findGroup(const QString& name) Find the group node named \a name and return a pointer to it. If the group node is not found, add a new group node named \a name and return a pointer to the new one. @@ -1227,18 +1254,8 @@ QmlModuleNode* Tree::getQmlModule(const QString& name) If a new group node is added, its parent is the tree root, and the new group node is marked \e{not seen}. */ -GroupNode* Tree::findGroup(const QString& name) -{ - CNMap::const_iterator i = groups_.find(name); - if (i != groups_.end()) - return static_cast(i.value());; - GroupNode* gn = new GroupNode(root(), name); - gn->markNotSeen(); - groups_.insert(name, gn); - return gn; -} -/*! +/*! \fn CollectionNode* Tree::findModule(const QString& name) Find the module node named \a name and return a pointer to it. If a matching node is not found, add a new module node named \a name and return a pointer to that one. @@ -1246,77 +1263,56 @@ GroupNode* Tree::findGroup(const QString& name) If a new module node is added, its parent is the tree root, and the new module node is marked \e{not seen}. */ -ModuleNode* Tree::findModule(const QString& name) -{ - CNMap::const_iterator i = modules_.find(name); - if (i != modules_.end()) - return static_cast(i.value()); - ModuleNode* mn = new ModuleNode(root(), name); - mn->markNotSeen(); - modules_.insert(name, mn); - return mn; -} -/*! +/*! \fn CollectionNode* Tree::findQmlModule(const QString& name) Find the QML module node named \a name and return a pointer to it. If a matching node is not found, add a new QML module node named \a name and return a pointer to that one. If a new QML module node is added, its parent is the tree root, - and the new QML module node is marked \e{not seen}. + and the new node is marked \e{not seen}. */ -QmlModuleNode* Tree::findQmlModule(const QString& name) -{ - CNMap::const_iterator i = qmlModules_.find(name); - if (i != qmlModules_.end()) - return static_cast(i.value()); - QmlModuleNode* qmn = new QmlModuleNode(root(), name); - qmn->markNotSeen(); - qmn->setQmlModuleInfo(name); - qmlModules_.insert(name, qmn); - return qmn; -} -/*! +/*! \fn CollectionNode* Tree::findJsModule(const QString& name) + Find the JavaScript module named \a name and return a pointer + to it. If a matching node is not found, add a new JavaScript + module node named \a name and return a pointer to that one. + + If a new JavaScript module node is added, its parent is the + tree root, and the new node is marked \e{not seen}. + */ + +/*! \fn CollectionNode* Tree::addGroup(const QString& name) Looks up the group node named \a name in the collection of all group nodes. If a match is found, a pointer to the node is returned. Otherwise, a new group node named \a name is created and inserted into the collection, and the pointer to that node is returned. */ -GroupNode* Tree::addGroup(const QString& name) -{ - GroupNode* group = findGroup(name); - return group; -} -/*! +/*! \fn CollectionNode* Tree::addModule(const QString& name) Looks up the module node named \a name in the collection of all module nodes. If a match is found, a pointer to the node is returned. Otherwise, a new module node named \a name is created and inserted into the collection, and the pointer to that node is returned. */ -ModuleNode* Tree::addModule(const QString& name) -{ - ModuleNode* module = findModule(name); - return module; -} -/*! +/*! \fn CollectionNode* Tree::addQmlModule(const QString& name) Looks up the QML module node named \a name in the collection of all QML module nodes. If a match is found, a pointer to the node is returned. Otherwise, a new QML module node named \a name is created and inserted into the collection, and the pointer to that node is returned. */ -QmlModuleNode* Tree::addQmlModule(const QString& name) -{ - QStringList blankSplit = name.split(QLatin1Char(' ')); - QmlModuleNode* qmn = findQmlModule(blankSplit[0]); - qmn->setQmlModuleInfo(name); - return qmn; -} + +/*! \fn CollectionNode* Tree::addJsModule(const QString& name) + Looks up the JavaScript module node named \a name in the collection + of all JavaScript module nodes. If a match is found, a pointer to the + node is returned. Otherwise, a new JavaScrpt module node named \a name + is created and inserted into the collection, and the pointer + to that node is returned. + */ /*! Looks up the group node named \a name in the collection @@ -1327,14 +1323,14 @@ QmlModuleNode* Tree::addQmlModule(const QString& name) \a node is not changed by this function. Returns a pointer to the group node. */ -GroupNode* Tree::addToGroup(const QString& name, Node* node) +CollectionNode* Tree::addToGroup(const QString& name, Node* node) { - GroupNode* gn = findGroup(name); + CollectionNode* cn = findGroup(name); if (!node->isInternal()) { - gn->addMember(node); + cn->addMember(node); node->appendGroupName(name); } - return gn; + return cn; } /*! @@ -1344,12 +1340,12 @@ GroupNode* Tree::addToGroup(const QString& name, Node* node) Then append \a node to the module's members list. The parent of \a node is not changed by this function. Returns the module node. */ -ModuleNode* Tree::addToModule(const QString& name, Node* node) +CollectionNode* Tree::addToModule(const QString& name, Node* node) { - ModuleNode* mn = findModule(name); - mn->addMember(node); + CollectionNode* cn = findModule(name); + cn->addMember(node); node->setPhysicalModuleName(name); - return mn; + return cn; } /*! @@ -1358,7 +1354,7 @@ ModuleNode* Tree::addToModule(const QString& name, Node* node) list. The parent of \a node is not changed by this function. Returns the pointer to the QML module node. */ -QmlModuleNode* Tree::addToQmlModule(const QString& name, Node* node) +CollectionNode* Tree::addToQmlModule(const QString& name, Node* node) { QStringList qmid; QStringList dotSplit; @@ -1370,9 +1366,9 @@ QmlModuleNode* Tree::addToQmlModule(const QString& name, Node* node) qmid.append(blankSplit[0] + dotSplit[0]); } - QmlModuleNode* qmn = findQmlModule(blankSplit[0]); - qmn->addMember(node); - node->setQmlModule(qmn); + CollectionNode* cn = findQmlModule(blankSplit[0]); + cn->addMember(node); + node->setQmlModule(cn); if (node->isQmlType()) { QmlTypeNode* n = static_cast(node); for (int i=0; i 1) { + qmid.append(blankSplit[0] + blankSplit[1]); + dotSplit = blankSplit[1].split(QLatin1Char('.')); + qmid.append(blankSplit[0] + dotSplit[0]); + } + + CollectionNode* cn = findJsModule(blankSplit[0]); + cn->addMember(node); + node->setQmlModule(cn); + if (node->isJsType()) { + QmlTypeNode* n = static_cast(node); + for (int i=0; iname(); + insertQmlType(key, n); + } + } + return cn; } /*! diff --git a/src/tools/qdoc/tree.h b/src/tools/qdoc/tree.h index c499bce9c7..2e6f766770 100644 --- a/src/tools/qdoc/tree.h +++ b/src/tools/qdoc/tree.h @@ -80,7 +80,7 @@ struct TargetLoc }; typedef QMultiMap TargetMap; -typedef QMultiMap DocNodeMultiMap; +typedef QMultiMap DocumentNodeMultiMap; typedef QMap QmlTypeMap; typedef QMultiMap ExampleNodeMap; typedef QVector TargetList; @@ -144,7 +144,7 @@ class Tree int priority); void resolveTargets(InnerNode* root); const Node* findUnambiguousTarget(const QString& target, QString& ref) const; - const DocNode* findDocNodeByTitle(const QString& title) const; + const DocumentNode* findDocumentNodeByTitle(const QString& title) const; void addPropertyFunction(PropertyNode *property, const QString &funcName, @@ -167,34 +167,29 @@ class Tree NodeList allBaseClasses(const ClassNode *classe) const; QString refForAtom(const Atom* atom); + CNMap* getCollectionMap(Node::Genus genus); const CNMap& groups() const { return groups_; } const CNMap& modules() const { return modules_; } const CNMap& qmlModules() const { return qmlModules_; } - const CNMap& getCollections(Node::Type t) const { - if (t == Node::Group) - return groups_; - if (t == Node::Module) - return modules_; - return qmlModules_; - } + const CNMap& jsModules() const { return jsModules_; } - CollectionNode* getCorrespondingCollection(CollectionNode* cn); + CollectionNode* getCollection(const QString& name, Node::Genus genus); + CollectionNode* findCollection(const QString& name, Node::Genus genus); - GroupNode* getGroup(const QString& name); - ModuleNode* getModule(const QString& name); - QmlModuleNode* getQmlModule(const QString& name); + CollectionNode* findGroup(const QString& name) { return findCollection(name, Node::DOC); } + CollectionNode* findModule(const QString& name) { return findCollection(name, Node::CPP); } + CollectionNode* findQmlModule(const QString& name) { return findCollection(name, Node::QML); } + CollectionNode* findJsModule(const QString& name) { return findCollection(name, Node::JS); } - GroupNode* findGroup(const QString& name); - ModuleNode* findModule(const QString& name); - QmlModuleNode* findQmlModule(const QString& name); + CollectionNode* addGroup(const QString& name) { return findGroup(name); } + CollectionNode* addModule(const QString& name) { return findModule(name); } + CollectionNode* addQmlModule(const QString& name) { return findQmlModule(name); } + CollectionNode* addJsModule(const QString& name) { return findJsModule(name); } - GroupNode* addGroup(const QString& name); - ModuleNode* addModule(const QString& name); - QmlModuleNode* addQmlModule(const QString& name); - - GroupNode* addToGroup(const QString& name, Node* node); - ModuleNode* addToModule(const QString& name, Node* node); - QmlModuleNode* addToQmlModule(const QString& name, Node* node); + CollectionNode* addToGroup(const QString& name, Node* node); + CollectionNode* addToModule(const QString& name, Node* node); + CollectionNode* addToQmlModule(const QString& name, Node* node); + CollectionNode* addToJsModule(const QString& name, Node* node); QmlTypeNode* lookupQmlType(const QString& name) const { return qmlTypeMap_.value(name); } void insertQmlType(const QString& key, QmlTypeNode* n); @@ -231,12 +226,13 @@ private: QDocDatabase* qdb_; NamespaceNode root_; PropertyMap unresolvedPropertyMap; - DocNodeMultiMap docNodesByTitle_; + DocumentNodeMultiMap docNodesByTitle_; TargetMap nodesByTargetRef_; TargetMap nodesByTargetTitle_; CNMap groups_; CNMap modules_; CNMap qmlModules_; + CNMap jsModules_; QmlTypeMap qmlTypeMap_; ExampleNodeMap exampleNodeMap_; TargetListMap* targetListMap_; -- cgit v1.2.3 -- cgit v1.2.3 From 23e9b57e3d261f66168a8a28ccb8e5c886b4841f Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Thu, 19 Feb 2015 13:47:22 +0100 Subject: D-Bus system tray: properly check whether StatusNotifierHost available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "org.kde.StatusNotifierWatcher" is just a watcher/helper, whereas the actual systray object is "org.kde.StatusNotifierHost-$PID". The org.kde.StatusNotifierWatcher.IsStatusNotifierHostRegistered property can tell us whether there is an actual system tray. Also renamed the accessor to isStatusNotifierHostRegistered since we are checking for the host, and also because it can be confusing that it's a member of QDBusMenuConnection if the name isn't clear. See also KDE bug 339707 Change-Id: I218c5357b9cc5a62e5cc07abe980893b826f98f4 Reviewed-by: Martin Klapetek Reviewed-by: Jørgen Lind Reviewed-by: Dmitry Shachnev --- src/platformsupport/dbusmenu/qdbusmenuconnection.cpp | 10 +++++----- src/platformsupport/dbusmenu/qdbusmenuconnection_p.h | 4 ++-- src/platformsupport/dbustray/qdbustrayicon.cpp | 7 ++----- src/platformsupport/themes/genericunix/qgenericunixthemes.cpp | 2 +- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/platformsupport/dbusmenu/qdbusmenuconnection.cpp b/src/platformsupport/dbusmenu/qdbusmenuconnection.cpp index a8211f63ce..73793d7497 100644 --- a/src/platformsupport/dbusmenu/qdbusmenuconnection.cpp +++ b/src/platformsupport/dbusmenu/qdbusmenuconnection.cpp @@ -63,14 +63,14 @@ QDBusMenuConnection::QDBusMenuConnection(QObject *parent) : QObject(parent) , m_connection(QDBusConnection::sessionBus()) , m_dbusWatcher(new QDBusServiceWatcher(StatusNotifierWatcherService, m_connection, QDBusServiceWatcher::WatchForRegistration, this)) - , m_watcherRegistered(false) + , m_statusNotifierHostRegistered(false) { #ifndef QT_NO_SYSTEMTRAYICON - // Start monitoring if any known tray-related services are registered. - if (m_connection.interface()->isServiceRegistered(StatusNotifierWatcherService)) - m_watcherRegistered = true; + QDBusInterface systrayHost(StatusNotifierWatcherService, StatusNotifierWatcherPath, StatusNotifierWatcherService, m_connection); + if (systrayHost.isValid() && systrayHost.property("IsStatusNotifierHostRegistered").toBool()) + m_statusNotifierHostRegistered = true; else - qCDebug(qLcMenu) << "failed to find service" << StatusNotifierWatcherService; + qCDebug(qLcMenu) << "StatusNotifierHost is not registered"; #endif } diff --git a/src/platformsupport/dbusmenu/qdbusmenuconnection_p.h b/src/platformsupport/dbusmenu/qdbusmenuconnection_p.h index 377999c365..8d230bd3bf 100644 --- a/src/platformsupport/dbusmenu/qdbusmenuconnection_p.h +++ b/src/platformsupport/dbusmenu/qdbusmenuconnection_p.h @@ -63,7 +63,7 @@ class QDBusMenuConnection : public QObject public: QDBusMenuConnection(QObject *parent = 0); QDBusConnection connection() const { return m_connection; } - bool isWatcherRegistered() const { return m_watcherRegistered; } + bool isStatusNotifierHostRegistered() const { return m_statusNotifierHostRegistered; } #ifndef QT_NO_SYSTEMTRAYICON bool registerTrayIcon(QDBusTrayIcon *item); bool unregisterTrayIcon(QDBusTrayIcon *item); @@ -80,7 +80,7 @@ private Q_SLOTS: private: QDBusConnection m_connection; QDBusServiceWatcher *m_dbusWatcher; - bool m_watcherRegistered; + bool m_statusNotifierHostRegistered; }; QT_END_NAMESPACE diff --git a/src/platformsupport/dbustray/qdbustrayicon.cpp b/src/platformsupport/dbustray/qdbustrayicon.cpp index 18e72d852a..d85d29a5c7 100644 --- a/src/platformsupport/dbustray/qdbustrayicon.cpp +++ b/src/platformsupport/dbustray/qdbustrayicon.cpp @@ -281,11 +281,8 @@ void QDBusTrayIcon::notificationClosed(uint id, uint reason) bool QDBusTrayIcon::isSystemTrayAvailable() const { QDBusMenuConnection * conn = const_cast(this)->dBusConnection(); - - // If the KDE watcher service is registered, we must be on a desktop - // where a StatusNotifier-conforming system tray exists. - qCDebug(qLcTray) << conn->isWatcherRegistered(); - return conn->isWatcherRegistered(); + qCDebug(qLcTray) << conn->isStatusNotifierHostRegistered(); + return conn->isStatusNotifierHostRegistered(); } QT_END_NAMESPACE diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp index 3fffec0dfd..ba328bfb41 100644 --- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp +++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp @@ -98,7 +98,7 @@ static bool isDBusTrayAvailable() { static bool dbusTrayAvailableKnown = false; if (!dbusTrayAvailableKnown) { QDBusMenuConnection conn; - if (conn.isWatcherRegistered()) + if (conn.isStatusNotifierHostRegistered()) dbusTrayAvailable = true; dbusTrayAvailableKnown = true; qCDebug(qLcTray) << "D-Bus tray available:" << dbusTrayAvailable; -- cgit v1.2.3 From 26a05fc0976220250442c4e7eaaa414e2b8602f3 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Thu, 19 Feb 2015 13:10:21 +0100 Subject: xcb: remove stray QDBusMenuConnection in QXcbNativeInterface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was unintentionally left in from an earlier version of 38abd653774aa0b3c5cdfd9a8b78619605230726 Change-Id: I7b0b19ed313493562874642cae8865bb0783e366 Reviewed-by: Daniel Molkentin Reviewed-by: Jørgen Lind --- src/plugins/platforms/xcb/qxcbnativeinterface.cpp | 3 +-- src/plugins/platforms/xcb/qxcbnativeinterface.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp index 95db0c56c1..5f322108a5 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp @@ -86,8 +86,7 @@ static int resourceType(const QByteArray &key) QXcbNativeInterface::QXcbNativeInterface() : m_genericEventFilterType(QByteArrayLiteral("xcb_generic_event_t")), m_sysTraySelectionAtom(XCB_ATOM_NONE), - m_systrayVisualId(XCB_NONE), - m_dbusTrayConnection(Q_NULLPTR) + m_systrayVisualId(XCB_NONE) { } diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.h b/src/plugins/platforms/xcb/qxcbnativeinterface.h index 388d774853..64da388258 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.h +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.h @@ -121,7 +121,6 @@ private: xcb_atom_t m_sysTraySelectionAtom; xcb_visualid_t m_systrayVisualId; - QDBusMenuConnection *m_dbusTrayConnection; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); -- cgit v1.2.3 From bc20d794cfddcc34d44a42217aabda1302972cf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lisandro=20Dami=C3=A1n=20Nicanor=20P=C3=A9rez=20Meyer?= Date: Thu, 19 Feb 2015 00:07:28 -0300 Subject: Fix typo: properly write endianness. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I5240f6eef0eef85cbc6a9107f047f36e97b9a060 Reviewed-by: Thiago Macieira Reviewed-by: Lisandro Damián Nicanor Pérez Meyer Reviewed-by: Dmitry Shachnev --- src/corelib/plugin/qelfparser_p.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/plugin/qelfparser_p.cpp b/src/corelib/plugin/qelfparser_p.cpp index fcc3820ea7..d93be439e0 100644 --- a/src/corelib/plugin/qelfparser_p.cpp +++ b/src/corelib/plugin/qelfparser_p.cpp @@ -94,7 +94,7 @@ int QElfParser::parse(const char *dataStart, ulong fdlen, const QString &library // endian if (data[5] == 0) { if (lib) - lib->errorString = QLibrary::tr("'%1' is an invalid ELF object (%2)").arg(library).arg(QLatin1String("odd endianess")); + lib->errorString = QLibrary::tr("'%1' is an invalid ELF object (%2)").arg(library).arg(QLatin1String("odd endianness")); return Corrupt; } m_endian = (data[5] == 1 ? ElfLittleEndian : ElfBigEndian); -- cgit v1.2.3 From 9bf8b2a412b77fa01e88c3f9ad9a9e7792cd4ac5 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 16 Feb 2015 15:46:55 +0100 Subject: Do not attempt to unregister an unregistered dbus service If a QSystemTrayIcon is created but never shown, it will trigger a warning on exit when it fails to unregister. This patch ensures we only try to unregister if the service was registered in the first place. Change-Id: I0e245d19be55c58aea180dbcbe5215e738d05280 Reviewed-by: Shawn Rutledge --- src/platformsupport/dbustray/qdbustrayicon.cpp | 7 +++++-- src/platformsupport/dbustray/qdbustrayicon_p.h | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/platformsupport/dbustray/qdbustrayicon.cpp b/src/platformsupport/dbustray/qdbustrayicon.cpp index d85d29a5c7..61849024da 100644 --- a/src/platformsupport/dbustray/qdbustrayicon.cpp +++ b/src/platformsupport/dbustray/qdbustrayicon.cpp @@ -77,6 +77,7 @@ QDBusTrayIcon::QDBusTrayIcon() , m_status(m_defaultStatus) , m_tempIcon(Q_NULLPTR) , m_tempAttentionIcon(Q_NULLPTR) + , m_registered(false) { qCDebug(qLcTray); if (instanceCount == 1) { @@ -101,15 +102,17 @@ QDBusTrayIcon::~QDBusTrayIcon() void QDBusTrayIcon::init() { qCDebug(qLcTray) << "registering" << m_instanceId; - dBusConnection()->registerTrayIcon(this); + m_registered = dBusConnection()->registerTrayIcon(this); } void QDBusTrayIcon::cleanup() { qCDebug(qLcTray) << "unregistering" << m_instanceId; - dBusConnection()->unregisterTrayIcon(this); + if (m_registered) + dBusConnection()->unregisterTrayIcon(this); delete m_dbusConnection; m_dbusConnection = Q_NULLPTR; + m_registered = false; } void QDBusTrayIcon::activate(int x, int y) diff --git a/src/platformsupport/dbustray/qdbustrayicon_p.h b/src/platformsupport/dbustray/qdbustrayicon_p.h index d3d1c5bb8f..78dfae7c02 100644 --- a/src/platformsupport/dbustray/qdbustrayicon_p.h +++ b/src/platformsupport/dbustray/qdbustrayicon_p.h @@ -156,6 +156,7 @@ private: QTimer m_attentionTimer; bool m_isRequestingAttention; bool m_hasMenu; + bool m_registered; }; QT_END_NAMESPACE -- cgit v1.2.3 From 0bcd06719377416b700ee0ace5554b1a35e9be3b Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 14 Feb 2015 21:35:43 -0800 Subject: Fix warning-as-error about member not used with Clang 3.6 Found by Clang 3.6 on Linux: qxcbeglcontext.h:91:21: error: private field 'm_connection' is not used [-Werror,-Wunused-private-field] Change-Id: I1a800c709d3543699131ffff13c2fcf8cf013175 Reviewed-by: Shawn Rutledge --- src/plugins/platforms/xcb/qxcbconnection.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index 2a4cfea62d..e3d9766a4b 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -661,7 +661,7 @@ cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, #else #define Q_XCB_CALL(x) x #define Q_XCB_CALL2(x, connection) x -#define Q_XCB_NOOP(c) +#define Q_XCB_NOOP(c) (void)c; #endif QT_END_NAMESPACE -- cgit v1.2.3 From d3893d805436c3541b30e71035de61e94dedf936 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Thu, 19 Feb 2015 07:18:45 +0100 Subject: Don't deploy networkmanager/connman/generic bearer on Android Android has its own plugin for bearer management Change-Id: I85c40ef7ae9ac5f9509123db11fe6f3d7a71604b Reviewed-by: Lorn Potter --- src/plugins/bearer/bearer.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/bearer/bearer.pro b/src/plugins/bearer/bearer.pro index e52df24857..7637bf1f5e 100644 --- a/src/plugins/bearer/bearer.pro +++ b/src/plugins/bearer/bearer.pro @@ -1,6 +1,6 @@ TEMPLATE = subdirs -linux*:qtHaveModule(dbus) { +!android:linux*:qtHaveModule(dbus) { SUBDIRS += generic SUBDIRS += connman networkmanager } -- cgit v1.2.3 From 7e2ef1fd219b57916525c4c5cd5b5750f9fd74fa Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Wed, 11 Feb 2015 16:51:34 -0200 Subject: Remove BlackBerry PlayBook support. Reasons: - the PlayBook NDK is old and its compiler does not keep up with newest C++11 improvements inside Qt code. - the PlayBook NDK diverges considerably from the standard BB10 NDK, making it non-trivial to keep a common codebase. - It's a defunct platform. - Maintenance time is limited. [ChangeLog][Platform Specific Changes] Removed BlackBerry PlayBook support. Change-Id: Ia338aff55f4e4b747ebdecb0e1463a369a656c03 Reviewed-by: Thiago Macieira Reviewed-by: Bernd Weimer Reviewed-by: Rafael Roquetto --- .../blackberry-playbook-armle-v7-qcc/qmake.conf | 8 - .../qplatformdefs.h | 34 --- .../devices/blackberry-playbook-x86-qcc/qmake.conf | 8 - .../blackberry-playbook-x86-qcc/qplatformdefs.h | 34 --- src/corelib/kernel/kernel.pri | 2 +- src/network/bearer/qnetworkconfiguration.cpp | 7 - src/network/ssl/qsslsocket.cpp | 1 - src/plugins/platforms/qnx/qnx.pro | 18 +- src/plugins/platforms/qnx/qqnxbpseventfilter.cpp | 33 --- src/plugins/platforms/qnx/qqnxbpseventfilter.h | 5 - src/plugins/platforms/qnx/qqnxfiledialoghelper.h | 21 +- .../qnx/qqnxfiledialoghelper_playbook.cpp | 312 --------------------- src/plugins/platforms/qnx/qqnxfilepicker.cpp | 6 - src/plugins/platforms/qnx/qqnxscreen.cpp | 2 +- .../platforms/qnx/qqnxvirtualkeyboardbps.cpp | 8 +- src/plugins/platforms/qnx/qqnxwindow.cpp | 6 +- tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 7 +- 17 files changed, 18 insertions(+), 494 deletions(-) delete mode 100644 mkspecs/devices/blackberry-playbook-armle-v7-qcc/qmake.conf delete mode 100644 mkspecs/devices/blackberry-playbook-armle-v7-qcc/qplatformdefs.h delete mode 100644 mkspecs/devices/blackberry-playbook-x86-qcc/qmake.conf delete mode 100644 mkspecs/devices/blackberry-playbook-x86-qcc/qplatformdefs.h delete mode 100644 src/plugins/platforms/qnx/qqnxfiledialoghelper_playbook.cpp diff --git a/mkspecs/devices/blackberry-playbook-armle-v7-qcc/qmake.conf b/mkspecs/devices/blackberry-playbook-armle-v7-qcc/qmake.conf deleted file mode 100644 index d14a5d644a..0000000000 --- a/mkspecs/devices/blackberry-playbook-armle-v7-qcc/qmake.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# qmake configuration for the Blackberry Playbook armle-v7 -# - -include(../../blackberry-armle-v7-qcc/qmake.conf) - -DEFINES += Q_OS_BLACKBERRY_TABLET -CONFIG += blackberry-playbook diff --git a/mkspecs/devices/blackberry-playbook-armle-v7-qcc/qplatformdefs.h b/mkspecs/devices/blackberry-playbook-armle-v7-qcc/qplatformdefs.h deleted file mode 100644 index 03afc96a62..0000000000 --- a/mkspecs/devices/blackberry-playbook-armle-v7-qcc/qplatformdefs.h +++ /dev/null @@ -1,34 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Klarälvdalens Datakonsult AB -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "../../blackberry-armle-v7-qcc/qplatformdefs.h" diff --git a/mkspecs/devices/blackberry-playbook-x86-qcc/qmake.conf b/mkspecs/devices/blackberry-playbook-x86-qcc/qmake.conf deleted file mode 100644 index ed9f7f33c7..0000000000 --- a/mkspecs/devices/blackberry-playbook-x86-qcc/qmake.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# qmake configuration for the Blackberry Playbook x86 -# - -include(../../blackberry-x86-qcc/qmake.conf) - -DEFINES += Q_OS_BLACKBERRY_TABLET -CONFIG += blackberry-playbook diff --git a/mkspecs/devices/blackberry-playbook-x86-qcc/qplatformdefs.h b/mkspecs/devices/blackberry-playbook-x86-qcc/qplatformdefs.h deleted file mode 100644 index c44bd6580a..0000000000 --- a/mkspecs/devices/blackberry-playbook-x86-qcc/qplatformdefs.h +++ /dev/null @@ -1,34 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Klarälvdalens Datakonsult AB -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "../../blackberry-x86-qcc/qplatformdefs.h" diff --git a/src/corelib/kernel/kernel.pri b/src/corelib/kernel/kernel.pri index 87367a9ee7..dabbb2dbbe 100644 --- a/src/corelib/kernel/kernel.pri +++ b/src/corelib/kernel/kernel.pri @@ -175,7 +175,7 @@ blackberry { kernel/qeventdispatcher_blackberry_p.h } -qqnx_pps:!blackberry-playbook { +qqnx_pps { LIBS_PRIVATE += -lpps SOURCES += \ kernel/qppsattribute.cpp \ diff --git a/src/network/bearer/qnetworkconfiguration.cpp b/src/network/bearer/qnetworkconfiguration.cpp index 1192a240fb..6b56d3ec88 100644 --- a/src/network/bearer/qnetworkconfiguration.cpp +++ b/src/network/bearer/qnetworkconfiguration.cpp @@ -205,13 +205,6 @@ QT_BEGIN_NAMESPACE #ifdef Q_OS_BLACKBERRY static const char cellularStatusFile[] = "/pps/services/radioctrl/modem0/status_public"; -#ifdef Q_OS_BLACKBERRY_TABLET -static bool pps_decoder_is_integer(pps_decoder_t *decoder, const char *name) -{ - return (pps_decoder_type(decoder, name) == PPS_TYPE_NUMBER); -} -#endif // Q_OS_BLACKBERRY_TABLET - static QNetworkConfiguration::BearerType cellularStatus() { QNetworkConfiguration::BearerType ret = QNetworkConfiguration::BearerUnknown; diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index db2e16edb1..508d300d42 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -2668,7 +2668,6 @@ QList QSslSocketPrivate::unixRootCertDirectories() << "/usr/local/ssl/" // Normal OpenSSL Tarball << "/var/ssl/certs/" // AIX << "/usr/local/ssl/certs/" // Solaris - << "/var/certmgr/web/user_trusted/" // BlackBerry Playbook << "/etc/openssl/certs/" // BlackBerry << "/opt/openssl/certs/"; // HP-UX } diff --git a/src/plugins/platforms/qnx/qnx.pro b/src/plugins/platforms/qnx/qnx.pro index b5c6b48931..95a8e44cb8 100644 --- a/src/plugins/platforms/qnx/qnx.pro +++ b/src/plugins/platforms/qnx/qnx.pro @@ -105,17 +105,13 @@ CONFIG(blackberry) { LIBS += -lbps } -CONFIG(blackberry-playbook) { - SOURCES += qqnxfiledialoghelper_playbook.cpp -} else { - CONFIG(blackberry) { - SOURCES += qqnxfiledialoghelper_bb10.cpp \ - qqnxfilepicker.cpp \ - qqnxnavigatorcover.cpp - - HEADERS += qqnxfilepicker.h \ - qqnxnavigatorcover.h - } +CONFIG(blackberry) { + SOURCES += qqnxfiledialoghelper_bb10.cpp \ + qqnxfilepicker.cpp \ + qqnxnavigatorcover.cpp + + HEADERS += qqnxfilepicker.h \ + qqnxnavigatorcover.h } CONFIG(qqnx_pps) { diff --git a/src/plugins/platforms/qnx/qqnxbpseventfilter.cpp b/src/plugins/platforms/qnx/qqnxbpseventfilter.cpp index f4258017e3..3950681c5e 100644 --- a/src/plugins/platforms/qnx/qqnxbpseventfilter.cpp +++ b/src/plugins/platforms/qnx/qqnxbpseventfilter.cpp @@ -119,24 +119,6 @@ void QQnxBpsEventFilter::unregisterForScreenEvents(QQnxScreen *screen) qWarning("QQNX: failed to unregister for screen events on screen %p", screen->nativeContext()); } -#if defined(Q_OS_BLACKBERRY_TABLET) -void QQnxBpsEventFilter::registerForDialogEvents(QQnxFileDialogHelper *dialog) -{ - if (dialog_request_events(0) != BPS_SUCCESS) - qWarning("QQNX: failed to register for dialog events"); - dialog_instance_t nativeDialog = dialog->nativeDialog(); - if (!m_dialogMapper.contains(nativeDialog)) - m_dialogMapper.insert(nativeDialog, dialog); -} - -void QQnxBpsEventFilter::unregisterForDialogEvents(QQnxFileDialogHelper *dialog) -{ - int count = m_dialogMapper.remove(dialog->nativeDialog()); - if (count == 0) - qWarning("QQNX: attempting to unregister dialog that was not registered"); -} -#endif // Q_OS_BLACKBERRY_TABLET - bool QQnxBpsEventFilter::nativeEventFilter(const QByteArray &eventType, void *message, long *result) { Q_UNUSED(eventType); @@ -155,15 +137,6 @@ bool QQnxBpsEventFilter::nativeEventFilter(const QByteArray &eventType, void *me return m_screenEventHandler->handleEvent(screenEvent); } -#if defined(Q_OS_BLACKBERRY_TABLET) - if (eventDomain == dialog_get_domain()) { - dialog_instance_t nativeDialog = dialog_event_get_dialog_instance(event); - QQnxFileDialogHelper *dialog = m_dialogMapper.value(nativeDialog, 0); - if (dialog) - return dialog->handleEvent(event); - } -#endif - if (eventDomain == navigator_get_domain()) return handleNavigatorEvent(event); @@ -218,14 +191,8 @@ bool QQnxBpsEventFilter::handleNavigatorEvent(bps_event_t *event) break; case NAVIGATOR_WINDOW_THUMBNAIL: m_navigatorEventHandler->handleWindowGroupStateChanged(id, Qt::WindowMinimized); -#if defined(Q_OS_BLACKBERRY_TABLET) - m_navigatorEventHandler->handleWindowGroupActivated(id); -#endif break; case NAVIGATOR_WINDOW_INVISIBLE: -#if defined(Q_OS_BLACKBERRY_TABLET) - m_navigatorEventHandler->handleWindowGroupDeactivated(id); -#endif break; } diff --git a/src/plugins/platforms/qnx/qqnxbpseventfilter.h b/src/plugins/platforms/qnx/qqnxbpseventfilter.h index 4fe28e909f..f1d67848e8 100644 --- a/src/plugins/platforms/qnx/qqnxbpseventfilter.h +++ b/src/plugins/platforms/qnx/qqnxbpseventfilter.h @@ -65,11 +65,6 @@ public: void registerForScreenEvents(QQnxScreen *screen); void unregisterForScreenEvents(QQnxScreen *screen); -#ifdef Q_OS_BLACKBERRY_TABLET - void registerForDialogEvents(QQnxFileDialogHelper *dialog); - void unregisterForDialogEvents(QQnxFileDialogHelper *dialog); -#endif - private: bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) Q_DECL_OVERRIDE; diff --git a/src/plugins/platforms/qnx/qqnxfiledialoghelper.h b/src/plugins/platforms/qnx/qqnxfiledialoghelper.h index 4c8a4fbd50..76cceafcfe 100644 --- a/src/plugins/platforms/qnx/qqnxfiledialoghelper.h +++ b/src/plugins/platforms/qnx/qqnxfiledialoghelper.h @@ -41,13 +41,7 @@ QT_BEGIN_NAMESPACE class QQnxIntegration; -#if defined(Q_OS_BLACKBERRY_TABLET) -#include -#define NativeDialogPtr dialog_instance_t -#else class QQnxFilePicker; -#define NativeDialogPtr QQnxFilePicker * -#endif class QQnxFileDialogHelper : public QPlatformFileDialogHelper { @@ -56,10 +50,6 @@ public: explicit QQnxFileDialogHelper(const QQnxIntegration *); ~QQnxFileDialogHelper(); -#if defined(Q_OS_BLACKBERRY_TABLET) - bool handleEvent(bps_event_t *event); -#endif - void exec(); bool show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent); @@ -74,29 +64,22 @@ public: void selectNameFilter(const QString &filter); QString selectedNameFilter() const; - NativeDialogPtr nativeDialog() const { return m_dialog; } + QQnxFilePicker *nativeDialog() const { return m_dialog; } Q_SIGNALS: void dialogClosed(); private Q_SLOTS: -#if !defined(Q_OS_BLACKBERRY_TABLET) void emitSignals(); -#endif private: void setNameFilter(const QString &filter); void setNameFilters(const QStringList &filters); const QQnxIntegration *m_integration; - NativeDialogPtr m_dialog; + QQnxFilePicker *m_dialog; QFileDialogOptions::AcceptMode m_acceptMode; QString m_selectedFilter; - -#if defined(Q_OS_BLACKBERRY_TABLET) - QPlatformDialogHelper::DialogCode m_result; - QList m_paths; -#endif }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/qnx/qqnxfiledialoghelper_playbook.cpp b/src/plugins/platforms/qnx/qqnxfiledialoghelper_playbook.cpp deleted file mode 100644 index 699ca97527..0000000000 --- a/src/plugins/platforms/qnx/qqnxfiledialoghelper_playbook.cpp +++ /dev/null @@ -1,312 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2012 Research In Motion -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qqnxfiledialoghelper.h" - -#include "qqnxbpseventfilter.h" -#include "qqnxscreen.h" -#include "qqnxintegration.h" - -#include -#include -#include -#include -#include - -#if defined(QQNXFILEDIALOGHELPER_DEBUG) -#define qFileDialogHelperDebug qDebug -#else -#define qFileDialogHelperDebug QT_NO_QDEBUG_MACRO -#endif - -QT_BEGIN_NAMESPACE - -QQnxFileDialogHelper::QQnxFileDialogHelper(const QQnxIntegration *integration) - : QPlatformFileDialogHelper(), - m_integration(integration), - m_dialog(0), - m_acceptMode(QFileDialogOptions::AcceptOpen), - m_selectedFilter(), - m_result(QPlatformDialogHelper::Rejected), - m_paths() -{ -} - -QQnxFileDialogHelper::~QQnxFileDialogHelper() -{ - if (m_dialog) - dialog_destroy(m_dialog); -} - -bool QQnxFileDialogHelper::handleEvent(bps_event_t *event) -{ - qFileDialogHelperDebug() << Q_FUNC_INFO; - - // Check dialog event response type (OK vs CANCEL) - // CANCEL => index = 0 - // OK => index = 1 - int index = dialog_event_get_selected_index(event); - qFileDialogHelperDebug() << "Index =" << index; - if (index == 1) { - m_result = QPlatformDialogHelper::Accepted; - - if (m_acceptMode == QFileDialogOptions::AcceptOpen) { - // File open dialog - - // ###TODO Check that this actually gets multiple paths and cleans up properly - char **filePaths = 0; - int pathCount = 0; - int result = dialog_event_get_filebrowse_filepaths(event, &filePaths, &pathCount); - if (result != BPS_SUCCESS) { - qWarning() << "Could not get paths from native file dialog"; - return false; - } - - for (int i = 0; i < pathCount; ++i) { - QString path = QFile::decodeName(filePaths[i]); - m_paths.append(QUrl::fromLocalFile(path)); - qFileDialogHelperDebug() << "path =" << path; - } - - bps_free(filePaths); - } else { - // File save dialog - const char *filePath = dialog_event_get_filesave_filepath(event); - QString path = QFile::decodeName(filePath); - qFileDialogHelperDebug() << "path =" << path; - m_paths.append(QUrl::fromLocalFile(path)); - } - } else { // Cancel - m_result = QPlatformDialogHelper::Rejected; - } - - Q_EMIT dialogClosed(); - - return true; -} - -void QQnxFileDialogHelper::exec() -{ - qFileDialogHelperDebug() << Q_FUNC_INFO; - - // Clear any previous results - m_paths.clear(); - - QEventLoop loop; - connect(this, SIGNAL(dialogClosed()), &loop, SLOT(quit())); - loop.exec(); - - if (m_result == QPlatformDialogHelper::Accepted) - Q_EMIT accept(); - else - Q_EMIT reject(); -} - -bool QQnxFileDialogHelper::show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent) -{ - Q_UNUSED(flags); - qFileDialogHelperDebug() << Q_FUNC_INFO; - - QQnxBpsEventFilter *eventFilter = m_integration->bpsEventFilter(); - // We *really* need the bps event filter ;) - if (!eventFilter) - return false; - - // Native dialogs can only handle application modal use cases so far - if (modality != Qt::ApplicationModal) - return false; - - // Tear down any existing dialog and start again as dialog mode may have changed - if (m_dialog) { - dialog_destroy(m_dialog); - m_dialog = 0; - } - - // Create dialog - const QSharedPointer &opts = options(); - if (opts->acceptMode() == QFileDialogOptions::AcceptOpen) { - if (dialog_create_filebrowse(&m_dialog) != BPS_SUCCESS) { - qWarning("dialog_create_filebrowse failed"); - return false; - } - - // Select one or many files? - bool multiSelect = (opts->fileMode() == QFileDialogOptions::ExistingFiles); - dialog_set_filebrowse_multiselect(m_dialog, multiSelect); - - // Set the actual list of extensions - if (!opts->nameFilters().isEmpty()) { - qFileDialogHelperDebug() << "nameFilters =" << opts->nameFilters(); - setNameFilter(opts->nameFilters().first()); - } else { - QString defaultNameFilter = QStringLiteral("*.*"); - setNameFilter(defaultNameFilter); - } - } else { - if (dialog_create_filesave(&m_dialog) != BPS_SUCCESS) { - qWarning("dialog_create_filesave failed"); - return false; - } - - // Maybe pre-select a filename - if (!opts->initiallySelectedFiles().isEmpty()) { - QString fileName = opts->initiallySelectedFiles().first().toLocalFile(); - dialog_set_filesave_filename(m_dialog, QFile::encodeName(fileName).constData()); - } - - // Add OK and Cancel buttons. We add the buttons in the order "CANCEL" followed by "OK - // such that they have indices matching the buttons on the file open dialog which - // is automatically populated with buttons. - if (dialog_add_button(m_dialog, tr("CANCEL").toLocal8Bit().constData(), true, 0, true) != BPS_SUCCESS) { - qWarning("dialog_add_button failed"); - return false; - } - - if (dialog_add_button(m_dialog, tr("OK").toLocal8Bit().constData(), true, 0, true) != BPS_SUCCESS) { - qWarning("dialog_add_button failed"); - return false; - } - } - - // Cache the accept mode so we know which functions to use to get the results back - m_acceptMode = opts->acceptMode(); - - // Set the libscreen window group and common properties - - QQnxScreen *nativeScreen = parent ? static_cast(parent->screen()->handle()) : - m_integration->primaryDisplay(); - Q_ASSERT(nativeScreen); - dialog_set_group_id(m_dialog, nativeScreen->windowGroupName()); - dialog_set_title_text(m_dialog, opts->windowTitle().toLocal8Bit().constData()); - - // Register ourselves for dialog domain events from bps - eventFilter->registerForDialogEvents(this); - - // Show the dialog - dialog_show(m_dialog); - - return true; -} - -void QQnxFileDialogHelper::hide() -{ - qFileDialogHelperDebug() << Q_FUNC_INFO; - if (!m_dialog) - return; - dialog_cancel(m_dialog); -} - -bool QQnxFileDialogHelper::defaultNameFilterDisables() const -{ - qFileDialogHelperDebug() << Q_FUNC_INFO; - return false; -} - -void QQnxFileDialogHelper::setDirectory(const QUrl &directory) -{ - qFileDialogHelperDebug() << Q_FUNC_INFO << "directory =" << directory; - // No native API for setting the directory(!). The best we can do is to - // set it as the file name but even then only with a file save dialog. - if (m_dialog && m_acceptMode == QFileDialogOptions::AcceptSave) - dialog_set_filesave_filename(m_dialog, QFile::encodeName(directory.toLocalFile()).constData()); -} - -QUrl QQnxFileDialogHelper::directory() const -{ - qFileDialogHelperDebug() << Q_FUNC_INFO; - return m_paths.first(); -} - -void QQnxFileDialogHelper::selectFile(const QUrl &fileName) -{ - qFileDialogHelperDebug() << Q_FUNC_INFO << "filename =" << fileName; - if (m_dialog && m_acceptMode == QFileDialogOptions::AcceptSave) - dialog_set_filesave_filename(m_dialog, QFile::encodeName(fileName.toLocalFile()).constData()); -} - -QList QQnxFileDialogHelper::selectedFiles() const -{ - qFileDialogHelperDebug() << Q_FUNC_INFO; - return m_paths; -} - -void QQnxFileDialogHelper::setFilter() -{ - // No native api to support setting a filter from QDir::Filters - qFileDialogHelperDebug() << Q_FUNC_INFO; -} - -void QQnxFileDialogHelper::selectNameFilter(const QString &filter) -{ - qFileDialogHelperDebug() << Q_FUNC_INFO << "filter =" << filter; - setNameFilter(filter); -} - -QString QQnxFileDialogHelper::selectedNameFilter() const -{ - // For now there is no way for the user to change the selected filter - // so this just reflects what the developer has set programmatically. - qFileDialogHelperDebug() << Q_FUNC_INFO; - return m_selectedFilter; -} - -void QQnxFileDialogHelper::setNameFilter(const QString &filter) -{ - qFileDialogHelperDebug() << Q_FUNC_INFO << "filter =" << filter; - setNameFilters(QPlatformFileDialogHelper::cleanFilterList(filter)); -} - -void QQnxFileDialogHelper::setNameFilters(const QStringList &filters) -{ - qFileDialogHelperDebug() << Q_FUNC_INFO << "filters =" << filters; - - Q_ASSERT(!filters.isEmpty()); - - char **globs = new char*[filters.size()]; - for (int i = 0; i < filters.size(); ++i) { - QByteArray glob = filters.at(i).toLocal8Bit(); - globs[i] = new char[glob.length()]; - strcpy(globs[i], glob.constData()); - } - - // Set the filters - dialog_set_filebrowse_filter(m_dialog, const_cast(globs), filters.size()); - m_selectedFilter = filters.first(); - - // Cleanup - for (int i = 0; i < filters.size(); ++i) - delete[] globs[i]; - delete[] globs; -} - -QT_END_NAMESPACE diff --git a/src/plugins/platforms/qnx/qqnxfilepicker.cpp b/src/plugins/platforms/qnx/qqnxfilepicker.cpp index cce7c44823..96ca531899 100644 --- a/src/plugins/platforms/qnx/qqnxfilepicker.cpp +++ b/src/plugins/platforms/qnx/qqnxfilepicker.cpp @@ -127,13 +127,7 @@ void QQnxFilePicker::open() map[QStringLiteral("Filter")] = m_filters.join(QLatin1Char(';')); QByteArray ppsData; -#if defined(Q_OS_BLACKBERRY_TABLET) - QJsonDocument document; - document.setObject(QJsonObject::fromVariantMap(map)); - ppsData = document.toJson(QJsonDocument::Compact); -#else ppsData = QPpsObject::encode(map); -#endif errorCode = navigator_invoke_invocation_set_data(m_invocationHandle, ppsData.constData(), ppsData.size()); if (errorCode != BPS_SUCCESS) { diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp index 7b7de01c82..85c7a91dec 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.cpp +++ b/src/plugins/platforms/qnx/qqnxscreen.cpp @@ -585,7 +585,7 @@ void QQnxScreen::addWindow(QQnxWindow *window) m_childWindows.push_back(window); updateHierarchy(); } else { -#if defined(Q_OS_BLACKBERRY) && !defined(Q_OS_BLACKBERRY_TABLET) +#if defined(Q_OS_BLACKBERRY) m_coverWindow = window; #endif } diff --git a/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp b/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp index 68be0c98cf..3d749b486d 100644 --- a/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp +++ b/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp @@ -38,7 +38,7 @@ #include #include #include -#if defined(Q_OS_BLACKBERRY) && !defined(Q_OS_BLACKBERRY_TABLET) +#if defined(Q_OS_BLACKBERRY) #include #endif @@ -118,21 +118,17 @@ virtualkeyboard_layout_t QQnxVirtualKeyboardBps::keyboardLayout() const return VIRTUALKEYBOARD_LAYOUT_WEB; case NumPunc: return VIRTUALKEYBOARD_LAYOUT_NUM_PUNC; -#ifndef Q_OS_BLACKBERRY_TABLET case Number: return VIRTUALKEYBOARD_LAYOUT_NUMBER; -#endif case Symbol: return VIRTUALKEYBOARD_LAYOUT_SYMBOL; case Phone: return VIRTUALKEYBOARD_LAYOUT_PHONE; case Pin: return VIRTUALKEYBOARD_LAYOUT_PIN; -#ifndef Q_OS_BLACKBERRY_TABLET case Password: return VIRTUALKEYBOARD_LAYOUT_PASSWORD; -#endif -#if defined(Q_OS_BLACKBERRY) && !defined(Q_OS_BLACKBERRY_TABLET) +#if defined(Q_OS_BLACKBERRY) #if BBNDK_VERSION_AT_LEAST(10, 2, 1) case Alphanumeric: return VIRTUALKEYBOARD_LAYOUT_ALPHANUMERIC; diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp index 19e6991a68..3f92bcbc01 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxwindow.cpp @@ -48,9 +48,7 @@ #include #if defined(Q_OS_BLACKBERRY) -#if !defined(Q_OS_BLACKBERRY_TABLET) #include "qqnxnavigatorcover.h" -#endif #include #include #endif @@ -635,7 +633,7 @@ QQnxWindow *QQnxWindow::findWindow(screen_window_t windowHandle) void QQnxWindow::minimize() { -#if defined(Q_OS_BLACKBERRY) && !defined(Q_OS_BLACKBERRY_TABLET) +#if defined(Q_OS_BLACKBERRY) qWindowDebug() << Q_FUNC_INFO; pps_encoder_t encoder; @@ -689,7 +687,7 @@ void QQnxWindow::initWindow() setScreen(platformScreen); if (window()->type() == Qt::CoverWindow) { -#if defined(Q_OS_BLACKBERRY) && !defined(Q_OS_BLACKBERRY_TABLET) +#if defined(Q_OS_BLACKBERRY) if (platformScreen->rootWindow()) { screen_set_window_property_pv(m_screen->rootWindow()->nativeHandle(), SCREEN_PROPERTY_ALTERNATE_WINDOW, (void**)&m_window); diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 8775df84c6..587fa250c4 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -1498,8 +1498,7 @@ void tst_QWidget::mapFromAndTo() subWindow2->setGeometry(75, 75, 100, 100); subSubWindow->setGeometry(10, 10, 10, 10); -#if !defined(Q_OS_WINCE) && !defined(Q_OS_QNX) \ - || (defined(Q_OS_BLACKBERRY) && !defined(Q_OS_BLACKBERRY_TABLET)) +#if !defined(Q_OS_WINCE) && !defined(Q_OS_QNX) || defined(Q_OS_BLACKBERRY) //update visibility if (windowMinimized) { if (!windowHidden) { @@ -7342,7 +7341,7 @@ void tst_QWidget::updateWhileMinimized() { if (m_platform == QStringLiteral("wayland")) QSKIP("Wayland: This fails. Figure out why."); -#if defined(Q_OS_QNX) && (!defined(Q_OS_BLACKBERRY) || defined(Q_OS_BLACKBERRY_TABLET)) +#if defined(Q_OS_QNX) && !defined(Q_OS_BLACKBERRY) QSKIP("Platform does not support showMinimized()"); #endif UpdateWidget widget; @@ -7897,7 +7896,7 @@ void tst_QWidget::doubleRepaint() // Minmize: Should not trigger a repaint. widget.showMinimized(); QTest::qWait(10); -#if defined(Q_OS_QNX) && (!defined(Q_OS_BLACKBERRY) || defined(Q_OS_BLACKBERRY_TABLET)) +#if defined(Q_OS_QNX) && !defined(Q_OS_BLACKBERRY) QEXPECT_FAIL("", "Platform does not support showMinimized()", Continue); #endif QCOMPARE(widget.numPaintEvents, 0); -- cgit v1.2.3 From b6184286cd1feeaef1e1aa2adaca3628c9ede1e0 Mon Sep 17 00:00:00 2001 From: Tobias Koenig Date: Tue, 17 Feb 2015 16:16:42 +0000 Subject: Haiku: Enable iconv support Fix the linking of the iconv config test on Haiku Change-Id: I7717faf51326a4e3b0f4f6331908a35f1ff0206a Reviewed-by: Augustin Cavalier Reviewed-by: Oswald Buddenhagen --- config.tests/unix/iconv/iconv.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.tests/unix/iconv/iconv.pro b/config.tests/unix/iconv/iconv.pro index 65a67f16d3..ca12e51947 100644 --- a/config.tests/unix/iconv/iconv.pro +++ b/config.tests/unix/iconv/iconv.pro @@ -1,3 +1,3 @@ SOURCES = iconv.cpp CONFIG -= qt dylib -mac|mingw|qnx:LIBS += -liconv +mac|mingw|qnx|haiku:LIBS += -liconv -- cgit v1.2.3 From 04ec8134e8b001ec2c853a75b581a9d5387c85e6 Mon Sep 17 00:00:00 2001 From: Tobias Koenig Date: Fri, 13 Feb 2015 13:42:28 +0000 Subject: Haiku: Use 'unknown' as QSysInfo::productType() There are no actual products of Haiku, so using 'unknown' (the default) is fine, otherwise the file platform selector would be '+unix/+haiku/+haiku' instead of '+unix/+haiku'. Change-Id: Id7653098e20374885a50c09e2aaac9e6fcfc6efb Reviewed-by: Augustin Cavalier Reviewed-by: Thiago Macieira --- src/corelib/global/qglobal.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 06f9e9080e..712e84185c 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -2529,9 +2529,6 @@ QString QSysInfo::productType() #elif defined(Q_OS_DARWIN) return QStringLiteral("darwin"); -#elif defined(Q_OS_HAIKU) - return QStringLiteral("haiku"); - #elif defined(USE_ETC_OS_RELEASE) // Q_OS_UNIX QUnixOSVersion unixOsVersion; readEtcOsRelease(unixOsVersion); -- cgit v1.2.3 From f7716a0899fba150fcde29f5b03da06dd284c6be Mon Sep 17 00:00:00 2001 From: Tobias Koenig Date: Mon, 16 Feb 2015 15:00:53 +0000 Subject: Haiku: Extend QStorageInfo implementation Provide the file system type, the name (label) of the volume and the path to the associated device (if available). Change-Id: I7dd0d314d3f757e0f57c8f82beaf8ee21da86167 Reviewed-by: Augustin Cavalier Reviewed-by: Thiago Macieira --- src/corelib/io/qstorageinfo_unix.cpp | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp index 667301b516..7e23ac897d 100644 --- a/src/corelib/io/qstorageinfo_unix.cpp +++ b/src/corelib/io/qstorageinfo_unix.cpp @@ -59,6 +59,7 @@ # include # include # include +# include # include #else # include @@ -341,9 +342,18 @@ inline bool QStorageIterator::next() return false; const BPath path(&directory); + + fs_info fsInfo; + memset(&fsInfo, 0, sizeof(fsInfo)); + + if (fs_stat_dev(volume.Device(), &fsInfo) != 0) + return false; + m_rootPath = path.Path(); - m_fileSystemType = QByteArray(); // no public API to access it - m_device = QByteArray::number(static_cast(volume.Device())); + m_fileSystemType = QByteArray(fsInfo.fsh_name); + + const QByteArray deviceName(fsInfo.device_name); + m_device = (deviceName.isEmpty() ? QByteArray::number(qint32(volume.Device())) : deviceName); return true; } @@ -444,6 +454,19 @@ static inline QString retrieveLabel(const QByteArray &device) if (fileInfo.isSymLink() && fileInfo.symLinkTarget().toLocal8Bit() == device) return fileInfo.fileName(); } +#elif defined Q_OS_HAIKU + fs_info fsInfo; + memset(&fsInfo, 0, sizeof(fsInfo)); + + int32 pos = 0; + dev_t dev; + while ((dev = next_dev(&pos)) >= 0) { + if (fs_stat_dev(dev, &fsInfo) != 0) + continue; + + if (qstrcmp(fsInfo.device_name, device.constData()) == 0) + return QString::fromLocal8Bit(fsInfo.volume_name); + } #else Q_UNUSED(device); #endif -- cgit v1.2.3 From 4af142d4e182f86bbcb486fbfec22f0a3b9e31e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Chatty?= Date: Sat, 14 Feb 2015 23:59:29 +0100 Subject: Linux/XCB: added a missing arg to QXcbConnection::QXcbConnection call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QXcbConnection::QXcbConnection has 3 args now, but in the call for extra X displays it still was used with 2 args. The bug has gone unnoticed so far because of default args and type conversion. Change-Id: I48b60ce6da8edb1e564010d2b4af9ae95da25316 Reviewed-by: Frederik Gladhorn Reviewed-by: Uli Schlachter Reviewed-by: Jørgen Lind --- src/plugins/platforms/xcb/qxcbintegration.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 791f91e054..2e9ba0e8c5 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -170,7 +170,7 @@ QXcbIntegration::QXcbIntegration(const QStringList ¶meters, int &argc, char qDebug() << "QXcbIntegration: Connecting to additional display: " << parameters.at(i) << parameters.at(i+1); #endif QString display = parameters.at(i) + QLatin1Char(':') + parameters.at(i+1); - m_connections << new QXcbConnection(m_nativeInterface.data(), display.toLatin1().constData()); + m_connections << new QXcbConnection(m_nativeInterface.data(), m_canGrab, display.toLatin1().constData()); } m_fontDatabase.reset(new QGenericUnixFontDatabase()); -- cgit v1.2.3 From ea80316f4ad5401a90cb74c54fc25ba5ff29ed48 Mon Sep 17 00:00:00 2001 From: David Morgan Date: Thu, 19 Feb 2015 16:55:24 +0000 Subject: Restore binary compatibility in versioned OpenGL function classes This is a partial revert of commit 18aae36a90c0753f1b1e615ba8437d8ebd1bd2fb that restores the removed *Backend classes and restores the ordering of members in other *Backend classes. This restores binary compatibility for QtGui. tst_bic now reports only that some of the *Backend classes have changed size. This is a false positive as all such cases have added new members at the end of the respective classes. Offsets to pre-existing members are still consistent with earlier versions. Change-Id: Ia7f651870c2dea7f1a8d3611e667151387506dc8 Reviewed-by: Sean Harmer --- src/gui/opengl/qopenglversionfunctions.cpp | 116 +++++++++++++ src/gui/opengl/qopenglversionfunctions.h | 250 +++++++++++++++++++++-------- 2 files changed, 295 insertions(+), 71 deletions(-) diff --git a/src/gui/opengl/qopenglversionfunctions.cpp b/src/gui/opengl/qopenglversionfunctions.cpp index 6f86375838..f3f709c3f0 100644 --- a/src/gui/opengl/qopenglversionfunctions.cpp +++ b/src/gui/opengl/qopenglversionfunctions.cpp @@ -338,6 +338,8 @@ QOpenGLFunctions_1_1_CoreBackend::QOpenGLFunctions_1_1_CoreBackend(QOpenGLContex HMODULE handle = static_cast(QOpenGLContext::openGLModuleHandle()); if (!handle) handle = GetModuleHandleA("opengl32.dll"); + Indexubv = reinterpret_cast(GetProcAddress(handle, "glIndexubv")); + Indexub = reinterpret_cast(GetProcAddress(handle, "glIndexub")); IsTexture = reinterpret_cast(GetProcAddress(handle, "glIsTexture")); GenTextures = reinterpret_cast(GetProcAddress(handle, "glGenTextures")); DeleteTextures = reinterpret_cast(GetProcAddress(handle, "glDeleteTextures")); @@ -349,9 +351,12 @@ QOpenGLFunctions_1_1_CoreBackend::QOpenGLFunctions_1_1_CoreBackend(QOpenGLContex CopyTexImage2D = reinterpret_cast(GetProcAddress(handle, "glCopyTexImage2D")); CopyTexImage1D = reinterpret_cast(GetProcAddress(handle, "glCopyTexImage1D")); PolygonOffset = reinterpret_cast(GetProcAddress(handle, "glPolygonOffset")); + GetPointerv = reinterpret_cast(GetProcAddress(handle, "glGetPointerv")); DrawElements = reinterpret_cast(GetProcAddress(handle, "glDrawElements")); DrawArrays = reinterpret_cast(GetProcAddress(handle, "glDrawArrays")); #else + Indexubv = reinterpret_cast(context->getProcAddress("glIndexubv")); + Indexub = reinterpret_cast(context->getProcAddress("glIndexub")); IsTexture = reinterpret_cast(context->getProcAddress("glIsTexture")); GenTextures = reinterpret_cast(context->getProcAddress("glGenTextures")); DeleteTextures = reinterpret_cast(context->getProcAddress("glDeleteTextures")); @@ -363,6 +368,7 @@ QOpenGLFunctions_1_1_CoreBackend::QOpenGLFunctions_1_1_CoreBackend(QOpenGLContex CopyTexImage2D = reinterpret_cast(context->getProcAddress("glCopyTexImage2D")); CopyTexImage1D = reinterpret_cast(context->getProcAddress("glCopyTexImage1D")); PolygonOffset = reinterpret_cast(context->getProcAddress("glPolygonOffset")); + GetPointerv = reinterpret_cast(context->getProcAddress("glGetPointerv")); DrawElements = reinterpret_cast(context->getProcAddress("glDrawElements")); DrawArrays = reinterpret_cast(context->getProcAddress("glDrawArrays")); #endif @@ -749,6 +755,36 @@ QOpenGLFunctions_3_3_CoreBackend::QOpenGLFunctions_3_3_CoreBackend(QOpenGLContex VertexAttribP2ui = reinterpret_cast(context->getProcAddress("glVertexAttribP2ui")); VertexAttribP1uiv = reinterpret_cast(context->getProcAddress("glVertexAttribP1uiv")); VertexAttribP1ui = reinterpret_cast(context->getProcAddress("glVertexAttribP1ui")); + SecondaryColorP3uiv = reinterpret_cast(context->getProcAddress("glSecondaryColorP3uiv")); + SecondaryColorP3ui = reinterpret_cast(context->getProcAddress("glSecondaryColorP3ui")); + ColorP4uiv = reinterpret_cast(context->getProcAddress("glColorP4uiv")); + ColorP4ui = reinterpret_cast(context->getProcAddress("glColorP4ui")); + ColorP3uiv = reinterpret_cast(context->getProcAddress("glColorP3uiv")); + ColorP3ui = reinterpret_cast(context->getProcAddress("glColorP3ui")); + NormalP3uiv = reinterpret_cast(context->getProcAddress("glNormalP3uiv")); + NormalP3ui = reinterpret_cast(context->getProcAddress("glNormalP3ui")); + MultiTexCoordP4uiv = reinterpret_cast(context->getProcAddress("glMultiTexCoordP4uiv")); + MultiTexCoordP4ui = reinterpret_cast(context->getProcAddress("glMultiTexCoordP4ui")); + MultiTexCoordP3uiv = reinterpret_cast(context->getProcAddress("glMultiTexCoordP3uiv")); + MultiTexCoordP3ui = reinterpret_cast(context->getProcAddress("glMultiTexCoordP3ui")); + MultiTexCoordP2uiv = reinterpret_cast(context->getProcAddress("glMultiTexCoordP2uiv")); + MultiTexCoordP2ui = reinterpret_cast(context->getProcAddress("glMultiTexCoordP2ui")); + MultiTexCoordP1uiv = reinterpret_cast(context->getProcAddress("glMultiTexCoordP1uiv")); + MultiTexCoordP1ui = reinterpret_cast(context->getProcAddress("glMultiTexCoordP1ui")); + TexCoordP4uiv = reinterpret_cast(context->getProcAddress("glTexCoordP4uiv")); + TexCoordP4ui = reinterpret_cast(context->getProcAddress("glTexCoordP4ui")); + TexCoordP3uiv = reinterpret_cast(context->getProcAddress("glTexCoordP3uiv")); + TexCoordP3ui = reinterpret_cast(context->getProcAddress("glTexCoordP3ui")); + TexCoordP2uiv = reinterpret_cast(context->getProcAddress("glTexCoordP2uiv")); + TexCoordP2ui = reinterpret_cast(context->getProcAddress("glTexCoordP2ui")); + TexCoordP1uiv = reinterpret_cast(context->getProcAddress("glTexCoordP1uiv")); + TexCoordP1ui = reinterpret_cast(context->getProcAddress("glTexCoordP1ui")); + VertexP4uiv = reinterpret_cast(context->getProcAddress("glVertexP4uiv")); + VertexP4ui = reinterpret_cast(context->getProcAddress("glVertexP4ui")); + VertexP3uiv = reinterpret_cast(context->getProcAddress("glVertexP3uiv")); + VertexP3ui = reinterpret_cast(context->getProcAddress("glVertexP3ui")); + VertexP2uiv = reinterpret_cast(context->getProcAddress("glVertexP2uiv")); + VertexP2ui = reinterpret_cast(context->getProcAddress("glVertexP2ui")); GetQueryObjectui64v = reinterpret_cast(context->getProcAddress("glGetQueryObjectui64v")); GetQueryObjecti64v = reinterpret_cast(context->getProcAddress("glGetQueryObjecti64v")); QueryCounter = reinterpret_cast(context->getProcAddress("glQueryCounter")); @@ -1882,6 +1918,86 @@ QOpenGLVersionStatus QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus() return QOpenGLVersionStatus(1, 4, QOpenGLVersionStatus::DeprecatedStatus); } +QOpenGLFunctions_2_0_DeprecatedBackend::QOpenGLFunctions_2_0_DeprecatedBackend(QOpenGLContext *context) + : QOpenGLVersionFunctionsBackend(context) +{ + // OpenGL 2.0 deprecated functions + VertexAttrib4usv = reinterpret_cast(context->getProcAddress("glVertexAttrib4usv")); + VertexAttrib4uiv = reinterpret_cast(context->getProcAddress("glVertexAttrib4uiv")); + VertexAttrib4ubv = reinterpret_cast(context->getProcAddress("glVertexAttrib4ubv")); + VertexAttrib4sv = reinterpret_cast(context->getProcAddress("glVertexAttrib4sv")); + VertexAttrib4s = reinterpret_cast(context->getProcAddress("glVertexAttrib4s")); + VertexAttrib4iv = reinterpret_cast(context->getProcAddress("glVertexAttrib4iv")); + VertexAttrib4fv = reinterpret_cast(context->getProcAddress("glVertexAttrib4fv")); + VertexAttrib4f = reinterpret_cast(context->getProcAddress("glVertexAttrib4f")); + VertexAttrib4dv = reinterpret_cast(context->getProcAddress("glVertexAttrib4dv")); + VertexAttrib4d = reinterpret_cast(context->getProcAddress("glVertexAttrib4d")); + VertexAttrib4bv = reinterpret_cast(context->getProcAddress("glVertexAttrib4bv")); + VertexAttrib4Nusv = reinterpret_cast(context->getProcAddress("glVertexAttrib4Nusv")); + VertexAttrib4Nuiv = reinterpret_cast(context->getProcAddress("glVertexAttrib4Nuiv")); + VertexAttrib4Nubv = reinterpret_cast(context->getProcAddress("glVertexAttrib4Nubv")); + VertexAttrib4Nub = reinterpret_cast(context->getProcAddress("glVertexAttrib4Nub")); + VertexAttrib4Nsv = reinterpret_cast(context->getProcAddress("glVertexAttrib4Nsv")); + VertexAttrib4Niv = reinterpret_cast(context->getProcAddress("glVertexAttrib4Niv")); + VertexAttrib4Nbv = reinterpret_cast(context->getProcAddress("glVertexAttrib4Nbv")); + VertexAttrib3sv = reinterpret_cast(context->getProcAddress("glVertexAttrib3sv")); + VertexAttrib3s = reinterpret_cast(context->getProcAddress("glVertexAttrib3s")); + VertexAttrib3fv = reinterpret_cast(context->getProcAddress("glVertexAttrib3fv")); + VertexAttrib3f = reinterpret_cast(context->getProcAddress("glVertexAttrib3f")); + VertexAttrib3dv = reinterpret_cast(context->getProcAddress("glVertexAttrib3dv")); + VertexAttrib3d = reinterpret_cast(context->getProcAddress("glVertexAttrib3d")); + VertexAttrib2sv = reinterpret_cast(context->getProcAddress("glVertexAttrib2sv")); + VertexAttrib2s = reinterpret_cast(context->getProcAddress("glVertexAttrib2s")); + VertexAttrib2fv = reinterpret_cast(context->getProcAddress("glVertexAttrib2fv")); + VertexAttrib2f = reinterpret_cast(context->getProcAddress("glVertexAttrib2f")); + VertexAttrib2dv = reinterpret_cast(context->getProcAddress("glVertexAttrib2dv")); + VertexAttrib2d = reinterpret_cast(context->getProcAddress("glVertexAttrib2d")); + VertexAttrib1sv = reinterpret_cast(context->getProcAddress("glVertexAttrib1sv")); + VertexAttrib1s = reinterpret_cast(context->getProcAddress("glVertexAttrib1s")); + VertexAttrib1fv = reinterpret_cast(context->getProcAddress("glVertexAttrib1fv")); + VertexAttrib1f = reinterpret_cast(context->getProcAddress("glVertexAttrib1f")); + VertexAttrib1dv = reinterpret_cast(context->getProcAddress("glVertexAttrib1dv")); + VertexAttrib1d = reinterpret_cast(context->getProcAddress("glVertexAttrib1d")); + +} + +QOpenGLVersionStatus QOpenGLFunctions_2_0_DeprecatedBackend::versionStatus() +{ + return QOpenGLVersionStatus(2, 0, QOpenGLVersionStatus::DeprecatedStatus); +} + +QOpenGLFunctions_3_0_DeprecatedBackend::QOpenGLFunctions_3_0_DeprecatedBackend(QOpenGLContext *context) + : QOpenGLVersionFunctionsBackend(context) +{ + // OpenGL 3.0 deprecated functions + VertexAttribI4usv = reinterpret_cast(context->getProcAddress("glVertexAttribI4usv")); + VertexAttribI4ubv = reinterpret_cast(context->getProcAddress("glVertexAttribI4ubv")); + VertexAttribI4sv = reinterpret_cast(context->getProcAddress("glVertexAttribI4sv")); + VertexAttribI4bv = reinterpret_cast(context->getProcAddress("glVertexAttribI4bv")); + VertexAttribI4uiv = reinterpret_cast(context->getProcAddress("glVertexAttribI4uiv")); + VertexAttribI3uiv = reinterpret_cast(context->getProcAddress("glVertexAttribI3uiv")); + VertexAttribI2uiv = reinterpret_cast(context->getProcAddress("glVertexAttribI2uiv")); + VertexAttribI1uiv = reinterpret_cast(context->getProcAddress("glVertexAttribI1uiv")); + VertexAttribI4iv = reinterpret_cast(context->getProcAddress("glVertexAttribI4iv")); + VertexAttribI3iv = reinterpret_cast(context->getProcAddress("glVertexAttribI3iv")); + VertexAttribI2iv = reinterpret_cast(context->getProcAddress("glVertexAttribI2iv")); + VertexAttribI1iv = reinterpret_cast(context->getProcAddress("glVertexAttribI1iv")); + VertexAttribI4ui = reinterpret_cast(context->getProcAddress("glVertexAttribI4ui")); + VertexAttribI3ui = reinterpret_cast(context->getProcAddress("glVertexAttribI3ui")); + VertexAttribI2ui = reinterpret_cast(context->getProcAddress("glVertexAttribI2ui")); + VertexAttribI1ui = reinterpret_cast(context->getProcAddress("glVertexAttribI1ui")); + VertexAttribI4i = reinterpret_cast(context->getProcAddress("glVertexAttribI4i")); + VertexAttribI3i = reinterpret_cast(context->getProcAddress("glVertexAttribI3i")); + VertexAttribI2i = reinterpret_cast(context->getProcAddress("glVertexAttribI2i")); + VertexAttribI1i = reinterpret_cast(context->getProcAddress("glVertexAttribI1i")); + +} + +QOpenGLVersionStatus QOpenGLFunctions_3_0_DeprecatedBackend::versionStatus() +{ + return QOpenGLVersionStatus(3, 0, QOpenGLVersionStatus::DeprecatedStatus); +} + QOpenGLFunctions_3_3_DeprecatedBackend::QOpenGLFunctions_3_3_DeprecatedBackend(QOpenGLContext *context) : QOpenGLVersionFunctionsBackend(context) { diff --git a/src/gui/opengl/qopenglversionfunctions.h b/src/gui/opengl/qopenglversionfunctions.h index d651af68c7..2ae0f429e5 100644 --- a/src/gui/opengl/qopenglversionfunctions.h +++ b/src/gui/opengl/qopenglversionfunctions.h @@ -223,6 +223,8 @@ public: static QOpenGLVersionStatus versionStatus(); // OpenGL 1.1 core functions + void (QOPENGLF_APIENTRYP Indexubv)(const GLubyte *c); + void (QOPENGLF_APIENTRYP Indexub)(GLubyte c); GLboolean (QOPENGLF_APIENTRYP IsTexture)(GLuint texture); void (QOPENGLF_APIENTRYP GenTextures)(GLsizei n, GLuint *textures); void (QOPENGLF_APIENTRYP DeleteTextures)(GLsizei n, const GLuint *textures); @@ -234,6 +236,7 @@ public: void (QOPENGLF_APIENTRYP CopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); void (QOPENGLF_APIENTRYP CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); void (QOPENGLF_APIENTRYP PolygonOffset)(GLfloat factor, GLfloat units); + void (QOPENGLF_APIENTRYP GetPointerv)(GLenum pname, GLvoid* *params); void (QOPENGLF_APIENTRYP DrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); void (QOPENGLF_APIENTRYP DrawArrays)(GLenum mode, GLint first, GLsizei count); @@ -333,42 +336,6 @@ public: // OpenGL 2.0 core functions void (QOPENGLF_APIENTRYP VertexAttribPointer)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); - void (QOPENGLF_APIENTRYP VertexAttrib4usv)(GLuint index, const GLushort *v); - void (QOPENGLF_APIENTRYP VertexAttrib4uiv)(GLuint index, const GLuint *v); - void (QOPENGLF_APIENTRYP VertexAttrib4ubv)(GLuint index, const GLubyte *v); - void (QOPENGLF_APIENTRYP VertexAttrib4sv)(GLuint index, const GLshort *v); - void (QOPENGLF_APIENTRYP VertexAttrib4s)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); - void (QOPENGLF_APIENTRYP VertexAttrib4iv)(GLuint index, const GLint *v); - void (QOPENGLF_APIENTRYP VertexAttrib4fv)(GLuint index, const GLfloat *v); - void (QOPENGLF_APIENTRYP VertexAttrib4f)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); - void (QOPENGLF_APIENTRYP VertexAttrib4dv)(GLuint index, const GLdouble *v); - void (QOPENGLF_APIENTRYP VertexAttrib4d)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); - void (QOPENGLF_APIENTRYP VertexAttrib4bv)(GLuint index, const GLbyte *v); - void (QOPENGLF_APIENTRYP VertexAttrib4Nusv)(GLuint index, const GLushort *v); - void (QOPENGLF_APIENTRYP VertexAttrib4Nuiv)(GLuint index, const GLuint *v); - void (QOPENGLF_APIENTRYP VertexAttrib4Nubv)(GLuint index, const GLubyte *v); - void (QOPENGLF_APIENTRYP VertexAttrib4Nub)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); - void (QOPENGLF_APIENTRYP VertexAttrib4Nsv)(GLuint index, const GLshort *v); - void (QOPENGLF_APIENTRYP VertexAttrib4Niv)(GLuint index, const GLint *v); - void (QOPENGLF_APIENTRYP VertexAttrib4Nbv)(GLuint index, const GLbyte *v); - void (QOPENGLF_APIENTRYP VertexAttrib3sv)(GLuint index, const GLshort *v); - void (QOPENGLF_APIENTRYP VertexAttrib3s)(GLuint index, GLshort x, GLshort y, GLshort z); - void (QOPENGLF_APIENTRYP VertexAttrib3fv)(GLuint index, const GLfloat *v); - void (QOPENGLF_APIENTRYP VertexAttrib3f)(GLuint index, GLfloat x, GLfloat y, GLfloat z); - void (QOPENGLF_APIENTRYP VertexAttrib3dv)(GLuint index, const GLdouble *v); - void (QOPENGLF_APIENTRYP VertexAttrib3d)(GLuint index, GLdouble x, GLdouble y, GLdouble z); - void (QOPENGLF_APIENTRYP VertexAttrib2sv)(GLuint index, const GLshort *v); - void (QOPENGLF_APIENTRYP VertexAttrib2s)(GLuint index, GLshort x, GLshort y); - void (QOPENGLF_APIENTRYP VertexAttrib2fv)(GLuint index, const GLfloat *v); - void (QOPENGLF_APIENTRYP VertexAttrib2f)(GLuint index, GLfloat x, GLfloat y); - void (QOPENGLF_APIENTRYP VertexAttrib2dv)(GLuint index, const GLdouble *v); - void (QOPENGLF_APIENTRYP VertexAttrib2d)(GLuint index, GLdouble x, GLdouble y); - void (QOPENGLF_APIENTRYP VertexAttrib1sv)(GLuint index, const GLshort *v); - void (QOPENGLF_APIENTRYP VertexAttrib1s)(GLuint index, GLshort x); - void (QOPENGLF_APIENTRYP VertexAttrib1fv)(GLuint index, const GLfloat *v); - void (QOPENGLF_APIENTRYP VertexAttrib1f)(GLuint index, GLfloat x); - void (QOPENGLF_APIENTRYP VertexAttrib1dv)(GLuint index, const GLdouble *v); - void (QOPENGLF_APIENTRYP VertexAttrib1d)(GLuint index, GLdouble x); void (QOPENGLF_APIENTRYP ValidateProgram)(GLuint program); void (QOPENGLF_APIENTRYP UniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); void (QOPENGLF_APIENTRYP UniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); @@ -425,7 +392,42 @@ public: void (QOPENGLF_APIENTRYP StencilOpSeparate)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); void (QOPENGLF_APIENTRYP DrawBuffers)(GLsizei n, const GLenum *bufs); void (QOPENGLF_APIENTRYP BlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha); - + void (QOPENGLF_APIENTRYP VertexAttrib4usv)(GLuint index, const GLushort *v); + void (QOPENGLF_APIENTRYP VertexAttrib4uiv)(GLuint index, const GLuint *v); + void (QOPENGLF_APIENTRYP VertexAttrib4ubv)(GLuint index, const GLubyte *v); + void (QOPENGLF_APIENTRYP VertexAttrib4sv)(GLuint index, const GLshort *v); + void (QOPENGLF_APIENTRYP VertexAttrib4s)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); + void (QOPENGLF_APIENTRYP VertexAttrib4iv)(GLuint index, const GLint *v); + void (QOPENGLF_APIENTRYP VertexAttrib4fv)(GLuint index, const GLfloat *v); + void (QOPENGLF_APIENTRYP VertexAttrib4f)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); + void (QOPENGLF_APIENTRYP VertexAttrib4dv)(GLuint index, const GLdouble *v); + void (QOPENGLF_APIENTRYP VertexAttrib4d)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); + void (QOPENGLF_APIENTRYP VertexAttrib4bv)(GLuint index, const GLbyte *v); + void (QOPENGLF_APIENTRYP VertexAttrib4Nusv)(GLuint index, const GLushort *v); + void (QOPENGLF_APIENTRYP VertexAttrib4Nuiv)(GLuint index, const GLuint *v); + void (QOPENGLF_APIENTRYP VertexAttrib4Nubv)(GLuint index, const GLubyte *v); + void (QOPENGLF_APIENTRYP VertexAttrib4Nub)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); + void (QOPENGLF_APIENTRYP VertexAttrib4Nsv)(GLuint index, const GLshort *v); + void (QOPENGLF_APIENTRYP VertexAttrib4Niv)(GLuint index, const GLint *v); + void (QOPENGLF_APIENTRYP VertexAttrib4Nbv)(GLuint index, const GLbyte *v); + void (QOPENGLF_APIENTRYP VertexAttrib3sv)(GLuint index, const GLshort *v); + void (QOPENGLF_APIENTRYP VertexAttrib3s)(GLuint index, GLshort x, GLshort y, GLshort z); + void (QOPENGLF_APIENTRYP VertexAttrib3fv)(GLuint index, const GLfloat *v); + void (QOPENGLF_APIENTRYP VertexAttrib3f)(GLuint index, GLfloat x, GLfloat y, GLfloat z); + void (QOPENGLF_APIENTRYP VertexAttrib3dv)(GLuint index, const GLdouble *v); + void (QOPENGLF_APIENTRYP VertexAttrib3d)(GLuint index, GLdouble x, GLdouble y, GLdouble z); + void (QOPENGLF_APIENTRYP VertexAttrib2sv)(GLuint index, const GLshort *v); + void (QOPENGLF_APIENTRYP VertexAttrib2s)(GLuint index, GLshort x, GLshort y); + void (QOPENGLF_APIENTRYP VertexAttrib2fv)(GLuint index, const GLfloat *v); + void (QOPENGLF_APIENTRYP VertexAttrib2f)(GLuint index, GLfloat x, GLfloat y); + void (QOPENGLF_APIENTRYP VertexAttrib2dv)(GLuint index, const GLdouble *v); + void (QOPENGLF_APIENTRYP VertexAttrib2d)(GLuint index, GLdouble x, GLdouble y); + void (QOPENGLF_APIENTRYP VertexAttrib1sv)(GLuint index, const GLshort *v); + void (QOPENGLF_APIENTRYP VertexAttrib1s)(GLuint index, GLshort x); + void (QOPENGLF_APIENTRYP VertexAttrib1fv)(GLuint index, const GLfloat *v); + void (QOPENGLF_APIENTRYP VertexAttrib1f)(GLuint index, GLfloat x); + void (QOPENGLF_APIENTRYP VertexAttrib1dv)(GLuint index, const GLdouble *v); + void (QOPENGLF_APIENTRYP VertexAttrib1d)(GLuint index, GLdouble x); }; class QOpenGLFunctions_2_1_CoreBackend : public QOpenGLVersionFunctionsBackend @@ -499,6 +501,24 @@ public: GLint (QOPENGLF_APIENTRYP GetFragDataLocation)(GLuint program, const GLchar *name); void (QOPENGLF_APIENTRYP BindFragDataLocation)(GLuint program, GLuint color, const GLchar *name); void (QOPENGLF_APIENTRYP GetUniformuiv)(GLuint program, GLint location, GLuint *params); + void (QOPENGLF_APIENTRYP GetVertexAttribIuiv)(GLuint index, GLenum pname, GLuint *params); + void (QOPENGLF_APIENTRYP GetVertexAttribIiv)(GLuint index, GLenum pname, GLint *params); + void (QOPENGLF_APIENTRYP VertexAttribIPointer)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); + void (QOPENGLF_APIENTRYP EndConditionalRender)(); + void (QOPENGLF_APIENTRYP BeginConditionalRender)(GLuint id, GLenum mode); + void (QOPENGLF_APIENTRYP ClampColor)(GLenum target, GLenum clamp); + void (QOPENGLF_APIENTRYP GetTransformFeedbackVarying)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); + void (QOPENGLF_APIENTRYP TransformFeedbackVaryings)(GLuint program, GLsizei count, const GLchar* const *varyings, GLenum bufferMode); + void (QOPENGLF_APIENTRYP BindBufferBase)(GLenum target, GLuint index, GLuint buffer); + void (QOPENGLF_APIENTRYP BindBufferRange)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); + void (QOPENGLF_APIENTRYP EndTransformFeedback)(); + void (QOPENGLF_APIENTRYP BeginTransformFeedback)(GLenum primitiveMode); + GLboolean (QOPENGLF_APIENTRYP IsEnabledi)(GLenum target, GLuint index); + void (QOPENGLF_APIENTRYP Disablei)(GLenum target, GLuint index); + void (QOPENGLF_APIENTRYP Enablei)(GLenum target, GLuint index); + void (QOPENGLF_APIENTRYP GetIntegeri_v)(GLenum target, GLuint index, GLint *data); + void (QOPENGLF_APIENTRYP GetBooleani_v)(GLenum target, GLuint index, GLboolean *data); + void (QOPENGLF_APIENTRYP ColorMaski)(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); void (QOPENGLF_APIENTRYP VertexAttribI4usv)(GLuint index, const GLushort *v); void (QOPENGLF_APIENTRYP VertexAttribI4ubv)(GLuint index, const GLubyte *v); void (QOPENGLF_APIENTRYP VertexAttribI4sv)(GLuint index, const GLshort *v); @@ -519,25 +539,6 @@ public: void (QOPENGLF_APIENTRYP VertexAttribI3i)(GLuint index, GLint x, GLint y, GLint z); void (QOPENGLF_APIENTRYP VertexAttribI2i)(GLuint index, GLint x, GLint y); void (QOPENGLF_APIENTRYP VertexAttribI1i)(GLuint index, GLint x); - void (QOPENGLF_APIENTRYP GetVertexAttribIuiv)(GLuint index, GLenum pname, GLuint *params); - void (QOPENGLF_APIENTRYP GetVertexAttribIiv)(GLuint index, GLenum pname, GLint *params); - void (QOPENGLF_APIENTRYP VertexAttribIPointer)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); - void (QOPENGLF_APIENTRYP EndConditionalRender)(); - void (QOPENGLF_APIENTRYP BeginConditionalRender)(GLuint id, GLenum mode); - void (QOPENGLF_APIENTRYP ClampColor)(GLenum target, GLenum clamp); - void (QOPENGLF_APIENTRYP GetTransformFeedbackVarying)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); - void (QOPENGLF_APIENTRYP TransformFeedbackVaryings)(GLuint program, GLsizei count, const GLchar* const *varyings, GLenum bufferMode); - void (QOPENGLF_APIENTRYP BindBufferBase)(GLenum target, GLuint index, GLuint buffer); - void (QOPENGLF_APIENTRYP BindBufferRange)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); - void (QOPENGLF_APIENTRYP EndTransformFeedback)(); - void (QOPENGLF_APIENTRYP BeginTransformFeedback)(GLenum primitiveMode); - GLboolean (QOPENGLF_APIENTRYP IsEnabledi)(GLenum target, GLuint index); - void (QOPENGLF_APIENTRYP Disablei)(GLenum target, GLuint index); - void (QOPENGLF_APIENTRYP Enablei)(GLenum target, GLuint index); - void (QOPENGLF_APIENTRYP GetIntegeri_v)(GLenum target, GLuint index, GLint *data); - void (QOPENGLF_APIENTRYP GetBooleani_v)(GLenum target, GLuint index, GLboolean *data); - void (QOPENGLF_APIENTRYP ColorMaski)(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); - }; class QOpenGLFunctions_3_1_CoreBackend : public QOpenGLVersionFunctionsBackend @@ -609,6 +610,36 @@ public: void (QOPENGLF_APIENTRYP VertexAttribP2ui)(GLuint index, GLenum type, GLboolean normalized, GLuint value); void (QOPENGLF_APIENTRYP VertexAttribP1uiv)(GLuint index, GLenum type, GLboolean normalized, const GLuint *value); void (QOPENGLF_APIENTRYP VertexAttribP1ui)(GLuint index, GLenum type, GLboolean normalized, GLuint value); + void (QOPENGLF_APIENTRYP SecondaryColorP3uiv)(GLenum type, const GLuint *color); + void (QOPENGLF_APIENTRYP SecondaryColorP3ui)(GLenum type, GLuint color); + void (QOPENGLF_APIENTRYP ColorP4uiv)(GLenum type, const GLuint *color); + void (QOPENGLF_APIENTRYP ColorP4ui)(GLenum type, GLuint color); + void (QOPENGLF_APIENTRYP ColorP3uiv)(GLenum type, const GLuint *color); + void (QOPENGLF_APIENTRYP ColorP3ui)(GLenum type, GLuint color); + void (QOPENGLF_APIENTRYP NormalP3uiv)(GLenum type, const GLuint *coords); + void (QOPENGLF_APIENTRYP NormalP3ui)(GLenum type, GLuint coords); + void (QOPENGLF_APIENTRYP MultiTexCoordP4uiv)(GLenum texture, GLenum type, const GLuint *coords); + void (QOPENGLF_APIENTRYP MultiTexCoordP4ui)(GLenum texture, GLenum type, GLuint coords); + void (QOPENGLF_APIENTRYP MultiTexCoordP3uiv)(GLenum texture, GLenum type, const GLuint *coords); + void (QOPENGLF_APIENTRYP MultiTexCoordP3ui)(GLenum texture, GLenum type, GLuint coords); + void (QOPENGLF_APIENTRYP MultiTexCoordP2uiv)(GLenum texture, GLenum type, const GLuint *coords); + void (QOPENGLF_APIENTRYP MultiTexCoordP2ui)(GLenum texture, GLenum type, GLuint coords); + void (QOPENGLF_APIENTRYP MultiTexCoordP1uiv)(GLenum texture, GLenum type, const GLuint *coords); + void (QOPENGLF_APIENTRYP MultiTexCoordP1ui)(GLenum texture, GLenum type, GLuint coords); + void (QOPENGLF_APIENTRYP TexCoordP4uiv)(GLenum type, const GLuint *coords); + void (QOPENGLF_APIENTRYP TexCoordP4ui)(GLenum type, GLuint coords); + void (QOPENGLF_APIENTRYP TexCoordP3uiv)(GLenum type, const GLuint *coords); + void (QOPENGLF_APIENTRYP TexCoordP3ui)(GLenum type, GLuint coords); + void (QOPENGLF_APIENTRYP TexCoordP2uiv)(GLenum type, const GLuint *coords); + void (QOPENGLF_APIENTRYP TexCoordP2ui)(GLenum type, GLuint coords); + void (QOPENGLF_APIENTRYP TexCoordP1uiv)(GLenum type, const GLuint *coords); + void (QOPENGLF_APIENTRYP TexCoordP1ui)(GLenum type, GLuint coords); + void (QOPENGLF_APIENTRYP VertexP4uiv)(GLenum type, const GLuint *value); + void (QOPENGLF_APIENTRYP VertexP4ui)(GLenum type, GLuint value); + void (QOPENGLF_APIENTRYP VertexP3uiv)(GLenum type, const GLuint *value); + void (QOPENGLF_APIENTRYP VertexP3ui)(GLenum type, GLuint value); + void (QOPENGLF_APIENTRYP VertexP2uiv)(GLenum type, const GLuint *value); + void (QOPENGLF_APIENTRYP VertexP2ui)(GLenum type, GLuint value); void (QOPENGLF_APIENTRYP GetQueryObjectui64v)(GLuint id, GLenum pname, GLuint64 *params); void (QOPENGLF_APIENTRYP GetQueryObjecti64v)(GLuint id, GLenum pname, GLint64 *params); void (QOPENGLF_APIENTRYP QueryCounter)(GLuint id, GLenum target); @@ -819,16 +850,6 @@ public: static QOpenGLVersionStatus versionStatus(); // OpenGL 4.3 core functions - void (QOPENGLF_APIENTRYP GetObjectPtrLabel)(const GLvoid *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); - void (QOPENGLF_APIENTRYP ObjectPtrLabel)(const GLvoid *ptr, GLsizei length, const GLchar *label); - void (QOPENGLF_APIENTRYP GetObjectLabel)(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); - void (QOPENGLF_APIENTRYP ObjectLabel)(GLenum identifier, GLuint name, GLsizei length, const GLchar *label); - void (QOPENGLF_APIENTRYP PopDebugGroup)(); - void (QOPENGLF_APIENTRYP PushDebugGroup)(GLenum source, GLuint id, GLsizei length, const GLchar *message); - GLuint (QOPENGLF_APIENTRYP GetDebugMessageLog)(GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); - void (QOPENGLF_APIENTRYP DebugMessageCallback)(GLDEBUGPROC callback, const GLvoid *userParam); - void (QOPENGLF_APIENTRYP DebugMessageInsert)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); - void (QOPENGLF_APIENTRYP DebugMessageControl)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); void (QOPENGLF_APIENTRYP TexStorage3DMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); void (QOPENGLF_APIENTRYP TexStorage2DMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); void (QOPENGLF_APIENTRYP TexBufferRange)(GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); @@ -862,6 +883,16 @@ public: void (QOPENGLF_APIENTRYP DispatchCompute)(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); void (QOPENGLF_APIENTRYP ClearBufferSubData)(GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); void (QOPENGLF_APIENTRYP ClearBufferData)(GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data); + void (QOPENGLF_APIENTRYP GetObjectPtrLabel)(const GLvoid *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); + void (QOPENGLF_APIENTRYP ObjectPtrLabel)(const GLvoid *ptr, GLsizei length, const GLchar *label); + void (QOPENGLF_APIENTRYP GetObjectLabel)(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); + void (QOPENGLF_APIENTRYP ObjectLabel)(GLenum identifier, GLuint name, GLsizei length, const GLchar *label); + void (QOPENGLF_APIENTRYP PopDebugGroup)(); + void (QOPENGLF_APIENTRYP PushDebugGroup)(GLenum source, GLuint id, GLsizei length, const GLchar *message); + GLuint (QOPENGLF_APIENTRYP GetDebugMessageLog)(GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); + void (QOPENGLF_APIENTRYP DebugMessageCallback)(GLDEBUGPROC callback, const GLvoid *userParam); + void (QOPENGLF_APIENTRYP DebugMessageInsert)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); + void (QOPENGLF_APIENTRYP DebugMessageControl)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); }; @@ -1281,22 +1312,21 @@ public: // OpenGL 1.1 deprecated functions void (QOPENGLF_APIENTRYP PushClientAttrib)(GLbitfield mask); void (QOPENGLF_APIENTRYP PopClientAttrib)(); - void (QOPENGLF_APIENTRYP Indexubv)(const GLubyte *c); - void (QOPENGLF_APIENTRYP Indexub)(GLubyte c); void (QOPENGLF_APIENTRYP PrioritizeTextures)(GLsizei n, const GLuint *textures, const GLfloat *priorities); GLboolean (QOPENGLF_APIENTRYP AreTexturesResident)(GLsizei n, const GLuint *textures, GLboolean *residences); void (QOPENGLF_APIENTRYP VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); void (QOPENGLF_APIENTRYP TexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); void (QOPENGLF_APIENTRYP NormalPointer)(GLenum type, GLsizei stride, const GLvoid *pointer); void (QOPENGLF_APIENTRYP InterleavedArrays)(GLenum format, GLsizei stride, const GLvoid *pointer); - void (QOPENGLF_APIENTRYP GetPointerv)(GLenum pname, GLvoid* *params); void (QOPENGLF_APIENTRYP IndexPointer)(GLenum type, GLsizei stride, const GLvoid *pointer); void (QOPENGLF_APIENTRYP EnableClientState)(GLenum array); void (QOPENGLF_APIENTRYP EdgeFlagPointer)(GLsizei stride, const GLvoid *pointer); void (QOPENGLF_APIENTRYP DisableClientState)(GLenum array); void (QOPENGLF_APIENTRYP ColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); void (QOPENGLF_APIENTRYP ArrayElement)(GLint i); - + void (QOPENGLF_APIENTRYP Indexubv)(const GLubyte *c); + void (QOPENGLF_APIENTRYP Indexub)(GLubyte c); + void (QOPENGLF_APIENTRYP GetPointerv)(GLenum pname, GLvoid* *params); }; class QOpenGLFunctions_1_2_DeprecatedBackend : public QOpenGLVersionFunctionsBackend @@ -1307,7 +1337,6 @@ public: static QOpenGLVersionStatus versionStatus(); // OpenGL 1.2 deprecated functions - void (QOPENGLF_APIENTRYP ColorTable)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); void (QOPENGLF_APIENTRYP ColorTableParameterfv)(GLenum target, GLenum pname, const GLfloat *params); void (QOPENGLF_APIENTRYP ColorTableParameteriv)(GLenum target, GLenum pname, const GLint *params); void (QOPENGLF_APIENTRYP CopyColorTable)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); @@ -1339,6 +1368,7 @@ public: void (QOPENGLF_APIENTRYP Minmax)(GLenum target, GLenum internalformat, GLboolean sink); void (QOPENGLF_APIENTRYP ResetHistogram)(GLenum target); void (QOPENGLF_APIENTRYP ResetMinmax)(GLenum target); + void (QOPENGLF_APIENTRYP ColorTable)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); }; @@ -1439,6 +1469,84 @@ public: }; +class QOpenGLFunctions_2_0_DeprecatedBackend : public QOpenGLVersionFunctionsBackend +{ +public: + QOpenGLFunctions_2_0_DeprecatedBackend(QOpenGLContext *context); + + static QOpenGLVersionStatus versionStatus(); + + // OpenGL 2.0 deprecated functions + void (QOPENGLF_APIENTRYP VertexAttrib4usv)(GLuint index, const GLushort *v); + void (QOPENGLF_APIENTRYP VertexAttrib4uiv)(GLuint index, const GLuint *v); + void (QOPENGLF_APIENTRYP VertexAttrib4ubv)(GLuint index, const GLubyte *v); + void (QOPENGLF_APIENTRYP VertexAttrib4sv)(GLuint index, const GLshort *v); + void (QOPENGLF_APIENTRYP VertexAttrib4s)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); + void (QOPENGLF_APIENTRYP VertexAttrib4iv)(GLuint index, const GLint *v); + void (QOPENGLF_APIENTRYP VertexAttrib4fv)(GLuint index, const GLfloat *v); + void (QOPENGLF_APIENTRYP VertexAttrib4f)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); + void (QOPENGLF_APIENTRYP VertexAttrib4dv)(GLuint index, const GLdouble *v); + void (QOPENGLF_APIENTRYP VertexAttrib4d)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); + void (QOPENGLF_APIENTRYP VertexAttrib4bv)(GLuint index, const GLbyte *v); + void (QOPENGLF_APIENTRYP VertexAttrib4Nusv)(GLuint index, const GLushort *v); + void (QOPENGLF_APIENTRYP VertexAttrib4Nuiv)(GLuint index, const GLuint *v); + void (QOPENGLF_APIENTRYP VertexAttrib4Nubv)(GLuint index, const GLubyte *v); + void (QOPENGLF_APIENTRYP VertexAttrib4Nub)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); + void (QOPENGLF_APIENTRYP VertexAttrib4Nsv)(GLuint index, const GLshort *v); + void (QOPENGLF_APIENTRYP VertexAttrib4Niv)(GLuint index, const GLint *v); + void (QOPENGLF_APIENTRYP VertexAttrib4Nbv)(GLuint index, const GLbyte *v); + void (QOPENGLF_APIENTRYP VertexAttrib3sv)(GLuint index, const GLshort *v); + void (QOPENGLF_APIENTRYP VertexAttrib3s)(GLuint index, GLshort x, GLshort y, GLshort z); + void (QOPENGLF_APIENTRYP VertexAttrib3fv)(GLuint index, const GLfloat *v); + void (QOPENGLF_APIENTRYP VertexAttrib3f)(GLuint index, GLfloat x, GLfloat y, GLfloat z); + void (QOPENGLF_APIENTRYP VertexAttrib3dv)(GLuint index, const GLdouble *v); + void (QOPENGLF_APIENTRYP VertexAttrib3d)(GLuint index, GLdouble x, GLdouble y, GLdouble z); + void (QOPENGLF_APIENTRYP VertexAttrib2sv)(GLuint index, const GLshort *v); + void (QOPENGLF_APIENTRYP VertexAttrib2s)(GLuint index, GLshort x, GLshort y); + void (QOPENGLF_APIENTRYP VertexAttrib2fv)(GLuint index, const GLfloat *v); + void (QOPENGLF_APIENTRYP VertexAttrib2f)(GLuint index, GLfloat x, GLfloat y); + void (QOPENGLF_APIENTRYP VertexAttrib2dv)(GLuint index, const GLdouble *v); + void (QOPENGLF_APIENTRYP VertexAttrib2d)(GLuint index, GLdouble x, GLdouble y); + void (QOPENGLF_APIENTRYP VertexAttrib1sv)(GLuint index, const GLshort *v); + void (QOPENGLF_APIENTRYP VertexAttrib1s)(GLuint index, GLshort x); + void (QOPENGLF_APIENTRYP VertexAttrib1fv)(GLuint index, const GLfloat *v); + void (QOPENGLF_APIENTRYP VertexAttrib1f)(GLuint index, GLfloat x); + void (QOPENGLF_APIENTRYP VertexAttrib1dv)(GLuint index, const GLdouble *v); + void (QOPENGLF_APIENTRYP VertexAttrib1d)(GLuint index, GLdouble x); + +}; + +class QOpenGLFunctions_3_0_DeprecatedBackend : public QOpenGLVersionFunctionsBackend +{ +public: + QOpenGLFunctions_3_0_DeprecatedBackend(QOpenGLContext *context); + + static QOpenGLVersionStatus versionStatus(); + + // OpenGL 3.0 deprecated functions + void (QOPENGLF_APIENTRYP VertexAttribI4usv)(GLuint index, const GLushort *v); + void (QOPENGLF_APIENTRYP VertexAttribI4ubv)(GLuint index, const GLubyte *v); + void (QOPENGLF_APIENTRYP VertexAttribI4sv)(GLuint index, const GLshort *v); + void (QOPENGLF_APIENTRYP VertexAttribI4bv)(GLuint index, const GLbyte *v); + void (QOPENGLF_APIENTRYP VertexAttribI4uiv)(GLuint index, const GLuint *v); + void (QOPENGLF_APIENTRYP VertexAttribI3uiv)(GLuint index, const GLuint *v); + void (QOPENGLF_APIENTRYP VertexAttribI2uiv)(GLuint index, const GLuint *v); + void (QOPENGLF_APIENTRYP VertexAttribI1uiv)(GLuint index, const GLuint *v); + void (QOPENGLF_APIENTRYP VertexAttribI4iv)(GLuint index, const GLint *v); + void (QOPENGLF_APIENTRYP VertexAttribI3iv)(GLuint index, const GLint *v); + void (QOPENGLF_APIENTRYP VertexAttribI2iv)(GLuint index, const GLint *v); + void (QOPENGLF_APIENTRYP VertexAttribI1iv)(GLuint index, const GLint *v); + void (QOPENGLF_APIENTRYP VertexAttribI4ui)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); + void (QOPENGLF_APIENTRYP VertexAttribI3ui)(GLuint index, GLuint x, GLuint y, GLuint z); + void (QOPENGLF_APIENTRYP VertexAttribI2ui)(GLuint index, GLuint x, GLuint y); + void (QOPENGLF_APIENTRYP VertexAttribI1ui)(GLuint index, GLuint x); + void (QOPENGLF_APIENTRYP VertexAttribI4i)(GLuint index, GLint x, GLint y, GLint z, GLint w); + void (QOPENGLF_APIENTRYP VertexAttribI3i)(GLuint index, GLint x, GLint y, GLint z); + void (QOPENGLF_APIENTRYP VertexAttribI2i)(GLuint index, GLint x, GLint y); + void (QOPENGLF_APIENTRYP VertexAttribI1i)(GLuint index, GLint x); + +}; + class QOpenGLFunctions_3_3_DeprecatedBackend : public QOpenGLVersionFunctionsBackend { public: -- cgit v1.2.3 From 94d79cf3d50b1a01ae1a73d6b9457d1047db7877 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 20 Feb 2015 20:43:29 +0100 Subject: tst_QNoDebug: don't use sprintf if there're no arguments This slipped in with commit 1d2efe1f27bedcbaa157ef4e82b8eda33dda46ad, but is of course completely bogus (though harmless). Change-Id: If3875b65af0fa3fe85216391599433158043e361 Reviewed-by: Olivier Goffart (Woboq GmbH) --- tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp b/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp index 12a67be213..ae08a4631d 100644 --- a/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp +++ b/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp @@ -70,7 +70,7 @@ void tst_QNoDebug::streaming() const { QDateTime dt(QDate(1,2,3),QTime(4,5,6)); const QString debugString = dt.toString(QStringLiteral("yyyy-MM-dd HH:mm:ss.zzz t")); - QTest::ignoreMessage(QtWarningMsg, qPrintable(QString::asprintf("QDateTime(\"%1\" Qt::TimeSpec(LocalTime))").arg(debugString))); + QTest::ignoreMessage(QtWarningMsg, qPrintable(QString::fromLatin1("QDateTime(\"%1\" Qt::TimeSpec(LocalTime))").arg(debugString))); qWarning() << dt; } -- cgit v1.2.3 From de8a34b9bdd3d4fc6f5515e144741bf205adfe6a Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sun, 15 Feb 2015 21:01:39 +0100 Subject: QDateTime: drop quotes in QDebug output As requested in review of 1d2efe1f27bedcbaa157ef4e82b8eda33dda46ad. I didn't add a comma in front of the timeSpec() as the other fields aren't separated by commas, either. Change-Id: I54d74b7199ca7e46e28d2ceca22b02205e318c90 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/tools/qdatetime.cpp | 3 ++- tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 191fcf8cfd..aaa639272c 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -4965,7 +4965,8 @@ QDebug operator<<(QDebug dbg, const QTime &time) QDebug operator<<(QDebug dbg, const QDateTime &date) { QDebugStateSaver saver(dbg); - dbg.nospace() << "QDateTime(" << date.toString(QStringLiteral("yyyy-MM-dd HH:mm:ss.zzz t")) + dbg.nospace() << "QDateTime("; + dbg.noquote() << date.toString(QStringLiteral("yyyy-MM-dd HH:mm:ss.zzz t")) << ' ' << date.timeSpec(); switch (date.d->m_spec) { case Qt::UTC: diff --git a/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp b/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp index ae08a4631d..5ece9190a5 100644 --- a/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp +++ b/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp @@ -70,7 +70,7 @@ void tst_QNoDebug::streaming() const { QDateTime dt(QDate(1,2,3),QTime(4,5,6)); const QString debugString = dt.toString(QStringLiteral("yyyy-MM-dd HH:mm:ss.zzz t")); - QTest::ignoreMessage(QtWarningMsg, qPrintable(QString::fromLatin1("QDateTime(\"%1\" Qt::TimeSpec(LocalTime))").arg(debugString))); + QTest::ignoreMessage(QtWarningMsg, qPrintable(QString::fromLatin1("QDateTime(%1 Qt::TimeSpec(LocalTime))").arg(debugString))); qWarning() << dt; } -- cgit v1.2.3 From 878cbbcb65f0c872db6c719422d9a426976fa8b2 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sun, 15 Feb 2015 21:01:39 +0100 Subject: QDateTime: cache the result of date.timeSpec() in QDebug op<< Saves a couple dozen bytes in text size on optimized AMD64 builds. Change-Id: Iefd9ca05a7b27f240836c1e1e00df569742fcd7f Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/tools/qdatetime.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index aaa639272c..eeefea8137 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -4965,10 +4965,11 @@ QDebug operator<<(QDebug dbg, const QTime &time) QDebug operator<<(QDebug dbg, const QDateTime &date) { QDebugStateSaver saver(dbg); + const Qt::TimeSpec ts = date.timeSpec(); dbg.nospace() << "QDateTime("; dbg.noquote() << date.toString(QStringLiteral("yyyy-MM-dd HH:mm:ss.zzz t")) - << ' ' << date.timeSpec(); - switch (date.d->m_spec) { + << ' ' << ts; + switch (ts) { case Qt::UTC: break; case Qt::OffsetFromUTC: -- cgit v1.2.3 From 571908f7fc8f5e4ef9a4dfd90102566f6f0fcad2 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Fri, 13 Feb 2015 22:20:12 +0100 Subject: QCoreTextFontEngine: Cache face_id. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This involves a significant amount of memory allocation, which made it rather more expensive than one would expect. The FT engine also caches face id, so this seems like a reasonable prospect. Increases delegates_text by another few ops/frame. Change-Id: If31e6b54478e4caf46a3a12a9ac45254a1f01525 Reviewed-by: Konstantin Ritt Reviewed-by: Morten Johan Sørvig --- .../fontdatabases/mac/qfontengine_coretext.mm | 12 +++++------- .../fontdatabases/mac/qfontengine_coretext_p.h | 1 + 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm index 48ec78951d..64de364bfb 100644 --- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm +++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm @@ -162,6 +162,10 @@ void QCoreTextFontEngine::init() Q_ASSERT(ctfont != NULL); Q_ASSERT(cgFont != NULL); + face_id.index = 0; + QCFString name = CTFontCopyName(ctfont, kCTFontUniqueNameKey); + face_id.filename = QCFString::toQString(name).toUtf8(); + QCFString family = CTFontCopyFamilyName(ctfont); fontDef.family = family; @@ -696,13 +700,7 @@ void QCoreTextFontEngine::recalcAdvances(QGlyphLayout *glyphs, QFontEngine::Shap QFontEngine::FaceId QCoreTextFontEngine::faceId() const { - FaceId result; - result.index = 0; - - QCFString name = CTFontCopyName(ctfont, kCTFontUniqueNameKey); - result.filename = QCFString::toQString(name).toUtf8(); - - return result; + return face_id; } bool QCoreTextFontEngine::canRender(const QChar *string, int len) const diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h index 4a6c8e57e6..88ce2c726d 100644 --- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h +++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h @@ -135,6 +135,7 @@ private: int synthesisFlags; CGAffineTransform transform; QFixed avgCharWidth; + QFontEngine::FaceId face_id; }; CGAffineTransform qt_transform_from_fontdef(const QFontDef &fontDef); -- cgit v1.2.3