mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-11 06:27:45 +00:00
CExportGameDialog: Remove uses of string_view .data()
We can use safer methods here by using the bounded size.
This commit is contained in:
@@ -326,8 +326,8 @@ void CExportGameDialog::RecursiveAddToTree(const nod::Node *pkNode, QTreeWidgetI
|
|||||||
{
|
{
|
||||||
if (pkLeft->getKind() != pkRight->getKind())
|
if (pkLeft->getKind() != pkRight->getKind())
|
||||||
return pkLeft->getKind() == nod::Node::Kind::Directory;
|
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
|
// 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;
|
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));
|
pItem->setIcon(0, QIcon(IsDir ? skDirIcon : skFileIcon));
|
||||||
|
|
||||||
if (IsDir)
|
if (IsDir)
|
||||||
|
|||||||
Reference in New Issue
Block a user