Allow the user of the class to pass "" for the requested icon url.

This commit is contained in:
pinkerton%netscape.com 1998-09-08 18:08:35 +00:00
parent 789724c9d3
commit 8a6ebf136f
2 changed files with 9 additions and 3 deletions

View File

@ -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() ) {

View File

@ -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|,