Commit f31ea498 authored by David's avatar David
Browse files

macosx: Simplify usage of toNSStr and _NS

Both correctly check for NULL char* already.
parent cb19b8d8
......@@ -935,10 +935,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
[self addSubview: self.label];
/* build the textfield */
if (p_item->value.psz)
o_textfieldString = toNSStr(p_item->value.psz);
else
o_textfieldString = @"";
o_textfieldString = toNSStr(p_item->value.psz);
if (p_item->i_type == CONFIG_ITEM_PASSWORD) {
ADD_SECURETEXTFIELD(o_textfield, mainFrame, [self.label frame].size.width + 2,
0, mainFrame.size.width - [self.label frame].size.width -
......@@ -1126,10 +1123,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
[self addSubview: o_button];
/* build the textfield */
if (p_item->value.psz)
o_textfieldString = [NSString stringWithFormat: @"%s", (char *)p_item->value.psz];
else
o_textfieldString = @"";
o_textfieldString = toNSStr(p_item->value.psz);
ADD_TEXTFIELD(o_textfield, mainFrame, 12, 2, mainFrame.size.width -
8 - [o_button frame].size.width,
o_itemTooltip, o_textfieldString)
......@@ -2099,10 +2093,7 @@ o_moduleenabled = [NSNumber numberWithBool:NO];\
[self addSubview: self.label];
/* build the textfield */
if (p_item->value.psz)
o_textfieldString = _NS(p_item->value.psz);
else
o_textfieldString = @"";
o_textfieldString = _NS(p_item->value.psz);
ADD_TEXTFIELD(o_textfield, mainFrame, [self.label frame].size.width + 2,
mainFrame.size.height - 22, mainFrame.size.width -
[self.label frame].size.width - 2, toolTip, o_textfieldString)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment