* fix probable memory leaks, not in the image but anyway...

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27850 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Karsten Heimrich
2008-10-03 11:35:28 +00:00
parent fffc7e3e42
commit ebf84359c4
2 changed files with 72 additions and 70 deletions
+19 -19
View File
@@ -17,7 +17,9 @@
PoorManPreferencesWindow::PoorManPreferencesWindow(BRect frame, char * name) PoorManPreferencesWindow::PoorManPreferencesWindow(BRect frame, char * name)
: BWindow(frame, name, B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_NOT_RESIZABLE) : BWindow(frame, name, B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_NOT_RESIZABLE),
webDirFilePanel(NULL),
logFilePanel(NULL)
{ {
frame = Bounds(); frame = Bounds();
@@ -97,37 +99,35 @@ PoorManPreferencesWindow::PoorManPreferencesWindow(BRect frame, char * name)
// FilePanels // FilePanels
BWindow * change_title; BWindow * change_title;
webDirFilePanel = new BFilePanel( BMessenger messenger(this);
B_OPEN_PANEL, BMessage message(MSG_FILE_PANEL_SELECT_WEB_DIR);
new BMessenger(this), webDirFilePanel = new BFilePanel(B_OPEN_PANEL, &messenger, NULL,
NULL, B_DIRECTORY_NODE, false, &message);
B_DIRECTORY_NODE,
false,
new BMessage(MSG_FILE_PANEL_SELECT_WEB_DIR)
);
webDirFilePanel->SetPanelDirectory(new BDirectory("/boot/home/public_html")); webDirFilePanel->SetPanelDirectory(new BDirectory("/boot/home/public_html"));
webDirFilePanel->SetButtonLabel(B_DEFAULT_BUTTON, "Select"); webDirFilePanel->SetButtonLabel(B_DEFAULT_BUTTON, "Select");
change_title = webDirFilePanel->Window(); change_title = webDirFilePanel->Window();
change_title->SetTitle(STR_FILEPANEL_SELECT_WEB_DIR); change_title->SetTitle(STR_FILEPANEL_SELECT_WEB_DIR);
message.what = MSG_FILE_PANEL_CREATE_LOG_FILE;
logFilePanel = new BFilePanel( logFilePanel = new BFilePanel(B_SAVE_PANEL, &messenger, NULL,
B_SAVE_PANEL, B_FILE_NODE, false, &message);
new BMessenger(this),
NULL,
B_FILE_NODE,
false,
new BMessage(MSG_FILE_PANEL_CREATE_LOG_FILE)
);
logFilePanel->SetButtonLabel(B_DEFAULT_BUTTON, "Create"); logFilePanel->SetButtonLabel(B_DEFAULT_BUTTON, "Create");
change_title = logFilePanel->Window(); change_title = logFilePanel->Window();
change_title->SetTitle(STR_FILEPANEL_CREATE_LOG_FILE); change_title->SetTitle(STR_FILEPANEL_CREATE_LOG_FILE);
Show(); Show();
} }
PoorManPreferencesWindow::~PoorManPreferencesWindow()
{
delete logFilePanel;
delete webDirFilePanel;
}
void void
PoorManPreferencesWindow::MessageReceived(BMessage* message) PoorManPreferencesWindow::MessageReceived(BMessage* message)
{ {
@@ -68,6 +68,8 @@ private:
int32 max_connections; int32 max_connections;
public: public:
PoorManPreferencesWindow(BRect frame, char * name); PoorManPreferencesWindow(BRect frame, char * name);
~PoorManPreferencesWindow();
virtual void MessageReceived(BMessage * message); virtual void MessageReceived(BMessage * message);
void ShowWebDirFilePanel() { if (!webDirFilePanel->IsShowing()) webDirFilePanel->Show(); } void ShowWebDirFilePanel() { if (!webDirFilePanel->IsShowing()) webDirFilePanel->Show(); }