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
This commit is contained in:
@@ -212,7 +212,7 @@ printf("CopyFile - cancled\n");
|
|||||||
|
|
||||||
fBytesRead += read;
|
fBytesRead += read;
|
||||||
loopIteration += 1;
|
loopIteration += 1;
|
||||||
if (loopIteration % 10 == 0)
|
if (loopIteration % 2 == 0)
|
||||||
_UpdateProgress();
|
_UpdateProgress();
|
||||||
|
|
||||||
buffer->deleteFile = read == 0;
|
buffer->deleteFile = read == 0;
|
||||||
@@ -413,15 +413,15 @@ CopyEngine::_CopyFolder(const char* _source, const char* _destination,
|
|||||||
BSymLink srcLink(&entry);
|
BSymLink srcLink(&entry);
|
||||||
if (ret < B_OK)
|
if (ret < B_OK)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
char linkPath[B_PATH_NAME_LENGTH];
|
char linkPath[B_PATH_NAME_LENGTH];
|
||||||
ssize_t read = srcLink.ReadLink(linkPath, B_PATH_NAME_LENGTH - 1);
|
ssize_t read = srcLink.ReadLink(linkPath, B_PATH_NAME_LENGTH - 1);
|
||||||
if (read < 0)
|
if (read < 0)
|
||||||
return (status_t)read;
|
return (status_t)read;
|
||||||
|
|
||||||
// just in case it already exists...
|
// just in case it already exists...
|
||||||
copy.Remove();
|
copy.Remove();
|
||||||
|
|
||||||
BSymLink dstLink;
|
BSymLink dstLink;
|
||||||
ret = destination.CreateSymLink(name, linkPath, &dstLink);
|
ret = destination.CreateSymLink(name, linkPath, &dstLink);
|
||||||
if (ret < B_OK)
|
if (ret < B_OK)
|
||||||
|
|||||||
@@ -65,11 +65,12 @@ private:
|
|||||||
};
|
};
|
||||||
struct Buffer {
|
struct Buffer {
|
||||||
Buffer(BFile* file)
|
Buffer(BFile* file)
|
||||||
: file(file)
|
:
|
||||||
, buffer(malloc(BUFFER_SIZE))
|
file(file),
|
||||||
, size(BUFFER_SIZE)
|
buffer(malloc(BUFFER_SIZE)),
|
||||||
, validBytes(0)
|
size(BUFFER_SIZE),
|
||||||
, deleteFile(false)
|
validBytes(0),
|
||||||
|
deleteFile(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
~Buffer()
|
~Buffer()
|
||||||
|
|||||||
Reference in New Issue
Block a user