forked from qt-creator/qt-creator
docker: Fix StringAspect default value handling
The StringAspect needs to return a possible default value if no value was set by the user. Otherwise it would write an empty string when ::apply was called. Also a small improvement for docker error logging is added Change-Id: I85f80253894d2c3e726da714616e5275039febcc Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -1196,12 +1196,18 @@ QVariant StringAspect::volatileValue() const
|
||||
switch (d->m_displayStyle) {
|
||||
case PathChooserDisplay:
|
||||
QTC_ASSERT(d->m_pathChooserDisplay, return {});
|
||||
if (d->m_pathChooserDisplay->filePath().isEmpty())
|
||||
return defaultValue().toString();
|
||||
return d->m_pathChooserDisplay->filePath().toString();
|
||||
case LineEditDisplay:
|
||||
QTC_ASSERT(d->m_lineEditDisplay, return {});
|
||||
if (d->m_lineEditDisplay->text().isEmpty())
|
||||
return defaultValue().toString();
|
||||
return d->m_lineEditDisplay->text();
|
||||
case TextEditDisplay:
|
||||
QTC_ASSERT(d->m_textEditDisplay, return {});
|
||||
if (d->m_textEditDisplay->document()->isEmpty())
|
||||
return defaultValue().toString();
|
||||
return d->m_textEditDisplay->document()->toPlainText();
|
||||
case LabelDisplay:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user