Changeset 9b5889a2e846d4a99ebb0b5b1b72f1ea39da8468

Show
Ignore:
Timestamp:
07/05/08 18:30:39 (2 months ago)
Author:
Pierre d'Herbemont <pdherbemont@videolan.org>
git-committer:
Pierre d'Herbemont <pdherbemont@videolan.org> 1215275439 +0200
git-parent:

[ffe7bdd1604d611685865f2f67048fabd55f69c7]

git-author:
Pierre d'Herbemont <pdherbemont@videolan.org> 1215275439 +0200
Message:

macosx: Kind of fix the preferences on Mac OS X.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/gui/macosx/prefs.m

    r8fb46d3 r9b5889a  
    325325                            withTitle: o_child_title 
    326326                            withHelp: o_child_help 
    327                             ID: p_items[i].value.i 
     327                            ID: ((vlc_object_t*)p_main_module)->i_object_id 
    328328                            parent:self 
    329329                            children:[[NSMutableArray alloc] 
    330330                                initWithCapacity:10] 
    331                             whithCategory: p_items[i].i_type]]; 
     331                            whithCategory: p_items[i].value.i]]; 
    332332                        break; 
    333333                    case CONFIG_SUBCATEGORY: 
     
    353353                                withTitle: o_child_title 
    354354                                withHelp: o_child_help 
    355                                 ID: p_items[i].value.i 
     355                                ID: ((vlc_object_t*)p_main_module)->i_object_id 
    356356                                parent:p_last_category 
    357357                                children:[[NSMutableArray alloc] 
    358358                                    initWithCapacity:10] 
    359                                 whithCategory: p_items[i].i_type]]; 
     359                                whithCategory: p_items[i].value.i]]; 
    360360                        } 
    361361 
     
    385385                /* Exclude empty plugins (submodules don't have config */ 
    386386                /* options, they are stored in the parent module) */ 
    387 // Does not work 
    388 //                if( modules_IsSubModule( p_module ) ) 
    389 //                    continue; 
    390387                p_items = module_GetConfig( p_module, &confsize ); 
    391388 
     
    416413                long cookie; 
    417414                bool b_found = false; 
    418                 unsigned int i; 
     415 
    419416                VLCTreeItem* p_category_item, * p_subcategory_item; 
    420                 for (i = 0 ; i < [o_children count] ; i++) 
     417                for (j = 0 ; j < [o_children count] ; j++) 
    421418                { 
    422                     p_category_item = [o_children objectAtIndex: i]; 
    423                     if( p_category_item->i_object_id == i_category ) 
     419                    p_category_item = [o_children objectAtIndex: j]; 
     420                    if( p_category_item->i_object_category == i_category ) 
    424421                    { 
    425422                        b_found = true; 
     
    432429                b_found = false; 
    433430                cookie = -1; 
    434                 for (i = 0 ; i < [p_category_item->o_children count] ; i++) 
     431                for (j = 0 ; j < [p_category_item->o_children count] ; j++) 
    435432                { 
    436433                    p_subcategory_item = [p_category_item->o_children 
    437                                             objectAtIndex: i]; 
    438                     if( p_subcategory_item->i_object_id == i_subcategory ) 
     434                                            objectAtIndex: j]; 
     435                    if( p_subcategory_item->i_object_category == i_subcategory ) 
    439436                    { 
    440437                        b_found = true; 
     
    592589            p_items = module_GetConfig( p_main_module, &confsize ); 
    593590 
     591            /* We need to first, find the right (sub)category, 
     592             * and then abort when we find a new (sub)category. Part of the Ugliness. */ 
     593            bool in_right_category = false; 
     594            bool in_subcategory = false; 
     595            bool done = false; 
    594596            for( i = 0; i < confsize; i++ ) 
    595597            { 
     
    602604                switch( p_items[i].i_type ) 
    603605                { 
     606                    case CONFIG_CATEGORY: 
     607                        if(!in_right_category && p_items[i].value.i == i_object_category) 
     608                            in_right_category = true; 
     609                        else if(in_right_category) 
     610                            done = true; 
     611                        break; 
    604612                    case CONFIG_SUBCATEGORY: 
    605                     case CONFIG_CATEGORY: 
     613                        if(!in_right_category && p_items[i].value.i == i_object_category) 
     614                        { 
     615                            in_right_category = true; 
     616                            in_subcategory = true; 
     617                        } 
     618                        else if(in_right_category && in_subcategory) 
     619                            done = true; 
     620                        break; 
    606621                    case CONFIG_SECTION: 
    607622                    case CONFIG_HINT_USAGE: 
     
    609624                    default: 
    610625                    { 
     626                        if(!in_right_category) break; 
     627 
    611628                        VLCConfigControl *o_control = nil; 
    612629                        o_control = [VLCConfigControl newControl:&p_items[i] 
     
    621638                    } 
    622639                } 
     640                if( done ) break; 
    623641            } 
    624642            vlc_object_release( (vlc_object_t*)p_main_module );