forked from qt-creator/qt-creator
Aspects: Fix ValueAcceptor handling
Previously returning std::nullopt from a StringAspect::ValueAcceptor would not cancel the change. Change-Id: I7a329f9fe32f6d798c10102a0b68dcd638fb2398 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -1305,6 +1305,7 @@ bool StringAspect::bufferToInternal()
|
||||
if (d->m_valueAcceptor) {
|
||||
if (const std::optional<QString> tmp = d->m_valueAcceptor(m_internal, m_buffer))
|
||||
return updateStorage(m_internal, *tmp);
|
||||
return false;
|
||||
}
|
||||
return updateStorage(m_internal, m_buffer);
|
||||
}
|
||||
@@ -1489,6 +1490,7 @@ bool FilePathAspect::bufferToInternal()
|
||||
if (d->m_valueAcceptor) {
|
||||
if (const std::optional<QString> tmp = d->m_valueAcceptor(m_internal, m_buffer))
|
||||
return updateStorage(m_internal, *tmp);
|
||||
return false;
|
||||
}
|
||||
return updateStorage(m_internal, m_buffer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user