From bb94402f82595cb71897e7148da8ff6eb7ec7a3d Mon Sep 17 00:00:00 2001 From: "pinkerton%netscape.com" Date: Tue, 8 Sep 1998 18:08:35 +0000 Subject: [PATCH] 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 --- mozilla/cmd/macfe/central/CIconCache.cp | 6 +++++- mozilla/cmd/macfe/central/CIconCache.h | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/mozilla/cmd/macfe/central/CIconCache.cp b/mozilla/cmd/macfe/central/CIconCache.cp index b7f4ad04845..2c75e694176 100644 --- a/mozilla/cmd/macfe/central/CIconCache.cp +++ b/mozilla/cmd/macfe/central/CIconCache.cp @@ -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() ) { diff --git a/mozilla/cmd/macfe/central/CIconCache.h b/mozilla/cmd/macfe/central/CIconCache.h index 291556e3233..728c12e8938 100644 --- a/mozilla/cmd/macfe/central/CIconCache.h +++ b/mozilla/cmd/macfe/central/CIconCache.h @@ -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|,