From 9dcc3a57282f60e2394a2a54fc0a735a4240c5c8 Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Tue, 23 Sep 2014 09:36:28 -0700 Subject: create_cmake: Fix mingw plugin path MinGW static libs use libfoo.a format, and not foo.lib. Change-Id: I899adca8ec0b1c8430f5b6c4f18ad0ea1dc6d398 Reviewed-by: Timothy Gu Reviewed-by: Oswald Buddenhagen --- mkspecs/features/create_cmake.prf | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf index 2533b7b8d6..e8749579ff 100644 --- a/mkspecs/features/create_cmake.prf +++ b/mkspecs/features/create_cmake.prf @@ -133,11 +133,16 @@ contains(CONFIG, plugin) { CMAKE_PLUGIN_NAME = $$PLUGIN_CLASS_NAME win32 { - isEmpty(CMAKE_STATIC_TYPE): CMAKE_PlUGIN_EXT = .dll - else: CMAKE_PlUGIN_EXT = .lib - - CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/$${TARGET}$${CMAKE_PlUGIN_EXT} - CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/$${TARGET}d$${CMAKE_PlUGIN_EXT} + isEmpty(CMAKE_STATIC_TYPE) { + CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/$${TARGET}.dll + CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/$${TARGET}d.dll + } else:mingw { + CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${TARGET}.a + CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${TARGET}d.a + } else { # MSVC static + CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/$${TARGET}.lib + CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/$${TARGET}d.lib + } } else { mac { isEmpty(CMAKE_STATIC_TYPE): CMAKE_PlUGIN_EXT = .dylib -- cgit v1.2.3 From 996054f5e65bc676aaea0743c2eacec51918e4aa Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Thu, 25 Sep 2014 19:53:49 +0200 Subject: QCocoaMenu: Keep a reference to the containing menu item MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows the menu to tell its containing item the menu got deleted. This removes the need to reset the COCOA_MENU_ANCESTOR property value, which would crash since QCocoaMenuItem::m_menu would be a dangling pointer. Task-number: QTBUG-41587 Change-Id: Ia3408ef85cf823bfddbc2c41d6534e43bf14ed29 Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qcocoamenu.h | 5 +++++ src/plugins/platforms/cocoa/qcocoamenu.mm | 17 ++++++++++++++++- src/plugins/platforms/cocoa/qcocoamenuitem.h | 1 + src/plugins/platforms/cocoa/qcocoamenuitem.mm | 16 ++++++++++++++-- 4 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoamenu.h b/src/plugins/platforms/cocoa/qcocoamenu.h index 3ee1dab84d..a05d2a4a38 100644 --- a/src/plugins/platforms/cocoa/qcocoamenu.h +++ b/src/plugins/platforms/cocoa/qcocoamenu.h @@ -94,6 +94,10 @@ public: QList merged() const; void setMenuBar(QCocoaMenuBar *menuBar); QCocoaMenuBar *menuBar() const; + + void setContainingMenuItem(QCocoaMenuItem *menuItem); + QCocoaMenuItem *containingMenuItem() const; + private: QCocoaMenuItem *itemOrNull(int index) const; void insertNative(QCocoaMenuItem *item, QCocoaMenuItem *beforeItem); @@ -106,6 +110,7 @@ private: bool m_visible; quintptr m_tag; QCocoaMenuBar *m_menuBar; + QCocoaMenuItem *m_containingMenuItem; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm index 3d0201e1a0..fcf670d0ef 100644 --- a/src/plugins/platforms/cocoa/qcocoamenu.mm +++ b/src/plugins/platforms/cocoa/qcocoamenu.mm @@ -222,7 +222,8 @@ QCocoaMenu::QCocoaMenu() : m_enabled(true), m_visible(true), m_tag(0), - m_menuBar(0) + m_menuBar(0), + m_containingMenuItem(0) { m_delegate = [[QCocoaMenuDelegate alloc] initWithMenu:this]; m_nativeItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""]; @@ -238,6 +239,10 @@ QCocoaMenu::~QCocoaMenu() if (COCOA_MENU_ANCESTOR(item) == this) SET_COCOA_MENU_ANCESTOR(item, 0); } + + if (m_containingMenuItem) + m_containingMenuItem->clearMenu(this); + QCocoaAutoReleasePool pool; [m_nativeItem setSubmenu:nil]; [m_nativeMenu release]; @@ -567,4 +572,14 @@ QCocoaMenuBar *QCocoaMenu::menuBar() const return m_menuBar; } +void QCocoaMenu::setContainingMenuItem(QCocoaMenuItem *menuItem) +{ + m_containingMenuItem = menuItem; +} + +QCocoaMenuItem *QCocoaMenu::containingMenuItem() const +{ + return m_containingMenuItem; +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/cocoa/qcocoamenuitem.h b/src/plugins/platforms/cocoa/qcocoamenuitem.h index 1efc9f9bfd..847064e6cf 100644 --- a/src/plugins/platforms/cocoa/qcocoamenuitem.h +++ b/src/plugins/platforms/cocoa/qcocoamenuitem.h @@ -101,6 +101,7 @@ public: inline bool isSeparator() const { return m_isSeparator; } QCocoaMenu *menu() const { return m_menu; } + void clearMenu(QCocoaMenu *menu); MenuRole effectiveRole() const; private: diff --git a/src/plugins/platforms/cocoa/qcocoamenuitem.mm b/src/plugins/platforms/cocoa/qcocoamenuitem.mm index 4b9a0146a9..f686c0a838 100644 --- a/src/plugins/platforms/cocoa/qcocoamenuitem.mm +++ b/src/plugins/platforms/cocoa/qcocoamenuitem.mm @@ -131,13 +131,19 @@ void QCocoaMenuItem::setMenu(QPlatformMenu *menu) { if (menu == m_menu) return; - if (m_menu && COCOA_MENU_ANCESTOR(m_menu) == this) - SET_COCOA_MENU_ANCESTOR(m_menu, 0); + + if (m_menu) { + if (COCOA_MENU_ANCESTOR(m_menu) == this) + SET_COCOA_MENU_ANCESTOR(m_menu, 0); + if (m_menu->containingMenuItem() == this) + m_menu->setContainingMenuItem(0); + } QCocoaAutoReleasePool pool; m_menu = static_cast(menu); if (m_menu) { SET_COCOA_MENU_ANCESTOR(m_menu, this); + m_menu->setContainingMenuItem(this); } else { // we previously had a menu, but no longer // clear out our item so the nexy sync() call builds a new one @@ -146,6 +152,12 @@ void QCocoaMenuItem::setMenu(QPlatformMenu *menu) } } +void QCocoaMenuItem::clearMenu(QCocoaMenu *menu) +{ + if (menu == m_menu) + m_menu = 0; +} + void QCocoaMenuItem::setVisible(bool isVisible) { m_isVisible = isVisible; -- cgit v1.2.3 From ee6e9cbf36a189a4f59851ea3b069560e823b4ef Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Wed, 24 Sep 2014 18:04:02 +0200 Subject: QMacStyle: Generalize Cocoa control rendering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So far, we were restricted by the values of ThemeButtonKind, which consist mostly of buttons. We want to generalize to other kind of controls when the time arrives. Already, QPushButton with pull- down menu is not possible to get from that enum, while its easy to get from NSPopupButton. Task-number: QTBUG-40833 Change-Id: I244c42c42ab595f4790050eb15ade70443e155b2 Reviewed-by: Morten Johan Sørvig --- src/widgets/styles/qmacstyle_mac.mm | 132 +++++++++++++++++++++------------ src/widgets/styles/qmacstyle_mac_p_p.h | 16 +++- 2 files changed, 97 insertions(+), 51 deletions(-) diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index 60e18eae5a..9bfa51094b 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -1717,7 +1717,7 @@ QMacStylePrivate::QMacStylePrivate() QMacStylePrivate::~QMacStylePrivate() { - Q_FOREACH (NSView *b, buttons) + Q_FOREACH (NSView *b, cocoaControls) [b release]; } @@ -1738,43 +1738,92 @@ ThemeDrawState QMacStylePrivate::getDrawState(QStyle::State flags) return tds; } -NSView *QMacStylePrivate::buttonOfKind(ThemeButtonKind kind, QPoint *offset) const +static QCocoaWidget cocoaWidgetFromHIThemeButtonKind(ThemeButtonKind kind) { - NSView *bv = buttons[kind]; + QCocoaWidget w; + + switch (kind) { + case kThemePopupButton: + case kThemePopupButtonSmall: + case kThemePopupButtonMini: + w.first = QCocoaPopupButton; + break; + case kThemeComboBox: + w.first = QCocoaComboBox; + break; + case kThemeArrowButton: + w.first = QCocoaArrowButton; + break; + case kThemeCheckBox: + case kThemeCheckBoxSmall: + case kThemeCheckBoxMini: + w.first = QCocoaCheckBox; + break; + case kThemeRadioButton: + case kThemeRadioButtonSmall: + case kThemeRadioButtonMini: + w.first = QCocoaRadioButton; + break; + case kThemePushButton: + case kThemePushButtonSmall: + case kThemePushButtonMini: + w.first = QCocoaPushButton; + break; + default: + break; + } + + switch (kind) { + case kThemePushButtonSmall: + case kThemePopupButtonSmall: + case kThemeCheckBoxSmall: + case kThemeRadioButtonSmall: + w.second = QAquaSizeSmall; + break; + case kThemePushButtonMini: + case kThemePopupButtonMini: + case kThemeCheckBoxMini: + case kThemeRadioButtonMini: + w.second = QAquaSizeMini; + break; + default: + w.second = QAquaSizeLarge; + break; + } + + return w; +} + +NSView *QMacStylePrivate::cocoaControl(QCocoaWidget widget, QPoint *offset) const +{ + NSView *bv = cocoaControls[widget]; if (!bv) { - if (kind == kThemePopupButton - || kind == kThemePopupButtonSmall - || kind == kThemePopupButtonMini) + + if (widget.first == QCocoaPopupButton) bv = [[NSPopUpButton alloc] init]; - else if (kind == kThemeComboBox) + else if (widget.first == QCocoaComboBox) bv = [[NSComboBox alloc] init]; else bv = [[NSButton alloc] init]; - switch (kind) { - case kThemeArrowButton: { + switch (widget.first) { + case QCocoaArrowButton: { NSButton *bc = (NSButton *)bv; bc.buttonType = NSOnOffButton; bc.bezelStyle = NSDisclosureBezelStyle; break; } - case kThemeCheckBox: - case kThemeCheckBoxSmall: - case kThemeCheckBoxMini: { + case QCocoaCheckBox: { NSButton *bc = (NSButton *)bv; bc.buttonType = NSSwitchButton; break; } - case kThemeRadioButton: - case kThemeRadioButtonSmall: - case kThemeRadioButtonMini: { + case QCocoaRadioButton: { NSButton *bc = (NSButton *)bv; bc.buttonType = NSRadioButton; break; } - case kThemePushButton: - case kThemePushButtonSmall: - case kThemePushButtonMini: { + case QCocoaPushButton: { NSButton *bc = (NSButton *)bv; bc.buttonType = NSMomentaryPushButton; bc.bezelStyle = NSRoundedBezelStyle; @@ -1787,19 +1836,15 @@ NSView *QMacStylePrivate::buttonOfKind(ThemeButtonKind kind, QPoint *offset) con if ([bv isKindOfClass:[NSButton class]]) { NSButton *bc = (NSButton *)bv; bc.title = nil; + } - NSCell *bcell = bc.cell; - switch (kind) { - case kThemePushButtonSmall: - case kThemePopupButtonSmall: - case kThemeCheckBoxSmall: - case kThemeRadioButtonSmall: + if ([bv isKindOfClass:[NSControl class]]) { + NSCell *bcell = [(NSControl *)bv cell]; + switch (widget.second) { + case QAquaSizeSmall: bcell.controlSize = NSSmallControlSize; break; - case kThemePushButtonMini: - case kThemePopupButtonMini: - case kThemeCheckBoxMini: - case kThemeRadioButtonMini: + case QAquaSizeMini: bcell.controlSize = NSMiniControlSize; break; default: @@ -1807,36 +1852,25 @@ NSView *QMacStylePrivate::buttonOfKind(ThemeButtonKind kind, QPoint *offset) con } } - const_cast(this)->buttons.insert(kind, bv); + const_cast(this)->cocoaControls.insert(widget, bv); } if (offset) { - switch (kind) { - case kThemeRadioButton: + if (widget == QCocoaWidget(QCocoaRadioButton, QAquaSizeLarge)) offset->setY(2); - break; - case kThemeRadioButtonSmall: + else if (widget == QCocoaWidget(QCocoaRadioButton, QAquaSizeSmall)) *offset = QPoint(-1, 2); - break; - case kThemeRadioButtonMini: + else if (widget == QCocoaWidget(QCocoaRadioButton, QAquaSizeMini)) offset->setY(2); - break; - case kThemePopupButtonSmall: - case kThemeCheckBox: + else if (widget == QCocoaWidget(QCocoaPopupButton, QAquaSizeSmall) + || widget == QCocoaWidget(QCocoaCheckBox, QAquaSizeLarge)) offset->setY(1); - break; - case kThemeCheckBoxSmall: + else if (widget == QCocoaWidget(QCocoaCheckBox, QAquaSizeSmall)) offset->setX(-1); - break; - case kThemeCheckBoxMini: + else if (widget == QCocoaWidget(QCocoaCheckBox, QAquaSizeMini)) *offset = QPoint(7, 5); - break; - case kThemePopupButtonMini: + else if (widget == QCocoaWidget(QCocoaPopupButton, QAquaSizeMini)) *offset = QPoint(2, -1); - break; - default: - break; - } } return bv; @@ -1956,7 +1990,7 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD pm = QPixmap::fromImage(image); } else if ((usingYosemiteOrLater && combo && !editableCombo) || button) { QPoint offset; - NSButton *bc = (NSButton *)buttonOfKind(bdi->kind, &offset); + NSButton *bc = (NSButton *)cocoaControl(cocoaWidgetFromHIThemeButtonKind(bdi->kind), &offset); [bc highlight:pressed]; bc.enabled = bdi->state != kThemeStateUnavailable && bdi->state != kThemeStateUnavailableInactive; bc.allowsMixedState = YES; diff --git a/src/widgets/styles/qmacstyle_mac_p_p.h b/src/widgets/styles/qmacstyle_mac_p_p.h index e4aad113d0..8fdeab9163 100644 --- a/src/widgets/styles/qmacstyle_mac_p_p.h +++ b/src/widgets/styles/qmacstyle_mac_p_p.h @@ -93,6 +93,7 @@ #include #include #include +#include #include #include #include @@ -128,6 +129,17 @@ QT_BEGIN_NAMESPACE enum QAquaWidgetSize { QAquaSizeLarge = 0, QAquaSizeSmall = 1, QAquaSizeMini = 2, QAquaSizeUnknown = -1 }; +enum QCocoaWidgetKind { + QCocoaArrowButton, // Disclosure triangle, like in QTreeView + QCocoaCheckBox, + QCocoaComboBox, // Editable QComboBox + QCocoaPopupButton, // Non-editable QComboBox + QCocoaPushButton, + QCocoaRadioButton +}; + +typedef QPair QCocoaWidget; + #define SIZE(large, small, mini) \ (controlSize == QAquaSizeLarge ? (large) : controlSize == QAquaSizeSmall ? (small) : (mini)) @@ -195,7 +207,7 @@ public: void setAutoDefaultButton(QObject *button) const; - NSView *buttonOfKind(ThemeButtonKind kind, QPoint *offset) const; + NSView *cocoaControl(QCocoaWidget widget, QPoint *offset) const; void drawNSViewInRect(NSView *view, const QRect &rect, QPainter *p) const; void resolveCurrentNSView(QWindow *window); @@ -219,7 +231,7 @@ public: #endif void *indicatorBranchButtonCell; NSView *backingStoreNSView; - QHash buttons; + QHash cocoaControls; }; QT_END_NAMESPACE -- cgit v1.2.3 From 27bc4c4ce5f1af8fd06b60c5d06e011001ea3613 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 22 Sep 2014 15:50:29 +0200 Subject: QPlainTextEdit: Fix crash on complex undo w/full width selection Say you have a document of two blocks of text. When you select a block of text in the document and then replace this with a new empty block (by pressing enter) and then subsequently undo this action, the following three steps are performed as a chain of undo commands: 1. Remove the empty block at the beginning of the document 2. Insert a new empty block at the beginning of the document 3. Insert the text back into the first block Since a block is removed and inserted in the same go, both blocks require a relayout, since the accumulated change spans both blocks. However, in QPlainTextDocumentLayout we would only look at the max of either removed chars or added chars. This would match the text length of the first block at this point, so we would only relayout that block. However, since we are also removing characters, the actual accumulated change to the document is larger. We should relayout any block touched by the sum of the added and removed character counts. Missing this, the paint event would later query block.layout()->lineForTextPosition(0) which would give an invalid line despite the fact that the block.length() > 0. This caused a crash in the paint event when the full width selection was turned on. Note that the logic here was only recently updated to include the removed characters at all in the logic, by the SHA1: 2983cb9531d47e5826540ca79e3066a8ed0db30c. [ChangeLog][QPlainTextEdit] Fixed a crash when using full width selections and issuing a complex undo command chain which removes and inserts an empty block in one go. Task-number: QTBUG-36415 Change-Id: Iafe8a69e455e0c713a48714f10f0cace69c84f51 Reviewed-by: Axel Rasmussen Reviewed-by: Konstantin Ritt Reviewed-by: Simon Hausmann --- src/widgets/widgets/qplaintextedit.cpp | 2 +- .../widgets/qplaintextedit/tst_qplaintextedit.cpp | 25 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/widgets/widgets/qplaintextedit.cpp b/src/widgets/widgets/qplaintextedit.cpp index bd7f844eca..8f0fff3d5c 100644 --- a/src/widgets/widgets/qplaintextedit.cpp +++ b/src/widgets/widgets/qplaintextedit.cpp @@ -289,7 +289,7 @@ void QPlainTextDocumentLayout::documentChanged(int from, int charsRemoved, int c Q_D(QPlainTextDocumentLayout); QTextDocument *doc = document(); int newBlockCount = doc->blockCount(); - int charsChanged = qMax(charsRemoved, charsAdded); + int charsChanged = charsRemoved + charsAdded; QTextBlock changeStartBlock = doc->findBlock(from); QTextBlock changeEndBlock = doc->findBlock(qMax(0, from + charsChanged - 1)); diff --git a/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp b/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp index c47f7b1ff6..613d4fa28c 100644 --- a/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp +++ b/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp @@ -155,6 +155,7 @@ private slots: void findWithRegExpReturnsFalseIfNoMoreResults(); #endif void layoutAfterMultiLineRemove(); + void undoCommandRemovesAndReinsertsBlock(); private: void createSelection(); @@ -1612,5 +1613,29 @@ void tst_QPlainTextEdit::layoutAfterMultiLineRemove() QCOMPARE(curs.blockNumber(), 3); } +void tst_QPlainTextEdit::undoCommandRemovesAndReinsertsBlock() +{ + ed->setVisible(true); + ed->setPlainText(QStringLiteral("line1\nline2")); + QCOMPARE(ed->document()->blockCount(), 2); + + QTextCursor cursor = ed->textCursor(); + cursor.movePosition(QTextCursor::Start); + cursor.movePosition(QTextCursor::NextBlock, QTextCursor::KeepAnchor); + cursor.insertText(QStringLiteral("\n")); + QCOMPARE(ed->document()->blockCount(), 2); + + ed->undo(); + QCOMPARE(ed->document()->blockCount(), 2); + + QTextBlock block; + for (block = ed->document()->begin(); block != ed->document()->end(); block = block.next()) { + QVERIFY(block.isValid()); + QCOMPARE(block.length(), 6); + QVERIFY(block.layout()->lineForTextPosition(0).isValid()); + } + +} + QTEST_MAIN(tst_QPlainTextEdit) #include "tst_qplaintextedit.moc" -- cgit v1.2.3 From 138e14d7bb749c08c751ca107393ce8b29c692d9 Mon Sep 17 00:00:00 2001 From: Dyami Caliri Date: Thu, 25 Sep 2014 10:37:34 -0700 Subject: Accessibility: Fix crash with invalid QAccessibleInterface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Windows accessibility can crash if it handles an event with an invalid QAccessibleInterface pointer (one whose object has been deleted). Task-number: QTBUG-41597 Change-Id: Iba099f7cb732fd00f18f04bd951c6cdd94785871 Reviewed-by: Friedemann Kleint Reviewed-by: Jan Arve Sæther --- src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp b/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp index 307f2fc3bb..139e1dbecd 100644 --- a/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp +++ b/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp @@ -159,7 +159,7 @@ void QWindowsAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event) // An event has to be associated with a window, // so find the first parent that is a widget and that has a WId QAccessibleInterface *iface = event->accessibleInterface(); - if (!iface) // ### This should not happen, maybe make it an assert. + if (!iface || !iface->isValid()) return; QWindow *window = QWindowsAccessibility::windowHelper(iface); -- cgit v1.2.3 From aedfb7e9826146f954d7c029c55bbea7dc0d350b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 30 Sep 2014 11:04:31 +0200 Subject: actually use DIRLIST_SEPARATOR it's QMAKE_DIRLIST_SEP and DIRLIST_SEPARATOR. pure evil. Task-number: QTBUG-41668 Change-Id: Ie2f6db6530e0f50bc1ce5db593180e7ad703766b Reviewed-by: Joerg Bornemann Reviewed-by: Eskil Abrahamsen Blomfeldt --- mkspecs/features/java.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/java.prf b/mkspecs/features/java.prf index 1c55b8974e..1b9754da8a 100644 --- a/mkspecs/features/java.prf +++ b/mkspecs/features/java.prf @@ -30,7 +30,7 @@ CONFIG += plugin no_plugin_name_prefix javac.input = JAVASOURCES javac.output = $$CLASS_DIR javac.CONFIG += combine -javac.commands = javac -source 6 -target 6 -Xlint:unchecked -bootclasspath $$ANDROID_JAR_FILE -cp $$shell_quote($$system_path($$join(JAVACLASSPATH, $$DIRLIST_SEP))) -d $$shell_quote($$CLASS_DIR) ${QMAKE_FILE_IN} +javac.commands = javac -source 6 -target 6 -Xlint:unchecked -bootclasspath $$ANDROID_JAR_FILE -cp $$shell_quote($$system_path($$join(JAVACLASSPATH, $$DIRLIST_SEPARATOR))) -d $$shell_quote($$CLASS_DIR) ${QMAKE_FILE_IN} # Force rebuild every time, because we don't know the paths of the destination files # as they depend on the code. javac.depends = FORCE -- cgit v1.2.3 From b56ff1f394b30d61f79c549903fa5b686d116868 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 25 Sep 2014 17:54:16 +0200 Subject: write 'all' target later MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this allows us to extend its dependencies, which we will make use of later. Change-Id: I8809bdffb435455338e88e97049b10beeab0468a Reviewed-by: Morten Johan Sørvig --- qmake/generators/unix/unixmake2.cpp | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index cc375f5c46..2153b24c95 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -376,6 +376,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } } } + QString allDeps; if (!project->values("QMAKE_APP_FLAG").isEmpty() || project->first("TEMPLATE") == "aux") { QString destdir = project->first("DESTDIR").toQString(); if(!project->isEmpty("QMAKE_BUNDLE")) { @@ -436,8 +437,6 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) deps.prepend(incr_target_dir + " "); incr_deps = "$(OBJECTS)"; } - t << "all: " << escapeDependencyPath(deps) << " " << valGlue(escapeDependencyPaths(project->values("ALL_DEPS")),""," "," ") << "$(TARGET)" - << endl << endl; //real target t << var("TARGET") << ": " << var("PRE_TARGETDEPS") << " " << incr_deps << " " << target_deps @@ -451,9 +450,6 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << "\n\t" << var("QMAKE_POST_LINK"); t << endl << endl; } else { - t << "all: " << escapeDependencyPath(deps) << " " << valGlue(escapeDependencyPaths(project->values("ALL_DEPS")),""," "," ") << "$(TARGET)" - << endl << endl; - t << "$(TARGET): " << var("PRE_TARGETDEPS") << " $(OBJECTS) " << target_deps << " " << var("POST_TARGETDEPS") << "\n\t"; if (project->first("TEMPLATE") != "aux") { @@ -467,6 +463,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } t << endl << endl; } + allDeps = " $(TARGET)"; } else if(!project->isActiveConfig("staticlib")) { QString destdir = unescapeFilePath(project->first("DESTDIR").toQString()), incr_deps; if(!project->isEmpty("QMAKE_BUNDLE")) { @@ -526,19 +523,15 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) incr_deps = "$(OBJECTS)"; } - t << "all: " << escapeDependencyPath(deps) << " " << valGlue(escapeDependencyPaths(project->values("ALL_DEPS")),""," "," ") - << " " << destdir << "$(TARGET)\n\n"; - //real target t << destdir << "$(TARGET): " << var("PRE_TARGETDEPS") << " " << incr_deps << " $(SUBLIBS) " << target_deps << " " << var("POST_TARGETDEPS"); } else { - t << "all: " << escapeDependencyPath(deps) << " " << valGlue(escapeDependencyPaths(project->values("ALL_DEPS")),""," "," ") << " " << - destdir << "$(TARGET)\n\n"; t << destdir << "$(TARGET): " << var("PRE_TARGETDEPS") << " $(OBJECTS) $(SUBLIBS) $(OBJCOMP) " << target_deps << " " << var("POST_TARGETDEPS"); } + allDeps = ' ' + destdir + "$(TARGET)"; if(!destdir.isEmpty()) t << "\n\t" << mkdir_p_asstring(destdir, false); if(!project->isEmpty("QMAKE_PRE_LINK")) @@ -641,9 +634,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } } else { QString destdir = project->first("DESTDIR").toQString(); - t << "all: " << escapeDependencyPath(deps) << " " << valGlue(escapeDependencyPaths(project->values("ALL_DEPS")),""," "," ") << destdir << "$(TARGET) " - << varGlue("QMAKE_AR_SUBLIBS", destdir, " " + destdir, "") << "\n\n" - << "staticlib: " << destdir << "$(TARGET)\n\n"; + allDeps = ' ' + destdir + "$(TARGET)" + + varGlue("QMAKE_AR_SUBLIBS", ' ' + destdir, ' ' + destdir, ""); + t << "staticlib: " << destdir << "$(TARGET)\n\n"; if(project->isEmpty("QMAKE_AR_SUBLIBS")) { t << destdir << "$(TARGET): " << var("PRE_TARGETDEPS") << " $(OBJECTS) $(OBJCOMP) " << var("POST_TARGETDEPS") << "\n\t"; @@ -828,6 +821,10 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } } + t << endl << "all: " << escapeDependencyPath(deps) + << valGlue(escapeDependencyPaths(project->values("ALL_DEPS")), " ", " ", "") + << allDeps << endl << endl; + ProString ddir; ProString packageName(project->first("QMAKE_ORIG_TARGET")); if(!project->isActiveConfig("no_dist_version")) -- cgit v1.2.3 From e9c1e3076c748149eed5296f999688db7a26488b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 25 Sep 2014 15:28:53 +0200 Subject: make top-level symlinks in bundles point to Current, not the major version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Current already points to the major version, and the other symlinks are supposed to take advantage of that (so a hypothetical change of major versions requires just one symlink to be adjusted). https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/FrameworkAnatomy.html Task-number: QTBUG-32895 Change-Id: I3c3a38c72ba18de6e48b20f2662341672022a274 Reviewed-by: Morten Johan Sørvig --- qmake/generators/unix/unixmake2.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 2153b24c95..55a94bef90 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -794,7 +794,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) bundledFiles << link; t << link << ": \n\t" << mkdir_p_asstring(path) << "\n\t" - << "@$(SYMLINK) " << version << project->first(pkey) << " " << path << endl; + << "@$(SYMLINK) " << project->first(vkey) + "/Current/" << project->first(pkey) + << " " << path << endl; path += version; } path += project->first(pkey).toQString(); -- cgit v1.2.3 From 4849037851b210507df63eb4aed7e467c834be62 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 25 Sep 2014 16:46:15 +0200 Subject: nest bundle-related conditionals for clarity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I97f9d87cb5a114bf4764f13f0fd0d22e9b4da96f Reviewed-by: Morten Johan Sørvig --- qmake/generators/unix/unixmake2.cpp | 39 +++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 55a94bef90..77170c3e89 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -702,26 +702,27 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) << "@$(QMAKE) -prl " << buildArgs() << " " << project->projectFile() << endl; } - if(!project->first("QMAKE_PKGINFO").isEmpty()) { - ProString pkginfo = escapeFilePath(project->first("QMAKE_PKGINFO")); - QString destdir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents"; - t << pkginfo << ": \n\t"; - if(!destdir.isEmpty()) + if (!project->isEmpty("QMAKE_BUNDLE")) { + if (!project->first("QMAKE_PKGINFO").isEmpty()) { + ProString pkginfo = escapeFilePath(project->first("QMAKE_PKGINFO")); + QString destdir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents"; + t << pkginfo << ": \n\t"; + if (!destdir.isEmpty()) + t << mkdir_p_asstring(destdir) << "\n\t"; + t << "@$(DEL_FILE) " << pkginfo << "\n\t" + << "@echo \"APPL" + << (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") + ? QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) + << "\" >" << pkginfo << endl; + } + if (!project->first("QMAKE_BUNDLE_RESOURCE_FILE").isEmpty()) { + ProString resources = escapeFilePath(project->first("QMAKE_BUNDLE_RESOURCE_FILE")); + bundledFiles << resources; + QString destdir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents/Resources"; + t << resources << ": \n\t"; t << mkdir_p_asstring(destdir) << "\n\t"; - t << "@$(DEL_FILE) " << pkginfo << "\n\t" - << "@echo \"APPL" - << (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) - << "\" >" << pkginfo << endl; - } - if(!project->first("QMAKE_BUNDLE_RESOURCE_FILE").isEmpty()) { - ProString resources = escapeFilePath(project->first("QMAKE_BUNDLE_RESOURCE_FILE")); - bundledFiles << resources; - QString destdir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents/Resources"; - t << resources << ": \n\t"; - t << mkdir_p_asstring(destdir) << "\n\t"; - t << "@touch " << resources << "\n\t\n"; - } - if(!project->isEmpty("QMAKE_BUNDLE")) { + t << "@touch " << resources << "\n\t\n"; + } //copy the plist QString info_plist = escapeFilePath(fileFixify(project->first("QMAKE_INFO_PLIST").toQString())), info_plist_out = escapeFilePath(project->first("QMAKE_INFO_PLIST_OUT").toQString()); -- cgit v1.2.3 From 59e8d430e9b8ff270246b64c1096f50151d32ec8 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 25 Sep 2014 16:48:44 +0200 Subject: centralize bundle_dir calculation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I353fb4eafc014bccdec71af42f8625b33488ae0d Reviewed-by: Morten Johan Sørvig --- qmake/generators/unix/unixmake2.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 77170c3e89..d900d28144 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -703,9 +703,10 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } if (!project->isEmpty("QMAKE_BUNDLE")) { + QString bundle_dir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/"; if (!project->first("QMAKE_PKGINFO").isEmpty()) { ProString pkginfo = escapeFilePath(project->first("QMAKE_PKGINFO")); - QString destdir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents"; + QString destdir = bundle_dir + "Contents"; t << pkginfo << ": \n\t"; if (!destdir.isEmpty()) t << mkdir_p_asstring(destdir) << "\n\t"; @@ -718,7 +719,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if (!project->first("QMAKE_BUNDLE_RESOURCE_FILE").isEmpty()) { ProString resources = escapeFilePath(project->first("QMAKE_BUNDLE_RESOURCE_FILE")); bundledFiles << resources; - QString destdir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents/Resources"; + QString destdir = bundle_dir + "Contents/Resources"; t << resources << ": \n\t"; t << mkdir_p_asstring(destdir) << "\n\t"; t << "@touch " << resources << "\n\t\n"; @@ -760,7 +761,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) << "" << info_plist << " >" << info_plist_out << endl; //copy the icon if(!project->isEmpty("ICON")) { - QString dir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents/Resources/"; + QString dir = bundle_dir + "Contents/Resources/"; const QString icon_path = escapeFilePath(dir + icon.section(Option::dir_sep, -1)); bundledFiles << icon_path; t << icon_path << ": " << icon << "\n\t" @@ -781,7 +782,6 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } //copy other data if(!project->isEmpty("QMAKE_BUNDLE_DATA")) { - QString bundle_dir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/"; const ProStringList &bundle_data = project->values("QMAKE_BUNDLE_DATA"); for(int i = 0; i < bundle_data.count(); i++) { const ProStringList &files = project->values(ProKey(bundle_data[i] + ".files")); -- cgit v1.2.3 From 10bd8e2104331e26ead4d3e43a41f997693fd494 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Wed, 30 Oct 2013 16:20:35 +0100 Subject: Don't make Info.plist for debug framework bundles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We do so by setting a 'no_plist' config property. Can be overridden with 'force_debug_plist'. The debug version of Info.plist would overwrite the release version, and it also happens to contain invalid data. In particular, CFBundleExecutable would contain the _debug suffixed libname, which it shouldn't. See the entry about CFBundleExecutable on https://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html Task-number: QTBUG-32894 Change-Id: Ideb018e4768a7c4e276e1b07d77937451f6db6a2 Reviewed-by: Morten Johan Sørvig --- mkspecs/features/resolve_config.prf | 7 ++- qmake/generators/unix/unixmake2.cpp | 112 ++++++++++++++++++------------------ 2 files changed, 62 insertions(+), 57 deletions(-) diff --git a/mkspecs/features/resolve_config.prf b/mkspecs/features/resolve_config.prf index 7835fe4f7c..b712a2b58e 100644 --- a/mkspecs/features/resolve_config.prf +++ b/mkspecs/features/resolve_config.prf @@ -25,10 +25,13 @@ CONFIG(static, static|shared) { !macx-xcode: \ addExclusiveBuilds(shared, static) -CONFIG(debug, debug|release): \ +CONFIG(debug, debug|release) { CONFIG -= release -else: \ + !force_debug_plist:debug_and_release: \ + CONFIG += no_plist +} else { CONFIG -= debug +} !macx-xcode { addExclusiveBuilds(debug, release) diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index d900d28144..50e0ec52a7 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -725,61 +725,63 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << "@touch " << resources << "\n\t\n"; } //copy the plist - QString info_plist = escapeFilePath(fileFixify(project->first("QMAKE_INFO_PLIST").toQString())), - info_plist_out = escapeFilePath(project->first("QMAKE_INFO_PLIST_OUT").toQString()); - if (info_plist.isEmpty()) - info_plist = specdir() + QDir::separator() + "Info.plist." + project->first("TEMPLATE"); - bundledFiles << info_plist_out; - QString destdir = info_plist_out.section(Option::dir_sep, 0, -2); - t << info_plist_out << ": \n\t"; - if(!destdir.isEmpty()) - t << mkdir_p_asstring(destdir, false) << "\n\t"; - ProStringList commonSedArgs; - if (!project->values("VERSION").isEmpty()) - commonSedArgs << "-e \"s,@SHORT_VERSION@," << project->first("VER_MAJ") << "." << project->first("VER_MIN") << ",g\" "; - commonSedArgs << "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? - QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" "; - if(project->first("TEMPLATE") == "app") { - QString icon = fileFixify(var("ICON")); - QString bundlePrefix = project->first("QMAKE_TARGET_BUNDLE_PREFIX").toQString(); - if (bundlePrefix.isEmpty()) - bundlePrefix = "com.yourcompany"; - if (bundlePrefix.endsWith(".")) - bundlePrefix.chop(1); - QString bundleIdentifier = bundlePrefix + "." + var("QMAKE_BUNDLE"); - if (bundleIdentifier.endsWith(".app")) - bundleIdentifier.chop(4); - t << "@$(DEL_FILE) " << info_plist_out << "\n\t" - << "@sed "; - foreach (const ProString &arg, commonSedArgs) - t << arg; - t << "-e \"s,@ICON@," << icon.section(Option::dir_sep, -1) << ",g\" " - << "-e \"s,@BUNDLEIDENTIFIER@," << bundleIdentifier << ",g\" " - << "-e \"s,@EXECUTABLE@," << var("QMAKE_ORIG_TARGET") << ",g\" " - << "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? - QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" " - << "" << info_plist << " >" << info_plist_out << endl; - //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)); - bundledFiles << icon_path; - t << icon_path << ": " << icon << "\n\t" - << mkdir_p_asstring(dir) << "\n\t" - << "@$(DEL_FILE) " << icon_path << "\n\t" - << "@$(COPY_FILE) " << escapeFilePath(icon) << " " << icon_path << endl; + if (!project->isActiveConfig("no_plist")) { + QString info_plist = escapeFilePath(fileFixify(project->first("QMAKE_INFO_PLIST").toQString())), + info_plist_out = escapeFilePath(project->first("QMAKE_INFO_PLIST_OUT").toQString()); + if (info_plist.isEmpty()) + info_plist = specdir() + QDir::separator() + "Info.plist." + project->first("TEMPLATE"); + bundledFiles << info_plist_out; + QString destdir = info_plist_out.section(Option::dir_sep, 0, -2); + t << info_plist_out << ": \n\t"; + if (!destdir.isEmpty()) + t << mkdir_p_asstring(destdir, false) << "\n\t"; + ProStringList commonSedArgs; + if (!project->values("VERSION").isEmpty()) + commonSedArgs << "-e \"s,@SHORT_VERSION@," << project->first("VER_MAJ") << "." << project->first("VER_MIN") << ",g\" "; + commonSedArgs << "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? + QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" "; + if (project->first("TEMPLATE") == "app") { + QString icon = fileFixify(var("ICON")); + QString bundlePrefix = project->first("QMAKE_TARGET_BUNDLE_PREFIX").toQString(); + if (bundlePrefix.isEmpty()) + bundlePrefix = "com.yourcompany"; + if (bundlePrefix.endsWith(".")) + bundlePrefix.chop(1); + QString bundleIdentifier = bundlePrefix + "." + var("QMAKE_BUNDLE"); + if (bundleIdentifier.endsWith(".app")) + bundleIdentifier.chop(4); + t << "@$(DEL_FILE) " << info_plist_out << "\n\t" + << "@sed "; + foreach (const ProString &arg, commonSedArgs) + t << arg; + t << "-e \"s,@ICON@," << icon.section(Option::dir_sep, -1) << ",g\" " + << "-e \"s,@BUNDLEIDENTIFIER@," << bundleIdentifier << ",g\" " + << "-e \"s,@EXECUTABLE@," << var("QMAKE_ORIG_TARGET") << ",g\" " + << "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? + QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" " + << "" << info_plist << " >" << info_plist_out << endl; + //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)); + bundledFiles << icon_path; + t << icon_path << ": " << icon << "\n\t" + << mkdir_p_asstring(dir) << "\n\t" + << "@$(DEL_FILE) " << icon_path << "\n\t" + << "@$(COPY_FILE) " << escapeFilePath(icon) << " " << icon_path << endl; + } + } else { + t << "@$(DEL_FILE) " << info_plist_out << "\n\t" + << "@sed "; + foreach (const ProString &arg, commonSedArgs) + t << arg; + t << "-e \"s,@LIBRARY@," << var("QMAKE_ORIG_TARGET") << ",g\" " + << "-e \"s,@TYPEINFO@," + << (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? + QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" " + << "" << info_plist << " >" << info_plist_out << endl; } - } else { - t << "@$(DEL_FILE) " << info_plist_out << "\n\t" - << "@sed "; - foreach (const ProString &arg, commonSedArgs) - t << arg; - t << "-e \"s,@LIBRARY@," << var("QMAKE_ORIG_TARGET") << ",g\" " - << "-e \"s,@TYPEINFO@," - << (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? - QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" " - << "" << info_plist << " >" << info_plist_out << endl; - } + } // project->isActiveConfig("no_plist") //copy other data if(!project->isEmpty("QMAKE_BUNDLE_DATA")) { const ProStringList &bundle_data = project->values("QMAKE_BUNDLE_DATA"); @@ -1267,7 +1269,7 @@ void UnixMakefileGenerator::init2() project->values("QMAKE_CXXFLAGS") += MD_flag; } - if(!project->isEmpty("QMAKE_BUNDLE")) { + if (!project->isEmpty("QMAKE_BUNDLE") && !project->isActiveConfig("no_plist")) { QString plist = fileFixify(project->first("QMAKE_INFO_PLIST").toQString(), qmake_getpwd()); if(plist.isEmpty()) plist = specdir() + QDir::separator() + "Info.plist." + project->first("TEMPLATE"); -- cgit v1.2.3 From d6444b2e56927f664635980ba0599cef43fa2d32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Mon, 22 Sep 2014 11:24:13 +0200 Subject: Add CFBundleVersion to the Info.plist files. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add @FULL_VERSION@ -> Qt version substitution to unixmake2. This makes the Qt-generated Info.plist files compliant with the bundle signing/validation process. Task-number: QTBUG-32896 Change-Id: I1818f028c2f740d699629dd78cc0fe6ffaf94a1c Reviewed-by: Jake Petroules Reviewed-by: Morten Johan Sørvig --- mkspecs/macx-clang-32/Info.plist.lib | 2 ++ mkspecs/macx-clang/Info.plist.lib | 2 ++ mkspecs/macx-g++-32/Info.plist.lib | 2 ++ mkspecs/macx-g++/Info.plist.lib | 2 ++ mkspecs/macx-g++40/Info.plist.lib | 2 ++ mkspecs/macx-g++42/Info.plist.lib | 2 ++ mkspecs/macx-icc/Info.plist.lib | 2 ++ mkspecs/macx-ios-clang/Info.plist.lib | 2 ++ mkspecs/macx-llvm/Info.plist.lib | 2 ++ qmake/generators/unix/unixmake2.cpp | 9 +++++++-- 10 files changed, 25 insertions(+), 2 deletions(-) diff --git a/mkspecs/macx-clang-32/Info.plist.lib b/mkspecs/macx-clang-32/Info.plist.lib index 63f1a945c2..2a44d1721e 100644 --- a/mkspecs/macx-clang-32/Info.plist.lib +++ b/mkspecs/macx-clang-32/Info.plist.lib @@ -6,6 +6,8 @@ FMWK CFBundleShortVersionString @SHORT_VERSION@ + CFBundleVersion + @FULL_VERSION@ CFBundleGetInfoString Created by Qt/QMake CFBundleSignature diff --git a/mkspecs/macx-clang/Info.plist.lib b/mkspecs/macx-clang/Info.plist.lib index 63f1a945c2..2a44d1721e 100644 --- a/mkspecs/macx-clang/Info.plist.lib +++ b/mkspecs/macx-clang/Info.plist.lib @@ -6,6 +6,8 @@ FMWK CFBundleShortVersionString @SHORT_VERSION@ + CFBundleVersion + @FULL_VERSION@ CFBundleGetInfoString Created by Qt/QMake CFBundleSignature diff --git a/mkspecs/macx-g++-32/Info.plist.lib b/mkspecs/macx-g++-32/Info.plist.lib index 63f1a945c2..2a44d1721e 100644 --- a/mkspecs/macx-g++-32/Info.plist.lib +++ b/mkspecs/macx-g++-32/Info.plist.lib @@ -6,6 +6,8 @@ FMWK CFBundleShortVersionString @SHORT_VERSION@ + CFBundleVersion + @FULL_VERSION@ CFBundleGetInfoString Created by Qt/QMake CFBundleSignature diff --git a/mkspecs/macx-g++/Info.plist.lib b/mkspecs/macx-g++/Info.plist.lib index 63f1a945c2..2a44d1721e 100644 --- a/mkspecs/macx-g++/Info.plist.lib +++ b/mkspecs/macx-g++/Info.plist.lib @@ -6,6 +6,8 @@ FMWK CFBundleShortVersionString @SHORT_VERSION@ + CFBundleVersion + @FULL_VERSION@ CFBundleGetInfoString Created by Qt/QMake CFBundleSignature diff --git a/mkspecs/macx-g++40/Info.plist.lib b/mkspecs/macx-g++40/Info.plist.lib index 63f1a945c2..2a44d1721e 100644 --- a/mkspecs/macx-g++40/Info.plist.lib +++ b/mkspecs/macx-g++40/Info.plist.lib @@ -6,6 +6,8 @@ FMWK CFBundleShortVersionString @SHORT_VERSION@ + CFBundleVersion + @FULL_VERSION@ CFBundleGetInfoString Created by Qt/QMake CFBundleSignature diff --git a/mkspecs/macx-g++42/Info.plist.lib b/mkspecs/macx-g++42/Info.plist.lib index 63f1a945c2..2a44d1721e 100644 --- a/mkspecs/macx-g++42/Info.plist.lib +++ b/mkspecs/macx-g++42/Info.plist.lib @@ -6,6 +6,8 @@ FMWK CFBundleShortVersionString @SHORT_VERSION@ + CFBundleVersion + @FULL_VERSION@ CFBundleGetInfoString Created by Qt/QMake CFBundleSignature diff --git a/mkspecs/macx-icc/Info.plist.lib b/mkspecs/macx-icc/Info.plist.lib index 63f1a945c2..2a44d1721e 100644 --- a/mkspecs/macx-icc/Info.plist.lib +++ b/mkspecs/macx-icc/Info.plist.lib @@ -6,6 +6,8 @@ FMWK CFBundleShortVersionString @SHORT_VERSION@ + CFBundleVersion + @FULL_VERSION@ CFBundleGetInfoString Created by Qt/QMake CFBundleSignature diff --git a/mkspecs/macx-ios-clang/Info.plist.lib b/mkspecs/macx-ios-clang/Info.plist.lib index 63f1a945c2..2a44d1721e 100644 --- a/mkspecs/macx-ios-clang/Info.plist.lib +++ b/mkspecs/macx-ios-clang/Info.plist.lib @@ -6,6 +6,8 @@ FMWK CFBundleShortVersionString @SHORT_VERSION@ + CFBundleVersion + @FULL_VERSION@ CFBundleGetInfoString Created by Qt/QMake CFBundleSignature diff --git a/mkspecs/macx-llvm/Info.plist.lib b/mkspecs/macx-llvm/Info.plist.lib index 63f1a945c2..2a44d1721e 100644 --- a/mkspecs/macx-llvm/Info.plist.lib +++ b/mkspecs/macx-llvm/Info.plist.lib @@ -6,6 +6,8 @@ FMWK CFBundleShortVersionString @SHORT_VERSION@ + CFBundleVersion + @FULL_VERSION@ CFBundleGetInfoString Created by Qt/QMake CFBundleSignature diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 50e0ec52a7..d8700b3ba0 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -736,8 +736,13 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if (!destdir.isEmpty()) t << mkdir_p_asstring(destdir, false) << "\n\t"; ProStringList commonSedArgs; - if (!project->values("VERSION").isEmpty()) - commonSedArgs << "-e \"s,@SHORT_VERSION@," << project->first("VER_MAJ") << "." << project->first("VER_MIN") << ",g\" "; + if (!project->values("VERSION").isEmpty()) { + commonSedArgs << "-e \"s,@SHORT_VERSION@," << project->first("VER_MAJ") << "." + << project->first("VER_MIN") << ",g\" "; + commonSedArgs << "-e \"s,@FULL_VERSION@," << project->first("VER_MAJ") << "." + << project->first("VER_MIN") << "." + << project->first("VER_PAT") << ",g\" "; + } commonSedArgs << "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" "; if (project->first("TEMPLATE") == "app") { -- cgit v1.2.3 From 9fb663e57fa2859682d68928f79d5fadeb03a478 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 25 Sep 2014 19:06:21 +0200 Subject: fix omission of QMAKE_PKGINFO from sliced bundles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Iff2c6686eae47e09fa6d046c60523aaf79aadfd5 Reviewed-by: Morten Johan Sørvig --- qmake/generators/unix/unixmake2.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index d8700b3ba0..3ea2961c92 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -706,6 +706,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) QString bundle_dir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/"; if (!project->first("QMAKE_PKGINFO").isEmpty()) { ProString pkginfo = escapeFilePath(project->first("QMAKE_PKGINFO")); + bundledFiles << pkginfo; QString destdir = bundle_dir + "Contents"; t << pkginfo << ": \n\t"; if (!destdir.isEmpty()) -- cgit v1.2.3 From 8c138054b31ab181c26f5b8135e307ed146d9ec6 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 25 Sep 2014 19:10:19 +0200 Subject: redo bundle file dependency tracking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit instead of duplicating the plist/icon/bundled_files logic just to obtain the dependencies, create them as a side effect of the actual target creation. Change-Id: I6a0fe26c82c490b1040a7a06d5d0e7a4567ae1af Reviewed-by: Morten Johan Sørvig --- qmake/generators/unix/unixmake.cpp | 2 -- qmake/generators/unix/unixmake2.cpp | 57 +++++++++++-------------------------- 2 files changed, 16 insertions(+), 43 deletions(-) diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 5ea47cc867..5b619a6fb4 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -310,8 +310,6 @@ UnixMakefileGenerator::init() } if(!bundle.isEmpty()) { project->values("QMAKE_BUNDLE") = ProStringList(bundle); - project->values("ALL_DEPS") += project->first("QMAKE_PKGINFO"); - project->values("ALL_DEPS") += project->first("QMAKE_BUNDLE_RESOURCE_FILE"); } else { project->values("QMAKE_BUNDLE").clear(); project->values("QMAKE_BUNDLE_LOCATION").clear(); diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 3ea2961c92..1f7d1ecf3e 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -703,10 +703,12 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } if (!project->isEmpty("QMAKE_BUNDLE")) { + 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")); bundledFiles << pkginfo; + alldeps << pkginfo; QString destdir = bundle_dir + "Contents"; t << pkginfo << ": \n\t"; if (!destdir.isEmpty()) @@ -720,18 +722,25 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if (!project->first("QMAKE_BUNDLE_RESOURCE_FILE").isEmpty()) { ProString resources = escapeFilePath(project->first("QMAKE_BUNDLE_RESOURCE_FILE")); bundledFiles << resources; + alldeps << resources; QString destdir = bundle_dir + "Contents/Resources"; t << resources << ": \n\t"; t << mkdir_p_asstring(destdir) << "\n\t"; t << "@touch " << resources << "\n\t\n"; } //copy the plist - if (!project->isActiveConfig("no_plist")) { - QString info_plist = escapeFilePath(fileFixify(project->first("QMAKE_INFO_PLIST").toQString())), - info_plist_out = escapeFilePath(project->first("QMAKE_INFO_PLIST_OUT").toQString()); + while (!project->isActiveConfig("no_plist")) { // 'while' just to be able to 'break' + QString info_plist = escapeFilePath(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))) { + warn_msg(WarnLogic, "Could not resolve Info.plist: '%s'. Check if QMAKE_INFO_PLIST points to a valid file.", + info_plist.toLatin1().constData()); + break; + } + QString info_plist_out = escapeFilePath(bundle_dir + "Contents/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"; if (!destdir.isEmpty()) @@ -771,6 +780,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) QString dir = bundle_dir + "Contents/Resources/"; const QString icon_path = escapeFilePath(dir + icon.section(Option::dir_sep, -1)); bundledFiles << icon_path; + alldeps << icon_path; t << icon_path << ": " << icon << "\n\t" << mkdir_p_asstring(dir) << "\n\t" << "@$(DEL_FILE) " << icon_path << "\n\t" @@ -787,6 +797,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" " << "" << info_plist << " >" << info_plist_out << endl; } + break; } // project->isActiveConfig("no_plist") //copy other data if(!project->isEmpty("QMAKE_BUNDLE_DATA")) { @@ -801,6 +812,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) project->first("QMAKE_FRAMEWORK_VERSION") + "/"; QString link = Option::fixPathToLocalOS(path + project->first(pkey)); bundledFiles << link; + alldeps << link; t << link << ": \n\t" << mkdir_p_asstring(path) << "\n\t" << "@$(SYMLINK) " << project->first(vkey) + "/Current/" << project->first(pkey) @@ -817,6 +829,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) src = escapeFilePath(src); const QString dst = escapeFilePath(path + Option::dir_sep + fileInfo(fn).fileName()); bundledFiles << dst; + alldeps << dst; t << dst << ": " << src << "\n\t" << mkdir_p_asstring(path) << "\n\t"; QFileInfo fi(fileInfo(fn)); @@ -1274,44 +1287,6 @@ void UnixMakefileGenerator::init2() project->values("QMAKE_CFLAGS") += MD_flag; project->values("QMAKE_CXXFLAGS") += MD_flag; } - - if (!project->isEmpty("QMAKE_BUNDLE") && !project->isActiveConfig("no_plist")) { - QString plist = fileFixify(project->first("QMAKE_INFO_PLIST").toQString(), qmake_getpwd()); - if(plist.isEmpty()) - plist = specdir() + QDir::separator() + "Info.plist." + project->first("TEMPLATE"); - if(exists(Option::fixPathToLocalOS(plist))) { - project->values("QMAKE_INFO_PLIST_OUT").append(project->first("DESTDIR") + - project->first("QMAKE_BUNDLE") + - "/Contents/Info.plist"); - project->values("ALL_DEPS") += project->first("QMAKE_INFO_PLIST_OUT"); - if(!project->isEmpty("ICON") && project->first("TEMPLATE") == "app") - project->values("ALL_DEPS") += project->first("DESTDIR") + - project->first("QMAKE_BUNDLE") + - "/Contents/Resources/" + project->first("ICON").toQString().section('/', -1); - if(!project->isEmpty("QMAKE_BUNDLE_DATA")) { - QString bundle_dir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/"; - ProStringList &alldeps = project->values("ALL_DEPS"); - const ProStringList &bundle_data = project->values("QMAKE_BUNDLE_DATA"); - for(int i = 0; i < bundle_data.count(); i++) { - const ProStringList &files = project->values(ProKey(bundle_data[i] + ".files")); - QString path = bundle_dir; - const ProKey vkey(bundle_data[i] + ".version"); - const ProKey pkey(bundle_data[i] + ".path"); - if (!project->isEmpty(vkey)) { - alldeps += Option::fixPathToLocalOS(path + Option::dir_sep + project->first(pkey)); - path += project->first(vkey) + "/" + - project->first("QMAKE_FRAMEWORK_VERSION") + "/"; - } - path += project->first(pkey); - path = Option::fixPathToLocalOS(path); - for(int file = 0; file < files.count(); file++) - alldeps += path + Option::dir_sep + fileInfo(files[file].toQString()).fileName(); - } - } - } else { - warn_msg(WarnLogic, "Could not resolve Info.plist: '%s'. Check if QMAKE_INFO_PLIST points to a valid file.", plist.toLatin1().constData()); - } - } } QString -- cgit v1.2.3 From 6c6b5ff8fb8dfdc9f9057e4d9db5f467131a3a04 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 25 Sep 2014 17:14:40 +0200 Subject: de-duplicate top-level bundle symlink creation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit multiple QMAKE_BUNDLE_DATA entries can install into the same directory, but it obviously makes no sense to symlink that repeatedly. Change-Id: If65f7acdf4e158e33511917a027a380e642e2f28 Reviewed-by: Morten Johan Sørvig --- qmake/generators/unix/unixmake2.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 1f7d1ecf3e..556036b692 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -703,6 +703,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } if (!project->isEmpty("QMAKE_BUNDLE")) { + QHash symlinks; ProStringList &alldeps = project->values("ALL_DEPS"); QString bundle_dir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/"; if (!project->first("QMAKE_PKGINFO").isEmpty()) { @@ -810,13 +811,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if (!project->isEmpty(vkey)) { QString version = project->first(vkey) + "/" + project->first("QMAKE_FRAMEWORK_VERSION") + "/"; - QString link = Option::fixPathToLocalOS(path + project->first(pkey)); - bundledFiles << link; - alldeps << link; - t << link << ": \n\t" - << mkdir_p_asstring(path) << "\n\t" - << "@$(SYMLINK) " << project->first(vkey) + "/Current/" << project->first(pkey) - << " " << path << endl; + symlinks[Option::fixPathToLocalOS(path + project->first(pkey))] = + project->first(vkey) + "/Current/" + project->first(pkey); path += version; } path += project->first(pkey).toQString(); @@ -842,6 +838,15 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } } } + QHash::ConstIterator symIt = symlinks.constBegin(), + symEnd = symlinks.constEnd(); + for (; symIt != symEnd; ++symIt) { + bundledFiles << symIt.key(); + alldeps << symIt.key(); + t << symIt.key() << ":\n\t" + << mkdir_p_asstring(bundle_dir) << "\n\t" + << "@$(SYMLINK) " << symIt.value() << " " << bundle_dir << endl; + } } t << endl << "all: " << escapeDependencyPath(deps) -- cgit v1.2.3 From 9cd9dfb0b1203c1c00356f5fdd7905888b6f7021 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 25 Sep 2014 19:15:27 +0200 Subject: don't try to create nested top-level bundle dir symlinks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the target path may have multiple components, e.g. Headers/private. obviously, only the first component must be linked in such cases. Task-number: QTBUG-32895 Change-Id: If632b3b72c170a9fde36e62c165e06ded53deda3 Reviewed-by: Morten Johan Sørvig --- qmake/generators/unix/unixmake2.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 556036b692..27ffb9f40d 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -811,8 +811,12 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if (!project->isEmpty(vkey)) { QString version = project->first(vkey) + "/" + project->first("QMAKE_FRAMEWORK_VERSION") + "/"; - symlinks[Option::fixPathToLocalOS(path + project->first(pkey))] = - project->first(vkey) + "/Current/" + project->first(pkey); + ProString name = project->first(pkey); + int pos = name.indexOf('/'); + if (pos > 0) + name = name.mid(0, pos); + symlinks[Option::fixPathToLocalOS(path + name)] = + project->first(vkey) + "/Current/" + name; path += version; } path += project->first(pkey).toQString(); -- cgit v1.2.3 From bd8c18cca5cd7f4c9901edb5f70752005b3fac9a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 25 Sep 2014 20:32:18 +0200 Subject: fix Info.plist location in framework bundles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to Apple's documentation [1], framework bundles don't have a 'Contents' folder. Instead, each version folder gets a 'Resources' folder which contains the Info.plist file, and which is also symlinked at the top-level framework folder. [1]: https://developer.apple.com/library/mac/documentation/macosx/conceptual/BPFrameworks/Concepts/FrameworkAnatomy.html Task-number: QTBUG-32895 Change-Id: I5e55cc097b179012add0ceb7c567dace8e282895 Reviewed-by: Morten Johan Sørvig --- qmake/generators/unix/unixmake2.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 27ffb9f40d..8bc5b00fd9 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -739,7 +739,11 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) info_plist.toLatin1().constData()); break; } - QString info_plist_out = escapeFilePath(bundle_dir + "Contents/Info.plist"); + bool isApp = (project->first("TEMPLATE") == "app"); + QString info_plist_out = escapeFilePath( + bundle_dir + (isApp ? "Contents/Info.plist" + : "Versions/" + project->first("QMAKE_FRAMEWORK_VERSION") + + "/Resources/Info.plist")); bundledFiles << info_plist_out; alldeps << info_plist_out; QString destdir = info_plist_out.section(Option::dir_sep, 0, -2); @@ -756,7 +760,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } commonSedArgs << "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" "; - if (project->first("TEMPLATE") == "app") { + if (isApp) { QString icon = fileFixify(var("ICON")); QString bundlePrefix = project->first("QMAKE_TARGET_BUNDLE_PREFIX").toQString(); if (bundlePrefix.isEmpty()) @@ -788,6 +792,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) << "@$(COPY_FILE) " << escapeFilePath(icon) << " " << icon_path << endl; } } else { + symlinks[bundle_dir + "Resources"] = "Versions/Current/Resources"; t << "@$(DEL_FILE) " << info_plist_out << "\n\t" << "@sed "; foreach (const ProString &arg, commonSedArgs) -- cgit v1.2.3 From f72dcff925deeacaef0b5252ac52097ddedd11c1 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 29 Sep 2014 13:22:05 +0200 Subject: fix parallel installation of private and qpa headers in qt framework bundles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit with qmake now de-duplicating the paths properly, we should version these QMAKE_BUNDLE_DATA entries as well, so we don't depend on the symlinking of the regular headers being done first. Change-Id: Idaa2ccc1ba9b5684b0c8d84f7f760735f54432e1 Reviewed-by: Morten Johan Sørvig --- mkspecs/features/qt_module.prf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index 8bf4c92cdd..4352ae0a0b 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -101,8 +101,10 @@ mac:CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) { FRAMEWORK_HEADERS.version = Versions FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES FRAMEWORK_HEADERS.path = Headers + FRAMEWORK_PRIVATE_HEADERS.version = Versions FRAMEWORK_PRIVATE_HEADERS.files = $$SYNCQT.PRIVATE_HEADER_FILES FRAMEWORK_PRIVATE_HEADERS.path = Headers/$$VERSION/$$MODULE_INCNAME/private + FRAMEWORK_QPA_HEADERS.version = Versions FRAMEWORK_QPA_HEADERS.files = $$SYNCQT.QPA_HEADER_FILES FRAMEWORK_QPA_HEADERS.path = Headers/$$VERSION/$$MODULE_INCNAME/qpa QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS FRAMEWORK_PRIVATE_HEADERS FRAMEWORK_QPA_HEADERS -- cgit v1.2.3 From 7f18406878764d56cbb5b681650b6911c439a280 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 29 Sep 2014 15:06:40 +0200 Subject: wrap ALL_DEPS somewhat sanely MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit otherwise we'll produce lines with tens of thousands columns when dealing with QMAKE_BUNDLE_DATA. Change-Id: Ia2a70f25e4ee1d3fe976027a7c46d234809a3f70 Reviewed-by: Morten Johan Sørvig --- qmake/generators/unix/unixmake2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 8bc5b00fd9..eb8161a18b 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -859,7 +859,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } t << endl << "all: " << escapeDependencyPath(deps) - << valGlue(escapeDependencyPaths(project->values("ALL_DEPS")), " ", " ", "") + << valGlue(escapeDependencyPaths(project->values("ALL_DEPS")), " \\\n\t\t", " \\\n\t\t", "") << allDeps << endl << endl; ProString ddir; -- cgit v1.2.3 From 7ca54ce5d964646a141acac82f468476f2d66c35 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 1 Oct 2014 13:22:02 +0200 Subject: Avoid naming clashes with QStringLiteral local variable MSVC 2013 complains about the use of 's' if a variable 's' is already defined in the context: error C2373: 's' : redefinition; different type modifiers error C3493: 's' cannot be implicitly captured because no default capture mode has been specified This looks like a compiler bug. Anyhow, it's easy to avoid the clash in most cases by using a more distinctive name ... Task-number: QTBUG-41706 Change-Id: Iaff1b6d37897fa8cf9e4913effa0498f9fd7bb07 Reviewed-by: hjk Reviewed-by: Olivier Goffart Reviewed-by: Thiago Macieira --- src/corelib/tools/qstring.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 3985bc76fe..52b382985e 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -167,8 +167,8 @@ Q_STATIC_ASSERT_X(sizeof(qunicodechar) == 2, Q_STATIC_STRING_DATA_HEADER_INITIALIZER(Size), \ QT_UNICODE_LITERAL(str) }; \ QStringDataPtr holder = { qstring_literal.data_ptr() }; \ - const QString s(holder); \ - return s; \ + const QString qstring_literal_temp(holder); \ + return qstring_literal_temp; \ }()) \ /**/ -- cgit v1.2.3 From 11c1fe13b88b4a5fa9c7b199d05a9af02f428c9b Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Thu, 2 Oct 2014 13:18:05 +0200 Subject: QMacStyle: Fix QToolButton appearance on Yosemite On Yosemite checkable toolbuttons look differently when highlighted - this modification tries to imitate such look without pixmaps we used on OS X >= 10.5 && < 10.10. Change-Id: I0fcdff42a67fa6d5188c9dc64401f0f27ae60b5d Reviewed-by: Gabriel de Dietrich --- src/widgets/styles/qmacstyle_mac.mm | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index 9bfa51094b..70daafc88c 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -93,6 +93,7 @@ #include #include #include +#include #include #include #include @@ -5813,7 +5814,25 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex drawToolbarButtonArrow(tb->rect, tds, cg); } if (tb->state & State_On) { - if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) { + if (QSysInfo::MacintoshVersion > QSysInfo::MV_MAVERICKS) { + QWindow *window = 0; + if (widget && widget->window()) + window = widget->window()->windowHandle(); + else if (opt->styleObject) + window = opt->styleObject->property("_q_styleObjectWindow").value(); + + NSView *view = window ? (NSView *)window->winId() : nil; + bool isKey = false; + if (view) + isKey = [view.window isKeyWindow]; + + QBrush brush(isKey ? QColor(0, 0, 0, 28) + : QColor(0, 0, 0, 21)); + QPainterPath path; + path.addRoundedRect(QRectF(tb->rect.x(), tb->rect.y(), tb->rect.width(), tb->rect.height() + 4), 4, 4); + p->setRenderHint(QPainter::Antialiasing); + p->fillPath(path, brush); + } else if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) { static QPixmap pm(QLatin1String(":/qt-project.org/mac/style/images/leopard-unified-toolbar-on.png")); p->setRenderHint(QPainter::SmoothPixmapTransform); QStyleHelper::drawBorderPixmap(pm, p, tb->rect, 2, 2, 2, 2); -- cgit v1.2.3 From 0edf68120bc72d35d5fe29c84467f5afeacb0585 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Tue, 24 Jun 2014 11:54:56 +0200 Subject: Doc: Clarify QBitArray::fill() documentation Fix a minor mistake in the the function parameter documentation, and add a code snippet. Task-number: QTBUG-39782 Change-Id: Ia5d88a983ad683ae5bde9f332d51adc4afda77a8 Reviewed-by: Thiago Macieira Reviewed-by: Alex Blasche --- .../doc/snippets/code/src_corelib_tools_qbitarray.cpp | 7 +++++++ src/corelib/tools/qbitarray.cpp | 13 ++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qbitarray.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qbitarray.cpp index 4b2916a619..7fe4ea191d 100644 --- a/src/corelib/doc/snippets/code/src_corelib_tools_qbitarray.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qbitarray.cpp @@ -174,3 +174,10 @@ a[0] = 1; a[1] = 0; a[2] = 1; // a: [ 1, 0, 1 ] b[0] = 1; b[1] = 1; // b: [ 1, 1 ] c = a ^ b; // c: [ 0, 1, 1 ] //! [14] + +//! [15] +QBitArray ba(4); +ba.fill(true, 1, 2); // ba: [ 0, 1, 0, 0 ] +ba.fill(true, 1, 3); // ba: [ 0, 1, 1, 0 ] +ba.fill(true, 1, 4); // ba: [ 0, 1, 1, 1 ] +//! [15] diff --git a/src/corelib/tools/qbitarray.cpp b/src/corelib/tools/qbitarray.cpp index a6f22abce8..9f7b2db526 100644 --- a/src/corelib/tools/qbitarray.cpp +++ b/src/corelib/tools/qbitarray.cpp @@ -290,11 +290,18 @@ void QBitArray::resize(int size) /*! \overload - Sets bits at index positions \a begin up to and excluding \a end + Sets bits at index positions \a begin up to (but not including) \a end to \a value. - \a begin and \a end must be a valid index position in the bit - array (i.e., 0 <= \a begin <= size() and 0 <= \a end <= size()). + \a begin must be a valid index position in the bit array + (0 <= \a begin < size()). + + \a end must be either a valid index position or equal to size(), in + which case the fill operation runs until the end of the array + (0 <= \a end <= size()). + + Example: + \snippet code/src_corelib_tools_qbitarray.cpp 15 */ void QBitArray::fill(bool value, int begin, int end) -- cgit v1.2.3