diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserTableModel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserTableModel.cpp index 1c4f141f38..2cf5b13c91 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserTableModel.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserTableModel.cpp @@ -89,17 +89,17 @@ namespace AzToolsFramework int AssetBrowserTableModel::BuildTableModelMap( const QAbstractItemModel* model, const QModelIndex& parent /*= QModelIndex()*/, int row /*= 0*/) { - static int cont = 0; + static int displayedItemsCounter = 0; int rows = model ? model->rowCount(parent) : 0; if (parent == QModelIndex()) { - cont = 0; + displayedItemsCounter = 0; } for (int i = 0; i < rows; ++i) { - if (cont < m_numberOfItemsDisplayed) + if (displayedItemsCounter < m_numberOfItemsDisplayed) { QModelIndex index = model->index(i, 0, parent); AssetBrowserEntry* entry = GetAssetEntry(m_filterModel->mapToSource(index)); @@ -112,18 +112,15 @@ namespace AzToolsFramework Q_EMIT dataChanged(index, index); ++row; - ++cont; + ++displayedItemsCounter; } - if (model->hasChildren(index) && cont < 10) + if (model->hasChildren(index)) { row = BuildTableModelMap(model, index, row); } } - else - { break; - } } return row; } diff --git a/Code/Sandbox/Editor/EditorPreferencesPageFiles.cpp b/Code/Sandbox/Editor/EditorPreferencesPageFiles.cpp index d4e7378d2b..f6333b9a76 100644 --- a/Code/Sandbox/Editor/EditorPreferencesPageFiles.cpp +++ b/Code/Sandbox/Editor/EditorPreferencesPageFiles.cpp @@ -42,10 +42,9 @@ void CEditorPreferencesPage_Files::Reflect(AZ::SerializeContext& serialize) ->Field("MaxCount", &AutoBackup::m_maxCount) ->Field("RemindTime", &AutoBackup::m_remindTime); - serialize - .Class() + serialize.Class() ->Version(1) - ->Field("Max number of items displayed", &AssetBrowserSearch::m_numOfItemsShown); + ->Field("Max number of items displayed", &AssetBrowserSearch::m_maxNumberOfItemsShownInSearch); serialize.Class() ->Version(1) @@ -86,10 +85,10 @@ void CEditorPreferencesPage_Files::Reflect(AZ::SerializeContext& serialize) ->DataElement(AZ::Edit::UIHandlers::SpinBox, &AutoBackup::m_remindTime, "Remind Time", "Auto Remind Every (Minutes)"); editContext->Class("Asset Browser Search View", "Asset Browser Search View") - ->DataElement(AZ::Edit::UIHandlers::SpinBox, &AssetBrowserSearch::m_numOfItemsShown, "Maximum number of displayed items", + ->DataElement(AZ::Edit::UIHandlers::SpinBox, &AssetBrowserSearch::m_maxNumberOfItemsShownInSearch, "Maximum number of displayed items", "Maximum number of displayed items displayed in the Search View") - ->Attribute(AZ::Edit::Attributes::Min, 100) - ->Attribute(AZ::Edit::Attributes::Max, 1000); + ->Attribute(AZ::Edit::Attributes::Min, 50) + ->Attribute(AZ::Edit::Attributes::Max, 5000); editContext->Class("File Preferences", "Class for handling File Preferences") ->ClassElement(AZ::Edit::ClassElements::EditorData, "") @@ -137,7 +136,7 @@ void CEditorPreferencesPage_Files::OnApply() gSettings.autoBackupMaxCount = m_autoBackup.m_maxCount; gSettings.autoRemindTime = m_autoBackup.m_remindTime; - gSettings.numberOfItemsShownInSearch = m_assetBrowserSearch.m_numOfItemsShown; + gSettings.maxNumberOfItemsShownInSearch = m_assetBrowserSearch.m_maxNumberOfItemsShownInSearch; } void CEditorPreferencesPage_Files::InitializeSettings() @@ -163,5 +162,5 @@ void CEditorPreferencesPage_Files::InitializeSettings() m_autoBackup.m_maxCount = gSettings.autoBackupMaxCount; m_autoBackup.m_remindTime = gSettings.autoRemindTime; - m_assetBrowserSearch.m_numOfItemsShown = gSettings.numberOfItemsShownInSearch; + m_assetBrowserSearch.m_maxNumberOfItemsShownInSearch = gSettings.maxNumberOfItemsShownInSearch; } diff --git a/Code/Sandbox/Editor/EditorPreferencesPageFiles.h b/Code/Sandbox/Editor/EditorPreferencesPageFiles.h index 2e27cd3c3e..40e9577f7f 100644 --- a/Code/Sandbox/Editor/EditorPreferencesPageFiles.h +++ b/Code/Sandbox/Editor/EditorPreferencesPageFiles.h @@ -72,7 +72,7 @@ private: { AZ_TYPE_INFO(AssetBrowserSearch, "{9FBFCD24-9452-49DF-99F4-2711443CEAAE}") - int m_numOfItemsShown; + int m_maxNumberOfItemsShownInSearch; }; Files m_files; diff --git a/Code/Sandbox/Editor/Settings.cpp b/Code/Sandbox/Editor/Settings.cpp index 398ad5f5cb..d49a1d40d1 100644 --- a/Code/Sandbox/Editor/Settings.cpp +++ b/Code/Sandbox/Editor/Settings.cpp @@ -498,7 +498,7 @@ void SEditorSettings::Save() SaveValue("Settings", "AutoBackupTime", autoBackupTime); SaveValue("Settings", "AutoBackupMaxCount", autoBackupMaxCount); SaveValue("Settings", "AutoRemindTime", autoRemindTime); - SaveValue("Settings", "MaxDisplayedItemsNumInSearch", numberOfItemsShownInSearch); + SaveValue("Settings", "MaxDisplayedItemsNumInSearch", maxNumberOfItemsShownInSearch); SaveValue("Settings", "CameraMoveSpeed", cameraMoveSpeed); SaveValue("Settings", "CameraRotateSpeed", cameraRotateSpeed); SaveValue("Settings", "StylusMode", stylusMode); @@ -711,7 +711,7 @@ void SEditorSettings::Load() LoadValue("Settings", "AutoBackupTime", autoBackupTime); LoadValue("Settings", "AutoBackupMaxCount", autoBackupMaxCount); LoadValue("Settings", "AutoRemindTime", autoRemindTime); - LoadValue("Settings", "MaxDisplayedItemsNumInSearch", numberOfItemsShownInSearch); + LoadValue("Settings", "MaxDisplayedItemsNumInSearch", maxNumberOfItemsShownInSearch); LoadValue("Settings", "CameraMoveSpeed", cameraMoveSpeed); LoadValue("Settings", "CameraRotateSpeed", cameraRotateSpeed); LoadValue("Settings", "StylusMode", stylusMode); @@ -1208,5 +1208,5 @@ AzToolsFramework::ConsoleColorTheme SEditorSettings::GetConsoleColorTheme() cons int SEditorSettings::GetMaxNumberOfItemsShownInSearchView() const { - return SEditorSettings::numberOfItemsShownInSearch; + return SEditorSettings::maxNumberOfItemsShownInSearch; } diff --git a/Code/Sandbox/Editor/Settings.h b/Code/Sandbox/Editor/Settings.h index ee6aa24ca5..802809ac11 100644 --- a/Code/Sandbox/Editor/Settings.h +++ b/Code/Sandbox/Editor/Settings.h @@ -382,7 +382,7 @@ AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING // Asset Browser Search View. ////////////////////////////////////////////////////////////////////////// //! Current maximum number of items that can be displayed in the AssetBrowser Search View. - int numberOfItemsShownInSearch; + int maxNumberOfItemsShownInSearch; //////////////////////////////////////////////////////////////////////////