From 5e39beaa7d498f89855358a9e043cf1c4b4ee3a6 Mon Sep 17 00:00:00 2001 From: xavier Date: Tue, 20 Sep 2011 17:49:17 +0000 Subject: [PATCH] Added a mutex to avoid loading a collection twice at the same time. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1334 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- sources/fileelementscollection.cpp | 1 + sources/fileelementscollection.h | 1 + 2 files changed, 2 insertions(+) diff --git a/sources/fileelementscollection.cpp b/sources/fileelementscollection.cpp index b76bab07e..1243117e3 100644 --- a/sources/fileelementscollection.cpp +++ b/sources/fileelementscollection.cpp @@ -51,6 +51,7 @@ ElementsCategory *FileElementsCollection::rootCategory() { Recharge l'arborescence des categories et elements. */ void FileElementsCollection::reload() { + QMutexLocker reload_lock(&reload_mutex_); // oublie l'arborescence precedente deleteContent(); diff --git a/sources/fileelementscollection.h b/sources/fileelementscollection.h index a2498be16..70d4b3231 100644 --- a/sources/fileelementscollection.h +++ b/sources/fileelementscollection.h @@ -57,5 +57,6 @@ class FileElementsCollection : public ElementsCollection { private: QString coll_path; FileElementsCategory *root; + QMutex reload_mutex_; ///< Mutex used to avoid loading a collection twice at the same time }; #endif