diff options
| author | Akseli Lahtinen <[email protected]> | 2023-12-08 10:59:19 +0000 |
|---|---|---|
| committer | Akseli Lahtinen <[email protected]> | 2023-12-08 10:59:19 +0000 |
| commit | b1f9c2e5c90548f391477fa17889ff8d1abf8f53 (patch) | |
| tree | 4797b1b0f1d9afaea69f1fb4551e6dea4455fd50 /src/kitemviews/kfileitemmodelrolesupdater.cpp | |
| parent | 30691235c5acc4c5b30ffc8820d2ef7c55fc632e (diff) | |
Do not reset expandability when loading previews
Fixes a weird bug with the treeview if one has
```
[PreviewSettings]
Plugins=audiothumbnail
```
in their `dolphinrc`. It can be any PreviewSettings plugin, as long as there it at least one.
Check the bug report for more, but in short, the bug is reproducible like this:
```
create folder tree inside a test folder with
mkdir -p 1/A/B/C/D/E/F/G/H/I
mkdir -p 2/A/B/C/D/E/F/G/H/I
mkdir -p 3/A/B/C/D/E/F/G/H/I
make sure you see the test folder, and expand it
expand folder 1, no need to expand all sub folders
expand folder 2
collapse and expand test folder
3 loses its expansion arrow
if all folders are expanded, only 3 keeps its order
if 1 and all its subfolders are expanded, then test is toggled,
folder 2 also loses its expansion arrow
```
Video of the bug:

The path to the bug is: `KFileItemModelRolesUpdater::slotPreviewFailed` -> `KFileItemModelRolesUpdater::applyResolvedRoles` -> `KFileItemModelRolesUpdater::rolesData` -> `KFileItemModelRolesUpdater::startDirectorySizeCounting`.
This causes Dolphin with preview plugins enabled trying to count the directories again, and the data gets reset even if there is something there. This then resets the `isExpandable` flag and that breaks the treeview, causing all kinds of issues, like being able to expand non-directories and makes things out of sync.
BUG:477607
Diffstat (limited to 'src/kitemviews/kfileitemmodelrolesupdater.cpp')
| -rw-r--r-- | src/kitemviews/kfileitemmodelrolesupdater.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/kitemviews/kfileitemmodelrolesupdater.cpp b/src/kitemviews/kfileitemmodelrolesupdater.cpp index bcd172d02..e2d32265e 100644 --- a/src/kitemviews/kfileitemmodelrolesupdater.cpp +++ b/src/kitemviews/kfileitemmodelrolesupdater.cpp @@ -1306,8 +1306,6 @@ void KFileItemModelRolesUpdater::startDirectorySizeCounting(const KFileItem &ite url = QUrl::fromLocalFile(item.localPath()); } - data.insert("isExpandable", false); - data.insert("count", 0); data.insert("size", -2); // invalid size, -1 means size unknown disconnect(m_model, &KFileItemModel::itemsChanged, this, &KFileItemModelRolesUpdater::slotItemsChanged); |
