hrev45775 adds 3 changesets to branch 'master' old head: 06dc1b57d49903e15506ded00a19fb8cfdc7e836 new head: ecd9ecb13293362df16be49420d64bd2af649aef overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=ecd9ecb+%5E06dc1b5 ---------------------------------------------------------------------------- 143fdaf: Style fix. 21d8063: Slight tweak to located file handling. - When the user helps locate a missing source file, verify that the source and located file names match. If they don't, prompt the user to verify that they did in fact intend to choose the file in question. Helps avoid accidentally clicking the wrong file when performing location. ecd9ecb: Add missing error check. [ Rene Gollent <anevilyak@xxxxxxxxx> ] ---------------------------------------------------------------------------- 2 files changed, 32 insertions(+), 9 deletions(-) .../gui/team_window/SourceView.cpp | 3 +- .../gui/team_window/TeamWindow.cpp | 38 ++++++++++++++++---- ############################################################################ Commit: 143fdaf7cf18c106ce14dca8c47e8ba5bdd9c033 URL: http://cgit.haiku-os.org/haiku/commit/?id=143fdaf Author: Rene Gollent <anevilyak@xxxxxxxxx> Date: Fri Jun 21 22:38:45 2013 UTC Style fix. ---------------------------------------------------------------------------- diff --git a/src/apps/debugger/user_interface/gui/team_window/SourceView.cpp b/src/apps/debugger/user_interface/gui/team_window/SourceView.cpp index 2a631d8..e385a99 100644 --- a/src/apps/debugger/user_interface/gui/team_window/SourceView.cpp +++ b/src/apps/debugger/user_interface/gui/team_window/SourceView.cpp @@ -1121,8 +1121,7 @@ SourceView::TextView::Draw(BRect updateRect) SetLowColor(ipColor); - } - else + } else SetLowColor(255, 255, 0, 255); FillRect(BRect(kLeftTextMargin, y, Bounds().right, y + fFontInfo->lineHeight), B_SOLID_LOW); ############################################################################ Commit: 21d806359150aa1b069e9e2d6051da2ac92431ff URL: http://cgit.haiku-os.org/haiku/commit/?id=21d8063 Author: Rene Gollent <anevilyak@xxxxxxxxx> Date: Fri Jun 21 22:50:47 2013 UTC Slight tweak to located file handling. - When the user helps locate a missing source file, verify that the source and located file names match. If they don't, prompt the user to verify that they did in fact intend to choose the file in question. Helps avoid accidentally clicking the wrong file when performing location. ---------------------------------------------------------------------------- diff --git a/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp b/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp index 563f061..2b64bbe 100644 --- a/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp +++ b/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp @@ -349,7 +349,9 @@ TeamWindow::MessageReceived(BMessage* message) case B_REFS_RECEIVED: { entry_ref locatedPath; - message->FindRef("refs", &locatedPath); + if (message->FindRef("refs", &locatedPath) != B_OK) + break; + _HandleResolveMissingSourceFile(locatedPath); break; } @@ -1438,11 +1440,30 @@ TeamWindow::_HandleResolveMissingSourceFile(entry_ref& locatedPath) ->SourceFile(); if (sourceFile != NULL) { BString sourcePath; - BString targetPath; sourceFile->GetPath(sourcePath); - BPath path(&locatedPath); - targetPath = path.Path(); - fListener->SourceEntryLocateRequested(sourcePath, targetPath); + BPath sourceFilePath(sourcePath); + BPath targetFilePath(&locatedPath); + if (sourceFilePath.InitCheck() != B_OK + || targetFilePath.InitCheck() != B_OK) { + return; + } + + if (strcmp(sourceFilePath.Leaf(), targetFilePath.Leaf()) != 0) { + BString message; + message.SetToFormat("The names of source file '%s' and located" + " file '%s' differ. Use file anyway?", + sourceFilePath.Leaf(), targetFilePath.Leaf()); + BAlert* alert = new(std::nothrow) BAlert( + "Source path mismatch", message.String(), "Cancel", "Use"); + if (alert == NULL) + return; + + int32 choice = alert->Go(); + if (choice <= 0) + return; + } + fListener->SourceEntryLocateRequested(sourcePath, + targetFilePath.Path()); fListener->FunctionSourceCodeRequested(fActiveFunction); } } ############################################################################ Revision: hrev45775 Commit: ecd9ecb13293362df16be49420d64bd2af649aef URL: http://cgit.haiku-os.org/haiku/commit/?id=ecd9ecb Author: Rene Gollent <anevilyak@xxxxxxxxx> Date: Fri Jun 21 22:53:36 2013 UTC Add missing error check. ---------------------------------------------------------------------------- diff --git a/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp b/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp index 2b64bbe..7401b12 100644 --- a/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp +++ b/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp @@ -264,8 +264,11 @@ TeamWindow::MessageReceived(BMessage* message) BString data; data.SetToFormat("Debug report successfully saved to '%s'", message->FindString("path")); - BAlert *alert = new BAlert("Report saved", data.String(), - "OK"); + BAlert *alert = new(std::nothrow) BAlert("Report saved", + data.String(), "Close"); + if (alert == NULL) + break; + alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE); alert->Go(); break;