summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Optimize generic conversion and remove now obsolete direct conversionsAllan Sandfeld Jensen2015-02-134-423/+187
| | | | | | | | | | There are many direct QImage conversions that doesn't need to be direct but only are because they are faster than the generic conversion. This patch optimizes the generic conversions and then removes all the direct conversions that are now no faster than the generic. Change-Id: I3dc5f44cc7f6358fd66420e9974eebaf2c7ca59c Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* QUrl effective TLDs: update tablePeter Hartmann2015-02-132-9565/+11345
| | | | | | | | | | There are more than 1000 new entries since the table has been generated the last time. Some auto tests needed to be adjusted, because some entries in the TLD table were removed while others were added. Change-Id: I4ceec392836d2031dfef49a0c5a857c31b36bb4c Reviewed-by: Richard J. Moore <rich@kde.org>
* OS X Accessibility: fix role descriptionBoris Dušek2015-02-131-1/+1
| | | | | | | Now we take into account also the subrole of the element. Change-Id: I471e7c6620e704780cef48266ef302ec8b56466d Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* OS X Accessibility: implement AXStyleRangeForIndex in QTextEditBoris Dušek2015-02-131-1/+6
| | | | | | | | Not tested as I have no idea what VoiceOver uses it for (it seems to never query this attribute during any operation I tested). Change-Id: Ie5e2b765a9956bcf2be9b659b8914e393ed1ea90 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* OS X accessibility: implement AXRangeForPositionBoris Dušek2015-02-131-0/+5
| | | | | | | | | | | | | | | | This enables users with "Speak text under mouse after delay" set in VoiceOver Utility > Verbosity > Announcements to hover mouse over text in QTextEdit and have it spoken by VoiceOver. It also allows users with Trackpad Commander on to interact with the text area (VO-Shift-arrow down) and "touch-explore" the text while holding their finger on the trackpad and moving it around. [ChangeLog][QtWidgets][Accessibility][OS X] VoiceOver users of QTextEdit can now use mouse and touch exploration on trackpad to point at text to have spoken to them. Change-Id: I6cfaa8b1ff2179cce027b22539ba9ee4f3ee7f3f Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Fix text-align justify in accessibility supportBoris Dušek2015-02-131-1/+1
| | | | | Change-Id: If43be193d64d7df29eb3f89b6c528ee1e8de310f Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Fix AXBoundsForRange in OS X accessibilityBoris Dušek2015-02-131-2/+11
| | | | | | | | | | | | | | | | | | | | | | When returning a rect for AXBoundsForRange, we always incorporated one more character. Along with this one more character being often either a newline or the first character of new softline, visual bounds often got wrongly and unnecessarily multiline when in fact only single line was correct. Also noticeable when moving character by character (VO-Shift-arrow left/right) - now only one character is being shown (as opposed to two before). Still due to VoiceOver bug, for bounds of width less than 8 points, it will draw bounds width with of 8 points (reported as <rdar://problem/19370707>). But still this is an improvement for cases with bounds of width more or equal to 8 points. [ChangeLog][QtGui][Accessibility][OS X] Visual bounds returned by QTextEdit were singificantly improved, this enables VoiceOver to draw properly positioned VoiceOver cursor. Change-Id: Idc50310f8016fbcc01b061d27b655c72922a4807 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Cocoa: Improve QT_MAC_WANTS_LAYER for GL windowsMorten Johan Sørvig2015-02-121-0/+9
| | | | | | | | | | | | | | | | | Add the NSOpenGLPFANoRecovery pixel format attribute. This disables the software rendering fallback and makes compositing OpenGL and raster NSViews using Core Animation layers possible. With QT_MAC_WANTS_LAYER enabled, native NSViews now stack correctly with QWindows with OpenGL content. One known limitation is that this mode currently supports main-thread rendering only. Change-Id: I2060cceda846b305b33b47f2eba3cb7cb838039c Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* Fix crash-on-exit when embedding QNViewMorten Johan Sørvig2015-02-123-0/+17
| | | | | | | | | | | | The QWindow and QCocoaWindow may be deleted before the QNSView (which Cocoa keeps a reference to). Clear pointers to the Qt windows on QCocoaWindow destruction and add null-pointer check to QNView::isOpaque. Change-Id: I71764886c27bf1d14fb4e684c15e7c72e1c0a17c Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Improve conversion of QVariants with QJsonValuesAllan Sandfeld Jensen2015-02-121-6/+56
| | | | | | | | Adds conversion from QJsonArray and QJsonObject, and report missing conversion failures for other QJsonValues. Change-Id: Ic0c3a952657912401db877b068f7fcc3c08c94c2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QOpenGLContext: expose the shared global contextGiuseppe D'Angelo2015-02-122-0/+26
| | | | | | | | | | | | We're documenting that this context exists, therefore applications are allowed to assume that it exists. For the same reason, we should expose it as public API -- an application should be allowed to upload GL objects before creating or showing QOpenGLWidgets that use them. Change-Id: Iedbba7cd393018d93833fd2a6b02cce0639a89b4 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* QTextCodec: micro-optimize loops.Friedemann Kleint2015-02-122-16/+23
| | | | | | | | Don't use index-based iteration, but use iterators. Change-Id: If8dabd56ff880191bb53861e31bfa6a007802c9c Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Simplify QTableGenerator::printComposeTable()Marc Mutz2015-02-121-15/+9
| | | | | | | | | | | | | | | Instead of filling a QString with lots of temporaries in-between, simply stream everything into QDebug directly. Requires the use of #ifndef QT_NO_DEBUG_STREAM because of the explicit mentioning of QDebug. Further simplified it by removing the complicated trailing-comma handling. The struct-like output can tolerate a trailing comma which has been allowed in C/C++ since its inception. Change-Id: I0393a37cd21a50e902c8cb9f8b752ebb946d1669 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Windows QPA: Remove helper function debugWindowStates().Friedemann Kleint2015-02-121-20/+3
| | | | | | | | | It is no longer required since registered enumerations now have an output operator for QDebug. Change-Id: Ib85be4b98f301993c6cda2638b84586d541af841 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com> Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* Clarify QTextEdit::createStandardContextMenu(QPoint) docsJ-P Nurmi2015-02-121-1/+1
| | | | | | | It assumes document coordinates. Change-Id: I9c1db154d45053065533c10bf76c338cc1324081 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Make the QPlatformTheme::keyBindings() search deterministicMorten Johan Sørvig2015-02-121-50/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QPlatformTheme::keyBindings() performs a binary search into an ordered list of StandardKey -> Key Sequence mappings where each StandardKey can have multiple key sequences. Previously the order of the Key Sequences in the returned list would be indeterministic and, except for the designated pri-1 key sequence, would not necessarily correspond to the list order. (The ordering was dependent on where the binary search "hits", which again depends on the size of the list.) This caused trouble when adding mappings, since it would change the order in the returned key sequence list for existing mappings and confusingly cause (apparently) unrelated test failures. Fix this by replacing the manually coded binary search with std::equal_range. One test case needed to be fixed up because it had the result in the wrong order (verified by looking at QPlatformTheme::keyBindings). Change-Id: I555ca2736b1a8e6454dc79645a8246f80119cfc2 Done-with: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* QDateTime: prepare for constexpr'ificationMarc Mutz2015-02-121-2/+9
| | | | | | | | | Make sure from{JulianDay,MSecsSinceStartOfDay}() are in a constexpr'able form by introducing new private ctors that allow formulating these functions as single expressions. Change-Id: Iee98edb74e63c32e98781b885bbb2c5ef5867fd9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtCore: assorted migrations to QString::asprintfMarc Mutz2015-02-122-7/+3
| | | | | Change-Id: Ie99d3eeeced89dd8336717954fd5ca7117bb20b4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QCoreApplication (Windows): migrate to QString::(v)asprintfMarc Mutz2015-02-121-25/+24
| | | | | Change-Id: I9628a96eee9b6afd7532ac65d61054d1117335ab Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtGui: assorted migrations to QString::asprintfMarc Mutz2015-02-122-13/+10
| | | | | Change-Id: Ibb177b22064efcad56ace60935e9c8759a87a3c9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtWidgets: assorted migrations to QString::asprintfMarc Mutz2015-02-122-5/+5
| | | | | Change-Id: I1a9977f52e9ce098944f876bca19669dac44d2c1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLogging: use return-by-value in qt_messageMarc Mutz2015-02-121-40/+16
| | | | | | | | | | | | | | | This also enables NRVO in almost all callers (a macro prevents it in one case), saving one default construction and one (move) assignment per call. Effects on Linux GCC 4.9 stripped release builds: text -896B data +-0B relocs +-0 Change-Id: Id3cde01057baaa408c4cbf95d8d15eaeeeec1604 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtMiscUtils: make toHex*() constexprMarc Mutz2015-02-121-6/+4
| | | | | | | | | | Bring them into a constexpr'able form, by indexing into the string literal directly instead of into a static const char[], which is a declaration not allowed in a C++11 constexpr function, then mark the functions constexpr. Change-Id: I6b32a55bf24f85caeb980c0c855b8db0952f914c Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Fix Q_ENUM in QWizard.Friedemann Kleint2015-02-121-1/+1
| | | | | | | | | | Make QWizard::WizardStyle a Q_ENUM instead of WizardButton. Fix startup warning of Qt Designer: QMetaProperty::read: Unable to handle unregistered datatype 'WizardStyle' for property 'QWizard::wizardStyle' Change-Id: Icb86e88b6ee2da301ef4ed9c003b54e0cc42efa5 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Avoid hardcoding build date in qtcore and toolsSune Vuorela2015-02-122-3/+7
| | | | | | | | | | | | | | To ensure QtCore can be rebuilt and get the exact same results, it is undesirable to hardcode the build date into the library Also deprecate QLibrayInfo::buildDate since it is relies on the build date. QLibraryInfo::buildDate was originally meant for evaluation licenses and such, but isn't used for that any longer. Change-Id: I98e91ca3e55f877e6ac0e02de289dc29422fc9da Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Make qdbusxml2cpp output reproducibleSune Vuorela2015-02-121-10/+4
| | | | | | | | | There doesn't seem to be a need for a timestamp in the include guard anyway. The class name and similar stays the same, so it seems to just add randomness to the build because it is possible. Change-Id: I186d281d7ec4a3db08a128ca170e455132930cba Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix accessibility lines on OS XBoris Dušek2015-02-121-16/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make QTextView accessibility on OS X mirror that of NSTextView in terms of translating between positions and line numbers. Most significantly, we report softlines (i.e. "lines" resulting from visual wrapping induced by text view's width) as individual lines, not just hardlines (i.e. "lines" delimited by newline characters, a.k.a. paragraphs). This fixes keyboard echo when using just arrow up and down (without VO prefix) as now in such case VoiceOver reads the softline that the text cursor moved to; before this fix it read again the whole paragraph (which it read no matter to which softline of paragraph we moved to). This enables the user to search more effectively for the softline they need (which they do very often when navigating text). Further, we changed the behavior to report the trailing newline character of a line as the last character of the line. This is consistent with how NSTextView (and TextEdit) does things (and makes the newline character be displayed on a braille display for the user to be able to distinguish that this is really the end of paragraph), but could be debated and changed as some important Apple apps do not include the newline character in the line range (most notably Pages and Mail, both in the document (or email text) text area). I asked about this here: http://lists.apple.com/archives/accessibility-dev/2015/Jan/msg00000.html This also fixes the case where empty line previously returned empty range (length == 0) for AXRangeForLine and VoiceOver interpreted that as end of document even if it was in the middle of document (e.g. in examples/widgets/richtext/textedit, there is an empty line in "Lists" section just before the last paragraph, if one attempted to move past it e.g with VO-arrow down after interacting with the text using VO-Shift-arrow down, then no luck). The code is currently O(N) as the previous one, which could mean a performance problem for bigger documents. As it seems QTextLayout has all the information it needs to do AXLineForIndex and AXRangeForLine efficiently (I would presume O(log N)), this should be eventually rewritten to take advantage of that (but the required interfaces are not currently exposed through QAccessibleTextInterface) [ChangeLog][QtGui][Accessibility][OS X] QTextEdit now properly reports to accessibility visual lines (softlines) as lines, instead of whole paragraphs. This allows better VoiceOver user experience when reading text line by line using arrows up/down. Change-Id: Ie7f06eb919de31d0a083b3b30d26ccac4aa27301 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* QOpenGLTexture: enable build on Windows CEGiuseppe D'Angelo2015-02-121-13/+9
| | | | | | | | | The various refactorings to this code allow it compile and work on Windows CE, so we can enable the build there. Change-Id: I8ac56e87dca13790a76f125330a5400e4b4f5d46 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com>
* Haiku: Enable usage of realpath implementationTobias Koenig2015-02-121-1/+1
| | | | | | | | | Haiku supports the realpath implementation, but failed the original #if check because of the wrong _POSIX_VERSION. Change-Id: Ibad12de3bf7c1031b2dff3026b5c61e5afd3f3e6 Reviewed-by: Augustin Cavalier <waddlesplash@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Haiku: Use setenv and unsetenv POSIX functionsTobias Koenig2015-02-121-3/+3
| | | | | | | | | | The _POSIX_VERSION declared in Haiku is 199009L, so we have to enable support for setenv/unsetenv explicitly until Haiku POSIX version is updated. Change-Id: Ic22374253b0512a6a816257db83b0c649be0585d Reviewed-by: Augustin Cavalier <waddlesplash@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use TabFocusBehavior in QStyleHints in widgetsLiang Qi2015-02-121-3/+1
| | | | | | | | qt_tab_all_widgets in qapplication.cpp was updated. Change-Id: If7ce14fc132d8a752c0e97450c4c8ecd75526f87 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Expose TabFocusBehavior in QStyleHintsLiang Qi2015-02-129-7/+54
| | | | | | | | | | TabAllWidgets in QPlatformTheme is replaced by TabFocusBehavior. [ChangeLog][QtGui] Expose TabFocusBehavior in QStyleHints Change-Id: Iafaad7c6a5c6bc888d1e124e6ddcdbdc46f37b1c Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* xcb: QSystemTrayIcon: grab background pixmap for compositing only onceShawn Rutledge2015-02-124-23/+16
| | | | | | | | | | | | | | | Followup to 2203d9d93e24e00d6e9bc9bda0e65a0c7f9923cc: clearRegion takes a little time, so doing grabWindow() too soon afterwards can result in grabbing a pixmap with undesired leftovers. And doing it every time we render the icon causes flicker. So, do clearRegion() ASAP when showing the icon, wait for it to happen, then grabWindow() only the first time we render, and reuse the resulting pixmap for all future calls to paintEvent(). (The downside is, if there is any corruption during the first grabWindow(), it's going to stay there as long as the app is running.) Task-number: QTBUG-35658 Change-Id: If881ab192dba43758dcbb0d080663ff42057fa4f Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* D-Bus tray icons: try to use them with QGenericUnixThemeShawn Rutledge2015-02-122-0/+16
| | | | | | | | | | | | | | | | Until now, only the Gnome and KDE themes have done this. But the gtk2 theme is not the same as the gnome theme. Further, Ubuntu sets the environment variable QT_QPA_PLATFORMTHEME=appmenu-qt5 if that plugin is installed on the system; and then with a custom build of Qt which cannot load the module (e.g. a static build), it will again fall back to QGenericUnixTheme instead of the gnome theme. In both cases we want to still try to use D-Bus StatusNotifier protocol instead of XEmbed. In general it should always be safe to check whether or not that is possible, before falling back to the XEmbed tray icon implementation. Change-Id: I86d6c6f6ad410ea31770d39166d0a7e3330365a0 Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* qtimezone.h: include correct headerMarc Mutz2015-02-121-1/+1
| | | | | | | QSharedDataPointer is declared in qshareddata.h, not qsharedpointer.h Change-Id: I4702f346ae01a8de07a6a9b50f951d2d4a89e1fb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QNX: fix compiler detection.Rafael Roquetto2015-02-121-6/+8
| | | | | | | | | | | | | | | Short version: fix build on QNX 6.5.0. C++11 has been included on QNX 6.6.0's libcpp (Dinkum C++11 libs), while continuing to be unsupported by the older QNX 6.5.0 toolchain. This patch updates the mechanism for detecting the QNX's libcpp that is being used during compile time, and also updates the list of C++11 features to be disabled when QNX C++11 support is not present by adding Q_COMPILER_UNICODE_STRINGS and Q_COMPILER_NOEXCEPT to it. Change-Id: Iddb3626206a0d97d7103c1ff17ba0ae953e9a4b9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QWheelEvent on OSX: phase changes to ScrollEnd after momentum phaseShawn Rutledge2015-02-121-1/+2
| | | | | | | | | | | | | | | | | The phase changes to ScrollEnd as soon as the user's fingers are lifted from the trackpad; then the OS can optionally continue sending scroll events to simulate deceleration, which are translated into more QWheelEvents with phase ScrollUpdate. With this patch, the phase of the final event after the momentum phase will be ScrollEnd to indicate that the scrolling is completely finished. [ChangeLog][QtGui][QWheelEvent] on OSX, trackpad wheel event phase transitions occur in the order ScrollBegin, ScrollUpdate, ..., ScrollEnd, ScrollUpdate, ..., ScrollEnd, where the second batch of updates represent momentum events (inertial scrolling). Change-Id: I7404ed6fbbeaff6b1fa63e226fe1800494986b7b Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Network: Fix operator<<(QDebug, ...) operationsKai Koehne2015-02-1210-34/+56
| | | | | | | | | | | | Use the QDebugStateSaver saver(debug); debug.resetFormat().nospace(); idiom to unify the formatting and whitespace handling. Change-Id: Id346d63b3f589b60ca19e4459271d587f1a0c003 Reviewed-by: Richard J. Moore <rich@kde.org>
* [QWindowsFont*] Unify HFONT fallbacksKonstantin Ritt2015-02-122-10/+5
| | | | | | | | | | In case CreateFontIndirect() call fails, always fallback to a better stock font provided by Windows (apparently, it is DEFAULT_GUI_FONT). Change-Id: Ib78fe0d21ba4fccbba1152b81ed87c010e1220e0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Update bundled HarfBuzz to 0.9.39Konstantin Ritt2015-02-127-30/+90
| | | | | | | No significant changes, just stick to a released version. Change-Id: Ib9c4ce6f7da07727e890a4ac3265fc4574e89821 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* QProcess: remove a use of QString::sprintf()Marc Mutz2015-02-121-6/+11
| | | | | | | | Instead of using QString::sprintf() (and converting the result back to QByteArray), simply do the conversion from uchar to octal digits ourselves, using QtMiscTools. Change-Id: I452c085b717c71609cd1a9465e31d90e6a0ba54b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTzTimeZonePrivate: replace an inefficient QList with QVector (IV)Marc Mutz2015-02-121-17/+17
| | | | | | | | | | | | | | The QTimeZonePrivate::Data type is larger than void*, so holding them in QLists is horribly inefficient. In addition, this type is held elsewhere in QVector, so do that here, too. As well as being faster, also saves 1.3K of text size on optimized AMD64 builds. Change-Id: I1ecf3ee0d955f6b19d2269204e2febc2ba2a9d9d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTzTimeZonePrivate: replace an inefficient QList with QVector (III)Marc Mutz2015-02-121-15/+16
| | | | | | | | | | | | | | The implementation-private QTzType type is larger than void*, so holding them in QLists is horribly inefficient. Fix by holding it in QVector instead (it was already marked as a primitive type before). Text size grows by ca. 0.5K, but of course we got rid of all those pesky heap allocations. Change-Id: I3b70ed36fa9947b695ffc87c6f6199daa13cb7cd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTzTimeZonePrivate: replace an inefficient QList with QVector (II)Marc Mutz2015-02-121-13/+12
| | | | | | | | | | | | | | | | | | The implementation-private QTzTransition type is larger than void*, so holding them in QLists is horribly inefficient. Fix by declaring it as a primitive types (it just contains various integers) and holding it in QVector instead. Also optimize parseTzTransitions() by preallocating the expected number of transitions and streaming directly into the container, resizing to the number of successful read items on error. Saves roughly 0.5K in text size, too. Change-Id: Iadec7a7b0721893e477e1778c9fb54afd6e49544 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTzTimeZonePrivate: replace some inefficient QLists with QVectors (I)Marc Mutz2015-02-121-13/+21
| | | | | | | | | | | | | | | | | | Both QTzTransitionTime and QTzTransitionRule are larger than void*, so holding them in QLists is horribly inefficient. Fix by declaring them as primitive types (they just contains various integers) and holding them in QVector instead. While we're at it, make the equality operator for QTzTransitionRule a constexpr, noexcept non-member, and provide the inequality operator, too. As well as being faster, this also saves 1.5K of text size on optimized AMD64 builds. Change-Id: I37100522f19556101c334625818dcf8c9a712dd9 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Add Q_DECL_CONST_FUNCTION and Q_DECL_NOTHROW to qPopulationCountMarc Mutz2015-02-121-5/+5
| | | | | Change-Id: I7602936b7064d6a87cd9fbfc4ab22a8fc881b9e9 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QFileInfoGatherer: fix race condition on fetchedRootMarc Mutz2015-02-121-4/+4
| | | | | | | | | | | | | | | | | | Though only present in QT_BUILD_INTERNAL builds, accessing an unprotected global bool is still a data race. While the intended use of reset flag/start test/check flag is kosher when it comes to the happens-before relation, this is no longer true when users use two instances of QFileSystemModel at the same time. To fix, make the bool an atomic int instead. Relaxed memory ordering suffices, since the atomic int represents all the data. The races over which model sets the variable is the job of the test case to resolve, and doesn't affect other users. Change-Id: I4d245b93a741e3457c42df6edd5b836a9bdacd83 Reviewed-by: Jason McDonald <macadder1@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QString: optimize number() and setNum()Marc Mutz2015-02-121-63/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, number() was implemented in terms of setNum(). That makes no sense whatsoever. It creates a temporary value which requires the function to have an exception table and an unwinding trampoline. It also introduces a default constructor (in number()) and a copy assignment (in setNum()), which breaks the chain of RVOs originating in the QLocaleData functions. Instead, implement setNum() in terms of number(). This makes setNum() such a premature pessimisation that it's probably best to deprecate it in the near future. There are not many users of it in qtbase left, and it just pollutes the QString interface. Effects on Linux GCC 4.9 stripped release builds: text -708B data +-0B relocs +-0 Change-Id: I015c9ddb1ba9c98c2c55e38e54ef7894954ac4ca Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* QLogging: prevent qt_message from being inlined into each of 14 callersMarc Mutz2015-02-121-0/+1
| | | | | | | | | | | Effects on Linux GCC 4.9 stripped release builds: text -2024B data +-0B relocs +-0 Change-Id: I1a315eb0f94ade2b40be62770c6ddcfc56da9ec0 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLogging: avoid a needless checkMarc Mutz2015-02-121-9/+3
| | | | | | | | | | | | QString::vasprintf() deals just fine with a nullptr format string, so don't check manually. The main advantage of dropping the check is that in two of three cases, we can replace assignment with initialization, thus saving one default ctor and one (move) assignment. Change-Id: I08dd24111cd0b92f21ef9f1c3e352ede0f66afe0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>