QCString construction

Ingo Klöcker kloecker at kde.org
Sun Feb 11 22:18:49 CET 2007


On Saturday 10 February 2007 02:16, David Faure wrote:
> This leads me to 3 patches.
>
> One for kmail, I wrote a utility function for creating a QCString
> from char*+size, and used that when creating a QCString from a
> DwString where it matters (i.e. where I found pretty large strings to
> be used when attaching large files).

The related changes look good. I'm just wondering why you didn't add
  QCString CString( const DwString & str )
instead of (or additionally to)
  QCString CString( const char* str, size_t strLen )
?

This would allow us to do
-  return asDwString().c_str();
+  return KMail::Util::CString( asDwString() );
instead of
-  return asDwString().c_str();
+  const DwString& asString = asDwString();
+  return KMail::Util::CString( asString.c_str(), asString.length() );

> Can a kmail developer review the change to KMMessage::asString() and
> asSendableString(), too? It avoids a asString() (Assemble) and a
> fromString (Parse), but I hope it's doing the right thing.

I am very uneasy about those changes because completely different things 
happen when you copy a message and when you create a message from a 
string. If we had unit tests... But as it stands I'm against those 
changes.

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-optimize/attachments/20070211/4f08348d/attachment.pgp 


More information about the Kde-optimize mailing list