You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
o3de/Code/Tools/AssetProcessor/native
Dennis Brakhane 7f75dc6dee
Fix "index out of range" error in AssetProcessor (#4324)
* Fix "index out of range" error

When the parent is the tree root element, beginInsertRows must be
called with an invalid (but legal) index. A QModelIndex with a row
index of zero when the parent has no children is an illegal index
and will result in "undefined behavior", like the "index out of
range" one.

Therefore, if our parent is the tree root element, we use QModelIndex()
instead.

Fixes #2343

Signed-off-by: Dennis Brakhane <brakhane@gmail.com>

* Use QModelIndex() instead of createIndex(-1, -1)

Both do the same, but the former is Qt best practise.

Signed-off-by: Dennis Brakhane <brakhane@gmail.com>

* add some sanity checks in debug mode

Using illegal ModelIndices can result in hard to debug problems later
on, so add a few checks to help spotting them sooner.

Signed-off-by: Dennis Brakhane <brakhane@gmail.com>
4 years ago
..
AssetDatabase Added new index on SourceDependency Table (#3648) 4 years ago
AssetManager Cleanup SerializeContext.h pt.1 (#4264) 4 years ago
FileProcessor Shorten copyright headers by splitting into 2 lines (#2213) 5 years ago
FileServer Shorten copyright headers by splitting into 2 lines (#2213) 5 years ago
FileWatcher Shorten copyright headers by splitting into 2 lines (#2213) 5 years ago
InternalBuilders Cleanup SerializeContext.h pt.1 (#4264) 4 years ago
connection Shorten copyright headers by splitting into 2 lines (#2213) 5 years ago
resourcecompiler Code/Tools/AssetProcessor 4 years ago
shadercompiler Shorten copyright headers by splitting into 2 lines (#2213) 5 years ago
tests Updated the AssetProcessorManagerTest LockFileTest to check the Source… (#4459) 4 years ago
ui Fix "index out of range" error in AssetProcessor (#4324) 4 years ago
unittests Removed ununeeded includes from EBus EBus.h and Policies.h (#4256) 4 years ago
utilities LYN-6882 release builds are executing code in asserts (#4305) 4 years ago
AssetProcessorBatchBuildTarget.cpp Shorten copyright headers by splitting into 2 lines (#2213) 5 years ago
AssetProcessorBuildTarget.cpp Shorten copyright headers by splitting into 2 lines (#2213) 5 years ago
assetprocessor.h Automated test for scene files with and without python scripts running python incorrectly (#2373) 4 years ago
main_batch.cpp Shorten copyright headers by splitting into 2 lines (#2213) 5 years ago
main_gui.cpp Shorten copyright headers by splitting into 2 lines (#2213) 5 years ago