[ui] Camera Response Function display: make it safer

More checks on file content and catch exception.
Check nbColumns using a slot instead of using the property.
Use a workaround on the CVS loader to avoid a crash (do not set active
to False).
This commit is contained in:
Fabien Castan 2020-08-24 11:33:26 +02:00
parent 04c21fffe4
commit b295242576
4 changed files with 38 additions and 22 deletions

View file

@ -22,7 +22,8 @@ FloatingPane {
CsvData {
id: csvData
filepath: ldrHdrCalibrationNode ? ldrHdrCalibrationNode.attribute("response").value : ""
property bool hasAttr: (ldrHdrCalibrationNode && ldrHdrCalibrationNode.hasAttribute("response"))
filepath: hasAttr ? ldrHdrCalibrationNode.attribute("response").value : ""
}
// To avoid interaction with components in background
@ -34,7 +35,8 @@ FloatingPane {
onWheel: {}
}
property bool crfReady: csvData.ready && csvData.nbColumns >= 4
// note: We need to use csvData.getNbColumns() slot instead of the csvData.nbColumns property to avoid a crash on linux.
property bool crfReady: csvData.ready && (csvData.getNbColumns() >= 4)
onCrfReadyChanged: {
if(crfReady)
{