Commit acf43c17 authored by Alexander Volkov's avatar Alexander Volkov
Browse files

QFileSystemModel: create nodes with correct QFileInfos

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 61cefb2f


(De-inline QFileSystemModel::fileInfo() and implement it efficiently).

Change-Id: I3b4e5f5b256711e27ad50824eaa8492dbc096808
Task-number: QTBUG-51586
Reviewed-by: default avatarLars Knoll <lars.knoll@theqtcompany.com>
Showing with 52 additions and 6 deletions
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment