[prev in list] [next in list] [prev in thread] [next in thread]
List: kmail-devel
Subject: Re: Abstracting date handling.
From: Marc Mutz <Marc.Mutz () uni-bielefeld ! de>
Date: 2002-03-30 14:31:47
[Download RAW message or body]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Saturday 30 March 2002 12:36, Zack Rusin wrote:
<snip>
> c) what I don't like about it and you may just as well
<snip>
> - it's not commit ready, it introduces klocale dependency on
> kmime_util.h
That's no problem.
> and mixing kmime with mimelib in some of those files feels
> pretty weird,
No. That's exactly how it should be done ;-) KMime will creep in in small
steps and eventually replace mimelib's functionality completely.
> which is why we probably should wait till the merger with
> the Aegypten branch is done, besides this is not exactly a tiny patch,
<snip>
Well, you can put the DateFormatter class into libkdenetwork right away. Write
a test program in libkdenetwork/tests and wait for the Merger if you so want
before actually using it in KMail. In the meantime, you could make KNode use
it ;-)
Now on to the design and features:
- - Please make the now KMime-NS-global functions static members of
DateFormatter,
- - use the "mVar" naming convention for data members,
- - include header files in order of increasing generality (ie.:
kmime,libkdenetwork,kde,qt,stdlib),
- - don't use a pointer to QDateTime as member var, use QDateTime directly (or a
time_t only)
- - Why do you hold a pointer to a KLocale? I don't see a point in using
anything than KGlobal::locale().
- - with the above two, you also don't need to disable copying.
- - overload the dateString method to take time_t, as well as QDateTime args.
- - add a method that returns a rfc2822-formatted date as QCString, so we can
use it later to construct headers in KMime.
- - don't allow access to the individual formats: The usage should be something
like:
DateFormatter f( config->readNumEntry("...", DateFormatter::Fancy ) );
QString dateStr = f.dateString( QDateTime::currentDateTime() );
or with the static convenience function
QString dateStr = DateFormatter::formatDate( DateFormatter::Fancy,
QDateTime::currentDateTime() );
or
QString dateStr = DateFormatter::formatCurrentDate( DateFormatter::Fancy );
If you have fun with this, you can also implement the "customized" format,
where the user can create his own format (also a wishlist item).
Sorry for so much criticism :-(
Marc
- --
Marc Mutz <mutz@kde.org>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD4DBQE8pcxT3oWD+L2/6DgRAixnAJiqZ0OwdoMmz+rlGI1jaibvIQugAJ9tuswm
ulizKiXLfm31uqrUuiUA1Q==
=5P0s
-----END PGP SIGNATURE-----
_______________________________________________
KMail Developers mailing list
kmail@mail.kde.org
http://mail.kde.org/mailman/listinfo/kmail
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic