From 4226e548662339ea1ca37b45385a7cf9b237ff1e Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 17:07:43 +0200 Subject: 3.8 --- library/iconBuffer.h | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'library/iconBuffer.h') diff --git a/library/iconBuffer.h b/library/iconBuffer.h index cb2d809f..4a19af3d 100644 --- a/library/iconBuffer.h +++ b/library/iconBuffer.h @@ -7,14 +7,9 @@ #ifndef ICONBUFFER_H_INCLUDED #define ICONBUFFER_H_INCLUDED -#ifndef FFS_WIN -header should be used in the windows build only! -#endif - #include #include "../shared/zstring.h" #include -#include class wxCriticalSection; class wxIcon; @@ -32,24 +27,27 @@ public: bool requestFileIcon(const Zstring& fileName, wxIcon* icon = NULL); //returns false if icon is not in buffer void setWorkload(const std::vector& load); //(re-)set new workload of icons to be retrieved; - static const int ICON_SIZE = 16; //size in pixel - static const size_t BUFFER_SIZE = 800; //maximum number if icons to buffer +#ifdef FFS_WIN + static const int ICON_SIZE = 16; //size in pixel +#elif defined FFS_LINUX + static const int ICON_SIZE = 24; //size in pixel +#endif private: IconBuffer(); ~IconBuffer(); - class WorkerThread; - friend class WorkerThread; + static const size_t BUFFER_SIZE = 800; //maximum number of icons to buffer class IconDB; class IconHolder; class IconDbSequence; - typedef boost::shared_ptr CountedIconPtr; - //methods used by worker thread - void insertIntoBuffer(const DefaultChar* entryName, IconHolder& icon); //icon is invalidated by this call!! + void insertIntoBuffer(const DefaultChar* entryName, const IconHolder& icon); + + static IconHolder getAssociatedIcon(const Zstring& filename); + static IconHolder getAssociatedIconByExt(const Zstring& extension); //---------------------- Shared Data ------------------------- std::auto_ptr lockIconDB; @@ -57,7 +55,8 @@ private: std::auto_ptr bufSequence; //save sequence of buffer entry to delete oldest elements (implicitly shared by sharing Zstring with IconDB!!!) //------------------------------------------------------------ - std::auto_ptr worker; + class WorkerThread; + WorkerThread* worker; //detached thread => destroys itself }; } -- cgit