[Kde-pim] [patch] korganizer - printing calendar item recurrence

Ingo Klöcker kloecker at kde.org
Tue Sep 2 22:18:47 BST 2008


On Tuesday 02 September 2008, Allen Winter wrote:
> On Sunday 31 August 2008 11:00:15 Ron Goodheart wrote:
> > > Date: Thu, 21 Aug 2008 22:18:50 -0700
> > > From: "Ron Goodheart" <ron.goodheart at gmail.com>
> > > Subject: [Kde-pim] [patch] korganizer - printing calendar item
> > >        recurrence
> > > To: kde-pim <kde-pim at kde.org>
> > >
> > > HI all,
> > > Got the following on my printout when printing my scheduled event
> > > on korganizer. "Repeat: TODO: Convert Repeat to String!"
> > >
> > > So created the attached patch to print the recurrence
> > > information.
>
> Committed.
>
> I mostly used what you had.  I replaced the STL ::push_back() style
> stuff with the plain old << operator.

IMO QList::push_back() (or QList::append()) is preferable to 
QList::operator<<(). Why? Well, what does the following do?

  const QVariantList a;
  QVariantList b;
  b << a;

Note that QVariantList is a typedef for QList<QVariant> and that there 
are two overloads of QList::operator<<():
  QList<T> & operator<< ( const QList<T> & other ) 
  QList<T> & operator<< ( const T & value )

So, is the above equivalent to
  b.push_back( a );
or is it equivalent to
  b = b + a;
or does it probably fail to compile?

Solution: It is equivalent to
  b = b + a;


Funny enough in Qt 3 it was equivalent to
  b.push_back( a );
because QValueList did have only one variant of operator<<(), namely
  QValueList<T> & operator<< ( const T & x )

What a great way to shoot yourself in the foot when you port Qt 3 code 
to Qt 4. All of the sudden you have flat variant lists instead of a 
nested ones.


So, that's why I prefer the explicit push_back() or append() over the 
sometimes ambiguous operator<<() (except for ad-hoc creation of lists 
as in someMethod( QStringList() << "foo" << "bar" )).


Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20080902/699091ee/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