config: add unknown cat/subcat defines

for use in unknown/unset/invalid situations.
This commit is contained in:
Lyndon Brown 2021-05-20 05:43:51 +01:00 committed by Jean-Baptiste Kempf
parent fe250af922
commit aef8cbfe19
3 changed files with 10 additions and 6 deletions

View File

@ -150,6 +150,10 @@ enum vlc_module_properties
#define CAT_HIDDEN -1
#define SUBCAT_HIDDEN -1
/* Unknown/unset/invalid */
#define CAT_UNKNOWN 0
#define SUBCAT_UNKNOWN 0
/* Categories and subcategories */
#define CAT_INTERFACE 1
#define SUBCAT_INTERFACE_GENERAL 101

View File

@ -488,7 +488,7 @@
VLCTreeSubCategoryItem * subCategoryItem = nil;
VLCTreePluginItem * pluginItem = nil;
module_config_t *p_configs = NULL;
int lastsubcat = 0;
int lastsubcat = SUBCAT_UNKNOWN;
unsigned int confsize;
module_t * p_module = modules[i];

View File

@ -189,7 +189,7 @@ PrefsTree::PrefsTree( qt_intf_t *_p_intf, QWidget *_parent,
if( module_is_main( p_module) ) continue;
unsigned confsize;
int i_subcategory = 0, i_category = 0;
int i_subcategory = SUBCAT_UNKNOWN, i_category = CAT_UNKNOWN;
bool b_options = false;
module_config_t *const p_config = module_config_get (p_module, &confsize);
@ -207,14 +207,14 @@ PrefsTree::PrefsTree( qt_intf_t *_p_intf, QWidget *_parent,
if( CONFIG_ITEM(p_item->i_type) )
b_options = true;
if( b_options && i_category && i_subcategory )
if( b_options && i_category != CAT_UNKNOWN && i_subcategory != SUBCAT_UNKNOWN )
break;
}
module_config_free (p_config);
/* Dummy item, please proceed */
if( !b_options || i_category == 0 || i_subcategory == 0 ) continue;
if( !b_options || i_category == CAT_UNKNOWN || i_subcategory == SUBCAT_UNKNOWN )
continue;
// Locate the category item;
QTreeWidgetItem *subcat_item = NULL;
@ -495,7 +495,7 @@ bool PrefsItemData::contains( const QString &text, Qt::CaseSensitivity cs )
return false;
bool is_core = this->i_type != TYPE_MODULE;
int id = 0;
int id = SUBCAT_UNKNOWN;
/* find our module */
module_t *p_module;