From: Steve Brokenshire Date: Sun, 20 Sep 2015 11:54:12 +0000 (+0100) Subject: Modified ETag system to make it more stable. X-Git-Tag: release-0.05~79 X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=commitdiff_plain;h=1dd9568c924ede2b46fa40ea8f7eed03a2ffba1c Modified ETag system to make it more stable. --- diff --git a/source/common/etag.cpp b/source/common/etag.cpp index 95e38e4..e4dcef1 100644 --- a/source/common/etag.cpp +++ b/source/common/etag.cpp @@ -106,6 +106,30 @@ void ETagDB::UpdateETag(wxString Filename, wxString ETag, wxString ETagOriginal) } +bool ETagDB::ETagExists(wxString Filename){ + + // Lock or wait if it is already locked. + + ProcessLock->lock(); + + bool FileResult = FALSE; + + if (FilenameETag.find(Filename) != FilenameETag.end()){ + + FileResult = TRUE; + + } else { + + FileResult = FALSE; + + } + + // Unlock. + + ProcessLock->unlock(); + +} + std::map* ETagDB::GetFilenamePointer(){ return &FilenameETag; diff --git a/source/common/etag.h b/source/common/etag.h index b81af16..097db40 100644 --- a/source/common/etag.h +++ b/source/common/etag.h @@ -33,6 +33,7 @@ public: wxString GetETag(wxString Filename); wxString GetETagOriginal(wxString Filename); bool CheckETagExists(wxString Filename); + bool ETagExists(wxString Filename); //boost::mutex ProcessLock; // ETagDB functions.