@@ -50,37 +50,6 @@ namespace {
5050const QString LAYER_EDITOR_MIME_TYPE = QStringLiteral(" text/plain" );
5151const QString LAYED_EDITOR_MIME_SEP = QStringLiteral(" ;" );
5252
53- bool isPathInside (const std::string& parentDir, const std::string& childPath)
54- {
55- ghc::filesystem::path parent = ghc::filesystem::weakly_canonical (parentDir);
56- ghc::filesystem::path child = ghc::filesystem::weakly_canonical (childPath);
57-
58- // Iterate up from child to root
59- for (ghc::filesystem::path p = child; !p.empty (); p = p.parent_path ()) {
60- if (p == parent)
61- return true ;
62-
63- ghc::filesystem::path next = p.parent_path ();
64- if (next == p) // reached root (ex "C:\")
65- break ;
66- }
67- return false ;
68- }
69-
70- bool shouldDisplayComponentInitialSaveDialog (
71- const UsdStageRefPtr stage,
72- const std::string& proxyShapePath)
73- {
74- if (!MayaUsd::ComponentUtils::isAdskUsdComponent (proxyShapePath)) {
75- return false ;
76- }
77-
78- MString tempDir;
79- MGlobal::executeCommand (" internalVar -userTmpDir" , tempDir);
80-
81- return isPathInside (UsdMayaUtil::convert (tempDir), stage->GetRootLayer ()->GetRealPath ());
82- }
83-
8453} // namespace
8554
8655namespace UsdLayerEditor {
@@ -575,7 +544,7 @@ void LayerTreeModel::saveStage(QWidget* in_parent)
575544 }
576545
577546 // Show the save dialog for component stages (initial save) or if confirmation is needed
578- if (shouldDisplayComponentInitialSaveDialog (
547+ if (MayaUsd::ComponentUtils:: shouldDisplayComponentInitialSaveDialog (
579548 _sessionState->stageEntry ()._stage , _sessionState->stageEntry ()._proxyShapePath )
580549 || showConfirmDgl) {
581550 bool isExporting = false ;
0 commit comments