* If you do something, please try to do it right, or at least test it.

* The alert escape check was broken in several ways. First of all, the buttons
  can be NULL which suddenly crashed apps. Second of all, the check didn't even
  work as it was reversed.
* Also, I disabled the code for now, as I really don't think string comparison
  heuristics are the way to solve this.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30018 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2009-04-08 08:23:07 +00:00
parent 6fc2d92bd3
commit 1f904d1e03

View File

@ -1390,15 +1390,15 @@ TFilePanel::ShowCenteredAlert(const char *text, const char *button1,
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->MoveTo(Frame().left + 10, Frame().top + 10);
if (strncmp(button1, "Cancel", 7))
#if 0
if (button1 != NULL && !strncmp(button1, "Cancel", 7))
alert->SetShortcut(0, B_ESCAPE);
if (strncmp(button2, "Cancel", 7))
else if (button2 != NULL && !strncmp(button2, "Cancel", 7))
alert->SetShortcut(1, B_ESCAPE);
if (strncmp(button3, "Cancel", 7))
else if (button3 != NULL && !strncmp(button3, "Cancel", 7))
alert->SetShortcut(2, B_ESCAPE);
#endif
return alert->Go();
}