Review Request 118596: Recognize QML slots and register them as uses of their corresponding signal

Denis Steckelmacher steckdenis at yahoo.fr
Fri Jun 6 18:48:59 UTC 2014



> On June 6, 2014, 6:40 p.m., Sven Brauch wrote:
> > duchain/helper.h, line 60
> > <https://git.reviewboard.kde.org/r/118596/diff/3/?file=279494#file279494line60>
> >
> >     maybe getDeclarationOrSignal?

This is a great name! I also removed the XXX, "onFoo" and "foo" are cleaner, and even show that the case is handled correctly.


- Denis


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


On June 6, 2014, 6:46 p.m., Denis Steckelmacher wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/118596/
> -----------------------------------------------------------
> 
> (Updated June 6, 2014, 6:46 p.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Repository: kdev-qmljs
> 
> 
> Description
> -------
> 
> When the declaration corresponding to a name is being looked for, and the name is "onXXX", declarations named "XXX" are also returned if they are signals. This allows UseBuilder to register "onClicked" as being an use of the "clicked" signal.
> 
> This patch is very general and modifies directly getDeclaration(). This has the advantage that the search logic can be used everywhere (for instance, DeclarationBuilder will soon be able to expose the parameters of a signal to its slot), but getDeclarations() must be very careful not to return an unexpected declaration. For instance, if the user, in a Javascript file, declares an "line" variable, "online" must not be an use of "line". This is done by ensuring that the returned declaration, when "on" has been stripped, is a QML signal.
> 
> 
> Diffs
> -----
> 
>   duchain/helper.h 0e23dda 
>   duchain/helper.cpp 27f5dd4 
>   duchain/usebuilder.cpp 43a3e30 
>   tests/files/plugins.qml 428955c 
>   tests/files/uses.js b528344 
> 
> Diff: https://git.reviewboard.kde.org/r/118596/diff/
> 
> 
> Testing
> -------
> 
> Two unit tests have been added: one ensures that "onDataChanged" is an use of "dataChanged", and one ensures that "online" is not an use of "line" in Javascript.
> 
> 
> Thanks,
> 
> Denis Steckelmacher
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20140606/72f82d80/attachment-0001.html>


More information about the KDevelop-devel mailing list