From 3bbf781c1a27f5c0e8d4f3c632908174ed1f6ede Mon Sep 17 00:00:00 2001 From: Alex Wilson Date: Mon, 16 Jul 2012 14:52:56 +1200 Subject: [PATCH] Fix #8706 in Poorman - Selecting a web dir There is no 'name' entry in the message from a B_OPEN_PANEL BFilePanel. Also fix a little memory leak along the way. --- src/apps/poorman/PoorManPreferencesWindow.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/apps/poorman/PoorManPreferencesWindow.cpp b/src/apps/poorman/PoorManPreferencesWindow.cpp index 5535f338b2..0095c82deb 100644 --- a/src/apps/poorman/PoorManPreferencesWindow.cpp +++ b/src/apps/poorman/PoorManPreferencesWindow.cpp @@ -142,12 +142,15 @@ PoorManPreferencesWindow::MessageReceived(BMessage* message) Quit(); break; case MSG_PREF_SITE_BTN_SELECT: + { // Select the Web Directory, root directory to look in. fWebDirFilePanel->SetTarget(this); - fWebDirFilePanel->SetMessage(new BMessage(MSG_FILE_PANEL_SELECT_WEB_DIR)); + BMessage webDirSelectedMsg(MSG_FILE_PANEL_SELECT_WEB_DIR); + fWebDirFilePanel->SetMessage(&webDirSelectedMsg); if (!fWebDirFilePanel->IsShowing()) fWebDirFilePanel->Show(); break; + } case MSG_FILE_PANEL_SELECT_WEB_DIR: // handle the open BMessage from the Select Web Directory File Panel PRINT(("Select Web Directory:\n")); @@ -177,13 +180,10 @@ void PoorManPreferencesWindow::SelectWebDir(BMessage* message) { entry_ref ref; - const char* name; BPath path; BEntry entry; - if (message->FindRef("refs", &ref) != B_OK - || message->FindString("name", &name) != B_OK - || entry.SetTo(&ref) != B_OK) { + if (message->FindRef("refs", &ref) != B_OK || entry.SetTo(&ref) != B_OK) { return; } entry.GetPath(&path);