diff --git a/checkin_notes b/checkin_notes index f0410c284b..f6fe97b236 100755 --- a/checkin_notes +++ b/checkin_notes @@ -6734,3 +6734,10 @@ David 25 June 2007 clientgui/ DlgAdvPreferencesBase.cpp,h + +David 25 June 2007 + - manager and client: fixed bug where only one day-of-week + preference would be parsed. + + lib/ + prefs.C,h diff --git a/lib/prefs.C b/lib/prefs.C index 8f0a0071d3..c73910e9c4 100644 --- a/lib/prefs.C +++ b/lib/prefs.C @@ -121,9 +121,7 @@ void GLOBAL_PREFS::defaults() { max_bytes_sec_down = 0; cpu_usage_limit = 100; week_prefs.present = false; - for(int i=0;i<7;i++) { - week_prefs.days[i].time_prefs.clear(); - } + week_prefs.clear(); // don't initialize source_project, source_scheduler, // mod_time, host_specific here // since they are outside of elements, @@ -223,6 +221,10 @@ int DAY_PREFS::parse(XML_PARSER& xp) { return ERR_XML_PARSE; } +void WEEK_PREFS::clear() { + memset(this, 0, sizeof(*this)); +} + // Parse global prefs, overriding whatever is currently in the structure. // // If host_venue is nonempty and we find an element of the form @@ -313,6 +315,7 @@ int GLOBAL_PREFS::parse_override( week_prefs.present = true; week_prefs.days[dp.day_of_week] = dp; } + continue; } if (xp.parse_bool(tag, "leave_apps_in_memory", leave_apps_in_memory)) { mask.leave_apps_in_memory = true; diff --git a/lib/prefs.h b/lib/prefs.h index 15f115c2c9..b369b3e708 100644 --- a/lib/prefs.h +++ b/lib/prefs.h @@ -93,6 +93,7 @@ struct DAY_PREFS { struct WEEK_PREFS { bool present; // at least one day is present DAY_PREFS days[7]; // sun..sat + void clear(); }; // The following structure is a parsed version of the prefs file