Review Request: Only show language context menu extensions if the menu is invoked in a context relevant to that language

Sven Brauch svenbrauch at gmx.de
Sun Mar 11 14:21:04 UTC 2012



> On March 11, 2012, 2:10 p.m., Milian Wolff wrote:
> > Sounds good, but this makes it just the more urgent to refactor our refactoring actions :)
> > 
> > We also have the "code" menu e.g. which will contain actions that are not relevant to php/python, like the class browser e.g.
> > 
> > So I'd really like to see some work on that, probably best would be some kind of refactor-controller where one can register actions that are then queried for validity. The class browser should also be extensible somehow.
> > 
> > What do you think? Somehow I have the feeling that this patch here is just a workaround...

It is a workaround, no doubts about that. :)
It seems that all those actions are not at all checked for validity currently, are they? Thus, it would probably indeed be good to have something controlling that...
However, I don't think I'm the right person to write that. I neither know anything about those classes, nor will I need much of their functionality in the near future (I don't plan to implement huge amounts of python refactoring tools currently, I just want rename to work).


> On March 11, 2012, 2:10 p.m., Milian Wolff wrote:
> > shell/plugincontroller.cpp, line 631
> > <http://git.reviewboard.kde.org/r/104212/diff/1/?file=52298#file52298line631>
> >
> >     Is this safe without locking the duchain? I somehow doubt that. So:
> >     
> >     if ( ... ) {
> >       DUChainReadLocker lock;
> >       if (c->declaration()) {
> >         url = c->declaration.data()->url().toUrl();
> >       }
> >     }

Okay, I'll change that.


- Sven


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/104212/#review11286
-----------------------------------------------------------


On March 9, 2012, 11:22 p.m., Sven Brauch wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/104212/
> -----------------------------------------------------------
> 
> (Updated March 9, 2012, 11:22 p.m.)
> 
> 
> Review request for KDevelop and Milian Wolff.
> 
> 
> Description
> -------
> 
> I tried to implement proper rename support for python, and during that task I noticed this behaviour: any loaded language plugin will add its context menu extensions to any context menu. The c++ plugin adds its rename dialog to php and python files. This patch fixes that behaviour by retrieving the URL of the file the action was invoked on, and then checks that the plugin -- if it is a language plugin -- fits that language.
> 
> 
> Diffs
> -----
> 
>   shell/plugincontroller.cpp 23408a6 
> 
> Diff: http://git.reviewboard.kde.org/r/104212/diff/
> 
> 
> Testing
> -------
> 
> The "rename" action no longer shows up in python, but seems to work as before in c++.
> 
> 
> Thanks,
> 
> Sven Brauch
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20120311/d8a9ad33/attachment.html>


More information about the KDevelop-devel mailing list