Fix RideEditor SEGV on rideselected (!)

.. When interval tree is rebuilt it can cause an issue in the
   ride editor when clearing the selection model.

.. still trying to get to the botton of a SEGV on Mac.
This commit is contained in:
Mark Liversedge
2014-02-27 17:07:50 +00:00
parent 3270a4f685
commit f631d72abe

View File

@@ -21,6 +21,7 @@
#include "Views.h"
#include "Athlete.h"
#include "IntervalItem.h"
#include "IntervalTreeView.h"
#include "MainWindow.h"
Tab::Tab(Context *context) : QWidget(context->mainWindow), context(context)
@@ -181,6 +182,10 @@ Tab::rideSelected(RideItem*)
if (!context->ride) return;
// stop SEGV in widgets watching for intervals being
// selected whilst we are deleting them from the tree
context->athlete->intervalWidget->blockSignals(true);
// refresh interval list for bottom left
// first lets wipe away the existing intervals
QList<QTreeWidgetItem *> intervals = context->athlete->allIntervals->takeChildren();
@@ -206,5 +211,7 @@ Tab::rideSelected(RideItem*)
}
}
}
// all done, so connected widgets can receive signals now
context->athlete->intervalWidget->blockSignals(false);
}