summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs/qfilesystemmodel.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.9' into devOswald Buddenhagen2017-08-021-2/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/xcb/qxcbconnection.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp src/plugins/styles/mac/qmacstyle_mac.mm src/widgets/widgets/qdockarealayout.cpp src/widgets/widgets/qmainwindow.cpp src/widgets/widgets/qmainwindowlayout.cpp src/widgets/widgets/qmainwindowlayout_p.h tests/auto/corelib/tools/qlocale/tst_qlocale.cpp tests/auto/other/macnativeevents/BLACKLIST tests/auto/widgets/widgets/qmenu/BLACKLIST Change-Id: Ic8e724b80a65e7b1af25511b0e674d209265e567
| * In QFileDialog delete a symlink rather than actual target it points toDongmei Wang2017-07-291-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In QFileDialog, when a resolved symlink gets deleted, the actual target it points to gets deleted instead of the symlink itself. The patch is to delete the symlink rather than actual target by doing the following: 1. In QFileDialog, if a directory being deleted is a resolved symlink, do not remove the directory. Instead, call QFileSystemModel to remove the model index. 2. In QFileSystemModel::remove(), use the full file path instead of the resolved file path for deletion. For a symlink, delete the symlink itself. The patch is for Windows and Linux. Task-number: QTBUG-29770 Change-Id: I4db545f0b5963acde3f89a8ee858338c23104804 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-07-041-6/+4
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qprocess_unix.cpp src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/widgets/util/util.pri tests/auto/corelib/thread/qthread/qthread.pro tests/auto/corelib/thread/qthread/tst_qthread.cpp Change-Id: I5c45ab54d46d3c75a5c6c116777ebf5bc47a871b
| * Convert features.filesystemmodel to QT_[REQUIRE_]CONFIGStephan Binner2017-07-021-4/+0
| | | | | | | | | | Change-Id: I862510387e79d04221ec075f3e79896908ee9d8f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * Convert features.messagebox to QT_[REQUIRE_]CONFIGStephan Binner2017-06-291-2/+4
| | | | | | | | | | Change-Id: Ie25dc672f8a675c06585c7757255f7dbadbfc5ec Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Add QLocale::formattedDataSize and consolidate use casesShawn Rutledge2017-06-201-15/+1
|/ | | | | | | | | | | | | | | It should be easier to translate sizes in bytes to human-readable strings consistently rather than having to repeat this code (and the string translations) in various places. The FileDialog in QtQuick.Controls has a use for this, too. [ChangeLog][QtCore][QLocale] Added QLocale::formattedDataSize() for formatting quantities of bytes as kB, MB, GB etc. Done-with: Edward Welbourne <edward.welbourne@qt.io> Change-Id: I27bca146c3eba90fa7a5d52ef6626ce85723e3f0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* 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>
* 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>
* | | 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>
* | | QFileSystemModel: reuse an existing variableMarc Mutz2016-09-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... to improve readability. The variable 'oldName' was defined one line up from the same expression as the RHS of the if, so use the variable instead. Change-Id: Ifcd119317e8c9594f5280f294bc3301f681b94be Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.7' into devEdward Welbourne2016-07-191-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/library/qmakebuiltins.cpp qmake/library/qmakeevaluator.cpp qmake/library/qmakeevaluator.h qmake/project.h QMakeEvaluator: * evaluateConditional(): one side changed return type, the other changed a parameter type. * split_value_list(): one side changed a parameter adjacent to where ... * expandVariableReferences(): ... the other killed one overload and changed the survivor src/corelib/io/qlockfile_unix.cpp One side changed a #if condition, the other moved NETBSD's part of what it controlled. src/corelib/tools/qdatetime.cpp One side fixed a reachable Q_UNREACHABLE in toMSecsSinceEpoch(), the other moved it from the private class to the public one, in the midst of the "short date-time" optimization, which confused diff entirely. One side changed a QStringLiteral to QLatin1String, the other rewrote adjoining code. src/network/kernel/qauthenticator.cpp Both rewrote a line, equivalently; kept the dev version. src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h One side changed #if-ery that the other removed. tools/configure/configureapp.cpp One side added a check to -target parsing; the other killed -target. tests/auto/testlib/selftests/expected_cmptest.lightxml tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt tests/auto/testlib/selftests/expected_cmptest.xml tests/auto/testlib/selftests/expected_cmptest.xunitxml Regenerated using generate_expected_output.py I note that quite a few other expected_* come out changed, now. There was no git-conflict in src/widgets/kernel/qformlayout.cpp but it didn't compile; one side removed some unused methods; the other found uses for one of them. Put FixedColumnMatrix<>::removeRow(int) back for its new user. Change-Id: I8cc2a71add48c0a848e13cfc47b5a7754e8ca584
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Edward Welbourne2016-07-041-1/+1
| |\| | | | | | | | | | Change-Id: Ibd81cd1df4a0650d93fcb556a57be90be2e1f569
| | * Doc: fix app type notes for QDirModel and QFileSystemModelJ-P Nurmi2016-06-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "GUI application" is quite confusing, because in fact, these models are part of QtWidgets and thus require QApplication instead of QGuiApplication. Change-Id: I35ccc8bfeb74c75a84b2ffbe1cab0c0839495980 Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com> Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-231-6/+15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/wince80colibri-armv7-msvc2012/qmake.conf qmake/generators/win32/msvc_vcproj.cpp src/corelib/global/qnamespace.h src/corelib/global/qnamespace.qdoc src/corelib/io/qfsfileengine_win.cpp src/corelib/tools/tools.pri src/network/ssl/qsslconfiguration_p.h src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp src/plugins/platforms/windows/windows.pri src/src.pro src/tools/bootstrap/bootstrap.pro src/tools/uic/cpp/cppwriteinitialization.cpp src/widgets/dialogs/qfilesystemmodel.cpp tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt Change-Id: I4d2ac78f0dcc97f008186bbbc769c6fe588ab0e5
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-191-6/+15
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp src/network/access/qnetworkaccessmanager.cpp src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.h src/widgets/widgets/qlineedit_p.cpp src/widgets/widgets/qlineedit_p.h src/winmain/winmain.pro tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp tools/configure/configureapp.cpp Change-Id: Ib9997b0d0f91946e4081d36c0c6b696c5c983b2a
| | * QFileSystemModel: create nodes with correct QFileInfosAlexander Volkov2016-05-101-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create parent nodes with the corresponding paths, not with the absolute path of the child node. Otherwise we will get incorrect QFileInfo at least in the following case: QFileSystemModel model; model.setRootPath("/usr/bin"); QModelIndex idx = model.setRootPath("/usr"); qDebug() << model.fileInfo(idx).absoluteFilePath(); Without the fix it prints "/usr/bin". It's a regression triggered by 61cefb2f7a7cb16dfa2732e26d2319017039ef62 (De-inline QFileSystemModel::fileInfo() and implement it efficiently). Change-Id: I3b4e5f5b256711e27ad50824eaa8492dbc096808 Task-number: QTBUG-51586 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-121-3/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config_help.txt configure src/corelib/io/qprocess_wince.cpp src/plugins/platforms/windows/qwindowstheme.cpp src/plugins/platforms/xcb/qxcbbackingstore.cpp tests/auto/corelib/tools/qtimezone/BLACKLIST tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp Change-Id: I26644d1cb3b78412c8ff285e2a55bea1bd641c01
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-271-3/+5
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qprocess_win.cpp src/widgets/itemviews/qheaderview.cpp Change-Id: I0a59ade9cd6e91f770fdf298a7d72a41e79fd761
| | * QFileSystemModel: fix updating QFileInfo for a node after a file renameAlexander Volkov2016-04-221-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the correct parent path for the renamed file when creating QFileInfo. It must be a path to the parent directory, not to the root directory of the model. Modify tst_QFileSystemModel::setData() to test renames in subdirs of the root directory of the model. Change-Id: I69d9e3a937616857a81617791ed118af3f6eea05 Task-number: QTBUG-52561 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | QtWidgets: Remove Windows CE.Friedemann Kleint2016-04-071-8/+7
|/ / | | | | | | | | | | | | | | | | Remove Windows CE-specific files, #ifdef sections for Q_OS_WINCE and wince .pro file clauses in library, examples and tests. Task-number: QTBUG-51673 Change-Id: I102745aaca9d9737f2108fe7618111743d5ae980 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QtWidgets: prevent detach attempts from first()/etc. use [dialogs, kernel, ↵Marc Mutz2016-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | util, widgets] The algorithm used was: - If possible, just declare the container const - Otherwise, for first()/last(), use constFirst()/constLast() and for front()/back(), to not destroy the use of the STL API subset, use qAsConst() Did some caching of function returns here and there, and converted one 0 to nullptr as a drive-by. Also saves almost 4KiB in text size on optimized GCC 4.9 Linux AMD64 builds. Change-Id: I04b7bfd68dc85c22de247cb65a310e1cbbca1e8c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QFileSystemModel: replace inefficient QList<Fetching> with QVectorMarc Mutz2016-01-171-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The type Fetching is larger than a void*, so holding it in QList is needlessly inefficient. Worse, the code could come to depend on the fragile property of (inefficient) QLists that references to elements therein never are invalidated. Fix by holding it in QVector instead. Also optimize the append site by liberal use of std::move(). This code would greatly benefit from emplace_back(), but we can neither assume it's present in std::vector nor do we require the necessary C++11 features that would allow us to implement it in QVector, yet (uniform init and, less so, variadic templates). Change-Id: I50da0ffd557adff57477245d0e8c1fc1fec1ebc1 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-12-181-12/+12
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/painting/painting.pri src/plugins/platforms/xcb/qxcbconnection.cpp tests/auto/corelib/thread/qthreadstorage/qthreadstorage.pro tests/auto/corelib/tools/qlocale/test/test.pro tests/auto/gui/kernel/qwindow/tst_qwindow.cpp tools/configure/environment.cpp Change-Id: I9c40f458b89b2c206de2d2c24e90b5f679c93495
| * QFileSystemModel: report special files which are not symlinksGiuseppe D'Angelo2015-12-131-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Since special files have file size == -1, they were always filtered out by QFileSystemModel, even when passing QDir::System as filtering option. Keep them instead. The testcase is more convoluted than it should be because QFSM is so broken that it returns valid indexes for invisible elements in the model (such as filtered out elements). Change-Id: I023a9813dbfeed7be99dded42c66b1191afdc17e Task-number: QTBUG-20968 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * QFileSystemModel: do not unwatch directories if removal failsGiuseppe D'Angelo2015-12-101-8/+12
| | | | | | | | | | | | | | | | | | ... otherwise we would not detect subsequent file/directories added into the non-removed one. Change-Id: I43018dfb9a9c6c0399190800da3f0d572ec5d8d8 Task-number: QTBUG-49307 Reviewed-by: David Faure <david.faure@kdab.com>
* | QtWidgets: replace some index-based for loops with C++11 range-forMarc Mutz2015-12-161-15/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This needs to be handled a bit carefully, because Qt containers will detach upon being iteratoed over using range-for. In the cases of this patch, that cannot happen, because all containers are marked as const (either by this patch or before). Separate patches will deal with other situations. Apart from being more readable, range-for loops are also the most efficient for loop. This patch shaves almost 2K of text size off an optimized Linux AMD64 GCC 4.9 build. Change-Id: I53810c7b25420b4fd449d20c90c07503c5e76a66 Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-12-021-90/+22
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qcoreapplication.cpp src/corelib/kernel/qeventdispatcher_blackberry.cpp src/network/bearer/qnetworkconfiguration.cpp src/plugins/bearer/blackberry/qbbengine.cpp src/plugins/platforms/android/androidjnimain.cpp src/plugins/platforms/android/qandroidplatformtheme.cpp src/plugins/platforms/qnx/qqnxbpseventfilter.cpp src/plugins/platforms/qnx/qqnxfiledialoghelper_bb10.cpp src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp src/plugins/platforms/qnx/qqnxintegration.cpp src/plugins/platforms/qnx/qqnxnavigatorbps.cpp src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp src/plugins/platforms/qnx/qqnxwindow.cpp src/widgets/kernel/qwidgetwindow.cpp src/widgets/styles/qwindowsvistastyle.cpp src/widgets/styles/qwindowsxpstyle.cpp src/widgets/widgets/qtoolbararealayout.cpp tests/auto/corelib/global/qflags/qflags.pro tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp tests/auto/corelib/tools/qversionnumber/qversionnumber.pro tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp Change-Id: I37be88c6c185bb85404823353e027a0a6acdbce4
| * Don't use QList<QPair>Lars Knoll2015-11-301-5/+5
| | | | | | | | | | | | | | Change it to use a QVector instead. Change-Id: Ie1749f326ba1165db48c0eb8763eb738672c7afd Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * Use natural comparison also for the file typesLars Knoll2015-11-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | If we want to sort according to file types, we're also sorting user visible strings. For that we can also use the natural comparison collator, as file types should be case insensitive, and won't contain numbers. And even if they do a natual sorting will make it easier for the end user to find what they are looking for. Change-Id: Ie1d7d0af041a08be0f0d1a4eeb2eae9be885ffc7 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * Use QCollator for sorting in the filesystem modelLars Knoll2015-11-301-84/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | The old code was extremely inefficient, and QCollator can provide the same functionality in a much better and faster way. Task-number: QTBUG-30902 Change-Id: Iaf5dbe587d9a6ebca26885259fdee74a29d3c84f Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * De-inline QFileSystemModel::fileInfo() and implement it efficientlyLars Knoll2015-11-281-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | De-inline the method, and return the file info that's already being cached by the model. This is ok to do in a minor release, as apps compiled against an older version of Qt will simply continue to use the less efficient implementation. Change-Id: I164c7961a8cf97447638af316512326442767dd8 Task-number: QTBUG-30902 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-11-041-1/+1
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/unix/ptrsize.test configure src/corelib/global/qnamespace.h src/network/socket/qabstractsocket.cpp tests/auto/other/networkselftest/networkselftest.pro Change-Id: Ic78abb4a34f9068567cea876861d4220f5a07672
| * QtWidgets: use printf-style qWarning/qDebug where possible (I)Marc Mutz2015-10-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The printf-style version of QDebug expands to a lot less code than the std::ostream-style version. Of course, you pay in type safety (but compilers warn about it these days), you cannot stream complex Qt types and streaming QStrings is awkward, but in many cases you actually improve on readability. But the main reason is that something that's not supposed to be executed under normal operation has no business bloating executable code size. This is not an attempt at converting all qWarnings() to printf-style, only the low-hanging fruit. In this first part, replace qWarning() << "..."; with qWarning("..."); Change-Id: I1f6869b024103c98262f1deae014e0d7337a541c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-10-231-37/+16
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf configure src/corelib/global/qglobal.h src/tools/qdoc/node.cpp src/tools/qdoc/qdocdatabase.cpp tests/auto/corelib/io/qsettings/tst_qsettings.cpp tools/configure/configureapp.cpp Change-Id: I66028ae5e441a06b73ee85ba72a03a3af3e8593f
| * QFileSystemModel: cleanup sortChildren()Maks Naumov2015-10-201-10/+10
| | | | | | | | | | | | | | | | Second value of QPair is not used. And add reserve for "indexNode->visibleChildren" list before pushing. Change-Id: Ia002130c929f71e0802f73f4c0694fd2887b4c91 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * QFileSystemModelPrivate::name(): avoid the double-lookupMaks Naumov2015-10-201-2/+1
| | | | | | | | | | Change-Id: I67507248220fbbddc67ab60ecb1933e1fbacf5fd Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * QFileSystemModel: avoid detachingMaks Naumov2015-10-191-6/+6
| | | | | | | | | | Change-Id: If7e9f11e5514b2f8975e7f83c56b606e67f5952f Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * QFileSystemModel: remove unused functorMaks Naumov2015-10-171-20/+0
| | | | | | | | | | Change-Id: I5809ebdfcd973336cf42735a1275b57f12e1823c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-10-141-1/+1
|\| | | | | | | | | | | | | | | | | Conflicts: tests/auto/corelib/io/qfile/tst_qfile.cpp tests/auto/corelib/io/qprocess/tst_qprocess.cpp tests/auto/corelib/tools/qversionnumber/qversionnumber.pro Change-Id: Ia93ce500349d96a2fbf0b4a37b73f088cc505c6e
| * Libraries: Fix single-character string literals.Friedemann Kleint2015-10-131-1/+1
| | | | | | | | | | | | | | Use character literals where applicable. Change-Id: I8e198774c2247c1cc1d852a41b59b301199b7878 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QFileSystemModel: reimplement sibling for same-rowMarc Mutz2015-09-131-0/+15
|/ | | | | | | | | | | | | Since QFSM, like most models, uses QModelIndex::internalPointer() as an indicator of the row, getting a sibling in the same row is as easy as copying the internalPointer() of the incoming index and just creating a new index with the column adjusted. For rows, the situation is quite a bit more complicated, so we currently continue to call the generic implementation. Change-Id: I36921e3f9c01c458a75aa439018f21c4c657e1cf Reviewed-by: David Faure <david.faure@kdab.com>
* QFileSystemModel: reserve() a QListMarc Mutz2015-07-191-1/+3
| | | | | | Change-Id: I136c24382a869ef92446dbe79bfd6a64273e55c6 Reviewed-by: Sérgio Martins <sergio.martins@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* QFileSystemModel: avoid sibling() callsMarc Mutz2015-07-181-9/+4
| | | | | | | | | | | | | | | | ...by allowing to pass the column to the Private::index() overloads. Because Private::index() always returns an index in column 0, callers that needed a different column used QModelIndex::sibling() to adjust the column of the returned index. But that calls QAIM::sibling(), which calls both QFSM::index() and ::parent(). Simply allowing to pass the column number instead of hard-coding 0 avoids that heavy detour. Change-Id: I8895b3d102d576ba291333cf61075b7263f96b9d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: David Faure <david.faure@kdab.com>
* QFileSystemModel: add a symbolic constant for the number of columnsMarc Mutz2015-07-161-1/+1
| | | | | | | | There are other literal 4's used in the implementation, so disambiguate. Change-Id: I5b0e4ac0018f9d5734e3de8b4f75259e175b23d3 Reviewed-by: David Faure <david.faure@kdab.com>
* widgets: Use QList::reserve(), reduces reallocations.Sérgio Martins2015-06-231-6/+12
| | | | | Change-Id: I49cc03f365c77f142f62c8e77505ec09723a44d9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* WinRT/Winphone: Fix warnings in qtbaseOliver Wolff2015-05-181-1/+3
| | | | | | Change-Id: I41725bcfeee0124b259e96f1e3a261e30f14350a Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>