summaryrefslogtreecommitdiff
path: root/library/icon_buffer.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:08:42 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:08:42 +0200
commitc32707148292d104c66276b43796d6057c8c7a5d (patch)
treebb83513f4aff24153e21a4ec92e34e4c27651b1f /library/icon_buffer.h
parent3.9 (diff)
downloadFreeFileSync-c32707148292d104c66276b43796d6057c8c7a5d.tar.gz
FreeFileSync-c32707148292d104c66276b43796d6057c8c7a5d.tar.bz2
FreeFileSync-c32707148292d104c66276b43796d6057c8c7a5d.zip
3.10
Diffstat (limited to 'library/icon_buffer.h')
-rw-r--r--library/icon_buffer.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/library/icon_buffer.h b/library/icon_buffer.h
index 9dc1ee55..3e021445 100644
--- a/library/icon_buffer.h
+++ b/library/icon_buffer.h
@@ -11,7 +11,7 @@
#include "../shared/zstring.h"
#include <memory>
#include <wx/icon.h>
-#include <boost/thread/mutex.hpp>
+#include "../shared/boost_thread_wrap.h" //include <boost/thread.hpp>
namespace ffs3
@@ -42,16 +42,26 @@ private:
class IconHolder;
class IconDbSequence;
+//---------------------------------------------------------------------------------------------------
+typedef Zbase<Zchar, StorageDeepCopy> BasicString; //thread safe string class
+//avoid reference-counted objects for shared data: NOT THREADSAFE!!! (implicitly shared variable: ref-count)
+//---------------------------------------------------------------------------------------------------
+
//methods used by worker thread
- void insertIntoBuffer(const DefaultChar* entryName, const IconHolder& icon);
+ void insertIntoBuffer(const BasicString& entryName, const IconHolder& icon);
+
+ static IconHolder getAssociatedIcon(const BasicString& filename);
+ static IconHolder getAssociatedIconByExt(const BasicString& extension);
- static IconHolder getAssociatedIcon(const Zstring& filename);
- static IconHolder getAssociatedIconByExt(const Zstring& extension);
+#ifdef FFS_WIN
+static BasicString getFileExtension(const BasicString& filename);
+static bool isPriceyExtension(const BasicString& extension);
+#endif
//---------------------- Shared Data -------------------------
boost::mutex lockIconDB;
std::auto_ptr<IconDB> buffer; //use synchronisation when accessing this!
- std::auto_ptr<IconDbSequence> bufSequence; //save sequence of buffer entry to delete oldest elements (implicitly shared by sharing Zstring with IconDB!!!)
+ std::auto_ptr<IconDbSequence> bufSequence; //save sequence of buffer entry to delete oldest elements
//------------------------------------------------------------
class WorkerThread;
bgstack15