From 98ecf620f7de377dc8ae9ad7fbd1e3b24477e138 Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 17:11:56 +0200 Subject: 3.17 --- library/icon_buffer.h | 41 +++++------------------------------------ 1 file changed, 5 insertions(+), 36 deletions(-) (limited to 'library/icon_buffer.h') diff --git a/library/icon_buffer.h b/library/icon_buffer.h index b00a566d..5ab2740c 100644 --- a/library/icon_buffer.h +++ b/library/icon_buffer.h @@ -7,21 +7,18 @@ #ifndef ICONBUFFER_H_INCLUDED #define ICONBUFFER_H_INCLUDED -#include #include "../shared/zstring.h" #include #include -#include "../shared/boost_thread_wrap.h" //include -namespace ffs3 +namespace zen { - class IconBuffer { public: - static const wxIcon& getDirectoryIcon(); //one folder icon should be sufficient... - static const wxIcon& getFileIcon(); //in case one folder icon is sufficient... + static const wxIcon& getDirectoryIcon(); //one icon should be sufficient... + static const wxIcon& getFileIcon(); // static IconBuffer& getInstance(); bool requestFileIcon(const Zstring& fileName, wxIcon* icon = NULL); //returns false if icon is not in buffer @@ -37,36 +34,8 @@ private: IconBuffer(); ~IconBuffer(); - static const size_t BUFFER_SIZE_MAX = 800; //maximum number of icons to buffer - - class IconDB; - class IconHolder; - class IconDbSequence; - - //--------------------------------------------------------------------------------------------------- - typedef Zbase 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 BasicString& entryName, const IconHolder& icon); - - static IconHolder getAssociatedIcon(const BasicString& filename); - static IconHolder getAssociatedIconByExt(const BasicString& 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 buffer; //use synchronisation when accessing this! - std::auto_ptr bufSequence; //save sequence of buffer entry to delete oldest elements - //------------------------------------------------------------ - - class WorkerThread; - std::auto_ptr worker; + struct Pimpl; + std::auto_ptr pimpl; }; } -- cgit