SUMMARY *** lokalize does not open project file using --project <project_file> *** STEPS TO REPRODUCE When I invoke lokalize using "lokalize --project <project_file>", either on a console or via a mime definition and clicking on a .lokalize file, it shows an empty tab "Project Overview". When I use, after in this way starting lokalize, the menu item "Open Project" and select a project file the tab "Project overview" shows the content of the project. OBSERVED RESULT Empty tab "Project Overview" EXPECTED RESULT Filled tab "Project Overview" SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: 5.27.9 KDE Frameworks Version: 5.112.0 Qt Version: 5.15.11 ADDITIONAL INFORMATION
Is this the same thing you reported on the mailing list? Did you see my follow up there?
(In reply to Albert Astals Cid from comment #1) > Is this the same thing you reported on the mailing list? > > Did you see my follow up there? You wrote on the mailing list: There's no code changes between 23.08.2 and 23.08.3 in lokalize. [Unless maybe you're using Ubunut+snaps] Are you sure it's not a different update that broke this? Maybe KDE Frameworks? Is your distribution powerful enough that lets you back some updates to try to find which update broke it? I am using openSUSE Tumbleweed, currently snapshot 20231126. I went back to snapshot 20231101 and installed the version 23.08.2, which showed the same behavior. Most likely it is a KDE Framework module that causes this problem. So now I am going back to snapshot 20231101 with all the software. Now it works OK. Trying snapshot 20231110. Frameworks 5.111.0. Works OK. Trying snapshot 20231113. Frameworks 5.112. 0. Not OK.
Caused by https://invent.kde.org/frameworks/kio/-/merge_requests/1457
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1508
So now we got a MR for KIO which should fix this. Indeed, Lokalize seems to exploit a corner case in KDirModel's API and the previous patch slightly changed the behavior for this particular case. This being said, it's one of those where I think we can consider the bug "shared" between KDirModel and Lokalize. It looks like this just uncovered another bug in Lokalize itself, I suspect it didn't really work as it should previously and might have cases where it'd break anyway. Indeed, the project model wrapping KDirModel in Lokalize seems to use rowCount but not canFetchMore/fetchMode to decide to go one level down the hierarchy. This is a bit optimistic in the general case since models (like KDirModel) can decide to not eagerly fetch children nodes. Also it set an invalid url as the root of the model which is allowed but I think a bit fishy. I don't know Lokalize enough to feel confident investing the time to look deeper into how this project model works, I'd probably just unwillingly break it. Also, the MR in KIO does the job for now... still revisiting the project model in Lokalize might be worth it at some point.
(In reply to Kevin Ottens from comment #5) > So now we got a MR for KIO which should fix this. Indeed, Lokalize seems to > exploit a corner case in KDirModel's API and the previous patch slightly > changed the behavior for this particular case. > > This being said, it's one of those where I think we can consider the bug > "shared" between KDirModel and Lokalize. It looks like this just uncovered > another bug in Lokalize itself, I suspect it didn't really work as it should > previously and might have cases where it'd break anyway. > > Indeed, the project model wrapping KDirModel in Lokalize seems to use > rowCount but not canFetchMore/fetchMode to decide to go one level down the > hierarchy. This is a bit optimistic in the general case since models (like > KDirModel) can decide to not eagerly fetch children nodes. Also it set an > invalid url as the root of the model which is allowed but I think a bit > fishy. > > I don't know Lokalize enough to feel confident investing the time to look > deeper into how this project model works, I'd probably just unwillingly > break it. Also, the MR in KIO does the job for now... still revisiting the > project model in Lokalize might be worth it at some point. The problem is still present in the current version of openSUSE Tumbleweed with KDE Frameworks Version 5.114.0
To be expected, nobody reviewed the patch, feels like it fell through the cracks. I'll poke.
Git commit 01a9c8c06dec7d748ed964c9e2f2c4091f9c125a by Kevin Ottens, on behalf of Kevin Ottens. Committed on 23/01/2024 at 09:46. Pushed by ervin into branch 'master'. KDirModel: Consider invalid roots are local fs If the item set on a node (typically the root node) was null it was implicitly considered local fs. But if the item was not null and the url invalid, it'd be considered network fs. In the context of KDirModel caching of the fs type guessing this would mean we'd wrongly assume the whole tree is network fs even if it's not. That's why we change this to consider non-null items with invalid URLs as local fs. M +5 -1 src/widgets/kdirmodel.cpp https://invent.kde.org/frameworks/kio/-/commit/01a9c8c06dec7d748ed964c9e2f2c4091f9c125a
Git commit 9d69638746703ee2f59d3d5e986edfb172960bb6 by Albert Astals Cid, on behalf of Kevin Ottens. Committed on 25/01/2024 at 22:23. Pushed by aacid into branch 'kf5'. KDirModel: Consider invalid roots are local fs If the item set on a node (typically the root node) was null it was implicitly considered local fs. But if the item was not null and the url invalid, it'd be considered network fs. In the context of KDirModel caching of the fs type guessing this would mean we'd wrongly assume the whole tree is network fs even if it's not. That's why we change this to consider non-null items with invalid URLs as local fs. (cherry picked from commit 01a9c8c06dec7d748ed964c9e2f2c4091f9c125a) M +5 -1 src/widgets/kdirmodel.cpp https://invent.kde.org/frameworks/kio/-/commit/9d69638746703ee2f59d3d5e986edfb172960bb6
The problem still exists. Maybe my setup is the culprit. I have in $HOME a symbolic link to the real location of the folder with the KDE translation folders.
Are you using KIO 5.115 or newer?
I am using kio-5.114.0-2.2 from the repository of openSUSE Tumbleweed
Then you don't have the fix.