Repository navigation
Remove dead Qt.clearComponentCache guard from plugin reload - #10070
fresh3nough wants to merge 1 commit into
Conversation
Qt.clearComponentCache is a C++ API (QQmlEngine), never exposed to QML. The typeof guard was always false, so the cache was never cleared during hot reload. Remove the dead call and document the known limitation. Fixes #9772 Signed-off-by: fresh3nough <anonwurcod@proton.me>
|
Reviewed against Three other open pull requests change the same line and actually fix #6981:
Of these, #8766 fixes the cause most directly. Whichever fix lands removes or rewrites this line anyway, so the cleanup here is better folded into it than merged on its own. A few smaller points, in case this one is kept:
I read the four diffs, and Codex at medium effort reviewed them separately. It put #8766 first and this pull request last, as I did. It raised the test-path collision with #10576 and the comment's gap about edited files, and I checked both against the diffs. Its agreement with the ranking is not guaranteed to be independent. Nothing was run on a worker, because this change has no runtime effect to reproduce. Which reload fix to take is up to the maintainer. #8766 and #7771 currently conflict with |
|
Thank you for this, @fresh3nough. #8766 got there first with a fix for the same problem, so this is closed in favour of it, and the credit stays with the first fix. If it does not cover your case, please say so there. Closed at the maintainer's request. The review comment above has the details; it was done by Claude Opus 5.5 with Codex Medium as a second opinion, whose agreement is not independent. |
Summary
finishPluginReload()guarded a call toQt.clearComponentCache()behindtypeof Qt.clearComponentCache === "function". That API is C++ only (QQmlEngine::clearComponentCache()) and has never been exported to QML, so the call never ran.The engine caches component types, script imports, and directory listings. When a plugin adds new files while the shell is running, those stale caches can cause
File name case mismatcherrors for files that exist at the correct path.Fix
Remove the dead guard and document that the QML engine caches are not cleared on reload. A plugin that adds new files after the shell starts may require a restart.
Fixes #9772
Test plan
typeof Qt.clearComponentCacheguard present on quattrobash test/shell.d/plugin-reload-cache-test.sh