|
|
@ -865,16 +865,16 @@ void MyMoneyStorageXML::signalProgress(int current, int total, const TQString& m
|
|
|
|
atEnd() status in certain circumstances which caused our
|
|
|
|
atEnd() status in certain circumstances which caused our
|
|
|
|
application to lock at startup.
|
|
|
|
application to lock at startup.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
TQByteArray TQIODevice::readAll()
|
|
|
|
QByteArray QIODevice::readAll()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( isDirectAccess() ) {
|
|
|
|
if ( TQT_TQIODEVICE(this)->isDirectAccess() ) {
|
|
|
|
// we know the size
|
|
|
|
// we know the size
|
|
|
|
int n = size()-at(); // ### fix for 64-bit or large files?
|
|
|
|
int n = size()-TQT_TQIODEVICE(this)->at(); // ### fix for 64-bit or large files?
|
|
|
|
int totalRead = 0;
|
|
|
|
int totalRead = 0;
|
|
|
|
TQByteArray ba( n );
|
|
|
|
TQByteArray ba( n );
|
|
|
|
char* c = ba.data();
|
|
|
|
char* c = ba.data();
|
|
|
|
while ( n ) {
|
|
|
|
while ( n ) {
|
|
|
|
int r = readBlock( c, n );
|
|
|
|
int r = TQT_TQIODEVICE(this)->readBlock( c, n );
|
|
|
|
if ( r < 0 )
|
|
|
|
if ( r < 0 )
|
|
|
|
return TQByteArray();
|
|
|
|
return TQByteArray();
|
|
|
|
n -= r;
|
|
|
|
n -= r;
|
|
|
@ -896,7 +896,7 @@ TQByteArray TQIODevice::readAll()
|
|
|
|
int r = 1;
|
|
|
|
int r = 1;
|
|
|
|
while ( !atEnd() && r != 0) {
|
|
|
|
while ( !atEnd() && r != 0) {
|
|
|
|
ba.resize( nread + blocksize );
|
|
|
|
ba.resize( nread + blocksize );
|
|
|
|
r = readBlock( ba.data()+nread, blocksize );
|
|
|
|
r = TQT_TQIODEVICE(this)->readBlock( ba.data()+nread, blocksize );
|
|
|
|
if ( r < 0 )
|
|
|
|
if ( r < 0 )
|
|
|
|
return TQByteArray();
|
|
|
|
return TQByteArray();
|
|
|
|
nread += r;
|
|
|
|
nread += r;
|
|
|
|