Cleanup: Various clang-tidy warnings in asset_system
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
This commit is contained in:
@@ -58,7 +58,6 @@ class AssetCatalogService {
|
||||
|
||||
struct read_only_tag {};
|
||||
|
||||
public:
|
||||
explicit AssetCatalogService(const CatalogFilePath &asset_library_root = {});
|
||||
explicit AssetCatalogService(read_only_tag);
|
||||
|
||||
@@ -317,7 +316,6 @@ class AssetCatalog {
|
||||
bool has_unsaved_changes = false;
|
||||
} flags;
|
||||
|
||||
public:
|
||||
AssetCatalog() = delete;
|
||||
AssetCatalog(CatalogID catalog_id, const AssetCatalogPath &path, const std::string &simple_name);
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ class AssetCatalogPath {
|
||||
/**
|
||||
* The path itself, such as "Agents/Secret/327".
|
||||
*/
|
||||
std::string path_ = "";
|
||||
std::string path_;
|
||||
|
||||
public:
|
||||
static const char SEPARATOR;
|
||||
|
||||
@@ -100,7 +100,6 @@ class AssetLibrary {
|
||||
friend class AssetLibraryService;
|
||||
friend class AssetRepresentation;
|
||||
|
||||
public:
|
||||
/**
|
||||
* \param name: The name this asset library will be displayed in the UI as. Will also be used as
|
||||
* a weak way to identify an asset library (e.g. by #AssetWeakReference). Make sure
|
||||
|
||||
@@ -39,7 +39,7 @@ AssetCatalogService::AssetCatalogService(const CatalogFilePath &asset_library_ro
|
||||
{
|
||||
}
|
||||
|
||||
AssetCatalogService::AssetCatalogService(read_only_tag) : AssetCatalogService()
|
||||
AssetCatalogService::AssetCatalogService(read_only_tag /*unused*/) : AssetCatalogService()
|
||||
{
|
||||
const_cast<bool &>(is_read_only_) = true;
|
||||
}
|
||||
@@ -495,9 +495,8 @@ bool AssetCatalogService::write_to_disk_ex(const CatalogFilePath &blend_file_pat
|
||||
return true; /* Writing nothing when there is nothing to write is still a success. */
|
||||
}
|
||||
|
||||
const CatalogFilePath cdf_path_to_write = this->find_suitable_cdf_path_for_writing(
|
||||
blend_file_path);
|
||||
catalog_collection_->catalog_definition_file_ = this->construct_cdf_in_memory(cdf_path_to_write);
|
||||
const CatalogFilePath cdf_path_to_write = find_suitable_cdf_path_for_writing(blend_file_path);
|
||||
catalog_collection_->catalog_definition_file_ = construct_cdf_in_memory(cdf_path_to_write);
|
||||
this->reload_catalogs();
|
||||
return catalog_collection_->catalog_definition_file_->write_to_disk();
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@ std::unique_ptr<AssetCatalogCollection> AssetCatalogCollection::deep_copy() cons
|
||||
auto copy = std::make_unique<AssetCatalogCollection>();
|
||||
|
||||
copy->has_unsaved_changes_ = this->has_unsaved_changes_;
|
||||
copy->catalogs_ = this->copy_catalog_map(this->catalogs_);
|
||||
copy->deleted_catalogs_ = this->copy_catalog_map(this->deleted_catalogs_);
|
||||
copy->catalogs_ = copy_catalog_map(this->catalogs_);
|
||||
copy->deleted_catalogs_ = copy_catalog_map(this->deleted_catalogs_);
|
||||
|
||||
if (catalog_definition_file_) {
|
||||
copy->catalog_definition_file_ = catalog_definition_file_->copy_and_remap(
|
||||
|
||||
@@ -39,7 +39,6 @@ class AssetCatalogDefinitionFile {
|
||||
|
||||
const CatalogFilePath file_path;
|
||||
|
||||
public:
|
||||
AssetCatalogDefinitionFile(const CatalogFilePath &file_path);
|
||||
|
||||
/**
|
||||
|
||||
@@ -63,7 +63,7 @@ bool AssetCatalogTreeItem::has_children() const
|
||||
void AssetCatalogTreeItem::foreach_item_recursive(const AssetCatalogTreeItem::ChildMap &children,
|
||||
const ItemIterFn callback)
|
||||
{
|
||||
for (auto &[key, item] : children) {
|
||||
for (const auto &[key, item] : children) {
|
||||
callback(item);
|
||||
foreach_item_recursive(item.children_, callback);
|
||||
}
|
||||
@@ -71,7 +71,7 @@ void AssetCatalogTreeItem::foreach_item_recursive(const AssetCatalogTreeItem::Ch
|
||||
|
||||
void AssetCatalogTreeItem::foreach_child(const ItemIterFn callback) const
|
||||
{
|
||||
for (auto &[key, item] : children_) {
|
||||
for (const auto &[key, item] : children_) {
|
||||
callback(item);
|
||||
}
|
||||
}
|
||||
@@ -122,7 +122,7 @@ void AssetCatalogTree::foreach_item(AssetCatalogTreeItem::ItemIterFn callback) c
|
||||
|
||||
void AssetCatalogTree::foreach_root_item(const ItemIterFn callback) const
|
||||
{
|
||||
for (auto &[key, item] : root_items_) {
|
||||
for (const auto &[key, item] : root_items_) {
|
||||
callback(item);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ void AssetLibrary::remap_ids_and_remove_invalid(const bke::id::IDRemapper &mappi
|
||||
{
|
||||
Set<AssetRepresentation *> removed_assets;
|
||||
|
||||
for (auto &asset_ptr : asset_storage_.local_id_assets) {
|
||||
for (const auto &asset_ptr : asset_storage_.local_id_assets) {
|
||||
AssetRepresentation &asset = *asset_ptr;
|
||||
BLI_assert(asset.is_local_id());
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ AssetLibrary *AssetLibraryService::get_asset_library(
|
||||
case ASSET_LIBRARY_ALL:
|
||||
return this->get_asset_library_all(bmain);
|
||||
case ASSET_LIBRARY_CUSTOM: {
|
||||
bUserAssetLibrary *custom_library = this->find_custom_asset_library_from_library_ref(
|
||||
bUserAssetLibrary *custom_library = find_custom_asset_library_from_library_ref(
|
||||
library_reference);
|
||||
if (!custom_library) {
|
||||
return nullptr;
|
||||
@@ -260,8 +260,8 @@ std::string AssetLibraryService::resolve_asset_weak_reference_to_library_path(
|
||||
|
||||
switch (eAssetLibraryType(asset_reference.asset_library_type)) {
|
||||
case ASSET_LIBRARY_CUSTOM: {
|
||||
bUserAssetLibrary *custom_lib =
|
||||
this->find_custom_preferences_asset_library_from_asset_weak_ref(asset_reference);
|
||||
bUserAssetLibrary *custom_lib = find_custom_preferences_asset_library_from_asset_weak_ref(
|
||||
asset_reference);
|
||||
if (custom_lib) {
|
||||
library_dirpath = custom_lib->dirpath;
|
||||
break;
|
||||
|
||||
@@ -2,17 +2,15 @@
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#include "BLI_string.h"
|
||||
|
||||
#include "asset_library_service.hh"
|
||||
#include "asset_library_test_common.hh"
|
||||
|
||||
#include "AS_asset_representation.hh"
|
||||
|
||||
#include "BKE_asset.hh"
|
||||
|
||||
#include "DNA_asset_types.h"
|
||||
|
||||
#include "BLI_string.h"
|
||||
|
||||
#include "../intern/utils.hh"
|
||||
|
||||
#include "testing/testing.h"
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#include "rna_internal.hh"
|
||||
|
||||
#include "WM_api.hh"
|
||||
#include "WM_keymap.hh"
|
||||
#include "WM_types.hh"
|
||||
|
||||
#include "BLT_lang.hh"
|
||||
|
||||
@@ -29,10 +29,13 @@
|
||||
#include "rna_internal.hh"
|
||||
|
||||
#include "WM_api.hh"
|
||||
#include "WM_keymap.hh"
|
||||
#include "WM_types.hh"
|
||||
|
||||
#ifdef RNA_RUNTIME
|
||||
|
||||
# include "BKE_wm_runtime.hh"
|
||||
|
||||
# include "wm_event_system.hh"
|
||||
|
||||
static const EnumPropertyItem event_mouse_type_items[] = {
|
||||
|
||||
Reference in New Issue
Block a user