Fixes: Crashes on switching sessions.

Task:     Reported on irc
Details:  Hopefully this new code is a little bit more robust, i tried
to untangle the code a bit.
This commit is contained in:
dt
2009-03-11 17:36:17 +01:00
parent 047e5af24a
commit 0cd8da28d4
5 changed files with 93 additions and 52 deletions

View File

@@ -826,10 +826,12 @@ Project *SessionManager::projectForNode(Node *node) const
return project;
}
Node *SessionManager::nodeForFile(const QString &fileName) const
Node *SessionManager::nodeForFile(const QString &fileName, Project *project) const
{
Node *node = 0;
if (Project *project = projectForFile(fileName)) {
if (!project)
project = projectForFile(fileName);
if (project) {
FindNodesForFileVisitor findNodes(fileName);
project->rootProjectNode()->accept(&findNodes);