On Wed, Jul 16, 2014 at 2:43 PM, Sergey Starosek <[email protected]> wrote: > Tomaz, > > On Wed, Jul 16, 2014 at 8:49 PM, Tomaz Canabrava <[email protected]> wrote: >> >> const QString& so we don't need to copy that. :) > > > Can you please clarify on this?
Sure. +QString getDateFormat(); should be const QString& getDateFormat(); because if you do QString getDateFormat(), each time that this is called a copy of the QString is created to be returned, but when you use the & a reference to the already - existing - variable is send (much like a de-referenced pointer ) the const is just to be safe and not modify it's contents. :) Tomaz > Sergey > > > _______________________________________________ > subsurface mailing list > [email protected] > http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface > _______________________________________________ subsurface mailing list [email protected] http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
