[frameworks-sonnet] [Bug 477897] Dolphin crashes when renaming a file or folder

Oded Arbel bugzilla_noreply at kde.org
Mon Jan 8 11:35:49 GMT 2024


https://bugs.kde.org/show_bug.cgi?id=477897

--- Comment #15 from Oded Arbel <oded at geek.co.il> ---
(In reply to Akseli Lahtinen from comment #14)
> *** Bug 479465 has been marked as a duplicate of this bug. ***

I spent some time analyzing the issue, but I'm still missing something.

The process looks to me like this:
- Dolphin's `KItemListRoleEditor` is a `KTextEdit` that has a `KTextDecorator`
(a kind of `Sonnet::SpellCheckDecorator`)  that has a `Sonnet::Highlighter`,
that is a kind of `QSyntaxHighlighter`.
- When `KitemListRoleEditor` destructs, it (automatically) destroys that chain.
- When `QSyntaxHighlighter` destructs it calls `setDocument(nullptr)`, which
makes sense, to unset the `QTextDocument` that was handling the editing.
- `QSyntaxHighlighter::setDocument()` tries to close the existing document, and
for some reason that requires creating a `QTextCursor` for the old doc, calling
`beginEditBlock()` followed by `endEditBlock()` (even though I don't think the
code in between does something with the cursor)
-` `QTextCursor::endEditBlock()` calls internally
`QTextDocumentPrivate::finishEdit()` which emits `cursorPositionChanged`
- `cursorPositionChanged` apparently is connected to the `KItemListRoleEditor`
that has yet to be disconnected when it started destructing.

I think the fix will simply be to have `KItemListRoleEditor` disconnect from
the `cursorPositionChanged` signal in its d'tor, but I can't find who or where
connects that signal.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the kfm-devel mailing list