From da268834aba1485f7a60b22985b1509adb495efc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Mon, 31 Aug 2009 09:23:22 +0000 Subject: [PATCH] Update the progress bar more often during file copies (every 2 MB instead of every 10, which was not smooth enough). +alphabranch git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32847 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/installer/CopyEngine.cpp | 8 ++++---- src/apps/installer/CopyEngine.h | 11 ++++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/apps/installer/CopyEngine.cpp b/src/apps/installer/CopyEngine.cpp index 75940743e5..a3a014dbbb 100644 --- a/src/apps/installer/CopyEngine.cpp +++ b/src/apps/installer/CopyEngine.cpp @@ -212,7 +212,7 @@ printf("CopyFile - cancled\n"); fBytesRead += read; loopIteration += 1; - if (loopIteration % 10 == 0) + if (loopIteration % 2 == 0) _UpdateProgress(); buffer->deleteFile = read == 0; @@ -413,15 +413,15 @@ CopyEngine::_CopyFolder(const char* _source, const char* _destination, BSymLink srcLink(&entry); if (ret < B_OK) return ret; - + char linkPath[B_PATH_NAME_LENGTH]; ssize_t read = srcLink.ReadLink(linkPath, B_PATH_NAME_LENGTH - 1); if (read < 0) return (status_t)read; - + // just in case it already exists... copy.Remove(); - + BSymLink dstLink; ret = destination.CreateSymLink(name, linkPath, &dstLink); if (ret < B_OK) diff --git a/src/apps/installer/CopyEngine.h b/src/apps/installer/CopyEngine.h index 3f027e23f3..887b2b0a74 100644 --- a/src/apps/installer/CopyEngine.h +++ b/src/apps/installer/CopyEngine.h @@ -65,11 +65,12 @@ private: }; struct Buffer { Buffer(BFile* file) - : file(file) - , buffer(malloc(BUFFER_SIZE)) - , size(BUFFER_SIZE) - , validBytes(0) - , deleteFile(false) + : + file(file), + buffer(malloc(BUFFER_SIZE)), + size(BUFFER_SIZE), + validBytes(0), + deleteFile(false) { } ~Buffer()