editor: explicit runtime path contract

This commit is contained in:
2026-04-28 14:49:41 +08:00
parent 0e506f21ec
commit cd166037bf
38 changed files with 210 additions and 129 deletions

View File

@@ -84,9 +84,9 @@ void EditorProjectRuntime::Reset() {
m_pendingSceneOpenPath.reset();
}
bool EditorProjectRuntime::Initialize(const std::filesystem::path& repoRoot) {
bool EditorProjectRuntime::Initialize(const std::filesystem::path& projectRoot) {
Reset();
m_browserModel.Initialize(repoRoot);
m_browserModel.Initialize(projectRoot);
return true;
}

View File

@@ -45,7 +45,7 @@ public:
};
void Reset();
bool Initialize(const std::filesystem::path& repoRoot);
bool Initialize(const std::filesystem::path& projectRoot);
void BindSelectionService(EditorSelectionService* selectionService);
void Refresh();

View File

@@ -545,9 +545,9 @@ void ProjectBrowserModel::Reset() {
m_currentFolderId.clear();
}
void ProjectBrowserModel::Initialize(const std::filesystem::path& repoRoot) {
void ProjectBrowserModel::Initialize(const std::filesystem::path& projectRoot) {
Reset();
m_assetsRootPath = (repoRoot / "project/Assets").lexically_normal();
m_assetsRootPath = (projectRoot / "Assets").lexically_normal();
TraceProjectBrowser("ProjectBrowserModel::Initialize assetsRoot=" + PathToUtf8String(m_assetsRootPath));
std::error_code errorCode = {};
if (!std::filesystem::exists(m_assetsRootPath, errorCode)) {

View File

@@ -54,7 +54,7 @@ public:
ProjectBrowserModel& operator=(ProjectBrowserModel&&) noexcept = default;
void Reset();
void Initialize(const std::filesystem::path& repoRoot);
void Initialize(const std::filesystem::path& projectRoot);
void Refresh();
bool Empty() const;