winemac.drv: Improved App name on windows and menus (Mac Driver)

Vitor Marques vitor251093 at gmail.com
Thu Jun 11 07:03:35 CDT 2015


Explaining it further:
- !bundleName returns true if the bundleName pointer is null, and that
would attribute "Wine" then. If false, there is a string, so it would look
at the next condition.
- [bundleName lenght] returns an int with the length of the string, and !
turn 0 into 1 (true) and any other number into 0 (false). So ![bundleName
lenght] will return true only if it's an empty string (""), and that would
also attribute "Wine".

Em 8h53 Qui, 11/06/2015, Vitor Marques <vitor251093 at gmail.com> escreveu:

> Yes it is. You see, ![bundleName lenght] return true if the bundleName
> string has size 0. It was even in the original code if you scroll down a
> bit (just without the !).
>
> Em 5h46 Qui, 11/06/2015, Huw Davies <huw at codeweavers.com> escreveu:
>
>> On Wed, Jun 10, 2015 at 11:48:35AM -0300, Vitor Marques wrote:
>> > Although I have not tested, the changes are simple enough
>> > to be analyzed in sight.
>>
>> Indeed they are, see below.  You really do need to test your patches.
>> And yes, gmail messed up the whitespace.
>>
>> > diff --git a/dlls/winemac.drv/cocoa_app.m b/dlls/winemac.drv/cocoa_app.m
>> > index 82925c8..a9d98c6 100644
>> > --- a/dlls/winemac.drv/cocoa_app.m
>> > +++ b/dlls/winemac.drv/cocoa_app.m
>> > @@ -214,14 +214,14 @@ - (void) transformProcessToForeground
>> >
>> >              mainMenu = [[[NSMenu alloc] init] autorelease];
>> >
>> > -            // Application menu
>> > -            submenu = [[[NSMenu alloc] initWithTitle:@"Wine"]
>> autorelease];
>> > +            // Application name
>> >              bundleName = [[NSBundle mainBundle]
>> objectForInfoDictionaryKey:(NSString*)kCFBundleNameKey];
>> > +            if (!bundleName || ![bundleName lenght]) bundleName =
>> @"Wine";
>>
>> "lenght" is not what you want here.
>>
>> Huw.
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20150611/167f3ffa/attachment.html>


More information about the wine-devel mailing list