[RFC] findProjectForUrl() returning >1 Project

Matt Rogers mattr at kde.org
Fri Apr 6 00:18:51 UTC 2007


On Apr 5, 2007, at 6:51 AM, Andreas Pakulat wrote:

> Hi,
>
> in the vcs-thread Kuba brought something up which I'd like to discuss
> here: What happens if 2 projects have files in common? His use-case is
> aegis where the project would consist of a couple of changeable  
> files in
> a changeset + various files from other changeset. So for example you
> have a project consisting of foobar.cpp, foobar.h and main.cpp. Now  
> you
> create a changeset and add main.cpp to it because you work on it. Your
> kdev4 project would be in that changeset, however the project would  
> also
> reference foobar.cpp and foobar.h which lie somewhere else in the
> filesystem (and are not writeable). Then you create another changeset
> to work on the foobar.cpp file. Now the Url for foobar.h is the  
> same for
> both projects.
>
> The same thing can happen with QMake projects, a KDevelop project  
> on top
> of a qmake project can reference files in another part of a complex
> qmake-projecttree (we have at least 1 QMake user with such a layout).
> Lets say something like this:
>
> common/
> apps/appa
> apps/appb
>
> And for each of the apps there's a Kdevelop project. Now for ease  
> of use
> the qmake .pro files reference sources in common. So here we have the
> same thing, both project appa and appb have project files that have  
> the
> same url.
>
> My idea is that the projectForUrl() function in ProjectController can
> return a list of projects instead of 1 project. For many cases this
> would be just a 1-element-list, but in the above mentioned cases it  
> is a
> list of projects to which the url belongs. For things like the
> user-actions from Quanta this means they have to decide wether they
> want:
>
> a) work on the first item in the list only
> b) work on all items in the list always
> c) ask the user, presenting a list of projects
>
> Andreas
>
>

That list thing is a bad idea. I would instead, suggest that we use  
the parent->child relationship in the model to determine which  
project the url is in, if we can. Sorry, no code for this, it's just  
my idea.
--
Matt






More information about the KDevelop-devel mailing list