Unbreak git..

This commit is contained in:
Mark Watkins 2014-09-17 12:34:50 +10:00
parent 54b159c880
commit 239c3096d7
6 changed files with 26 additions and 14 deletions

View File

@ -63,9 +63,9 @@ void gSummaryChart::SetDay(Day *unused_day)
firstday = p_profile->FirstDay(m_machtype);
lastday = p_profile->LastDay(m_machtype);
dayindex.clear();
daylist.clear();
if (!firstday.isValid() || !lastday.isValid()) return;
// daylist.reserve(firstday.daysTo(lastday)+1);
QDate date = firstday;
@ -75,7 +75,6 @@ void gSummaryChart::SetDay(Day *unused_day)
Day * day = nullptr;
if (di != p_profile->daylist.end()) {
day = di.value();
if (!day->hasMachine(m_machtype)) day = nullptr;
}
daylist.append(day);
dayindex[date] = idx;
@ -92,6 +91,11 @@ void gSummaryChart::SetDay(Day *unused_day)
}
//QMap<QDate, int> gSummaryChart::dayindex;
//QList<Day *> gSummaryChart::daylist;
bool gSummaryChart::keyPressEvent(QKeyEvent *event, gGraph *graph)
{
Q_UNUSED(event)
@ -148,9 +152,6 @@ bool gSummaryChart::mouseReleaseEvent(QMouseEvent *event, gGraph *graph)
return true;
}
QMap<QDate, int> gSummaryChart::dayindex;
QList<Day *> gSummaryChart::daylist;
void gSummaryChart::preCalc()
{
midcalc = p_profile->general->prefCalcMiddle();
@ -307,6 +308,7 @@ QString gSummaryChart::tooltipData(Day *, int idx)
void gSummaryChart::populate(Day * day, int idx)
{
int size = calcitems.size();
bool good = false;
for (int i=0; i < size; ++i) {
@ -462,7 +464,7 @@ void gSummaryChart::paint(QPainter &painter, gGraph &graph, const QRegion &regio
for (int i=idx; i <= idx_end; ++i) {
Day * day = daylist.at(i);
if (!day)
if (!day) // || !day->hasMachine(m_machtype))
continue;
day->OpenSummary();
@ -511,7 +513,7 @@ void gSummaryChart::paint(QPainter &painter, gGraph &graph, const QRegion &regio
totaldays++;
if (!day) {
if (!day) {// || !day->hasMachine(m_machtype)) {
lasty1 = rect.bottom();
lastx1 += barw;
it++;
@ -848,7 +850,8 @@ void gSessionTimesChart::paint(QPainter &painter, gGraph &graph, const QRegion &
for (int i=idx; (i <= idx_end) && (it2 != it_end); ++i, ++it2) {
Day * day = daylist.at(i);
if (!day)
if (!day) // || !day->hasMachine(m_machtype))
continue;
QHash<int, QList<SummaryChartSlice> >::iterator cit = cache.find(i);
@ -949,7 +952,7 @@ void gSessionTimesChart::paint(QPainter &painter, gGraph &graph, const QRegion &
totaldays++;
if (!day) {
if (!day) { // || !day->hasMachine(m_machtype)) {
lasty1 = rect.bottom();
lastx1 += barw;
nousedays++;

View File

@ -200,6 +200,8 @@ public:
layer->idx_start = idx_start;
layer->idx_end = idx_end;
layer->cache.clear();
layer->dayindex = dayindex;
layer->daylist = daylist;
}
protected:
@ -224,8 +226,8 @@ protected:
QDate firstday;
QDate lastday;
static QMap<QDate, int> dayindex;
static QList<Day *> daylist;
QMap<QDate, int> dayindex;
QList<Day *> daylist;
QHash<int, QList<SummaryChartSlice> > cache;
QList<SummaryCalcItem> calcitems;

View File

@ -298,6 +298,9 @@ class Day
}
void updateCPAPCache();
inline QDate date() const { return d_date; }
void setDate(QDate date) { d_date = date; }
protected:
@ -314,6 +317,7 @@ class Day
QHash<ChannelID, long> d_count;
QHash<ChannelID, double> d_sum;
bool d_invalidate;
QDate d_date;
};

View File

@ -825,8 +825,6 @@ bool Machine::hasModifiedSessions()
return false;
}
BROKEN... DO NOT TRY TO BUILD THIS
const QString summaryFileName = "Summaries.xml";
bool Machine::LoadSummary(bool everything)
@ -884,7 +882,8 @@ bool Machine::LoadSummary(bool everything)
sess->really_set_last(last);
sess->setEnabled(enabled);
sess->setSummaryOnly(!events);
AddSession(sess);
if (!AddSession(sess))
delete sess;
// sess->LoadSummary();
}
}

View File

@ -644,6 +644,7 @@ Day *Profile::addDay(QDate date)
dit = daylist.insert(date, new Day());
}
Day * day = dit.value();
day->setDate(date);
if (is_first_day) {
m_first = m_last = date;

View File

@ -9,6 +9,9 @@
<p>The New Features and Bugfixes list is getting a little scary, and I completely rewrote some important parts.. so let's have a Version Bump!</p>
<p>First up, a warning: Some new stuff is going down that might break on you.. Overview overhead figures aren't completely finished yet. I know about these and am working on them.
You will likely have to Rebuild CPAP data to get this to behave properly.. If you have to do it more than once, somethings not right, and I need to know.</p>
<p>Right clicky menu has tons of new stuff for you to play with... some of this you're hopefully going to love! :)</p>
<p>New Graph Clone ability allows you to make a temporary copy of a graph, and operate it completely independently...
You can even take these graph clones with you to another day! They aren't saved though. they are gone when you close SleepyHead.</li>