Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Modified ETag system to make it more stable.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 20 Sep 2015 11:54:12 +0000 (12:54 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 20 Sep 2015 11:54:12 +0000 (12:54 +0100)
source/common/etag.cpp
source/common/etag.h

index 95e38e4..e4dcef1 100644 (file)
@@ -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<wxString,wxString>* ETagDB::GetFilenamePointer(){
     
     return &FilenameETag;
index b81af16..097db40 100644 (file)
@@ -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.
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy