Special enum item when no sound is found

This happens when you build without sound libraries and such.
Without that the console is spammed with tons of RNA messages because
the enum is empty.
This commit is contained in:
Dalai Felinto 2018-10-05 11:51:04 -03:00
parent eab00bf202
commit 149e912b1f
1 changed files with 7 additions and 0 deletions

View File

@ -486,6 +486,13 @@ static const EnumPropertyItem *rna_userdef_audio_device_itemf(bContext *UNUSED(C
RNA_enum_item_add(&item, &totitem, &new_item);
}
#ifndef NDEBUG
if (i == 0) {
EnumPropertyItem new_item = {i, "SOUND_NONE", 0, "No Sound", ""};
RNA_enum_item_add(&item, &totitem, &new_item);
}
#endif
/* may be unused */
UNUSED_VARS(index, audio_device_items);