Sounds preflet: don't reuse variable names.
This fixes "issue 2" from #17150, that only manifested on x86-64. Also: moved the "menu" variable declaration closer to its usege. Change-Id: If44f84a8d5ee2bd662c312aec26359c857db5a93 Reviewed-on: https://review.haiku-os.org/c/haiku/+/5720 Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk> Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
This commit is contained in:
parent
ee45779374
commit
6eff9ae623
@ -210,7 +210,6 @@ HWindow::MessageReceived(BMessage* message)
|
||||
|
||||
case M_EVENT_CHANGED:
|
||||
{
|
||||
const char* path;
|
||||
BMenuField* menufield
|
||||
= dynamic_cast<BMenuField*>(FindView("filemenu"));
|
||||
if (menufield == NULL)
|
||||
@ -218,10 +217,13 @@ HWindow::MessageReceived(BMessage* message)
|
||||
|
||||
menufield->SetEnabled(true);
|
||||
|
||||
BMenu* menu = menufield->Menu();
|
||||
const char* filePath;
|
||||
|
||||
if (message->FindString("path", &filePath) == B_OK) {
|
||||
|
||||
BMenu* menu = menufield->Menu();
|
||||
BPath path(filePath);
|
||||
|
||||
if (message->FindString("path", &path) == B_OK) {
|
||||
BPath path(path);
|
||||
if (path.InitCheck() != B_OK) {
|
||||
BMenuItem* item = menu->FindItem(B_TRANSLATE("<none>"));
|
||||
if (item != NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user