diff --git a/sleepyhead/SleepLib/session.cpp b/sleepyhead/SleepLib/session.cpp index 5d424baf..d4c993ff 100644 --- a/sleepyhead/SleepLib/session.cpp +++ b/sleepyhead/SleepLib/session.cpp @@ -282,20 +282,11 @@ bool Session::LoadSummary(QString filename) settings[code] = i.value(); } - if (version < 13) { - QHash zcnt; - in >> zcnt; - for (QHash::iterator i = zcnt.begin(); i != zcnt.end(); i++) { - code = schema::channel[i.key()].id(); - m_cnt[code] = i.value(); - } - } else { - QHash zcnt; - in >> zcnt; - for (QHash::iterator i = zcnt.begin(); i != zcnt.end(); i++) { - code = schema::channel[i.key()].id(); - m_cnt[code] = i.value(); - } + QHash zcnt; + in >> zcnt; + for (QHash::iterator i = zcnt.begin(); i != zcnt.end(); i++) { + code = schema::channel[i.key()].id(); + m_cnt[code] = i.value(); } QHash zsum; @@ -375,7 +366,18 @@ bool Session::LoadSummary(QString filename) //SetChanged(true); } else { in >> settings; - in >> m_cnt; + if (version < 13) { + QHash cnt2; + in >> cnt2; + + QHash::iterator it; + + for (it = cnt2.begin(); it != cnt2.end(); ++it) { + m_cnt[it.key()] = it.value(); + } + } else { + in >> m_cnt; + } in >> m_sum; in >> m_avg; in >> m_wavg;