Bug 3673

Summary: GW: Add QBuffer::setBuffer(QByteArray) support to KWQBuffer
Product: WebKit Reporter: Eric Seidel (no email) <eric>
Component: New BugsAssignee: Dave Hyatt <hyatt>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P3    
Version: 412   
Hardware: Mac   
OS: OS X 10.4   
Bug Depends on:    
Bug Blocks: 3250    
Attachments:
Description Flags
Adds setBuffer() support and a QByteArray based constructor
darin: review-
Formatting oversights now fixed.
darin: review-
Fixed QByteArray & darin: review+

Description Eric Seidel (no email) 2005-06-23 02:56:26 PDT
Adds QBuffer::setBuffer(QByteArray) support to KWQBuffer
also adds QBuffer(QByteArray) constructor.

The only thing I'm not sure about in this patch is the "open" state after setBuffer.  However, I'm also pretty 
sure that it doesn't matter... at least for this minimalist implementation of QBuffer.  Again code has been 
tested locally and does not affect the rest of WebKit.
Comment 1 Eric Seidel (no email) 2005-06-23 02:58:21 PDT
Created attachment 2577 [details]
Adds setBuffer() support and a QByteArray based constructor
Comment 2 Darin Adler 2005-06-23 07:14:47 PDT
Comment on attachment 2577 [details]
Adds setBuffer() support and a QByteArray based constructor

Formatting of QBuffer::setBuffer does not match our coding guidelines. The "{"
should be on the line after the declaration, not on the same line. Also, the
"if (isOpen()) return false;" should be broken into two lines rather than
together on one.

Other than the coding guidelines issue, this looks great.
Comment 3 Eric Seidel (no email) 2005-06-23 09:23:35 PDT
Created attachment 2589 [details]
Formatting oversights now fixed.
Comment 4 Darin Adler 2005-06-23 10:01:40 PDT
Comment on attachment 2589 [details]
Formatting oversights now fixed.

The parameter to the QBuffer constructor should be QByteArray, not QByteArray
&, to match Qt.

If it's going to be a reference, then I suggest that we make it const
QByteArray & and do the same with the parameter to setBuffer.

Otherwise, looks good.
Comment 5 Eric Seidel (no email) 2005-06-23 12:55:22 PDT
Created attachment 2606 [details]
Fixed QByteArray &
Comment 6 Darin Adler 2005-06-23 22:58:06 PDT
Comment on attachment 2606 [details]
Fixed QByteArray &

r=me