Cleanup round 2:
Renamed CopyEngine2 back to CopyEngine. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30601 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,4 +1,9 @@
|
|||||||
#include "CopyEngine2.h"
|
/*
|
||||||
|
* Copyright 2008-2009, Stephan Aßmus <superstippi@gmx.de>
|
||||||
|
* All rights reserved. Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "CopyEngine.h"
|
||||||
|
|
||||||
#include <new>
|
#include <new>
|
||||||
|
|
||||||
@@ -20,7 +25,7 @@
|
|||||||
using std::nothrow;
|
using std::nothrow;
|
||||||
|
|
||||||
|
|
||||||
CopyEngine2::CopyEngine2(const BMessenger& messenger, BMessage* message)
|
CopyEngine::CopyEngine(const BMessenger& messenger, BMessage* message)
|
||||||
:
|
:
|
||||||
fBufferQueue(),
|
fBufferQueue(),
|
||||||
fWriterThread(-1),
|
fWriterThread(-1),
|
||||||
@@ -50,7 +55,7 @@ CopyEngine2::CopyEngine2(const BMessenger& messenger, BMessage* message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CopyEngine2::~CopyEngine2()
|
CopyEngine::~CopyEngine()
|
||||||
{
|
{
|
||||||
while (fBufferQueue.Size() > 0)
|
while (fBufferQueue.Size() > 0)
|
||||||
snooze(10000);
|
snooze(10000);
|
||||||
@@ -66,7 +71,7 @@ CopyEngine2::~CopyEngine2()
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
CopyEngine2::CopyFolder(const char* source, const char* destination,
|
CopyEngine::CopyFolder(const char* source, const char* destination,
|
||||||
BLocker* locker)
|
BLocker* locker)
|
||||||
{
|
{
|
||||||
fBytesRead = 0;
|
fBytesRead = 0;
|
||||||
@@ -101,7 +106,7 @@ printf("%lld bytes to read in %lld files\n", fBytesToCopy, fItemsToCopy);
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
CopyEngine2::CopyFile(const BEntry& _source, const BEntry& _destination,
|
CopyEngine::CopyFile(const BEntry& _source, const BEntry& _destination,
|
||||||
BLocker* locker)
|
BLocker* locker)
|
||||||
{
|
{
|
||||||
AutoLocker<BLocker> lock(locker);
|
AutoLocker<BLocker> lock(locker);
|
||||||
@@ -184,7 +189,7 @@ printf("CopyFile - cancled\n");
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
CopyEngine2::_CollectCopyInfo(const char* _source, int32& level)
|
CopyEngine::_CollectCopyInfo(const char* _source, int32& level)
|
||||||
{
|
{
|
||||||
level++;
|
level++;
|
||||||
|
|
||||||
@@ -232,7 +237,7 @@ CopyEngine2::_CollectCopyInfo(const char* _source, int32& level)
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
CopyEngine2::_CopyFolder(const char* _source, const char* _destination,
|
CopyEngine::_CopyFolder(const char* _source, const char* _destination,
|
||||||
int32& level, BLocker* locker)
|
int32& level, BLocker* locker)
|
||||||
{
|
{
|
||||||
level++;
|
level++;
|
||||||
@@ -378,7 +383,7 @@ CopyEngine2::_CopyFolder(const char* _source, const char* _destination,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
CopyEngine2::_UpdateProgress()
|
CopyEngine::_UpdateProgress()
|
||||||
{
|
{
|
||||||
if (fMessage != NULL) {
|
if (fMessage != NULL) {
|
||||||
BMessage message(*fMessage);
|
BMessage message(*fMessage);
|
||||||
@@ -394,7 +399,7 @@ CopyEngine2::_UpdateProgress()
|
|||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CopyEngine2::_ShouldCopyEntry(const char* name, const struct stat& statInfo,
|
CopyEngine::_ShouldCopyEntry(const char* name, const struct stat& statInfo,
|
||||||
int32 level) const
|
int32 level) const
|
||||||
{
|
{
|
||||||
if (level == 1 && S_ISDIR(statInfo.st_mode)) {
|
if (level == 1 && S_ISDIR(statInfo.st_mode)) {
|
||||||
@@ -412,16 +417,16 @@ CopyEngine2::_ShouldCopyEntry(const char* name, const struct stat& statInfo,
|
|||||||
|
|
||||||
|
|
||||||
int32
|
int32
|
||||||
CopyEngine2::_WriteThreadEntry(void* cookie)
|
CopyEngine::_WriteThreadEntry(void* cookie)
|
||||||
{
|
{
|
||||||
CopyEngine2* engine = (CopyEngine2*)cookie;
|
CopyEngine* engine = (CopyEngine*)cookie;
|
||||||
engine->_WriteThread();
|
engine->_WriteThread();
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
CopyEngine2::_WriteThread()
|
CopyEngine::_WriteThread()
|
||||||
{
|
{
|
||||||
bigtime_t bufferWaitTimeout = 100000;
|
bigtime_t bufferWaitTimeout = 100000;
|
||||||
|
|
||||||
@@ -1,5 +1,9 @@
|
|||||||
#ifndef COPY_ENGINE_2_H
|
/*
|
||||||
#define COPY_ENGINE_2_H
|
* Copyright 2008-2009, Stephan Aßmus <superstippi@gmx.de>
|
||||||
|
* All rights reserved. Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
#ifndef COPY_ENGINE_H
|
||||||
|
#define COPY_ENGINE_H
|
||||||
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -15,11 +19,11 @@ class BLocker;
|
|||||||
class BMessage;
|
class BMessage;
|
||||||
class BMessenger;
|
class BMessenger;
|
||||||
|
|
||||||
class CopyEngine2 {
|
class CopyEngine {
|
||||||
public:
|
public:
|
||||||
CopyEngine2(const BMessenger& messenger,
|
CopyEngine(const BMessenger& messenger,
|
||||||
BMessage* message);
|
BMessage* message);
|
||||||
virtual ~CopyEngine2();
|
virtual ~CopyEngine();
|
||||||
|
|
||||||
status_t CopyFolder(const char* source,
|
status_t CopyFolder(const char* source,
|
||||||
const char* destination,
|
const char* destination,
|
||||||
@@ -4,7 +4,7 @@ UsePrivateHeaders shared storage tracker ;
|
|||||||
SubDirHdrs [ FDirName $(HAIKU_TOP) src kits tracker ] ;
|
SubDirHdrs [ FDirName $(HAIKU_TOP) src kits tracker ] ;
|
||||||
|
|
||||||
Application Installer :
|
Application Installer :
|
||||||
CopyEngine2.cpp
|
CopyEngine.cpp
|
||||||
InstallerApp.cpp
|
InstallerApp.cpp
|
||||||
InstallerWindow.cpp
|
InstallerWindow.cpp
|
||||||
PackageViews.cpp
|
PackageViews.cpp
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
#include <VolumeRoster.h>
|
#include <VolumeRoster.h>
|
||||||
|
|
||||||
#include "AutoLocker.h"
|
#include "AutoLocker.h"
|
||||||
#include "CopyEngine2.h"
|
#include "CopyEngine.h"
|
||||||
#include "InstallerWindow.h"
|
#include "InstallerWindow.h"
|
||||||
#include "PackageViews.h"
|
#include "PackageViews.h"
|
||||||
#include "PartitionMenuItem.h"
|
#include "PartitionMenuItem.h"
|
||||||
@@ -246,7 +246,7 @@ WorkerThread::_PerformInstall(BMenu *srcMenu, BMenu *targetMenu)
|
|||||||
entry_ref testRef;
|
entry_ref testRef;
|
||||||
|
|
||||||
BMessenger messenger(fWindow);
|
BMessenger messenger(fWindow);
|
||||||
CopyEngine2 engine(messenger, new BMessage(MSG_STATUS_MESSAGE));
|
CopyEngine engine(messenger, new BMessage(MSG_STATUS_MESSAGE));
|
||||||
|
|
||||||
PartitionMenuItem *targetItem = (PartitionMenuItem *)targetMenu->FindMarked();
|
PartitionMenuItem *targetItem = (PartitionMenuItem *)targetMenu->FindMarked();
|
||||||
PartitionMenuItem *srcItem = (PartitionMenuItem *)srcMenu->FindMarked();
|
PartitionMenuItem *srcItem = (PartitionMenuItem *)srcMenu->FindMarked();
|
||||||
|
|||||||
Reference in New Issue
Block a user