Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 312146 Details for
Bug 455876
sr# 1798266 : kde/K3B Verify data says it differs, but it does not (rounded up to 32KB)
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
md5sum.patch
md5sum.patch (text/x-patch), 4.27 KB, created by
Alan Matsuoka
on 2008-07-18 15:19:40 UTC
(
hide
)
Description:
md5sum.patch
Filename:
MIME Type:
Creator:
Alan Matsuoka
Created:
2008-07-18 15:19:40 UTC
Size:
4.27 KB
patch
obsolete
>--- branches/k3b_0_11_branch/kdeextragear-1/k3b/src/tools/k3bmd5job.cpp 2004/01/31 10:50:32 283933 >+++ k3b/src/tools/k3bmd5job.cpp 2005/01/19 12:54:43 380065 >@@ -17,6 +17,7 @@ > #include "k3bmd5job.h" > #include <k3biso9660.h> > #include <k3bglobals.h> >+#include <k3bdevice.h> > > #include <kmdcodec.h> > #include <klocale.h> >@@ -46,6 +47,8 @@ > QTimer timer; > QString filename; > int fileDes; >+ K3bCdDevice::CdDevice* device; >+ > bool finished; > char* data; > const K3bIso9660File* isoFile; >@@ -86,7 +89,7 @@ > if( d->isoFile ) { > d->imageSize = d->isoFile->size(); > } >- else if( d->fileDes < 0 ) { >+ else if( !d->filename.isEmpty() ) { > if( !QFile::exists( d->filename ) ) { > emit infoMessage( i18n("Could not find file %1").arg(d->filename), ERROR ); > emit finished(false); >@@ -100,7 +103,7 @@ > return; > } > >- d->imageSize = K3b::filesize( d->filename ); >+ d->imageSize = K3b::filesize( KURL::fromPathOrURL(d->filename) ); > } > else > d->imageSize = 0; >@@ -128,6 +131,7 @@ > d->filename = filename; > d->isoFile = 0; > d->fileDes = -1; >+ d->device = 0; > } > > >@@ -136,6 +140,7 @@ > d->isoFile = file; > d->fileDes = -1; > d->filename.truncate(0); >+ d->device = 0; > } > > >@@ -144,6 +149,16 @@ > d->fileDes = fd; > d->filename.truncate(0); > d->isoFile = 0; >+ d->device = 0; >+} >+ >+ >+void K3bMd5Job::setDevice( K3bCdDevice::CdDevice* dev ) >+{ >+ d->device = dev; >+ d->fileDes = -1; >+ d->filename.truncate(0); >+ d->isoFile = 0; > } > > >@@ -157,19 +172,56 @@ > { > if( !d->finished ) { > >- if( d->readData >= d->maxSize && d->maxSize > 0 ) { >+ // determine bytes to read >+ unsigned int readSize = K3bMd5JobPrivate::BUFFERSIZE; >+ if( d->maxSize > 0 ) >+ readSize = QMIN( readSize, d->maxSize - d->readData ); >+ >+ if( readSize <= 0 ) { > stop(); > emit percent( 100 ); > emit finished(true); > } > else { > int read = 0; >- if( d->isoFile ) >- read = d->isoFile->read( d->readData, d->data, K3bMd5JobPrivate::BUFFERSIZE ); >- else if( d->fileDes < 0 ) >- read = d->file.readBlock( d->data, K3bMd5JobPrivate::BUFFERSIZE ); >- else >- read = ::read( d->fileDes, d->data, K3bMd5JobPrivate::BUFFERSIZE ); >+ >+ // >+ // read from the iso9660 file >+ // >+ if( d->isoFile ) { >+ read = d->isoFile->read( d->readData, d->data, readSize ); >+ } >+ >+ // >+ // read from the device >+ // >+ else if( d->device ) { >+ // >+ // when reading from a device we always read multiples of 2048 bytes. >+ // Only the last sector may not be used completely. >+ // >+ unsigned long sector = d->readData/2048; >+ unsigned int sectorCnt = QMAX( readSize/2048, 1 ); >+ read = -1; >+ if( d->device->read10( reinterpret_cast<unsigned char*>(d->data), >+ sectorCnt*2048, >+ sector, >+ sectorCnt ) ) >+ read = QMIN( readSize, sectorCnt*2048 ); >+ } >+ >+ // >+ // read from the file >+ // >+ else if( d->fileDes < 0 ) { >+ read = d->file.readBlock( d->data, readSize ); >+ } >+ >+ // >+ // read from the file descriptor >+ else { >+ read = ::read( d->fileDes, d->data, readSize ); >+ } > > if( read < 0 ) { > emit infoMessage( i18n("Error while reading from file %1").arg(d->filename), ERROR ); >@@ -184,7 +236,7 @@ > else { > d->readData += read; > d->md5.update( d->data, read ); >- if( d->fileDes < 0 ) >+ if( d->isoFile || !d->filename.isEmpty() ) > emit percent( (int)((double)d->readData * 100.0 / (double)d->imageSize) ); > else if( d->maxSize > 0 ) > emit percent( (int)((double)d->readData * 100.0 / (double)d->maxSize) ); > >--- branches/k3b_0_11_branch/kdeextragear-1/k3b/src/tools/k3bmd5job.h 2004/01/31 10:50:32 283933 >+++ k3b/src/tools/k3bmd5job.h 2005/01/19 12:54:43 380065 >@@ -20,6 +20,9 @@ > #include <k3bjob.h> > #include <qcstring.h> > >+namespace K3bCdDevice { >+ class CdDevice; >+} > > class K3bIso9660File; > >@@ -39,10 +42,23 @@ > void start(); > void cancel(); > >+ /** >+ * read from a file >+ */ > void setFile( const QString& filename ); >+ >+ /** >+ * read from an iso9660 file >+ */ > void setFile( const K3bIso9660File* ); > > /** >+ * read from a device >+ * This should be used in combination with setMaxReadSize >+ */ >+ void setDevice( K3bCdDevice::CdDevice* dev ); >+ >+ /** > * read from the opened file descriptor > */ > void setFd( int fd ); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 455876
: 312146 |
312147