Adding AZ_CVAR for the new feature

This commit is contained in:
igarri
2021-05-18 13:33:21 +01:00
parent 61ac423ebd
commit 1c2b8f9111
4 changed files with 43 additions and 24 deletions
@@ -12,6 +12,7 @@
#include <AzToolsFramework/AssetBrowser/Search/Filter.h>
#include <AzToolsFramework/AssetBrowser/Entries/FolderAssetBrowserEntry.h>
#include <AzToolsFramework/AssetBrowser/Entries/SourceAssetBrowserEntry.h>
#include <AzCore/Console/IConsole.h>
AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option")
#include <AzToolsFramework/AssetBrowser/AssetBrowserFilterModel.h>
@@ -22,6 +23,10 @@ AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option")
#include <QCollator>
AZ_POP_DISABLE_WARNING
AZ_CVAR(
bool, ed_useNewAssetBrowserTableView, false, nullptr, AZ::ConsoleFunctorFlags::Null,
"Use the new AssetBrowser TableView for searching assets.");
namespace AzToolsFramework
{
namespace AssetBrowser
@@ -32,7 +37,10 @@ namespace AzToolsFramework
: QSortFilterProxyModel(parent)
{
m_showColumn.insert(static_cast<int>(AssetBrowserEntry::Column::DisplayName));
m_showColumn.insert(static_cast<int>(AssetBrowserEntry::Column::Path));
if (ed_useNewAssetBrowserTableView)
{
m_showColumn.insert(static_cast<int>(AssetBrowserEntry::Column::Path));
}
m_collator.setNumericMode(true);
AssetBrowserComponentNotificationBus::Handler::BusConnect();
}
@@ -233,11 +233,6 @@ namespace AzToolsFramework
Q_EMIT updatedSignal();
}
bool StringFilter::IsEmpty() const
{
return m_filterString.isEmpty();
}
QString StringFilter::GetNameInternal() const
{
return m_filterString;
@@ -110,7 +110,6 @@ namespace AzToolsFramework
~StringFilter() override = default;
void SetFilterString(const QString& filterString);
bool IsEmpty() const;
protected:
QString GetNameInternal() const override;
bool MatchInternal(const AssetBrowserEntry* entry) const override;