fixed unit tests bugs, removed commented out code, removed loading spam

Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com>
This commit is contained in:
chcurran
2021-11-24 18:55:11 -08:00
parent 30bcddc694
commit 132d06b6da
23 changed files with 52 additions and 640 deletions
@@ -285,8 +285,6 @@ namespace ScriptCanvasEditor
ScriptCanvasEditor::Widget::CanvasWidget* ScriptCanvasMemoryAsset::CreateView(QWidget* /*parent*/)
{
//m_canvasWidget = new Widget::CanvasWidget(m_fileAssetId, parent);
//return m_canvasWidget;
return nullptr;
}
@@ -433,66 +431,11 @@ namespace ScriptCanvasEditor
void ScriptCanvasMemoryAsset::SourceFileFailed(AZStd::string /*relativePath*/, AZStd::string /*scanFolder*/, AZ::Uuid)
{
// AZStd::string fullPath;
// AzFramework::StringFunc::Path::Join(scanFolder.data(), relativePath.data(), fullPath);
// AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::NormalizePath, fullPath);
//
// auto assetPathIdIt = AZStd::find(m_pendingSave.begin(), m_pendingSave.end(), fullPath);
//
// if (assetPathIdIt != m_pendingSave.end())
// {
// if (m_onSaveCallback)
// {
// m_onSaveCallback(false, m_inMemoryAsset.Get(), AZ::Data::AssetId());
// m_onSaveCallback = nullptr;
// }
//
// m_pendingSave.erase(assetPathIdIt);
// }
}
void ScriptCanvasMemoryAsset::SavingComplete(const AZStd::string& /*streamName*/, AZ::Uuid /*sourceAssetId*/)
{
// AZStd::string normPath = streamName;
// AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::NormalizePath, normPath);
//
// auto assetPathIdIt = AZStd::find(m_pendingSave.begin(), m_pendingSave.end(), normPath);
// if (assetPathIdIt != m_pendingSave.end())
// {
// AZ::Data::AssetId previousFileAssetId;
//
// if (sourceAssetId != m_fileAssetId.m_guid)
// {
// previousFileAssetId = m_fileAssetId;
//
// // The source file has changed, store the AssetId to the canonical asset on file
// SetFileAssetId(sourceAssetId);
//
// }
// else if (!m_fileAssetId.IsValid())
// {
// SetFileAssetId(sourceAssetId);
// }
//
// m_formerGraphIdPair = AZStd::make_pair(m_scriptCanvasId, m_graphId);
//
// m_fileState = Tracker::ScriptCanvasFileState::UNMODIFIED;
//
// m_pendingSave.erase(assetPathIdIt);
//
// m_absolutePath = m_saveAsPath;
// m_saveAsPath.clear();
//
// // Connect to the source asset's bus to monitor for situations we may need to handle
// AZ::Data::AssetBus::MultiHandler::BusConnect(m_inMemoryAsset.GetId());
// AZ::Data::AssetBus::MultiHandler::BusConnect(m_fileAssetId);
//
// if (m_onSaveCallback)
// {
// m_onSaveCallback(true, m_inMemoryAsset.Get(), previousFileAssetId);
// m_onSaveCallback = nullptr;
// }
// }
}
void ScriptCanvasMemoryAsset::FinalizeAssetSave(bool, const AzToolsFramework::SourceControlFileInfo& fileInfo, const AZ::Data::AssetStreamInfo& saveInfo, Callbacks::OnSave onSaveCallback)
@@ -528,17 +471,11 @@ namespace ScriptCanvasEditor
void ScriptCanvasMemoryAsset::SetFileAssetId(const AZ::Data::AssetId& /*fileAssetId*/)
{
// m_fileAssetId = fileAssetId;
//
// if (m_canvasWidget)
// {
// m_canvasWidget->SetAssetId(fileAssetId);
// }
}
void ScriptCanvasMemoryAsset::SignalFileStateChanged()
{
MemoryAssetNotificationBus::Event(m_fileAssetId, &MemoryAssetNotifications::OnFileStateChanged, GetFileState());
}
AZStd::string ScriptCanvasMemoryAsset::MakeTemporaryFilePathForSave(AZStd::string_view targetFilename)
@@ -607,25 +544,6 @@ namespace ScriptCanvasEditor
bool AssetSaveFinalizer::ValidateStatus(const AzToolsFramework::SourceControlFileInfo& /*fileInfo*/)
{
// auto fileIO = AZ::IO::FileIOBase::GetInstance();
// if (fileInfo.IsLockedByOther())
// {
// AZ_Error("Script Canvas", !fileInfo.IsLockedByOther(), "The file is already exclusively opened by another user: %s", fileInfo.m_filePath.data());
// AZStd::invoke(m_onSave, false, m_inMemoryAsset, m_fileAssetId);
// return false;
// }
// else if (fileInfo.IsReadOnly() && fileIO->Exists(fileInfo.m_filePath.c_str()))
// {
// AZ_Error("Script Canvas", !fileInfo.IsReadOnly(), "File %s is read-only. It cannot be saved."
// " If this file is in Perforce it may not have been checked out by the Source Control API.", fileInfo.m_filePath.data());
// AZStd::invoke(m_onSave, false, m_inMemoryAsset, m_fileAssetId);
// return false;
// }
// else if (m_saving)
// {
// AZ_Warning("Script Canvas", false, "Trying to save the same file twice. Will result in one save callback being ignored.");
// return false;
// }
return true;
}