Godzil / theunarchiver

Automatically exported from code.google.com/p/theunarchiver
Other
0 stars 0 forks source link

Icons for standard folders #606

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When you select a folder for extracting in the preferences window, only some 
folders display the right icon. This patch adds the icons for User folder, 
Desktop, Documents and Public.

Original issue reported on code.google.com by jaimem...@gmail.com on 14 Dec 2012 at 7:17

Attachments:

GoogleCodeExporter commented 8 years ago
This is probably be a good idea, but I'd really prefer to only implement it if 
it can correctly copy all of the Finder behavior. Otherwise it will just seem 
inconsistent.

Is there some way to get a hold of the missing icons?

Original comment by paracel...@gmail.com on 15 Dec 2012 at 9:23

GoogleCodeExporter commented 8 years ago
I've been searching but for the rest of folders there are some constants 
defined in Folders.h, but I haven't managed to get the icons with them. The 
only method I've found is to initialize the icons with a path, the pictures 
folder will be then: icon=[[NSImage alloc] 
initWithContentsOfFile:@"/System/Library/CoreServices/CoreTypes.bundle/Contents/
Resources/PicturesFolderIcon.icns"];.
But there should be some way to do it, because in Automator or Skype the folder 
icons are the correct.

Original comment by jaimem...@gmail.com on 16 Dec 2012 at 10:54

GoogleCodeExporter commented 8 years ago
Since I haven't found any reference on other ways for getting the rest of 
icons, I have added the rest by looking on the path I mentioned.
If there's any icon missing,  I'll add them.

Original comment by jaimem...@gmail.com on 20 Dec 2012 at 8:31

Attachments:

GoogleCodeExporter commented 8 years ago
Are those accessible while sandboxed? I guess they are.

Also, maybe it woud make sense to grab them all by path to simplify the code.

I'll look into merging it later. I already submitted 3.6 for review so unless 
it's a boomerang, it'll have to wait until 3.7 anyway.

Original comment by paracel...@gmail.com on 20 Dec 2012 at 9:07

GoogleCodeExporter commented 8 years ago
I don't know about the sandbox, I tested with the entitlements set and there is 
no problem.
The only problem could be for older OS X versions, the folder could be in other 
place, for example I have check it on 10.3.9 and instead of CoreTypes.bundle 
they are located in SystemIcons.bundle, I don't know in which version it was 
changed.

Original comment by jaimem...@gmail.com on 20 Dec 2012 at 9:29

GoogleCodeExporter commented 8 years ago
FINALLY got around to rewriting this patch to use only CoreTypes and no HFS 
types, and applied it. For older versions, it'll fall back on NSWorkspace 
anyway so that will be good enough. Fixed!

Original comment by paracel...@gmail.com on 26 Sep 2013 at 6:16