[Kde-pim] rfcdecoder move to lib?

Ingo Klöcker kloecker at kde.org
Wed Feb 7 22:35:42 GMT 2007


On Wednesday 07 February 2007 10:47, Tom Albers wrote:
> At Tuesday 06 February 2007 23:55, you wrote:
> > > And to you all, is that ok with you to move it to kdepimlibs and
> > > where should it go? kdepimlibs/emailfunctions is a candidate but
> > > that's a bit general for this specific imap lib.
> >
> > kdepimlibs/kmime would be more appropriate. At least for the RFC
> > 2047/2231 codecs. But doesn't kmime already include such decoders?
>
> Yes, for me the primary reason is the fromImap and toImap functions,
> which should be renamed to encodeImapFolderName() and
> decodeImapFolderName(). This is used the correctly encode umlauts &
> co in the communication to the IMAP-server. So it has little to do
> with kmime.

So something like kdepimlibs/libimap would be more appropriate. I guess 
over time there will be more imap-related code that you would want to 
share with the imap4 ioslave.

> > > Are there any other copyright holders? svn log mentions several
> > > people, but that's all due to porting or tiny fixes I think.
> >
> > Also the code needs to be cleaned up. For example, the decoding
> > methods should take QByteArray arguments and the encoding methods
> > should return QByteArray. After all RFC 2047 and RFC 2231 encoded
> > strings are ASCII.
> >
> > And looking at (which is just a random code snippet I saw when
> > glancing over the code)
> >   signed char *latin = (signed char *) calloc (1, _str.length () +
> > 1); char *latin_us = (char *) latin;
> >   strcpy (latin_us, _str.toLatin1 ());
> > makes me cringe.
>
> Not sure if that's in the functions I'm using, but this kind of code
> is far beyond my knowledge, so if it needs to be cleaned up we need a
> volunteer for that.

It's basically equivalent to
  QByteArray latin_us_array( _str.toLatin1() );
  char *latin_us = latin_us_array.data();
  signed char *latin = (signed char *) latin_us;
which I hope is more understandable to you. If that's the case, then 
I've made my point. Apart from using evil functions like calloc() and 
strcpy() the code isn't really easy to understand for C++ and Qt 
hackers without a background in low-level C programming.

Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20070207/ae6984c7/attachment.sig>
-------------- next part --------------
_______________________________________________
kde-pim mailing list
kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/


More information about the kde-pim mailing list