Today's lesson in not using Apple's private methods: somewhere between old/886f95f00431 and #9620 Apple changed their document icon setup process. Use the new methods and fix #9620.
(transplanted from 5cf365ce9352d25978ffd6073d3bc07573aba518)
/*
* Adium is the legal property of its developers, whose names are listed in the copyright file included
* with this source distribution.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU
* General Public License as published by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program; if not,
* write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* Called by either ESFileTransferRequestPromptController or self, this method is the last step in accepting or
* refusing a request to be sent a file.
*
* @param fileTransfer The file transfer in question
* @param localFilename Full path at which to save the file. If anything exists at this path it will be overwritten without further confirmation. Pass nil to deny the transfer.
format=AILocalizedString(@"%@ requests to send you %@","A person is wanting to send you a file. The first %@ is a name; the second %@ is the filename of the file being sent.");
format=AILocalizedString(@"Offering to send %@ to %@","You are offering to send a file to a remote user. The first %@ is the filename of the file being sent; the second %@ is the recipient of the file being sent.");
format=AILocalizedString(@"%@ began sending you %@","A person began sending you a file. The first %@ is a name; the second %@ is the filename of the file being sent.");
}else{
format=AILocalizedString(@"%@ began receiving %@","A person began receiving a file from you. The first %@ is the recipient of the file; the second %@ is the filename of the file being sent.");
format=AILocalizedString(@"%@ cancelled the transfer of %@","The other contact cancelled a file transfer in progress. The first %@ is the recipient of the file; the second %@ is the filename of the file being sent.");
ret=[NSStringstringWithFormat:AILocalizedString(@"%llu of %llu bytes","file sizes both measured in bytes"),inSize,totalSize];
}else{
ret=[NSStringstringWithFormat:AILocalizedString(@"%llu bytes of %@","file size measured in bytes out of some other measurement"),inSize,totalSizeString];
}
}elseif(inSize>=1024.&&inSize<pow(1024.,2.)){
if(totalSize>=1024.&&totalSize<pow(1024.,2.)){
ret=[NSStringstringWithFormat:AILocalizedString(@"%.1f of %.1f KB","file sizes both measured in kilobytes"),(inSize/1024.),(totalSize/1024.)];
}else{
ret=[NSStringstringWithFormat:AILocalizedString(@"%.1f KB of %@","file size measured in kilobytes out of some other measurement"),(inSize/1024.),totalSizeString];
ret=[NSStringstringWithFormat:AILocalizedString(@"%.2f of %.2f MB","file sizes both measured in megabytes"),(inSize/pow(1024.,2.)),(totalSize/pow(1024.,2.))];
}else{
ret=[NSStringstringWithFormat:AILocalizedString(@"%.2f MB of %@","file size measured in megabytes out of some other measurement"),(inSize/pow(1024.,2.)),totalSizeString];
ret=[NSStringstringWithFormat:AILocalizedString(@"%.3f of %.3f GB","file sizes both measured in gigabytes"),(inSize/pow(1024.,3.)),(totalSize/pow(1024.,3.))];
}else{
ret=[NSStringstringWithFormat:AILocalizedString(@"%.3f GB of %@","file size measured in gigabytes out of some other measurement"),(inSize/pow(1024.,3.)),totalSizeString];
}
}
elseif(inSize>=pow(1024.,4.)){
if(totalSize>=pow(1024.,4.)){
ret=[NSStringstringWithFormat:AILocalizedString(@"%.4f of %.4f TB","file sizes both measured in terabytes"),(inSize/pow(1024.,4.)),(totalSize/pow(1024.,4.))];
}else{
ret=[NSStringstringWithFormat:AILocalizedString(@"%.4f TB of %@","file size measured in terabytes out of some other measurement"),(inSize/pow(1024.,4.)),totalSizeString];