comparison mac/dw.m @ 1704:873304f581be

Fix Unicode issues with the directory browser on Windows. Fix a hang with the directory browser on Mac when passing an empty string.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 05 May 2012 06:48:40 +0000
parents e19b93a8229b
children 3fa0448d3a7e
comparison
equal deleted inserted replaced
1703:043db6b221c2 1704:873304f581be
3206 DW_LOCAL_POOL_IN; 3206 DW_LOCAL_POOL_IN;
3207 3207
3208 /* Figure out path information... 3208 /* Figure out path information...
3209 * These functions are only support in Snow Leopard and later... 3209 * These functions are only support in Snow Leopard and later...
3210 */ 3210 */
3211 if(defpath && DWOSMinor > 5) 3211 if(defpath && *defpath && DWOSMinor > 5)
3212 { 3212 {
3213 struct stat buf; 3213 struct stat buf;
3214 3214
3215 /* Get an absolute path */ 3215 /* Get an absolute path */
3216 if(!realpath(defpath, temp)) 3216 if(!realpath(defpath, temp))
3271 [openDlg setCanChooseFiles:NO]; 3271 [openDlg setCanChooseFiles:NO];
3272 [openDlg setCanChooseDirectories:YES]; 3272 [openDlg setCanChooseDirectories:YES];
3273 } 3273 }
3274 3274
3275 /* Handle file types */ 3275 /* Handle file types */
3276 if(ext) 3276 if(ext && *ext)
3277 { 3277 {
3278 NSArray* fileTypes = [[[NSArray alloc] initWithObjects:[NSString stringWithUTF8String:ext], nil] autorelease]; 3278 NSArray* fileTypes = [[[NSArray alloc] initWithObjects:[NSString stringWithUTF8String:ext], nil] autorelease];
3279 [openDlg setAllowedFileTypes:fileTypes]; 3279 [openDlg setAllowedFileTypes:fileTypes];
3280 } 3280 }
3281 3281
3312 3312
3313 /* Enable the creation of directories in the dialog. */ 3313 /* Enable the creation of directories in the dialog. */
3314 [saveDlg setCanCreateDirectories:YES]; 3314 [saveDlg setCanCreateDirectories:YES];
3315 3315
3316 /* Handle file types */ 3316 /* Handle file types */
3317 if(ext) 3317 if(ext && *ext)
3318 { 3318 {
3319 NSArray* fileTypes = [[[NSArray alloc] initWithObjects:[NSString stringWithUTF8String:ext], nil] autorelease]; 3319 NSArray* fileTypes = [[[NSArray alloc] initWithObjects:[NSString stringWithUTF8String:ext], nil] autorelease];
3320 [saveDlg setAllowedFileTypes:fileTypes]; 3320 [saveDlg setAllowedFileTypes:fileTypes];
3321 } 3321 }
3322 3322