vlc/vlc-3.0 | branch: master | Felix Paul Kühne <fe...@feepk.net> | Sat Jun 9 20:00:45 2018 +0200| [b3899a6101a976a6bf3e642ec8694be167fa0e97] | committer: Felix Paul Kühne
macosx/advanced prefs: fix display of advanced modules and their options This also adds a tad of debug bits for the future (cherry picked from commit 08134b3f77fad1a0da3a20ddc869aadb8fe997cc) > http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=b3899a6101a976a6bf3e642ec8694be167fa0e97 --- modules/gui/macosx/prefs.m | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/modules/gui/macosx/prefs.m b/modules/gui/macosx/prefs.m index 1560fc46d9..2d3f2e8d89 100644 --- a/modules/gui/macosx/prefs.m +++ b/modules/gui/macosx/prefs.m @@ -1,7 +1,7 @@ /***************************************************************************** * prefs.m: MacOS X module for vlc ***************************************************************************** - * Copyright (C) 2002-2015 VLC authors and VideoLAN + * Copyright (C) 2002-2018 VLC authors and VideoLAN * $Id$ * * Authors: Jon Lech Johansen <jon...@nanocrew.net> @@ -315,6 +315,11 @@ return self; } +- (NSString *)description +{ + return [NSString stringWithFormat:@"%@: name: %@, number of children %li", NSStringFromClass([self class]), [self name], [self numberOfChildren]]; +} + - (VLCTreeItem *)childAtIndex:(NSInteger)i_index { return [[self children] objectAtIndex:i_index]; @@ -454,7 +459,6 @@ - (bool)isSubCategoryGeneral:(int)category { if (category == SUBCAT_VIDEO_GENERAL || - category == SUBCAT_ADVANCED_MISC || category == SUBCAT_INPUT_GENERAL || category == SUBCAT_INTERFACE_GENERAL || category == SUBCAT_SOUT_GENERAL|| @@ -501,8 +505,7 @@ } p_configs = [pluginItem configItems]; - unsigned int j; - for (j = 0; j < confsize; j++) { + for (unsigned int j = 0; j < confsize; j++) { int configType = p_configs[j].i_type; if (configType == CONFIG_CATEGORY) { categoryItem = [self itemRepresentingCategory:p_configs[j].value.i]; @@ -525,17 +528,23 @@ } if (module_is_main(p_module) && (CONFIG_ITEM(configType) || configType == CONFIG_SECTION)) { - if (categoryItem && [self isSubCategoryGeneral:lastsubcat]) + if (categoryItem && [self isSubCategoryGeneral:lastsubcat]) { [[categoryItem options] addObject:[[VLCTreeLeafItem alloc] initWithConfigItem:&p_configs[j]]]; - else if (subCategoryItem) + } else if (subCategoryItem) { [[subCategoryItem options] addObject:[[VLCTreeLeafItem alloc] initWithConfigItem:&p_configs[j]]]; + } } else if (!module_is_main(p_module) && (CONFIG_ITEM(configType) || configType == CONFIG_SECTION)) { - if (![[subCategoryItem children] containsObject: pluginItem]) + if (![[subCategoryItem children] containsObject: pluginItem]) { [[subCategoryItem children] addObject:pluginItem]; + } - if (pluginItem) + if (pluginItem) { [[pluginItem options] addObject:[[VLCTreeLeafItem alloc] initWithConfigItem:&p_configs[j]]]; + } + } + else { + msg_Err(getIntf(), "failed to handle index %i which is neither a category nor a subcategory", j); } } } @@ -548,7 +557,10 @@ @implementation VLCTreeCategoryItem + (VLCTreeCategoryItem *)categoryTreeItemWithCategory:(int)category { - if (!config_CategoryNameGet(category)) return nil; + if (!config_CategoryNameGet(category)) { + msg_Err(getIntf(), "failed to get name for category %i", category); + return nil; + } return [[[self class] alloc] initWithCategory:category]; } @@ -578,6 +590,7 @@ { return _category; } + @end #pragma mark - _______________________________________________ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits