From f96cab8aa31e2697afa7e8f6f596b6704bb9f4cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Wed, 16 Aug 2006 10:24:00 +0000 Subject: [PATCH] tentative at fixing bug #733, unable to test git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18513 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/pulse/Prefs.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/apps/pulse/Prefs.cpp b/src/apps/pulse/Prefs.cpp index f6fea06e08..aed79bb7dd 100644 --- a/src/apps/pulse/Prefs.cpp +++ b/src/apps/pulse/Prefs.cpp @@ -19,11 +19,16 @@ #include Prefs::Prefs() +: fatalerror(false) { BPath path; find_directory(B_USER_SETTINGS_DIRECTORY, &path); path.Append("Pulse_settings"); file = new BFile(path.Path(), B_READ_WRITE | B_CREATE_FILE); + if (file->InitCheck() != B_OK) { + fatalerror = true; + return; + } int i = NORMAL_WINDOW_MODE; if (!GetInt("window_mode", &window_mode, &i)) { @@ -248,6 +253,9 @@ Prefs::PutRect(char *name, BRect *value) bool Prefs::Save() { + if (fatalerror) + return false; + if (!PutInt("window_mode", &window_mode) || !PutRect("normal_window_rect", &normal_window_rect) || !PutRect("mini_window_rect", &mini_window_rect)