Getting the current active project
Andreas Pakulat
apaku at gmx.de
Sat Mar 31 13:39:34 UTC 2007
On 31.03.07 16:05:33, Andras Mantia wrote:
> On Saturday 31 March 2007, Andreas Pakulat wrote:
> > On 31.03.07 13:42:06, Andras Mantia wrote:
> > > Hi,
> > >
> > > At this moment it is not possible to find out what is the active
> > > project inside KDevelop. In Quanta we need to know the current
> > > project in the following places:
> > >
> > > - monitoring all opened project folders and notifying the user if
> > > there was a change there. Problem: how will this work with remote
> > > projects?
> >
> > I don't think we support remote projects, atm.
>
> We should. This was discussed before and we all agreed that we should
> make the platform use only KUrl's and thus support remote projects.
Hmm, currently we don't because KConfig doesn't support reading from
remote urls. I have currently no idea how we could make this work,
except by copying the project file to the remote location after project
closing.
> > > Thereby I request to introduce back the notion of the current
> > > project in the KDevelop platform.
> >
> > What happens if your user actions or the other stuff doesn't get a
> > project?
>
> It will limit the user, so he cannot run scripts that work on the active
> project, only on the active document (and probably the folder where the
> document lies).
I meant what if currentProject() returns 0 instead of a valid IProject*.
> > For example currently if the first project is opened the
> > currentProject is not yet set, its connected to the currentChanged
> > signal of the treeview. Thus currentProject() would return a
> > 0-pointer. While this can be "worked around" by automatically
> > activating the first opened project, this won't work for closing
> > projects.
>
> You mean what will happen if no project is opened? That's not a problem,
> as in that case the path given to the script will be the path of the
> active document. This workes (and worked) fine.
Yeah, but what happens if the script uses your proposed %projectbase and
projectbase is suddenly empty? I guess I have to look into Quanta's code
to properly understand that.
> > Then again there's no "current item" in the treeview and I
> > don't think its sane to just select the top-most project in the
> > treeview...
>
> Sorry, what treeview is this?
Uhm, the projectmanagerview (do we have another treeview in kdev4?), its
visible only after opening a project.
Don't get me wrong, I'm not fighting a war against bringing back
currentProject, but I'd like to have some real good reasons to do so.
Andreas
--
Do nothing unless you must, and when you must act -- hesitate.
More information about the KDevelop-devel
mailing list