forked from qt-creator/qt-creator
QmlDesigner: Fix ItemLibraryEntry serialization
When data is read from QDataStream into Qt containers, it is simply appended/inserted into the container rather than completely overwriting the container contents. This isn't desirable when reading an ItemLibraryEntry object from data stream, as the assumption is that we want the entry to be exactly what was originally stored into the stream. Task-number: QDS-1815 Change-Id: Ifaee244b2b4e7326b6f10fde3faeb5218f505ee2 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -225,6 +225,10 @@ QDataStream& operator<<(QDataStream& stream, const ItemLibraryEntry &itemLibrary
|
||||
|
||||
QDataStream& operator>>(QDataStream& stream, ItemLibraryEntry &itemLibraryEntry)
|
||||
{
|
||||
// Clear containers so that we don't simply append to them in case the object is reused
|
||||
itemLibraryEntry.m_data->hints.clear();
|
||||
itemLibraryEntry.m_data->properties.clear();
|
||||
|
||||
stream >> itemLibraryEntry.m_data->name;
|
||||
stream >> itemLibraryEntry.m_data->typeName;
|
||||
stream >> itemLibraryEntry.m_data->majorVersion;
|
||||
|
Reference in New Issue
Block a user