Author: rmottola Date: Thu Mar 10 23:59:46 2016 New Revision: 39525 URL: http://svn.gna.org/viewcvs/gnustep?rev=39525&view=rev Log: Always traverse links explicitely and get the original path to do icon lookup, not just for Symliks. The symlink may be infact in the middle of the path, not just the last one
Modified: libs/gui/trunk/ChangeLog libs/gui/trunk/Source/NSWorkspace.m Modified: libs/gui/trunk/ChangeLog URL: http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/ChangeLog?rev=39525&r1=39524&r2=39525&view=diff ============================================================================== --- libs/gui/trunk/ChangeLog (original) +++ libs/gui/trunk/ChangeLog Thu Mar 10 23:59:46 2016 @@ -1,3 +1,8 @@ +2016-03-10 Riccardo Mottola <r...@gnu.org> + + * Source/NSWorkspace.m + Always traverse links explicitely and get the original path to do icon lookup, not just for Symliks. The symlink may be infact in the middle of the path, not just the last one. + 2016-03-10 Riccardo Mottola <r...@gnu.org> * Source/NSWorkspace.m Modified: libs/gui/trunk/Source/NSWorkspace.m URL: http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/NSWorkspace.m?rev=39525&r1=39524&r2=39525&view=diff ============================================================================== --- libs/gui/trunk/Source/NSWorkspace.m (original) +++ libs/gui/trunk/Source/NSWorkspace.m Thu Mar 10 23:59:46 2016 @@ -1384,23 +1384,17 @@ NSDictionary *attributes; NSString *fileType; - attributes = [mgr fileAttributesAtPath: fullPath traverseLink: NO]; - fileType = [attributes fileType]; - /* If we have a symobolic link, get not only the original path attributes, but also the original path, to resolve the correct icon. mac resolves the original icon */ - if ([fileType isEqual: NSFileTypeSymbolicLink] == YES) - { - fullPath = [fullPath stringByResolvingSymlinksInPath]; - - /* now we reget the target attributes */ - attributes = [mgr fileAttributesAtPath: fullPath traverseLink: NO]; - fileType = [attributes fileType]; - } - + fullPath = [fullPath stringByResolvingSymlinksInPath]; + + /* now we get the target attributes of the traversed link */ + attributes = [mgr fileAttributesAtPath: fullPath traverseLink: NO]; + fileType = [attributes fileType]; + if ([fileType isEqual: NSFileTypeDirectory] == YES) { NSString *iconPath = nil; _______________________________________________ Gnustep-cvs mailing list Gnustep-cvs@gna.org https://mail.gna.org/listinfo/gnustep-cvs