Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.6.0
-
None
-
Windows 7, Linux
-
e27fae353ca9a2d4d5054d32bb3a2622ccf9d889 (qtbase/5.6, 22.4.2016, 5.6.1)
Description
Consider the following example:
1) Create QFIleSystemModel and attach it to a view, connect fileRenamed() signal
2) Create a subdirectory x1/x2/x3 under the root
3) Expand x1
4) Rename x2 to xx
5) Catch fileRenamed() signal and get the information: m_model->fileInfo(path + '/' + newName).
Result:
fileInfo() reports that the directory "xx" doesn't exist
Using the attached project:
1) Compile and run
2) Click "Expand"
3) Select "x2", press F2 and rename "x2" to "xx"
Result: in the stderr console you see
Renamed x2 to xx
New file exists: false
Dirty workaround: check the item's information after some time using QTimer::singleShot(10, ...);
Using qtbug52561.zip:
"/tmp/watcher-text2" "5.6.1 xcb" Renamed "x2" to "xx" New file exists: "/tmp/watcher-text2/x1/xx" idx= true QModelIndex(0,0,0x254a6d0,QFileSystemModel(0x245a5f0)) exist= false absPath= "/tmp/watcher-text2/xx"
"/tmp/watcher-text2" "5.5.1 xcb" Renamed "x2" to "xx" New file exists: "/tmp/watcher-text2/x1/xx" idx= true QModelIndex(0,0,0x15c0f80,QFileSystemModel(0x158f2e0)) exist= true absPath= "/tmp/watcher-text2/x1/xx"
Attachments
Issue Links
- relates to
-
QTBUG-51586 [REG 5.5 -> 5.6.0 RC] QFileSystemModel reports incorrect QFileInfo
- Closed
- resulted from
-
QTBUG-30902 QFileSystemModel sorting extremely slow
- Closed