[Adium-devl] Importer API

Peter Hosey boredzo at gmail.com
Thu Apr 12 20:07:59 UTC 2007


On Apr 12, 2007, at 09:07:20, Graham Booker wrote:
> Also, I liked Peter's suggestion of using a temp dir for the log  
> import, so that is added too.

That was an implementation suggestion, not an API suggestion. There  
is no reason for the caller to specify a directory.

At most, there should be a class method that subclasses of AIImporter  
can use to obtain a temporary directory path.

> /*
>  * Sets the current progress for a progress bar
>  * @param current the log number just imported
>  * @param total the total number of logs
>  */
> - (void)importedLog:(int)current of:(int)total;

Problem 1: Use of signed ints for values that can never be negative.
Solution 1: s/int/unsigned/

Problem 2: There can be more logs than an int (signed or not) can count.
Solution 2: s/int|unsigned/unsigned long long/

Problem 3: Non-standard naming.
Solution 3a: s/importedLog:\(int\)current/importer:(AIImporter *) 
importer didLog:(unsigned long long)current
Solution 3b: What Brian said.
___________________________________
\ Peter Hosey / boredzo at adiumx.com
PGP public key ID: C6550423 (since 2007-01-01)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
URL: <http://adium.im/pipermail/devel_adium.im/attachments/20070412/15c0fb62/attachment.sig>


More information about the devel mailing list