tentative at fixing bug #733, unable to test
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18513 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -19,11 +19,16 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
Prefs::Prefs()
|
Prefs::Prefs()
|
||||||
|
: fatalerror(false)
|
||||||
{
|
{
|
||||||
BPath path;
|
BPath path;
|
||||||
find_directory(B_USER_SETTINGS_DIRECTORY, &path);
|
find_directory(B_USER_SETTINGS_DIRECTORY, &path);
|
||||||
path.Append("Pulse_settings");
|
path.Append("Pulse_settings");
|
||||||
file = new BFile(path.Path(), B_READ_WRITE | B_CREATE_FILE);
|
file = new BFile(path.Path(), B_READ_WRITE | B_CREATE_FILE);
|
||||||
|
if (file->InitCheck() != B_OK) {
|
||||||
|
fatalerror = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int i = NORMAL_WINDOW_MODE;
|
int i = NORMAL_WINDOW_MODE;
|
||||||
if (!GetInt("window_mode", &window_mode, &i)) {
|
if (!GetInt("window_mode", &window_mode, &i)) {
|
||||||
@@ -248,6 +253,9 @@ Prefs::PutRect(char *name, BRect *value)
|
|||||||
bool
|
bool
|
||||||
Prefs::Save()
|
Prefs::Save()
|
||||||
{
|
{
|
||||||
|
if (fatalerror)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (!PutInt("window_mode", &window_mode)
|
if (!PutInt("window_mode", &window_mode)
|
||||||
|| !PutRect("normal_window_rect", &normal_window_rect)
|
|| !PutRect("normal_window_rect", &normal_window_rect)
|
||||||
|| !PutRect("mini_window_rect", &mini_window_rect)
|
|| !PutRect("mini_window_rect", &mini_window_rect)
|
||||||
|
|||||||
Reference in New Issue
Block a user