Getting the current active project

Andreas Pakulat apaku at gmx.de
Sat Mar 31 11:32:02 UTC 2007


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.

> - iterate over all the projects and do the check for each and everyone. 
> Problem: slower, more compilcated code.

Well, iterating over a list isn't that slow, especially as the list of
opened projects shouldn't be _that_ large (I think less than 20 projects
is sane to anticipate). And the complicated code would be inside
projectcontroller and it will exist anyway because we need a way to find
the project or projectitem for a given url.

> 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? 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. 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...

Andreas

-- 
A visit to a fresh place will bring strange work.




More information about the KDevelop-devel mailing list