Asset Bundler - Minor Feedback (#550)

Asset Bundler - Minor Feedback

* updated the formatting so all lines are shorter than 140 characters

* fixed a few nitpicks that came up on a recent PR

* removed a function that wasn't being used anymore

* updated some error messages based on PR feedback
This commit is contained in:
Zaladane
2021-05-05 13:59:37 -07:00
committed by GitHub
parent 5783bf635b
commit 1455fcbde6
37 changed files with 529 additions and 207 deletions
@@ -20,13 +20,18 @@
namespace AssetBundler
{
const char* DateTimeFormat = "hh:mm:ss MMM dd, yyyy";
const char* ReadOnlyFileErrorMessage = "File (%s) is Read-Only. Please check your version control and try again.";
AssetBundlerAbstractFileTableModel::AssetBundlerAbstractFileTableModel(QObject* parent)
: QAbstractTableModel(parent)
{
}
void AssetBundlerAbstractFileTableModel::Reload(const char* fileExtension, const QSet<QString>& watchedFolders, const QSet<QString>& watchedFiles, const AZStd::unordered_map<AZStd::string, AZStd::string>& pathToProjectNameMap)
void AssetBundlerAbstractFileTableModel::Reload(
const char* fileExtension,
const QSet<QString>& watchedFolders,
const QSet<QString>& watchedFiles,
const AZStd::unordered_map<AZStd::string, AZStd::string>& pathToProjectNameMap)
{
AZStd::vector<AZStd::string> keysToRemove = m_fileListKeys;
@@ -49,7 +54,9 @@ namespace AssetBundler
// If a project name is already specified, then the associated file is a default file
LoadFile(absolutePath, projectName, !projectName.empty());
keysToRemove.erase(AZStd::remove(keysToRemove.begin(), keysToRemove.end(), AssetBundler::GenerateKeyFromAbsolutePath(absolutePath)), keysToRemove.end());
keysToRemove.erase(
AZStd::remove(keysToRemove.begin(), keysToRemove.end(), AssetBundler::GenerateKeyFromAbsolutePath(absolutePath)),
keysToRemove.end());
}
}
@@ -63,7 +70,9 @@ namespace AssetBundler
// If a project name is already specified, then the associated file is a default file
LoadFile(absolutePath, projectName, !projectName.empty());
keysToRemove.erase(AZStd::remove(keysToRemove.begin(), keysToRemove.end(), AssetBundler::GenerateKeyFromAbsolutePath(absolutePath)), keysToRemove.end());
keysToRemove.erase(
AZStd::remove(keysToRemove.begin(), keysToRemove.end(), AssetBundler::GenerateKeyFromAbsolutePath(absolutePath)),
keysToRemove.end());
}
}
@@ -74,7 +83,9 @@ namespace AssetBundler
}
}
void AssetBundlerAbstractFileTableModel::ReloadFiles(const AZStd::vector<AZStd::string>& absoluteFilePathList, AZStd::unordered_map<AZStd::string, AZStd::string> pathToProjectNameMap)
void AssetBundlerAbstractFileTableModel::ReloadFiles(
const AZStd::vector<AZStd::string>& absoluteFilePathList,
AZStd::unordered_map<AZStd::string, AZStd::string> pathToProjectNameMap)
{
for (const AZStd::string& absoluteFilePath : absoluteFilePathList)
{
@@ -30,6 +30,7 @@ namespace AssetBundler
{
extern const char* DateTimeFormat;
extern const char* ReadOnlyFileErrorMessage;
//! Provides an abstract model that can be subclassed to create table models used to store information about files found on-disk.
class AssetBundlerAbstractFileTableModel
@@ -47,9 +48,15 @@ namespace AssetBundler
//////////////////////////////////////////////////////////////////////////
// Pure virtual functions
virtual AZStd::vector<AZStd::string> CreateNewFiles(const AZStd::string& absoluteFilePath, const AzFramework::PlatformFlags& platforms, const QString& project = QString()) = 0;
virtual AZStd::vector<AZStd::string> CreateNewFiles(
const AZStd::string& absoluteFilePath,
const AzFramework::PlatformFlags& platforms,
const QString& project = QString()) = 0;
virtual bool DeleteFile(const QModelIndex& index) = 0;
virtual void LoadFile(const AZStd::string& absoluteFilePath, const AZStd::string& projectName = "", bool isDefaultFile = false) = 0;
virtual void LoadFile(
const AZStd::string& absoluteFilePath,
const AZStd::string& projectName = "",
bool isDefaultFile = false) = 0;
virtual bool WriteToDisk(const AZStd::string& key) = 0;
//! Returns the absolute path of the file at the given index on success, returns an empty string on failure.
@@ -60,9 +67,15 @@ namespace AssetBundler
//////////////////////////////////////////////////////////////////////////
//! Reload all the data based on the watched folders and files
virtual void Reload(const char* fileExtension, const QSet<QString>& watchedFolders, const QSet<QString>& watchedFiles = QSet<QString>(), const AZStd::unordered_map<AZStd::string, AZStd::string>& pathToProjectNameMap = AZStd::unordered_map<AZStd::string, AZStd::string>());
virtual void Reload(
const char* fileExtension,
const QSet<QString>& watchedFolders,
const QSet<QString>& watchedFiles = QSet<QString>(),
const AZStd::unordered_map<AZStd::string, AZStd::string>& pathToProjectNameMap = AZStd::unordered_map<AZStd::string, AZStd::string>());
virtual void ReloadFiles(const AZStd::vector<AZStd::string>& absoluteFilePathList, AZStd::unordered_map<AZStd::string, AZStd::string> pathToProjectNameMap = AZStd::unordered_map<AZStd::string, AZStd::string>());
virtual void ReloadFiles(
const AZStd::vector<AZStd::string>& absoluteFilePathList,
AZStd::unordered_map<AZStd::string, AZStd::string> pathToProjectNameMap = AZStd::unordered_map<AZStd::string, AZStd::string>());
bool Save(const QModelIndex& selectedIndex);
@@ -87,12 +87,15 @@ namespace AssetBundler
{
if (AZ::IO::FileIOBase::GetInstance()->IsReadOnly(absolutePath))
{
AZ_Error(AssetBundler::AppWindowName, false, ReadOnlyFileErrorMessage, absolutePath);
return false;
}
auto deleteResult = AZ::IO::FileIOBase::GetInstance()->Remove(absolutePath);
if (!deleteResult)
{
AZ_Error(AssetBundler::AppWindowName, false,
"Unable to delete (%s). Result code: %u", absolutePath, deleteResult.GetResultCode());
return false;
}
}
@@ -104,7 +107,10 @@ namespace AssetBundler
return true;
}
void AssetListFileTableModel::LoadFile(const AZStd::string& absoluteFilePath, const AZStd::string& /*projectName*/, bool /*isDefaultFile*/)
void AssetListFileTableModel::LoadFile(
const AZStd::string& absoluteFilePath,
const AZStd::string& /*projectName*/,
bool /*isDefaultFile*/)
{
AZStd::string fullFileName;
AzFramework::StringFunc::Path::GetFullFileName(absoluteFilePath.c_str(), fullFileName);
@@ -56,7 +56,10 @@ namespace AssetBundler
//////////////////////////////////////////////////////////////////////////
// AssetBundlerAbstractFileTableModel overrides
AZStd::vector<AZStd::string> CreateNewFiles(const AZStd::string& /*absoluteFilePath*/, const AzFramework::PlatformFlags& /*platforms*/, const QString& /*project*/) override { return {}; }
AZStd::vector<AZStd::string> CreateNewFiles(
const AZStd::string& /*absoluteFilePath*/,
const AzFramework::PlatformFlags& /*platforms*/,
const QString& /*project*/) override { return {}; }
bool DeleteFile(const QModelIndex& index) override;
void LoadFile(const AZStd::string& absoluteFilePath, const AZStd::string& projectName = "", bool isDefaultFile = false) override;
bool WriteToDisk(const AZStd::string& key) override;
@@ -23,7 +23,10 @@ namespace AssetBundler
: public QAbstractTableModel
{
public:
explicit AssetListTableModel(QObject* parent = nullptr, const AZStd::string& absolutePath = AZStd::string(), const AZStd::string& platform = "");
explicit AssetListTableModel(
QObject* parent = nullptr,
const AZStd::string& absolutePath = AZStd::string(),
const AZStd::string& platform = "");
virtual ~AssetListTableModel() {}
AZStd::shared_ptr<AzToolsFramework::AssetSeedManager> GetSeedListManager() { return m_seedListManager; }
@@ -73,14 +73,15 @@ namespace AssetBundler
{
if (AZ::IO::FileIOBase::GetInstance()->IsReadOnly(absolutePath))
{
AZ_Error(AssetBundler::AppWindowName, false, "File (%s) is Read-Only. Please check your version control and try again.", absolutePath);
AZ_Error(AssetBundler::AppWindowName, false, ReadOnlyFileErrorMessage, absolutePath);
return false;
}
auto deleteResult = AZ::IO::FileIOBase::GetInstance()->Remove(absolutePath);
if (!deleteResult)
{
AZ_Error(AssetBundler::AppWindowName, false, "Unable to delete: %s", absolutePath);
AZ_Error(AssetBundler::AppWindowName, false,
"Unable to delete (%s). Result code: %u", absolutePath, deleteResult.GetResultCode());
return false;
}
}
@@ -175,7 +176,10 @@ namespace AssetBundler
return Column::ColumnFileCreationTime;
}
void BundleFileListModel::LoadFile(const AZStd::string& absoluteFilePath, const AZStd::string& /*projectName*/, bool /*isDefaultFile*/)
void BundleFileListModel::LoadFile(
const AZStd::string& absoluteFilePath,
const AZStd::string& /*projectName*/,
bool /*isDefaultFile*/)
{
AZStd::string key = AssetBundler::GenerateKeyFromAbsolutePath(absoluteFilePath);
@@ -43,7 +43,10 @@ namespace AssetBundler
explicit BundleFileListModel();
virtual ~BundleFileListModel() {}
AZStd::vector<AZStd::string> CreateNewFiles(const AZStd::string& /*absoluteFilePath*/, const AzFramework::PlatformFlags& /*platforms*/, const QString& /*project*/) override { return {}; }
AZStd::vector<AZStd::string> CreateNewFiles(
const AZStd::string& /*absoluteFilePath*/,
const AzFramework::PlatformFlags& /*platforms*/,
const QString& /*project*/) override { return {}; }
bool DeleteFile(const QModelIndex& index) override;
void LoadFile(const AZStd::string& absoluteFilePath, const AZStd::string& projectName = "", bool isDefaultFile = false) override;
bool WriteToDisk(const AZStd::string& /*key*/) override { return true; }
@@ -67,7 +67,10 @@ namespace AssetBundler
{
}
AZStd::vector<AZStd::string> RulesFileTableModel::CreateNewFiles(const AZStd::string& absoluteFilePath, const AzFramework::PlatformFlags& /*platforms*/, const QString& /*project*/)
AZStd::vector<AZStd::string> RulesFileTableModel::CreateNewFiles(
const AZStd::string& absoluteFilePath,
const AzFramework::PlatformFlags& /*platforms*/,
const QString& /*project*/)
{
if (absoluteFilePath.empty())
{
@@ -116,14 +119,16 @@ namespace AssetBundler
// Remove file from disk
if (AZ::IO::FileIOBase::GetInstance()->IsReadOnly(rulesFileInfo->m_absolutePath.c_str()))
{
AZ_Error(AssetBundler::AppWindowName, false, "File (%s) is Read-Only. Please check your version control and try again.", rulesFileInfo->m_absolutePath.c_str());
AZ_Error(AssetBundler::AppWindowName, false, ReadOnlyFileErrorMessage, rulesFileInfo->m_absolutePath.c_str());
return false;
}
auto deleteResult = AZ::IO::FileIOBase::GetInstance()->Remove(rulesFileInfo->m_absolutePath.c_str());
if (!deleteResult)
{
AZ_Error(AssetBundler::AppWindowName, false, "Unable to delete: %s", rulesFileInfo->m_absolutePath.c_str());
AZ_Error(AssetBundler::AppWindowName, false,
"Unable to delete (%s). Result code: %u", rulesFileInfo->m_absolutePath.c_str(),
deleteResult.GetResultCode());
return false;
}
@@ -134,7 +139,10 @@ namespace AssetBundler
return true;
}
void RulesFileTableModel::LoadFile(const AZStd::string& absoluteFilePath, const AZStd::string& /*projectName*/, bool /*isDefaultFile*/)
void RulesFileTableModel::LoadFile(
const AZStd::string& absoluteFilePath,
const AZStd::string& /*projectName*/,
bool /*isDefaultFile*/)
{
// Get the file name without the extension for display purposes
AZStd::string fileName(absoluteFilePath);
@@ -145,7 +153,8 @@ namespace AssetBundler
auto fileInfoIt = m_rulesFileInfoMap.find(key);
if (fileInfoIt != m_rulesFileInfoMap.end() && fileInfoIt->second->m_hasUnsavedChanges)
{
AZ_Warning(AssetBundler::AppWindowName, false, "Rules File %s has unsaved changes and couldn't be reloaded", absoluteFilePath.c_str());
AZ_Warning(AssetBundler::AppWindowName, false,
"Rules File %s has unsaved changes and couldn't be reloaded", absoluteFilePath.c_str());
return;
}
@@ -48,7 +48,10 @@ namespace AssetBundler
RulesFileTableModel();
virtual ~RulesFileTableModel() {}
AZStd::vector<AZStd::string> CreateNewFiles(const AZStd::string& absoluteFilePath, const AzFramework::PlatformFlags& platforms = AzFramework::PlatformFlags::Platform_NONE, const QString& project = QString()) override;
AZStd::vector<AZStd::string> CreateNewFiles(
const AZStd::string& absoluteFilePath,
const AzFramework::PlatformFlags& platforms = AzFramework::PlatformFlags::Platform_NONE,
const QString& project = QString()) override;
bool DeleteFile(const QModelIndex& index) override;
@@ -91,12 +91,19 @@ namespace AssetBundler
m_seedTabWidget = nullptr;
}
void SeedListFileTableModel::AddDefaultSeedsToInMemoryList(const AZStd::vector<AZStd::string>& defaultSeeds, const char* projectName, const AzFramework::PlatformFlags& platforms)
void SeedListFileTableModel::AddDefaultSeedsToInMemoryList(
const AZStd::vector<AZStd::string>& defaultSeeds,
const char* projectName,
const AzFramework::PlatformFlags& platforms)
{
m_inMemoryDefaultSeedList.reset(new SeedListFileInfo(m_inMemoryDefaultSeedListKey, tr("DefaultSeeds"), QString(projectName), false, true, defaultSeeds, platforms));
m_inMemoryDefaultSeedList.reset(
new SeedListFileInfo(m_inMemoryDefaultSeedListKey, tr("DefaultSeeds"), QString(projectName), false, true, defaultSeeds, platforms));
}
AZStd::vector<AZStd::string> SeedListFileTableModel::CreateNewFiles(const AZStd::string& absoluteFilePath, const AzFramework::PlatformFlags& /*platforms*/, const QString& project)
AZStd::vector<AZStd::string> SeedListFileTableModel::CreateNewFiles(
const AZStd::string& absoluteFilePath,
const AzFramework::PlatformFlags& /*platforms*/,
const QString& project)
{
if (absoluteFilePath.empty())
{
@@ -111,7 +118,8 @@ namespace AssetBundler
// Create a Seed List File and save it to disk
AZStd::string key = AssetBundler::GenerateKeyFromAbsolutePath(absoluteFilePath);
AZStd::shared_ptr<SeedListFileInfo> newSeedListFile = AZStd::make_shared<SeedListFileInfo>(absoluteFilePath, QString(fileName.c_str()), project, false);
AZStd::shared_ptr<SeedListFileInfo> newSeedListFile =
AZStd::make_shared<SeedListFileInfo>(absoluteFilePath, QString(fileName.c_str()), project, false);
newSeedListFile->m_seedListModel->SetHasUnsavedChanges(true);
bool saveResult = newSeedListFile->SaveSeedFile();
if (!saveResult)
@@ -151,14 +159,15 @@ namespace AssetBundler
{
if (AZ::IO::FileIOBase::GetInstance()->IsReadOnly(absolutePath))
{
AZ_Error(AssetBundler::AppWindowName, false, "File (%s) is Read-Only. Please check your version control and try again.", absolutePath);
AZ_Error(AssetBundler::AppWindowName, false, ReadOnlyFileErrorMessage, absolutePath);
return false;
}
auto deleteResult = AZ::IO::FileIOBase::GetInstance()->Remove(absolutePath);
if (!deleteResult)
{
AZ_Error(AssetBundler::AppWindowName, false, "Unable to delete: %s", absolutePath);
AZ_Error(AssetBundler::AppWindowName, false,
"Unable to delete (%s). Result code: %u", absolutePath, deleteResult.GetResultCode());
return false;
}
}
@@ -170,7 +179,11 @@ namespace AssetBundler
return true;
}
void SeedListFileTableModel::Reload(const char* fileExtension, const QSet<QString>& watchedFolders, const QSet<QString>& watchedFiles, const AZStd::unordered_map<AZStd::string, AZStd::string>& pathToProjectNameMap)
void SeedListFileTableModel::Reload(
const char* fileExtension,
const QSet<QString>& watchedFolders,
const QSet<QString>& watchedFiles,
const AZStd::unordered_map<AZStd::string, AZStd::string>& pathToProjectNameMap)
{
// Load in the Seed List files from disk
AssetBundlerAbstractFileTableModel::Reload(fileExtension, watchedFolders, watchedFiles, pathToProjectNameMap);
@@ -191,7 +204,8 @@ namespace AssetBundler
auto fileInfoIt = m_seedListFileInfoMap.find(key);
if (fileInfoIt != m_seedListFileInfoMap.end() && fileInfoIt->second->HasUnsavedChanges())
{
AZ_Warning(AssetBundler::AppWindowName, false, "Seed List File %s has unsaved changes and couldn't be reloaded", absoluteFilePath.c_str());
AZ_Warning(AssetBundler::AppWindowName, false,
"Seed List File %s has unsaved changes and couldn't be reloaded", absoluteFilePath.c_str());
return;
}
@@ -208,7 +222,8 @@ namespace AssetBundler
projectNameOnDisplay = outcome.TakeValue();
}
m_seedListFileInfoMap[key].reset(new SeedListFileInfo(absoluteFilePath, QString(fileName.c_str()), QString(projectNameOnDisplay.c_str()), true, isDefaultFile));
m_seedListFileInfoMap[key].reset(
new SeedListFileInfo(absoluteFilePath, QString(fileName.c_str()), QString(projectNameOnDisplay.c_str()), true, isDefaultFile));
AddFileKey(key);
}
@@ -241,7 +256,9 @@ namespace AssetBundler
emit dataChanged(firstIndex, lastIndex, { Qt::CheckStateRole });
}
AZStd::vector<AZStd::string> SeedListFileTableModel::GenerateAssetLists(const AZStd::string& absoluteFilePath, const AzFramework::PlatformFlags& platforms)
AZStd::vector<AZStd::string> SeedListFileTableModel::GenerateAssetLists(
const AZStd::string& absoluteFilePath,
const AzFramework::PlatformFlags& platforms)
{
if (!m_checkedSeedListFiles.size())
{
@@ -280,7 +297,8 @@ namespace AssetBundler
AZStd::vector<AZStd::string> createdFiles;
for (const auto& platformIndex : AzFramework::PlatformHelper::GetPlatformIndicesInterpreted(platforms))
{
AZStd::string platformSpecificCachePath = AzToolsFramework::PlatformAddressedAssetCatalog::GetCatalogRegistryPathForPlatform(platformIndex);
AZStd::string platformSpecificCachePath =
AzToolsFramework::PlatformAddressedAssetCatalog::GetCatalogRegistryPathForPlatform(platformIndex);
AzFramework::StringFunc::Path::StripFullName(platformSpecificCachePath);
FilePath platformSpecificPath(absoluteFilePath, AZStd::string(AzFramework::PlatformHelper::GetPlatformName(platformIndex)));
@@ -304,7 +322,10 @@ namespace AssetBundler
return seedFileInfoOutcome.GetValue()->m_seedListModel;
}
bool SeedListFileTableModel::SetSeedPlatforms(const QModelIndex& seedFileIndex, const QModelIndex& seedIndex, const AzFramework::PlatformFlags& platforms)
bool SeedListFileTableModel::SetSeedPlatforms(
const QModelIndex& seedFileIndex,
const QModelIndex& seedIndex,
const AzFramework::PlatformFlags& platforms)
{
AZStd::string key = GetFileKey(seedFileIndex);
if (key.empty())
@@ -334,7 +355,10 @@ namespace AssetBundler
return true;
}
bool SeedListFileTableModel::AddSeed(const QModelIndex& seedFileIndex, const AZStd::string& seedRelativePath, const AzFramework::PlatformFlags& platforms)
bool SeedListFileTableModel::AddSeed(
const QModelIndex& seedFileIndex,
const AZStd::string& seedRelativePath,
const AzFramework::PlatformFlags& platforms)
{
AZStd::string key = GetFileKey(seedFileIndex);
if (key.empty())
@@ -71,15 +71,28 @@ namespace AssetBundler
explicit SeedListFileTableModel(SeedTabWidget* parentSeedTabWidget);
virtual ~SeedListFileTableModel();
void AddDefaultSeedsToInMemoryList(const AZStd::vector<AZStd::string>& defaultSeeds, const char* projectName, const AzFramework::PlatformFlags& platforms);
void AddDefaultSeedsToInMemoryList(
const AZStd::vector<AZStd::string>& defaultSeeds,
const char* projectName,
const AzFramework::PlatformFlags& platforms);
AZStd::vector<AZStd::string> CreateNewFiles(const AZStd::string& absoluteFilePath, const AzFramework::PlatformFlags& platforms, const QString& project) override;
AZStd::vector<AZStd::string> CreateNewFiles(
const AZStd::string& absoluteFilePath,
const AzFramework::PlatformFlags& platforms,
const QString& project) override;
bool DeleteFile(const QModelIndex& index) override;
void Reload(const char* fileExtension, const QSet<QString>& watchedFolders, const QSet<QString>& watchedFiles = QSet<QString>(), const AZStd::unordered_map<AZStd::string, AZStd::string>& pathToProjectNameMap = AZStd::unordered_map<AZStd::string, AZStd::string>()) override;
void Reload(
const char* fileExtension,
const QSet<QString>& watchedFolders,
const QSet<QString>& watchedFiles = QSet<QString>(),
const AZStd::unordered_map<AZStd::string, AZStd::string>& pathToProjectNameMap = AZStd::unordered_map<AZStd::string, AZStd::string>()) override;
void LoadFile(const AZStd::string& absoluteFilePath, const AZStd::string& projectName = "", bool isDefaultFile = false) override;
void LoadFile(
const AZStd::string& absoluteFilePath,
const AZStd::string& projectName = "",
bool isDefaultFile = false) override;
void SelectDefaultSeedLists(bool setSelected);
@@ -38,7 +38,11 @@ namespace AssetBundler
//////////////////////////////////////////////////////////////////////////////////////////////////
// SeedListTableModel
//////////////////////////////////////////////////////////////////////////////////////////////////
SeedListTableModel::SeedListTableModel(QObject* parent, const AZStd::string& absolutePath, const AZStd::vector<AZStd::string>& defaultSeeds, const AzFramework::PlatformFlags& platforms)
SeedListTableModel::SeedListTableModel(
QObject* parent,
const AZStd::string& absolutePath,
const AZStd::vector<AZStd::string>& defaultSeeds,
const AzFramework::PlatformFlags& platforms)
: QAbstractTableModel(parent)
{
m_seedListManager.reset(new AzToolsFramework::AssetSeedManager());
@@ -66,7 +70,10 @@ namespace AssetBundler
QString platformList;
for (const auto& seed : m_seedListManager->GetAssetSeedList())
{
assetInfo = AzToolsFramework::AssetSeedManager::GetAssetInfoById(seed.m_assetId, AzFramework::PlatformHelper::GetPlatformIndicesInterpreted(seed.m_platformFlags)[0], absolutePath);
assetInfo = AzToolsFramework::AssetSeedManager::GetAssetInfoById(
seed.m_assetId,
AzFramework::PlatformHelper::GetPlatformIndicesInterpreted(seed.m_platformFlags)[0],
absolutePath);
platformList = QString(m_seedListManager->GetReadablePlatformList(seed).c_str());
m_additionalSeedInfoMap[seed.m_assetId].reset(new AdditionalSeedInfo(assetInfo.m_relativePath.c_str(), platformList));
@@ -126,7 +133,8 @@ namespace AssetBundler
AZ_Error(AssetBundler::AppWindowName, false, "Unable to find additional Seed info");
return false;
}
additionalSeedInfo->second->m_platformList = QString(AzFramework::PlatformHelper::GetCommaSeparatedPlatformList(platforms).c_str());
additionalSeedInfo->second->m_platformList =
QString(AzFramework::PlatformHelper::GetCommaSeparatedPlatformList(platforms).c_str());
SetHasUnsavedChanges(true);
@@ -140,7 +148,8 @@ namespace AssetBundler
bool SeedListTableModel::AddSeed(const AZStd::string& seedRelativePath, const AzFramework::PlatformFlags& platforms)
{
AZStd::pair<AZ::Data::AssetId, AzFramework::PlatformFlags> addSeedsResult = m_seedListManager->AddSeedAssetForValidPlatforms(seedRelativePath, platforms);
AZStd::pair<AZ::Data::AssetId, AzFramework::PlatformFlags> addSeedsResult =
m_seedListManager->AddSeedAssetForValidPlatforms(seedRelativePath, platforms);
if (!addSeedsResult.first.IsValid() || addSeedsResult.second == AzFramework::PlatformFlags::Platform_NONE)
{
@@ -36,7 +36,11 @@ namespace AssetBundler
: public QAbstractTableModel
{
public:
explicit SeedListTableModel(QObject* parent = nullptr, const AZStd::string& absolutePath = AZStd::string(), const AZStd::vector<AZStd::string>& defaultSeeds = AZStd::vector<AZStd::string>(), const AzFramework::PlatformFlags& platforms = AzFramework::PlatformFlags::Platform_NONE);
explicit SeedListTableModel(
QObject* parent = nullptr,
const AZStd::string& absolutePath = AZStd::string(),
const AZStd::vector<AZStd::string>& defaultSeeds = AZStd::vector<AZStd::string>(),
const AzFramework::PlatformFlags& platforms = AzFramework::PlatformFlags::Platform_NONE);
virtual ~SeedListTableModel() {}
AZStd::shared_ptr<AzToolsFramework::AssetSeedManager> GetSeedListManager() { return m_seedListManager; }