Re: Custom icon for mounted disk being ignored
Re: Custom icon for mounted disk being ignored
- Subject: Re: Custom icon for mounted disk being ignored
- From: Alexander von Below <email@hidden>
- Date: Wed, 2 Nov 2005 19:21:30 +0100
You have to set the Custom Folder flag using the Carbon Interfaces:
result = FSPathMakeRef((UInt8*)[someNSStringPath cString], &fsRef,
&isDir);
if (result != noErr)
return result;
result = FSGetCatalogInfo(&fsRef, kFSCatInfoFinderInfo,
&catalogInfo, NULL, NULL, NULL);
if (result != noErr)
return result;
fInfo = (FInfo*)&catalogInfo.finderInfo;
fInfo->fdFlags |= kHasCustomIcon;
result = FSSetCatalogInfo(&fsRef, kFSCatInfoFinderInfo, &catalogInfo);
[[NSWorkspace sharedWorkspace] noteFileSystemChanged:
someNSStringPath];
Am 02.11.2005 um 18:47 schrieb Brad Peterson:
Hi all,
Is there a special trick to creating/specifying a
.VolumeIcon.icns file for a mounted storage card? My
application stores (or has the option to store) some
data on a flash, SD, etc. card.
However, once I detect it, I copy over one of our
icons to the card's .VolumeIcon.icns file. However,
Finder seems to ignore it. Now, usually, I know you
can do this with DMG files, and it seems that the
iPods do this as well.
Any ideas on why it wouldn't work? The source and
copied icns file are both valid, and I've ejected and
re-mounted the disk several times, to no avail. The
code itself is working, and very simple:
if ([[[self imagePath] lowercaseString]
hasSuffix:@".icns"]){ //if you have an icon
[[NSFileManager defaultManager] copyPath: [self
imagePath] toPath: path handler: nil];
}
Thanks!
__________________________________
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden