Fix crash in imap config view. Remove hard coded path.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40592 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Clemens Zeidler
2011-02-21 07:19:24 +00:00
parent 27f365eaa3
commit ba11c28b6b
@@ -11,6 +11,8 @@
#include <TextControl.h>
#include <FileConfigView.h>
#include <FindDirectory.h>
#include <Path.h>
#include <ProtocolConfigView.h>
#include <MailAddon.h>
@@ -60,8 +62,8 @@ IMAPConfig::IMAPConfig(MailAddonSettings& settings,
SetTo(settings);
((BControl *)(FindView("leave_mail_remote")))->SetValue(B_CONTROL_ON);
((BControl *)(FindView("leave_mail_remote")))->Hide();
((BControl *)(FindView("leave_mail_on_server")))->SetValue(B_CONTROL_ON);
((BControl *)(FindView("leave_mail_on_server")))->Hide();
BRect frame = FindView("delete_remote_when_local")->Frame();
@@ -75,10 +77,15 @@ IMAPConfig::IMAPConfig(MailAddonSettings& settings,
frame.right -= 10;
BString defaultFolder = "/boot/home/mail/";
defaultFolder += accountSettings.Name();
BPath defaultFolder;
if (find_directory(B_USER_DIRECTORY, &defaultFolder) == B_OK)
defaultFolder.Append("mail");
else
defaultFolder.SetTo("/boot/home/mail/");
defaultFolder.Append(accountSettings.Name());
fFileView = new BMailFileConfigView("Destination:", "destination",
false, defaultFolder);
false, defaultFolder.Path());
fFileView->SetTo(&settings.Settings(), NULL);
AddChild(fFileView);
fFileView->MoveBy(0, frame.bottom + 5);