D17459: SearchBar: Add Cancel button to stop long running tasks

Anthony Fieroni noreply at phabricator.kde.org
Thu Dec 20 06:50:52 GMT 2018


anthonyfieroni added inline comments.

INLINE COMMENTS

> katesearchbar.h:153
> -    bool find(SearchDirection searchDirection = SearchForward, const QString *replacement = nullptr);
> -    int findAll(KTextEditor::Range inputRange, const QString *replacement);
>  

It's exported class you cannot remove a function, it breaks the ABI

> katesearchbar.h:172
>      // Helpers
> -    bool find(SearchDirection searchDirection = SearchForward, const QString *replacement = nullptr);
> -    int findAll(KTextEditor::Range inputRange, const QString *replacement);
> +    bool find(SearchDirection searchDirection = SearchForward) { return findOrReplace(searchDirection, nullptr); };
> +    bool findOrReplace(SearchDirection searchDirection, const QString *replacement);

Do not change.

> katesearchbar.h:174
>  
> -    void showInfoMessage(const QString &text);
>  

Same here.

> katesearchbar.h:221-227
> +    KTextEditor::MovingRange *m_workingRange = nullptr;
> +    KTextEditor::Range m_inputRange;
> +    QString m_replacement;
> +    uint m_matchCounter = 0;
> +    bool m_replaceMode = false;
> +    bool m_cancelFindOrReplace = false;
> +    std::vector<KTextEditor::Range> m_highlightRanges;

You cannot add new members as well, they change object size. Since this class not use pimpl idiom it will be harder to change anything in header except to add new non-virtual functions.

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

To: loh.tar, #ktexteditor, #vdg, cullmann
Cc: anthonyfieroni, brauch, cullmann, abetts, kwrite-devel, kde-frameworks-devel, #ktexteditor, hase, michaelh, ngraham, bruns, demsking, sars, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20181220/c72176c6/attachment-0001.html>


More information about the KWrite-Devel mailing list