]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/prefs_widgets.m
Removes trailing spaces. Removes tabs.
[vlc] / modules / gui / macosx / prefs_widgets.m
index 1092cf092e872a9c75710668d220abbd5daadce4..62c2ab1e5fea74ce13567b1e21885272f8a992fb 100644 (file)
@@ -11,7 +11,7 @@
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -38,7 +38,7 @@
 #define OFFSET_RIGHT 20
 #define OFFSET_BETWEEN 2
 
-#define UPWARDS_WHITE_ARROW                 "\xE2\x87\xA7" 
+#define UPWARDS_WHITE_ARROW                 "\xE2\x87\xA7"
 #define OPTION_KEY                          "\xE2\x8C\xA5"
 #define UP_ARROWHEAD                        "\xE2\x8C\x83"
 #define PLACE_OF_INTEREST_SIGN              "\xE2\x8C\x98"
             [[VLCMain sharedInstance]
                 localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP];
         if( p_item->value.psz )
-            o_textfieldString = [[VLCMain sharedInstance]
-                                    localizedString: (char *)p_item->value.psz];
+            o_textfieldString = [NSString stringWithFormat: @"%s", (char *)p_item->value.psz];
         else
             o_textfieldString = [NSString stringWithString: @""];
         ADD_TEXTFIELD( o_textfield, mainFrame, 12, 2, mainFrame.size.width -
         types:nil
         modalForWindow:[sender window]
         modalDelegate: self
-        didEndSelector: @selector(pathChosenInPanel: 
+        didEndSelector: @selector(pathChosenInPanel:
                         withReturn:
                         contextInfo:)
         contextInfo: nil];
         int i_index;
         vlc_list_t *p_list;
         module_t *p_parser;
-        module_config_t *p_end;
         i_view_type = CONFIG_ITEM_MODULE;
 
         /* add the label */
         for( i_index = 0; i_index < p_list->i_count; i_index++ )
         {
             p_parser = (module_t *)p_list->p_values[i_index].p_object;
-            p_end = p_item + p_parser->confsize;
+
             if( p_item->i_type == CONFIG_ITEM_MODULE )
             {
                 if( !strcmp( p_parser->psz_capability,
             }
             else
             {
-                module_config_t *p_config;
+                int i;
+
                 if( !strcmp( p_parser->psz_object_name, "main" ) )
-                      continue;
+                    continue;
 
-                p_config = p_parser->p_config;
-                if( p_config ) do
+                for ( i = 0; i < p_parser->confsize; i++ )
                 {
+                    module_config_t *p_config = p_parser->p_config + i;
                     /* Hack: required subcategory is stored in i_min */
                     if( p_config->i_type == CONFIG_SUBCATEGORY &&
                         p_config->value.i == p_item->min.i )
                                                 p_parser->psz_object_name) )
                             [o_popup selectItem:[o_popup lastItem]];
                     }
-                } while( p_item < p_end && p_config++ );
+                }
             }
         }
         vlc_list_release( p_list );
 {
     NSString *newval = [o_popup titleOfSelectedItem];
     char *returnval = NULL;
-    int i_index;
+    int i_module_index;
     vlc_list_t *p_list;
     module_t *p_parser;
-    module_config_t *p_end;
 
     p_list = vlc_list_find( VLCIntf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
-    for( i_index = 0; i_index < p_list->i_count; i_index++ )
+    for( i_module_index = 0; i_module_index < p_list->i_count; i_module_index++ )
     {
-        p_parser = (module_t *)p_list->p_values[i_index].p_object;
-         p_end = p_item + p_parser->confsize;
+        p_parser = (module_t *)p_list->p_values[i_module_index].p_object;
+
         if( p_item->i_type == CONFIG_ITEM_MODULE )
         {
             if( !strcmp( p_parser->psz_capability,
         }
         else
         {
-            module_config_t *p_config;
+            int i;
+
             if( !strcmp( p_parser->psz_object_name, "main" ) )
-                  continue;
+                continue;
 
-            p_config = p_parser->p_config;
-            if( p_config ) do
+            for ( i = 0; i < p_parser->confsize; i++ )
             {
+                module_config_t *p_config = p_parser->p_config + i;
                 /* Hack: required subcategory is stored in i_min */
                 if( p_config->i_type == CONFIG_SUBCATEGORY &&
                     p_config->value.i == p_item->min.i )
                         break;
                     }
                 }
-            } while( p_item < p_end && p_config++ );
+            }
         }
     }
     vlc_list_release( p_list );
            withView: (NSView *)o_parent_view
 {
     NSRect mainFrame = [o_parent_view frame];
-    NSString *o_labelString, *o_tooltip, *o_textfieldString;
+    NSString *o_labelString, *o_tooltip;
     mainFrame.size.height = 23;
     mainFrame.size.width = mainFrame.size.width - LEFTMARGIN - RIGHTMARGIN + 1;
     mainFrame.origin.x = LEFTMARGIN;
         [o_stepper setAutoresizingMask:NSViewMaxXMargin ];
         [self addSubview: o_stepper];
 
-        /* build the textfield */
-        if( p_item->value.psz )
-            o_textfieldString = [[VLCMain sharedInstance]
-                                    localizedString: (char *)p_item->value.psz];
-        else
-            o_textfieldString = [NSString stringWithString: @""];
         ADD_TEXTFIELD( o_textfield, mainFrame, mainFrame.size.width - 19 - 52,
             1, 49, o_tooltip, @"" )
         [o_textfield setIntValue: p_item->value.i];
            withView: (NSView *)o_parent_view
 {
     NSRect mainFrame = [o_parent_view frame];
-    NSString *o_labelString, *o_tooltip, *o_textfieldString;
+    NSString *o_labelString, *o_tooltip;
     mainFrame.size.height = 23;
     mainFrame.size.width = mainFrame.size.width - LEFTMARGIN - RIGHTMARGIN + 1;
     mainFrame.origin.x = LEFTMARGIN;
         [self addSubview: o_stepper];
 
         /* build the textfield */
-        if( p_item->value.psz )
-            o_textfieldString = [[VLCMain sharedInstance]
-                                    localizedString: (char *)p_item->value.psz];
-        else
-            o_textfieldString = [NSString stringWithString: @""];
         ADD_TEXTFIELD( o_textfield, mainFrame, mainFrame.size.width - 19 - 52,
             1, 49, o_tooltip, @"" )
         [o_textfield setFloatValue: p_item->value.f];
@@ -2060,27 +2048,27 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
 //Fill our array to know how may items we have...
     vlc_list_t *p_list;
     module_t *p_parser;
-    module_config_t *p_end;
-    int i_index;
+    int i_module_index;
     NSRect mainFrame = [o_parent_view frame];
     NSString *o_labelString, *o_textfieldString, *o_tooltip;
 
     o_modulearray = [[NSMutableArray alloc] initWithCapacity:10];
     /* build a list of available modules */
     p_list = vlc_list_find( VLCIntf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
-    for( i_index = 0; i_index < p_list->i_count; i_index++ )
+    for( i_module_index = 0; i_module_index < p_list->i_count; i_module_index++ )
     {
-        p_parser = (module_t *)p_list->p_values[i_index].p_object;
-        p_end = p_item + p_parser->confsize;
+        int i;
+        p_parser = (module_t *)p_list->p_values[i_module_index].p_object;
 
         if( !strcmp( p_parser->psz_object_name, "main" ) )
             continue;
 
-        module_config_t *p_config = p_parser->p_config;
-        if( p_config ) do
+        for ( i = 0; i < p_parser->confsize; i++ )
         {
+            module_config_t *p_config = p_parser->p_config + i;
             NSString *o_modulelongname, *o_modulename;
             NSNumber *o_moduleenabled = nil;
+
             /* Hack: required subcategory is stored in i_min */
             if( p_config->i_type == CONFIG_SUBCATEGORY &&
                 p_config->value.i == _p_item->min.i )
@@ -2100,7 +2088,7 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
                     arrayWithObjects: o_modulename, o_modulelongname,
                     o_moduleenabled, nil]];
             }
-        } while( p_item < p_end && p_config++ );
+        }
     }
     vlc_list_release( p_list );
 
@@ -2227,7 +2215,7 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
 
 - (char *)stringValue
 {
-    return strdup( [[o_textfield stringValue] cString] );
+    return strdup( [[o_textfield stringValue] UTF8String] );
 }
 
 @end