Rearrange _HandleSourceCodeChanged() a bit so it correctly handles updating

the current source path when changing frames in all cases.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42322 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rene Gollent
2011-06-26 16:22:45 +00:00
parent 3d3a03c017
commit 9186e23d5a
@@ -1006,12 +1006,14 @@ TeamWindow::_HandleSourceCodeChanged()
AutoLocker< ::Team> locker(fTeam); AutoLocker< ::Team> locker(fTeam);
SourceCode* sourceCode = fActiveFunction->GetFunction()->GetSourceCode(); SourceCode* sourceCode = fActiveFunction->GetFunction()->GetSourceCode();
if (sourceCode == NULL) { LocatableFile* sourceFile = NULL;
BString sourceText;
if (sourceCode == NULL)
sourceCode = fActiveFunction->GetSourceCode(); sourceCode = fActiveFunction->GetSourceCode();
BString sourceText; if (sourceCode != NULL)
LocatableFile* sourceFile = fActiveFunction->GetFunctionDebugInfo() sourceFile = fActiveFunction->GetFunctionDebugInfo()->SourceFile();
->SourceFile();
if (sourceFile != NULL && !sourceFile->GetLocatedPath(sourceText)) if (sourceFile != NULL && !sourceFile->GetLocatedPath(sourceText))
sourceFile->GetPath(sourceText); sourceFile->GetPath(sourceText);
@@ -1025,7 +1027,6 @@ TeamWindow::_HandleSourceCodeChanged()
fSourcePathView->SetText(sourceText.String()); fSourcePathView->SetText(sourceText.String());
} else } else
fSourcePathView->SetText("Source file unavailable."); fSourcePathView->SetText("Source file unavailable.");
}
BReference<SourceCode> sourceCodeReference(sourceCode); BReference<SourceCode> sourceCodeReference(sourceCode);