From f827b0168a3712e37c0d31d783a26baa92c05411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sun, 3 May 2009 09:35:42 +0000 Subject: [PATCH] Cleanup round 2: Renamed CopyEngine2 back to CopyEngine. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30601 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../{CopyEngine2.cpp => CopyEngine.cpp} | 29 +++++++++++-------- .../installer/{CopyEngine2.h => CopyEngine.h} | 14 +++++---- src/apps/installer/Jamfile | 2 +- src/apps/installer/WorkerThread.cpp | 4 +-- 4 files changed, 29 insertions(+), 20 deletions(-) rename src/apps/installer/{CopyEngine2.cpp => CopyEngine.cpp} (92%) rename src/apps/installer/{CopyEngine2.h => CopyEngine.h} (86%) diff --git a/src/apps/installer/CopyEngine2.cpp b/src/apps/installer/CopyEngine.cpp similarity index 92% rename from src/apps/installer/CopyEngine2.cpp rename to src/apps/installer/CopyEngine.cpp index a616ad1a42..7ca3f8b274 100644 --- a/src/apps/installer/CopyEngine2.cpp +++ b/src/apps/installer/CopyEngine.cpp @@ -1,4 +1,9 @@ -#include "CopyEngine2.h" +/* + * Copyright 2008-2009, Stephan Aßmus + * All rights reserved. Distributed under the terms of the MIT License. + */ + +#include "CopyEngine.h" #include @@ -20,7 +25,7 @@ using std::nothrow; -CopyEngine2::CopyEngine2(const BMessenger& messenger, BMessage* message) +CopyEngine::CopyEngine(const BMessenger& messenger, BMessage* message) : fBufferQueue(), fWriterThread(-1), @@ -50,7 +55,7 @@ CopyEngine2::CopyEngine2(const BMessenger& messenger, BMessage* message) } -CopyEngine2::~CopyEngine2() +CopyEngine::~CopyEngine() { while (fBufferQueue.Size() > 0) snooze(10000); @@ -66,7 +71,7 @@ CopyEngine2::~CopyEngine2() status_t -CopyEngine2::CopyFolder(const char* source, const char* destination, +CopyEngine::CopyFolder(const char* source, const char* destination, BLocker* locker) { fBytesRead = 0; @@ -101,7 +106,7 @@ printf("%lld bytes to read in %lld files\n", fBytesToCopy, fItemsToCopy); status_t -CopyEngine2::CopyFile(const BEntry& _source, const BEntry& _destination, +CopyEngine::CopyFile(const BEntry& _source, const BEntry& _destination, BLocker* locker) { AutoLocker lock(locker); @@ -184,7 +189,7 @@ printf("CopyFile - cancled\n"); status_t -CopyEngine2::_CollectCopyInfo(const char* _source, int32& level) +CopyEngine::_CollectCopyInfo(const char* _source, int32& level) { level++; @@ -232,7 +237,7 @@ CopyEngine2::_CollectCopyInfo(const char* _source, int32& level) status_t -CopyEngine2::_CopyFolder(const char* _source, const char* _destination, +CopyEngine::_CopyFolder(const char* _source, const char* _destination, int32& level, BLocker* locker) { level++; @@ -378,7 +383,7 @@ CopyEngine2::_CopyFolder(const char* _source, const char* _destination, void -CopyEngine2::_UpdateProgress() +CopyEngine::_UpdateProgress() { if (fMessage != NULL) { BMessage message(*fMessage); @@ -394,7 +399,7 @@ CopyEngine2::_UpdateProgress() bool -CopyEngine2::_ShouldCopyEntry(const char* name, const struct stat& statInfo, +CopyEngine::_ShouldCopyEntry(const char* name, const struct stat& statInfo, int32 level) const { if (level == 1 && S_ISDIR(statInfo.st_mode)) { @@ -412,16 +417,16 @@ CopyEngine2::_ShouldCopyEntry(const char* name, const struct stat& statInfo, int32 -CopyEngine2::_WriteThreadEntry(void* cookie) +CopyEngine::_WriteThreadEntry(void* cookie) { - CopyEngine2* engine = (CopyEngine2*)cookie; + CopyEngine* engine = (CopyEngine*)cookie; engine->_WriteThread(); return B_OK; } void -CopyEngine2::_WriteThread() +CopyEngine::_WriteThread() { bigtime_t bufferWaitTimeout = 100000; diff --git a/src/apps/installer/CopyEngine2.h b/src/apps/installer/CopyEngine.h similarity index 86% rename from src/apps/installer/CopyEngine2.h rename to src/apps/installer/CopyEngine.h index 4cc7f45e9c..bce89981ac 100644 --- a/src/apps/installer/CopyEngine2.h +++ b/src/apps/installer/CopyEngine.h @@ -1,5 +1,9 @@ -#ifndef COPY_ENGINE_2_H -#define COPY_ENGINE_2_H +/* + * Copyright 2008-2009, Stephan Aßmus + * All rights reserved. Distributed under the terms of the MIT License. + */ +#ifndef COPY_ENGINE_H +#define COPY_ENGINE_H #include @@ -15,11 +19,11 @@ class BLocker; class BMessage; class BMessenger; -class CopyEngine2 { +class CopyEngine { public: - CopyEngine2(const BMessenger& messenger, + CopyEngine(const BMessenger& messenger, BMessage* message); - virtual ~CopyEngine2(); + virtual ~CopyEngine(); status_t CopyFolder(const char* source, const char* destination, diff --git a/src/apps/installer/Jamfile b/src/apps/installer/Jamfile index 833339fc6d..468d69e3b2 100644 --- a/src/apps/installer/Jamfile +++ b/src/apps/installer/Jamfile @@ -4,7 +4,7 @@ UsePrivateHeaders shared storage tracker ; SubDirHdrs [ FDirName $(HAIKU_TOP) src kits tracker ] ; Application Installer : - CopyEngine2.cpp + CopyEngine.cpp InstallerApp.cpp InstallerWindow.cpp PackageViews.cpp diff --git a/src/apps/installer/WorkerThread.cpp b/src/apps/installer/WorkerThread.cpp index e71cb0587e..688f1c5239 100644 --- a/src/apps/installer/WorkerThread.cpp +++ b/src/apps/installer/WorkerThread.cpp @@ -23,7 +23,7 @@ #include #include "AutoLocker.h" -#include "CopyEngine2.h" +#include "CopyEngine.h" #include "InstallerWindow.h" #include "PackageViews.h" #include "PartitionMenuItem.h" @@ -246,7 +246,7 @@ WorkerThread::_PerformInstall(BMenu *srcMenu, BMenu *targetMenu) entry_ref testRef; 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 *srcItem = (PartitionMenuItem *)srcMenu->FindMarked();