Signed-off-by: Lukas Hrazky <lukkash@email.cz>
engine.seek(0);
fileValue = 0;
engine.seek(0);
fileValue = 0;
- ERROR_PROMPT(!newEngine.open(QIODevice::WriteOnly | QIODevice::Truncate),
+ ERROR_PROMPT(!newEngine.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Unbuffered),
tr("Error writing file %1."), newPath)
if (abort || response == IGNORE) {
tr("Error writing file %1."), newPath)
if (abort || response == IGNORE) {
qint64 bytes;
while ((bytes = engine.read(block, sizeof(block))) > 0) {
qint64 bytes;
while ((bytes = engine.read(block, sizeof(block))) > 0) {
- if (bytes == -1 || bytes != newEngine.write(block, bytes)) {
- if (bytes == -1) {
- SHOW_ERROR_PROMPT(tr("Error while reading from file %1."), path);
- } else {
- SHOW_ERROR_PROMPT(tr("Error while writing to file %1."), newPath);
- }
-
+ if (bytes == -1) {
+ SHOW_ERROR_PROMPT(tr("Error while reading from file %1."), path);
+
if (!abort) {
if (response == IGNORE) {
updateProgress(fileSizeMap[path] - fileValue);
if (!abort) {
if (response == IGNORE) {
updateProgress(fileSizeMap[path] - fileValue);
+ } else {
+ qint64 written = 0;
+ char *blockPointer = block;
+ while (bytes != (written = newEngine.write(blockPointer, bytes))) {
+ SHOW_ERROR_PROMPT(tr("Error while writing to file %1."), newPath);
+
+ if (response == IGNORE) {
+ updateProgress(fileSizeMap[path] - fileValue);
+ removeExcludeFiles.insert(path);
+ ignore = true;
+ }
+
+ if (abort || ignore) break;
+
+ if (written == -1) written = 0;
+ bytes -= written;
+ blockPointer += written;
+
+ PAUSE();
+ }
+ if (abort || ignore) break;