Code/Editor

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-08-02 17:56:56 -07:00
parent 3b28267569
commit a14b4e478e
47 changed files with 208 additions and 1219 deletions
+6 -6
View File
@@ -55,10 +55,10 @@ bool CEditorFileMonitor::RegisterListener(IFileChangeListener* pListener, const
//////////////////////////////////////////////////////////////////////////
static string CanonicalizePath(const char* path)
static AZStd::string CanonicalizePath(const char* path)
{
auto canon = QFileInfo(path).canonicalFilePath();
return canon.isEmpty() ? string(path) : string(canon.toUtf8());
return canon.isEmpty() ? AZStd::string(path) : AZStd::string(canon.toUtf8());
}
//////////////////////////////////////////////////////////////////////////
@@ -66,8 +66,8 @@ bool CEditorFileMonitor::RegisterListener(IFileChangeListener* pListener, const
{
bool success = true;
string gameFolder = Path::GetEditingGameDataFolder().c_str();
string naivePath;
AZStd::string gameFolder = Path::GetEditingGameDataFolder().c_str();
AZStd::string naivePath;
CFileChangeMonitor* fileChangeMonitor = CFileChangeMonitor::Instance();
AZ_Assert(fileChangeMonitor, "CFileChangeMonitor singleton missing.");
@@ -75,12 +75,12 @@ bool CEditorFileMonitor::RegisterListener(IFileChangeListener* pListener, const
// Append slash in preparation for appending the second part.
naivePath = PathUtil::AddSlash(naivePath);
naivePath += sFolderRelativeToGame;
naivePath.replace('/', '\\');
AZ::StringFunc::Replace(naivePath, '/', '\\');
// Remove the final slash if the given item is a folder so the file change monitor correctly picks up on it.
naivePath = PathUtil::RemoveSlash(naivePath);
string canonicalizedPath = CanonicalizePath(naivePath.c_str());
AZStd::string canonicalizedPath = CanonicalizePath(naivePath.c_str());
if (fileChangeMonitor->IsDirectory(canonicalizedPath.c_str()) || fileChangeMonitor->IsFile(canonicalizedPath.c_str()))
{