From e0f33910d3a5e94a70049e1df93e4abe62a69230 Mon Sep 17 00:00:00 2001 From: Lioncache Date: Wed, 3 Dec 2025 10:06:16 -0500 Subject: [PATCH] CExportGameDialog: Remove uses of string_view .data() We can use safer methods here by using the bounded size. --- src/Editor/CExportGameDialog.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Editor/CExportGameDialog.cpp b/src/Editor/CExportGameDialog.cpp index 00d06b94..ca6b0058 100644 --- a/src/Editor/CExportGameDialog.cpp +++ b/src/Editor/CExportGameDialog.cpp @@ -326,8 +326,8 @@ void CExportGameDialog::RecursiveAddToTree(const nod::Node *pkNode, QTreeWidgetI { if (pkLeft->getKind() != pkRight->getKind()) return pkLeft->getKind() == nod::Node::Kind::Directory; - else - return TString(pkLeft->getName().data()).ToUpper() < TString(pkRight->getName().data()).ToUpper(); + + return TString(pkLeft->getName()).ToUpper() < TString(pkRight->getName()).ToUpper(); }); // Add nodes to tree @@ -343,7 +343,8 @@ void CExportGameDialog::RecursiveAddToTree(const nod::Node *pkNode, QTreeWidgetI const bool IsDir = pkNode->getKind() == nod::Node::Kind::Directory; - auto* pItem = new QTreeWidgetItem(pParent, QStringList(QString::fromStdString(pkNode->getName().data()))); + const auto nodeName = pkNode->getName(); + auto* pItem = new QTreeWidgetItem(pParent, QStringList(QString::fromUtf8(nodeName.data(), nodeName.size()))); pItem->setIcon(0, QIcon(IsDir ? skDirIcon : skFileIcon)); if (IsDir)