D14408: SymbolView: Avoid unneeded update of current item

Kåre Särs noreply at phabricator.kde.org
Sun Jul 29 08:22:38 BST 2018


sars added a comment.


  What I still would like to have in this patch is the preventing of the m_currItemTimer from being started while m_updateTimer is active.
  
  If you press enter a couple of times just above a symbol, you notice that the cursor position is updated and indicates that you have moved to the symbol below, but then after a little while, the symbols are updated and the active item is then again updated. The first update is useless and a bit annoying ;)

INLINE COMMENTS

> plugin_katesymbolviewer.cpp:179
>  void KatePluginSymbolViewerView::slotRefreshSymbol()
>  {
>    parseSymbols();

I like this change! :)

Checking pointers should be done close to where you use them.

I think we even could merge slotRefreshSymbols() with parseSymbols() as the first now just calls the later.

> plugin_katesymbolviewer.cpp:199
>  {
> - slotRefreshSymbol();
> + slotDocEdited();
>  

As you noticed this change is not good. It does not decrease the number of calls to parseSymbols() it just adds a delay of 500ms. Notice that cursorPositionChanged and slotDocEdited are connected later in this slot and therefore not trigger any calls to them.

REVISION DETAIL
  https://phabricator.kde.org/D14408

To: loh.tar, #kate, sars
Cc: cullmann, brauch, ngraham, sars, kwrite-devel, #kate, michaelh, kevinapavew, demsking, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20180729/531cabfe/attachment-0001.html>


More information about the KWrite-Devel mailing list