imap: added Settings::MaxConnections()/IdleMode().
* Also made use of the new BMessage API for the existing methods.
This commit is contained in:
parent
f8b5e17a23
commit
c67313f3c3
@ -31,11 +31,7 @@ Settings::ServerAddress() const
|
||||
BString
|
||||
Settings::Server() const
|
||||
{
|
||||
BString server;
|
||||
if (fMessage.FindString("server", &server) == B_OK)
|
||||
return server;
|
||||
|
||||
return "";
|
||||
return fMessage.GetString("server", "");
|
||||
}
|
||||
|
||||
|
||||
@ -53,22 +49,14 @@ Settings::Port() const
|
||||
bool
|
||||
Settings::UseSSL() const
|
||||
{
|
||||
int32 flavor;
|
||||
if (fMessage.FindInt32("flavor", &flavor) == B_OK)
|
||||
return flavor == 1;
|
||||
|
||||
return false;
|
||||
return fMessage.GetInt32("flavor", 1) == 1;
|
||||
}
|
||||
|
||||
|
||||
BString
|
||||
Settings::Username() const
|
||||
{
|
||||
BString username;
|
||||
if (fMessage.FindString("username", &username) == B_OK)
|
||||
return username;
|
||||
|
||||
return "";
|
||||
return fMessage.GetString("username", "");
|
||||
}
|
||||
|
||||
|
||||
@ -90,9 +78,19 @@ Settings::Password() const
|
||||
BPath
|
||||
Settings::Destination() const
|
||||
{
|
||||
BString destination;
|
||||
if (fMessage.FindString("destination", &destination) == B_OK)
|
||||
return BPath(destination);
|
||||
|
||||
return "/boot/home/mail/in";
|
||||
return BPath(fMessage.GetString("destination", "/boot/home/mail/in"));
|
||||
}
|
||||
|
||||
|
||||
int32
|
||||
Settings::MaxConnections() const
|
||||
{
|
||||
return fMessage.GetInt32("max connections", 1);
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
Settings::IdleMode() const
|
||||
{
|
||||
return fMessage.GetBool("idle", true);
|
||||
}
|
||||
|
@ -27,6 +27,9 @@ public:
|
||||
|
||||
BPath Destination() const;
|
||||
|
||||
int32 MaxConnections() const;
|
||||
bool IdleMode() const;
|
||||
|
||||
private:
|
||||
const BMessage fMessage;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user