[KateCompletionWidget] Create configuration interface on demand
AbandonedPublic

Authored by broulik on Mar 13 2018, 9:13 AM.

Details

Summary

No need to create it immediately. Saves some cycles on startup.

Test Plan

Compiles. I didn't find a way to actually trigger the config UI, though

Diff Detail

Repository
R39 KTextEditor
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Mar 13 2018, 9:13 AM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptMar 13 2018, 9:13 AM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
broulik requested review of this revision.Mar 13 2018, 9:13 AM
kfunk added a subscriber: kfunk.Mar 13 2018, 9:29 AM

Looks like you don't need the member at all? Otherwise late-init wouldn't work this way.

m_configWidget seems only used in showConfig(). Let's remove the member altogether?

kfunk accepted this revision.Mar 13 2018, 11:07 AM

Looks like you don't need the member at all? Otherwise late-init wouldn't work this way.

m_configWidget seems only used in showConfig(). Let's remove the member altogether?

Ah, disregard my comment. If showConfig() is invoked multiple times then my approach would be slower.

This revision is now accepted and ready to land.Mar 13 2018, 11:07 AM
cullmann accepted this revision.Mar 13 2018, 11:08 AM
cullmann added a subscriber: cullmann.

I think it is ok that way, too ;=)

This revision was automatically updated to reflect the committed changes.

Hi! After this commit I don't see a completion dropdown anymore. And after it should be opened and one presses backspace, kate or kwrite crashes. Simple example:

  1. open empty Kate
  2. write "aaaa", enter, "aaaa", backspace

I will provide backtrace on demand :). I'm running on kdesrc-build environment, therefore frameworks and KDE applications are built from git. I have stable Qt version 5.10.1. Wayland session.

hein added a subscriber: hein.Mar 17 2018, 8:57 AM

A backtrace for the crash @martinkostolny mentioned can be found here: https://bugs.kde.org/show_bug.cgi?id=391955

Perhaps one has not thought about the side-effects of the construction of the KateCompletionConfig.
It looks like it does a readConfig and that triggers applyInternal() which in return will configure the m_presentationModel.
I will revert this commit for the time being.

cullmann reopened this revision.Mar 18 2018, 12:34 PM

See:

Git commit 7f3d9e774129618dfb9fd871d5d5c8fbb66b4d9a by Christoph Cullmann.
Committed on 18/03/2018 at 12:33.
Pushed by cullmann into branch 'master'.

Revert "[KateCompletionWidget] Create configuration interface on demand"

This reverts commit 92e21fb03b7fd01eab6fd6f4a116b849cb93ef9e.

KateCompletionConfig construction seems to have some side-effects that are necessary
(e.g. initial config loading)

M +1 -5 src/completion/katecompletionwidget.cpp

https://commits.kde.org/ktexteditor/7f3d9e774129618dfb9fd871d5d5c8fbb66b4d9a

This revision is now accepted and ready to land.Mar 18 2018, 12:34 PM
cullmann requested changes to this revision.Mar 18 2018, 12:35 PM

If we want that, one needs to take care of the config loading/initial setup of the m_presentationModel in a different way than relying on the config widget to do it.

This revision now requires changes to proceed.Mar 18 2018, 12:35 PM
broulik abandoned this revision.Apr 24 2018, 5:34 PM