From 01bba93f28efc1f1469baf21d46fcc34c99b450e Mon Sep 17 00:00:00 2001 From: mnaumov Date: Fri, 30 Apr 2021 12:52:03 -0700 Subject: [PATCH] PR feedback --- .../AssetBrowser/Thumbnails/FolderThumbnail.cpp | 6 ++---- .../AzToolsFramework/Thumbnails/LoadingThumbnail.cpp | 8 +++----- .../AzToolsFramework/Thumbnails/MissingThumbnail.cpp | 8 +++----- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Thumbnails/FolderThumbnail.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Thumbnails/FolderThumbnail.cpp index 59bb8d940b..01f164b506 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Thumbnails/FolderThumbnail.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Thumbnails/FolderThumbnail.cpp @@ -10,6 +10,7 @@ * */ +#include #include #include #include @@ -62,12 +63,9 @@ namespace AzToolsFramework auto folderKey = azrtti_cast(m_key.data()); AZ_Assert(folderKey, "Incorrect key type, excpected FolderThumbnailKey"); - const char* engineRoot = nullptr; - AzFramework::ApplicationRequests::Bus::BroadcastResult(engineRoot, &AzFramework::ApplicationRequests::GetEngineRoot); - AZ_Assert(engineRoot, "Engine Root not initialized"); const char* folderIcon = folderKey->IsGem() ? GemIconPath : FolderIconPath; AZStd::string absoluteIconPath; - AZ::StringFunc::Path::Join(engineRoot, folderIcon, absoluteIconPath); + AZ::StringFunc::Path::Join(AZ::Utils::GetEnginePath().c_str(), folderIcon, absoluteIconPath); m_pixmap.load(absoluteIconPath.c_str()); m_state = m_pixmap.isNull() ? State::Failed : State::Ready; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/LoadingThumbnail.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/LoadingThumbnail.cpp index f6578ad9d2..0ad5453c65 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/LoadingThumbnail.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/LoadingThumbnail.cpp @@ -10,6 +10,7 @@ * */ +#include #include #include #include @@ -23,17 +24,14 @@ namespace AzToolsFramework ////////////////////////////////////////////////////////////////////////// // LoadingThumbnail ////////////////////////////////////////////////////////////////////////// - static const char* LoadingIconPath = "Assets/Editor/Icons/AssetBrowser/in_progress.gif"; + static constexpr const char* LoadingIconPath = "Assets/Editor/Icons/AssetBrowser/in_progress.gif"; LoadingThumbnail::LoadingThumbnail() : Thumbnail(MAKE_TKEY(ThumbnailKey)) , m_angle(0) { - const char* engineRoot = nullptr; - AzFramework::ApplicationRequests::Bus::BroadcastResult(engineRoot, &AzFramework::ApplicationRequests::GetEngineRoot); - AZ_Assert(engineRoot, "Engine Root not initialized"); AZStd::string iconPath; - AZ::StringFunc::Path::Join(engineRoot, LoadingIconPath, iconPath); + AZ::StringFunc::Path::Join(AZ::Utils::GetEnginePath().c_str(), LoadingIconPath, iconPath); m_loadingMovie.setFileName(iconPath.c_str()); m_loadingMovie.setCacheMode(QMovie::CacheMode::CacheAll); m_loadingMovie.setScaledSize(QSize(LoadingThumbnailSize, LoadingThumbnailSize)); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/MissingThumbnail.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/MissingThumbnail.cpp index 7a7c98f764..2a2afa005b 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/MissingThumbnail.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/MissingThumbnail.cpp @@ -10,6 +10,7 @@ * */ +#include #include #include #include @@ -18,16 +19,13 @@ namespace AzToolsFramework { namespace Thumbnailer { - static const char* MissingIconPath = "Assets/Editor/Icons/AssetBrowser/Default_16.svg"; + static constexpr const char* MissingIconPath = "Assets/Editor/Icons/AssetBrowser/Default_16.svg"; MissingThumbnail::MissingThumbnail() : Thumbnail(MAKE_TKEY(ThumbnailKey)) { - const char* engineRoot = nullptr; - AzFramework::ApplicationRequests::Bus::BroadcastResult(engineRoot, &AzFramework::ApplicationRequests::GetEngineRoot); - AZ_Assert(engineRoot, "Engine Root not initialized"); AZStd::string absoluteIconPath; - AZ::StringFunc::Path::Join(engineRoot, MissingIconPath, absoluteIconPath); + AZ::StringFunc::Path::Join(AZ::Utils::GetEnginePath().c_str(), MissingIconPath, absoluteIconPath); m_pixmap.load(absoluteIconPath.c_str()); m_state = m_pixmap.isNull() ? State::Failed : State::Ready;