From 35f1fa0609e779570d21697ffb66538aab966d6f Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 17:19:37 +0100 Subject: [PATCH] Changed: Renamed thread to Thread and assign InstallThread and DownloadThread --HG-- branch : develop --- code/ryzom/client/src/login_patch.cpp | 67 ++++++++++++++------------- code/ryzom/client/src/login_patch.h | 5 +- 2 files changed, 37 insertions(+), 35 deletions(-) diff --git a/code/ryzom/client/src/login_patch.cpp b/code/ryzom/client/src/login_patch.cpp index 4636da11f..659844a57 100644 --- a/code/ryzom/client/src/login_patch.cpp +++ b/code/ryzom/client/src/login_patch.cpp @@ -143,7 +143,8 @@ CPatchManager::CPatchManager() : State("t_state"), DataScanState("t_data_scan_st CheckThread = NULL; InstallThread = NULL; ScanDataThread = NULL; - thread = NULL; + DownloadThread = NULL; + Thread = NULL; LogSeparator = "\n"; ValidDescFile = false; @@ -364,7 +365,7 @@ void CPatchManager::startCheckThread(bool includeBackgroundPatch) nlwarning ("check thread is already running"); return; } - if (thread != NULL) + if (Thread != NULL) { nlwarning ("a thread is already running"); return; @@ -375,9 +376,9 @@ void CPatchManager::startCheckThread(bool includeBackgroundPatch) CheckThread = new CCheckThread(includeBackgroundPatch); nlassert (CheckThread != NULL); - thread = IThread::create (CheckThread); - nlassert (thread != NULL); - thread->start (); + Thread = IThread::create (CheckThread); + nlassert (Thread != NULL); + Thread->start (); } // **************************************************************************** @@ -402,11 +403,11 @@ bool CPatchManager::isCheckThreadEnded(bool &ok) // **************************************************************************** void CPatchManager::stopCheckThread() { - if(CheckThread && thread) + if(CheckThread && Thread) { - thread->wait(); - delete thread; - thread = NULL; + Thread->wait(); + delete Thread; + Thread = NULL; delete CheckThread; CheckThread = NULL; } @@ -534,7 +535,7 @@ void CPatchManager::startPatchThread(const vector &CategoriesSelected, b nlwarning ("check thread is already running"); return; } - if (thread != NULL) + if (Thread != NULL) { nlwarning ("a thread is already running"); return; @@ -622,9 +623,9 @@ void CPatchManager::startPatchThread(const vector &CategoriesSelected, b } // Launch the thread - thread = IThread::create (PatchThread); - nlassert (thread != NULL); - thread->start (); + Thread = IThread::create (PatchThread); + nlassert (Thread != NULL); + Thread->start (); } // **************************************************************************** @@ -685,11 +686,11 @@ bool CPatchManager::getThreadState (ucstring &stateOut, vector &stateL // **************************************************************************** void CPatchManager::stopPatchThread() { - if(PatchThread && thread) + if(PatchThread && Thread) { - thread->wait(); - delete thread; - thread = NULL; + Thread->wait(); + delete Thread; + Thread = NULL; delete PatchThread; PatchThread = NULL; } @@ -1944,7 +1945,7 @@ void CPatchManager::startScanDataThread() nlwarning ("scan data thread is already running"); return; } - if (thread != NULL) + if (Thread != NULL) { nlwarning ("a thread is already running"); return; @@ -1962,9 +1963,9 @@ void CPatchManager::startScanDataThread() ScanDataThread = new CScanDataThread(); nlassert (ScanDataThread != NULL); - thread = IThread::create (ScanDataThread); - nlassert (thread != NULL); - thread->start (); + Thread = IThread::create (ScanDataThread); + nlassert (Thread != NULL); + Thread->start (); } // **************************************************************************** @@ -1989,11 +1990,11 @@ bool CPatchManager::isScanDataThreadEnded(bool &ok) // **************************************************************************** void CPatchManager::stopScanDataThread() { - if(ScanDataThread && thread) + if(ScanDataThread && Thread) { - thread->wait(); - delete thread; - thread = NULL; + Thread->wait(); + delete Thread; + Thread = NULL; delete ScanDataThread; ScanDataThread = NULL; } @@ -3044,18 +3045,18 @@ IAsyncDownloader* CPatchManager::getAsyncDownloader() const // **************************************************************************** void CPatchManager::startInstallThread(const std::vector& entries) { - CInstallThread* installThread = new CInstallThread(entries); - thread = IThread::create (installThread); - nlassert (thread != NULL); - thread->start (); + InstallThread = new CInstallThread(entries); + Thread = IThread::create (InstallThread); + nlassert (Thread != NULL); + Thread->start (); } void CPatchManager::startDownloadThread(const std::vector& entries) { - CDownloadThread* downloadThread = new CDownloadThread(entries); - thread = IThread::create (downloadThread); - nlassert (thread != NULL); - thread->start (); + DownloadThread = new CDownloadThread(entries); + Thread = IThread::create (DownloadThread); + nlassert (Thread != NULL); + Thread->start (); } diff --git a/code/ryzom/client/src/login_patch.h b/code/ryzom/client/src/login_patch.h index 1de6f03f0..0daf83b46 100644 --- a/code/ryzom/client/src/login_patch.h +++ b/code/ryzom/client/src/login_patch.h @@ -238,7 +238,7 @@ public: CProductDescriptionForClient &getDescFile() { return DescFile; } - NLMISC::IThread *getCurrThread() const { return thread; } + NLMISC::IThread *getCurrThread() const { return Thread; } // set an external state listener (enable to log) infos void setStateListener(IPatchManagerStateListener* stateListener); @@ -410,7 +410,8 @@ private: CCheckThread *CheckThread; CScanDataThread *ScanDataThread; CInstallThread *InstallThread; - NLMISC::IThread *thread; + CDownloadThread *DownloadThread; + NLMISC::IThread *Thread; // State struct CState