Skip to content

Commit

Permalink
fix: Read ddf file data failed
Browse files Browse the repository at this point in the history
Ensure serialization consistency, after Qt6,
size() uses qsizetype, default 8 bytes.

Log: Fix read ddf file failed.
  • Loading branch information
rb-union committed Feb 13, 2025
1 parent ac8ae36 commit bc2064d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/service/filehander.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,8 @@ struct STreePlatInfo {
void serializationTree_helper_1(QDataStream &countStream, int &bzItemCount, int &groupCount,
const CGroupBzItemsTreeInfo &tree, std::function<void(int, int)> f = nullptr)
{
countStream << tree.childGroups.size();
// Note: Use int to ensure serialization consistency (after Qt6, size() uses qsizetype, default 8 bytes)
countStream << int(tree.childGroups.size());

qDebug() << "save group count = " << tree.childGroups.size();

Expand All @@ -387,7 +388,7 @@ void serializationTree_helper_1(QDataStream &countStream, int &bzItemCount, int
serializationTree_helper_1(countStream, bzItemCount, groupCount, p, f);
}

countStream << tree.bzItems.size();
countStream << int(tree.bzItems.size());

qDebug() << "save item count = " << tree.bzItems.size();

Expand Down

0 comments on commit bc2064d

Please sign in to comment.