summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs
Commit message (Collapse)AuthorAgeFilesLines
...
| * QErrorMessage: use QStringBuilderMarc Mutz2017-04-201-21/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extract Method msgType2i18nString() and use it to build 'rich' in a single QStringBuilder expression. Replace the switch over QtMsgType with an array of QT_TRANSLATE_NOOP'ed strings. That introduces a dependency on the order and amount of enum values, so add static and dynamic asserts to catch any change. Saves memory allocations, as well as nearly 300B in text size on GCC 7 optimized Linux AMD64 builds. Change-Id: I48cc916cba283e482a90ca4ae28aa17b26a4e5ab Reviewed-by: David Faure <david.faure@kdab.com>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-03-2813-37/+55
|\| | | | | | | | | | | | | | | | | Conflicts: examples/examples.pro tests/auto/corelib/tools/qchar/tst_qchar.cpp tests/auto/other/qaccessibility/accessiblewidgets.h Change-Id: I426696c40ab57d14dc295b8103152cede79f244c
| * Bump copyright yearFriedemann Kleint2017-03-271-1/+1
| | | | | | | | | | | | Task-number: QTBUG-59648 Change-Id: Ie2d08515f4ad177bab338210a0a3e52f5519dcc3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Add feature.dialogStephan Binner2017-03-2211-35/+53
| | | | | | | | | | Change-Id: I160d0f270d7f41671459358b9c180d71dd7786d6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * QWizard: use the 3-int QColor ctor instead of the string oneMarc Mutz2017-03-211-1/+1
| | | | | | | | | | | | | | The value is hard-coded, there's no need to parse a string to extract the value. Change-Id: I987280d7a92b7a1eb75233b2a1f811b5177f0a63 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-03-146-7/+31
|\| | | | | | | | | | | | | Conflicts: src/widgets/widgets/qpushbutton.cpp Change-Id: I615de00e6e64540c50f658d4d8ab3e002d701a81
| * Add feature.pushbuttonStephan Binner2017-03-062-2/+19
| | | | | | | | | | Change-Id: I654d91635e60b177df16f6dfe00acc940132f66a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Build fix for -no-feature-shortcutPaul Olav Tvete2017-03-034-5/+12
| | | | | | | | | | Change-Id: I99144b114b3c2eacb56b522b3059aa53a6bbd969 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-03-022-6/+13
|\| | | | | | | Change-Id: I84097f8e7b3b2128028bd7693c913d6968b82bfe
| * QSideBar: replace a QPair with a structMarc Mutz2017-02-242-6/+13
| | | | | | | | | | | | | | | | Instead of the incomprehensible "names" .first and .second, the code can now use .index and .path. Change-Id: I1449ba668f703b9a8b9391b0a0774072c8c6e8aa Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-02-281-6/+18
|\| | | | | | | Change-Id: I7d84cfed0b2a122d334b8a920e6e4f18472d2f11
| * QErrorMessage: replace a QPair with a structMarc Mutz2017-02-221-5/+11
| | | | | | | | | | | | | | | | Instead of the incomprehensible "names" .first and .second, the code can now use .content and .type. Change-Id: I7fe320ded33a07fb8ff77ac96c17fc5ee1079da3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * QErrorMessage: handle all message typesMarc Mutz2017-02-211-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The perils of adding a default: case to a switch over an enum type: the compiler no longer warns when the enum is extended. Provide strings for QtCriticalMsg and QtInfoMsg, too. [ChangeLog][QtWidgets][QErrorMessage] No longer displays critical (QtCriticalMsg) and informational (QtInfoMsg) messages as if they were debug (QtDebugMsg) ones. Change-Id: Id6776081be736ad92423ec016988dcd92a963cc7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-02-172-8/+5
|\| | | | | | | | | | | | | Conflicts: qmake/Makefile.unix Change-Id: Ia18e391198222eef34ffa2df6f683e052058d032
| * Fix typo in apidoc.Frederik Schwarzer2017-02-171-1/+1
| | | | | | | | | | | | Change-Id: Ibd71c1ed653769637aa176dfb52c4594141be8ce Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| * Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-02-161-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/plugin/qlibrary_unix.cpp src/plugins/platforms/xcb/qxcbconnection.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp Change-Id: I632c400d909f8c204f55743aadc7886af2f15dfb
| | * QFileDialog: Protect against nullptr dereferenceKevin Funk2017-02-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the QFileDialog receives a language change event, and native dialogs are used, this code path dereference a nullptr in the qFileDialogUi member. Protect by checking the return value of QFileDialogPrivate::usingWidgets() as done in other places deferencing qFileDialogUi. Fixes a crash in GammaRay Change-Id: I3e9eb81c75d9fc983519a58c5ec06e316ac80263 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * | Windows styles/wizard: Do not invoke winId() of desktop windowsFriedemann Kleint2017-02-131-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Call the Win32 API GetDesktopWindow() to obtain a HWND of the desktop instead of calling QApplicationPrivate::getHWNDForWidget() for desktop windows. This allows for lazily creating desktop platform windows. Observed in some tests where no window is visible. Change-Id: I97074f69606b3d74f3fbc90acb4a077d52eeb84d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-02-103-66/+60
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/widgets/qmainwindowlayout_p.h Change-Id: Id406a67606b885052ed405b0fbc8eea7d9d03224
| * | Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-02-083-66/+60
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: configure.json mkspecs/win32-icc/qmake.conf Change-Id: Ibf40546b024d644c7d9ed490bee15b82597f4d3f
| | * Fix result handling in QDialog::doneSamuel Gaist2017-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The setData method of an item view would get an incorrect value of a QDialog's result. This patch changes the order of functions called to fix that. [ChangeLog][QtWidgets][QDialog] Fixed a bug where accessing the result of QDialog's result could yield an incorrect value in some situation like using it as a delegate for item views. Task-number: QTBUG-6018 Task-number: QTBUG-12156 Task-number: QTBUG-14430 Change-Id: I6ee4b6e8cacf6a806631c05c6c5dbcff925df65e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | * QInputDialog: prevent crash in static get*() functions when parent gets deletedMarc Mutz2017-02-062-65/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As explained in https://blogs.kde.org/2009/03/26/how-crash-almost-every-qtkde-application-and-how-fix-it-0 creating dialogs on the stack is a bad idea if the application or the dialog's parent window can be closed by means other than user interaction (such as a timer or an IPC call). Since we cannot know whether Qt is used to build such an application, we must assume it is, create the dialog on the heap, and monitor its lifetime with a QPointer. Instead of using manual resource management, add a minimal implementation of QAutoPointer, and use that in all static get*() functions. Task-number: QTBUG-54693 Change-Id: I6157dca18608e02be1ea2c2defbc31641defc9d1 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: David Faure <david.faure@kdab.com>
* | | Remove references to QUrlOperator (Qt3) classGatis Paeglis2017-02-041-1/+1
|/ / | | | | | | | | Change-Id: I2bb9fa77a8e260d5ba75541f66597a1c8904895f Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-302-3/+7
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/network-chat/peermanager.cpp src/widgets/util/qsystemtrayicon.cpp src/widgets/util/qsystemtrayicon_qpa.cpp src/widgets/util/qsystemtrayicon_win.cpp src/widgets/util/qsystemtrayicon_x11.cpp Change-Id: I1c026df83818c0ccaf956980370e7522960627db
| * Fix build with -no-feature-texteditPaul Olav Tvete2017-01-251-0/+4
| | | | | | | | | | Change-Id: I4a75c134803043180c57287ca352e26e3422204c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Make sure features are defined before testing themPaul Olav Tvete2017-01-251-3/+3
| | | | | | | | | | | | | | | | | | Include the file defining the feature before testing whether the feature exists. Also use the new feature macro to make sure this bug doesn't happen again. Change-Id: I204836fee59b143a7ce7d256a7aed223c4d0ceb1 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Doc update: reflect use of native font dialog by default on macOSPierre Rossi2017-01-081-2/+1
| | | | | | | | | | | | | | | | | | The documentation still stated that the Qt standard font dialog was used. Task-number: QTBUG-47572 Change-Id: Iff4262869efde2d9fefb38264b2f6f8a9d2f7483 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Improve mime type filters in QFileDialogElvis Angelaccio2017-01-063-3/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch improves the handling of mime type filters in QFileDialog. The main change is in selectMimeTypeFilter(), which was just falling back unconditionally on selectNameFilter(). Instead, mime type filters should have an higher priority than name filters. This patch also adds a new selectedMimeTypeFilter() method, which is used in the unit test. Change-Id: Ice8bb08f5ff46e4a942d539f6001424eca878f74 Reviewed-by: David Faure <david.faure@kdab.com>
* | doc: Fix all remaining "Cannot tie" errors in QtBaseMartin Smith2017-01-062-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Most of these involved moving or removing extraneous aide-memoir comments left by programmers between qdoc comments and their functions. There were also some cases where Q_CLANG_QDOC had to be tested to make something visible to clangqdoc. And there were a few functions that should not have been documented at all. Change-Id: I3bf7c397a9e5ddbffc40cc1fee7f19cad71a1ae7 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | doc: Removed illegal qdoc commentsMartin Smith2017-01-051-5/+1
| | | | | | | | | | | | | | | | | | Some member functions of a class declared in a cpp file were documented, but they should not have been documented. Change-Id: I9ce621bd858ebf1ad916beaf217d1c4d9feabbce Reviewed-by: Martin Smith <martin.smith@qt.io>
* | QFileDialog: Only focus file name edit when becoming visibleTor Arne Vestbø2017-01-041-1/+1
| | | | | | | | | | | | | | | | | | Doing it when hiding the dialog (which happens when closing it) makes no sense, and messes with the focus object for no reason. Change-Id: I4831d4a9b3c22248594f52bfa3b14dc73db110b7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | Q_ENUMS -> Q_ENUM and Q_FLAGS -> Q_FLAGAlbert Astals Cid2017-01-023-3/+3
| | | | | | | | | | Change-Id: I3cdc7338354da40ab20bdaeb9d5745264ea27228 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-12-134-40/+44
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure qmake/Makefile.unix.macos qmake/Makefile.unix.win32 qmake/generators/win32/msvc_vcproj.cpp src/3rdparty/pcre/qt_attribution.json src/corelib/io/qsettings.cpp src/corelib/kernel/qdeadlinetimer.cpp src/platformsupport/kmsconvenience/qkmsdevice.cpp src/platformsupport/kmsconvenience/qkmsdevice_p.h src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h tests/manual/qstorageinfo/printvolumes.cpp tools/configure/configureapp.cpp Change-Id: Ibaabcc8e965c44926f9fb018466e8b132b8df49e
| * Clean up style selection codeLars Knoll2016-11-293-31/+35
| | | | | | | | | | | | | | | | Turn styles into proper features and test for them using qtConfig/QT_CONFIG. Change-Id: I7e28785a46723364b90d8aa286f4d6e5ab085651 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * QtWidgets: Add missing overrideAlexander Volkov2016-11-291-9/+9
| | | | | | | | | | Change-Id: I991659db5510acbbb44d0f5987edc213acf62a74 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-11-022-8/+11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Blacklist tst_QMenuBar::taskQTBUG46812_doNotLeaveMenubarHighlighted() on macOS. Conflicts: mkspecs/features/mac/default_post.prf mkspecs/features/mac/sdk.prf mkspecs/features/uikit/default_post.prf mkspecs/features/uikit/sdk.prf src/angle/src/libEGL/libEGL.pro src/platformsupport/fontdatabases/fontdatabases.pro src/platformsupport/platformsupport.pro src/plugins/platforms/cocoa/qnswindowdelegate.mm src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp src/plugins/platforms/ios/ios.pro src/plugins/platforms/ios/kernel.pro tests/auto/widgets/widgets/qmenubar/BLACKLIST tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp Task-number: QTBUG-56853 Change-Id: If58785210feee3550892fc7768cce90e75a2416c
| * Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-011-0/+5
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/win/msvc_version.cpp configure.pri mkspecs/macx-ios-clang/features/default_post.prf mkspecs/macx-ios-clang/features/resolve_config.prf mkspecs/features/uikit/default_post.prf mkspecs/features/uikit/resolve_config.prf src/corelib/io/qsettings_mac.cpp src/corelib/json/qjsondocument.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/cocoa/qnswindowdelegate.h src/plugins/platforms/cocoa/qnswindowdelegate.mm src/plugins/platforms/ios/ios.pro src/plugins/platforms/ios/kernel.pro src/plugins/platforms/ios/qiosintegration.h src/plugins/platforms/minimalegl/qminimaleglintegration.cpp tests/auto/gui/painting/qpainter/tst_qpainter.cpp tools/configure/environment.cpp Change-Id: I654845e54e40f5951fb78aab349ca667e9f27843
| | * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-271-0/+3
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/ios/ios.pro src/plugins/platforms/ios/kernel.pro src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.h src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.mm src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileenginefactory.h src/plugins/platforms/ios/qiosintegration.h src/widgets/widgets/qcombobox.cpp tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp Change-Id: Ibaee7cbbba99e7c4b1d8926e55932ffa6030ce45
| | | * iOS: link photo lib plugin based on Info.plist contentsRichard Moe Gustavsen2016-10-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the application's Info.plist contains the key 'NSPhotoLibraryUsageDescription', we know that we can safely link in qiosnsphotolibrarysupport without violating AppStore requirements. This is a simple feature that doesn't introduce additional qmake API for doing app deployment with optional iOS QPA plugins. [ChangeLog][iOS] Starting from iOS 10, Apple requires all apps that need access to photos to have the key 'NSPhotoLibraryUsageDescription' in the Info.plist. Therefore, to get the same support in Qt (when, e.g., using a file dialog), the Info.plist assigned to QMAKE_INFO_PLIST will need this key as well. Change-Id: I7a93afe24b589cad96d5a1d9e2a155ad1671178a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
| | * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-131-0/+2
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also bump minimum required Qt version for Android: Ministro updates. Conflicts: src/android/java/src/org/qtproject/qt5/android/bindings/QtActivityLoader.java src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java src/plugins/platforms/android/androidjnimain.cpp Change-Id: I966f249bebf92da37bfdeb995ad21b027eb03301
| | | * QFileDialog: add missing break statements in switch in labelText()Marc Mutz2016-10-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is of course wrong to potentially return the text of the Cancel button if the text of the Accept role button was asked for. Found independently by GCC 7 and Coverity. Coverity-Id: 11150 Change-Id: Ie30f7875daee16a78eeff4b314ce17cbd7cd3aa8 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | | QFileSystemModel: improve readability of the renaming codeMarc Mutz2016-10-281-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of calling QHash::value(), inserting the return value into the hash with a different name and only many lines later removing the old node, do the extraction into a QScopedPointer, and the insertion into the hash from the QScopedPoiner, keeping the node update in between the two. Avoids the double-lookup of 'oldName', makes it clearer what's going on, and limits the potential for some return between the insertion under the new name and the removal under the old one sneaking in, which would cause a double-delete later in the dtor. Change-Id: Ia2d1cca77c04708421ccb5e594729ec83de85345 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | | QFileInfoGatherer/Win32: Connect to drive arrival/removal signals of watcherFriedemann Kleint2016-10-272-12/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Retrieve instance of QWindowsRemovableDriveListener via dynamic property of QFileSystemWatcher and connect to its signals to add/remove drives. Task-number: QTBUG-18729 Task-number: QTBUG-14290 Change-Id: I603a6f99aca8e6fb3e28d4bc997d8e49d7d0a7c8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-10-132-19/+12
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/library/qmakeevaluator.cpp (cherry picked from commit 1af6dc2c8fb4d91400fddc5050166f972ae57c9a in qttools) src/corelib/kernel/qcore_mac_objc.mm src/gui/painting/qcolor.h src/plugins/platforms/cocoa/qcocoawindow.mm Change-Id: I5b3ec468a5a9a73911b528d3d24ff8e19f339f31
| * | | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-10-061-3/+1
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/mac/default_pre.prf mkspecs/features/qpa/genericunixfontdatabase.prf mkspecs/features/uikit/default_post.prf mkspecs/features/uikit/resolve_config.prf mkspecs/macx-ios-clang/features/default_post.prf mkspecs/macx-ios-clang/features/resolve_config.prf src/corelib/io/qiodevice.cpp Change-Id: I6f210f71f177a3c3278a4f380542195e14e4b491
| | * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-051-3/+1
| | |\| | | | | | | | | | | | | Change-Id: I34b5e290233d0869fbafac094a939aec2bf83fd5
| | | * QFileSystemModel: Plug leak on file renamingMarc Mutz2016-10-041-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In setData(), the old code both called Private::addNode(), which creates a QFileSystemNode and adds it to the parent's QHash of children, and also re-purposed the old node by taking it out of the children hash, adjusting the fileName member of the node and putting it back into the children hash under the new name, where it would overwrite the node just added under the same (new) name in addNode(). Since the hash stores naked pointers, no-one deletes the node that was put into the hash first. Fix by dropping the addNode() call completely. Change-Id: I0c37917fd0ffd74716393786c69b5bb172aa372e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | | * QFileSystemModel: fix unused variable with QT_NO_FILESYSTEMWATCHERMarc Mutz2016-10-041-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QFileInfo 'info' is only used in code conditional on QT_NO_FILESYSTEMWATCHER, so move the definiton into the conditionally-compiled block, too. Turn it into an rvalue while at it. Change-Id: I9983bfdcd0b32d0abecf7c588973a60df9de8cbc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | | QFileSystemNode: simplify three loops over the children hashMarc Mutz2016-09-301-15/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the dtor, simply call qDeleteAll(children) instead of looping manually. In updateIcon() and retranslateStrings() replace a manual loop with C++11 ranged for. At least I only saw 'iterator' everywhere (who names an iterator 'iterator' instead of 'it'??). Change-Id: Ib0047dece3c88244bb4364cd4491cd04514a91bb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | QFileSystemModel: add an assert to prevent leaksMarc Mutz2016-09-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Private::addNode() adds the new node to the parent's hash without checking whether a node already exists. If it does, then the old node is leaked. Add an assertion to check for this condition. Change-Id: Ib949d71c86c28d1152a538756c0efc283c793c24 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>