Review Request 115710: Hide private methods and slots behind the d-pointer in KHistoryComboBox

Frank Reininghaus frank78ac at googlemail.com
Mon Feb 24 08:55:02 UTC 2014



> On Feb. 15, 2014, 7:38 p.m., David Faure wrote:
> > src/khistorycombobox.cpp, line 508
> > <https://git.reviewboard.kde.org/r/115710/diff/1/?file=243810#file243810line508>
> >
> >     infinite recursion!
> >     
> >     Sounds like a unittest for reset() should be added.
> 
> David Gil Oliva wrote:
>     There are two reset() methods, the private slot and the public method, which only calls the private slot. My error was not calling the d-pointer method:
>     
>     void KHistoryComboBox::reset()
>     {
>         Q_D(KHistoryComboBox);
>         d->reset();
>     }
>     
>     Maybe the private slot could be substituted by the public method (making it a public slot)?
>     
>     By the way, I would need a hint about the unittest that you think that should be added.

Probably it's sufficient to simply call KHistoryComboBox::reset() in a unit test. This test would crash immediately with version 1 because of the infinite recursion.


- Frank


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/115710/#review49866
-----------------------------------------------------------


On Feb. 23, 2014, 11:23 p.m., David Gil Oliva wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/115710/
> -----------------------------------------------------------
> 
> (Updated Feb. 23, 2014, 11:23 p.m.)
> 
> 
> Review request for KDE Frameworks.
> 
> 
> Repository: kcompletion
> 
> 
> Description
> -------
> 
> Hide private methods and slots behind the d-pointer in KHistoryComboBox
> 
> Also:
> -Remove header not used
> 
> 
> Diffs
> -----
> 
>   src/khistorycombobox.h 3667eb4 
>   src/khistorycombobox.cpp 6f81dda 
> 
> Diff: https://git.reviewboard.kde.org/r/115710/diff/
> 
> 
> Testing
> -------
> 
> It builds. Tests pass.
> 
> 
> Thanks,
> 
> David Gil Oliva
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140224/aa1f1969/attachment.html>


More information about the Kde-frameworks-devel mailing list