projectmanager interface

Andreas Pakulat apaku at gmx.de
Sat Dec 27 18:37:51 UTC 2008


On 27.12.08 18:39:09, Aleix Pol wrote:
> On Sat, Dec 27, 2008 at 12:18 PM, Andreas Pakulat <apaku at gmx.de> wrote:
> > On 26.12.08 20:36:29, Aleix Pol wrote:
> > > On Fri, Dec 26, 2008 at 5:19 AM, Matt Rogers <mattr at kde.org> wrote:
> > > > On Wednesday 24 December 2008 07:35:17 pm Aleix Pol wrote:
> > > > > hi,
> > > > > I've been checking the project modification interface and there are
> > some
> > > > > things that look a bit strange.
> > > > >
> > > > > - why do we need the removeFileFromTarget when we have a removeFile?
> > we
> > > > can
> > > > > check if it is from an item using
> > > > > dynamic_cast<ProjectTargetItem*>(it->parent()).
> > > >
> > > > What happens if you want to remove a file from a target and move it to
> > > > another
> > > > target? That was the use-case that removeFileFromTarget was intended
> > for.
> > > > If
> > > > removeFile is a destructive action (i.e. the file gets deleted) then
> > this
> > > > is
> > > > still needed. It also makes the operation explicit in terms of API.
> > >
> > > Maybe the name is wrong?
> > > By now the file is deleted by the projectmanagerview though, not by the
> > > plugin. the plugin just makes sure that the change is coherent with the
> > > call.
> >
> > I'm not sure the project-manager-plugin (i.e. cmake/qmake/etc) should be
> > doing the deletion because:
> >
> > a) it duplicates code
> > b) thats not the task of those plugins, they should just manage the
> > buildsystem/project-file-list
> >
> Well, I think it is quite clear that the buildtool should not delete the
> files by themselves. it should be done by the vcs plugin, instead.
> 
> > However, that still leaves the case Matt explained: I want to remove file
> > foo.cpp from target a, which should leave that file in the project, but
> > simply not attach it to a certain target.
> 
> Then we should remove it from the buildtool but not from the filesystem
> (which is not performed by this interface) and then add the file again to
> another parent :/.

Well, there's a difference between what we have as API and what the context
menu for example offers. We may have Delete File as well as "Remove File
from Project". The latter action may ask wether the file should be deleted
from disk, but it shouldn't do that by default.

Andreas
 
-- 
You're not my type.  For that matter, you're not even my species!!!




More information about the KDevelop-devel mailing list