Allow the user of the class to pass "" for the requested icon url.
git-svn-id: svn://10.0.0.236/trunk@9502 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -146,13 +146,17 @@ CImageCache :: ~CImageCache ( )
|
||||
//
|
||||
// Make a request for an icon. Will start loading if not present, and the return result
|
||||
// will be |kPutOnWaitingList|. If the data is already there in the cache, |kDataPresent|
|
||||
// is returned.
|
||||
// is returned. If the url being asked for is the empty string (""), return |kEmptyURL|.
|
||||
//
|
||||
CImageCache::ELoadResult
|
||||
CImageCache :: RequestIcon ( const string & inURL, const LListener* inClient )
|
||||
{
|
||||
ELoadResult result;
|
||||
|
||||
// first check to make sure URL is not ""
|
||||
if ( ! inURL.length() )
|
||||
return kEmptyURL;
|
||||
|
||||
ImageCacheData* data = mCache[inURL];
|
||||
if ( data ) {
|
||||
if ( !data->ImageAvailable() && data->IconContext() ) {
|
||||
|
||||
@@ -87,12 +87,14 @@ private:
|
||||
class CImageCache : public LListener
|
||||
{
|
||||
public:
|
||||
enum ELoadResult { kDataPresent, kPutOnWaitingList } ;
|
||||
enum ELoadResult { kDataPresent, kPutOnWaitingList, kEmptyURL } ;
|
||||
|
||||
CImageCache ( ) ;
|
||||
virtual ~CImageCache ( ) ;
|
||||
|
||||
// Make a request for an icon. Will start loading if not present.
|
||||
// Make a request for an icon. Will start loading if not present. If an
|
||||
// empty string is passed in, this will return |kEmptyURL| and nothing
|
||||
// will be loaded.
|
||||
ELoadResult RequestIcon ( const string & inURL, const LListener* inClient ) ;
|
||||
|
||||
// For images that are already loaded (RequestIcon() returned |kDataPresent|,
|
||||
|
||||
Reference in New Issue
Block a user