diff options
Diffstat (limited to 'src/Cache.cpp')
-rw-r--r-- | src/Cache.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/Cache.cpp b/src/Cache.cpp index 1c3261b..df97174 100644 --- a/src/Cache.cpp +++ b/src/Cache.cpp @@ -134,7 +134,7 @@ namespace dchat } catch(std::exception &e) { - + fprintf(stderr, "Failed to load image %s, reason: %s\n", filepath.string().c_str(), e.what()); } return { (sf::Texture*)nullptr, ImageByUrlResult::Type::FAILED_DOWNLOAD }; } @@ -162,14 +162,9 @@ namespace dchat imageDownloadMutex.lock(); imageUrlCache[it->url] = imageByUrlResult; imageDownloadMutex.unlock(); - switch(imageByUrlResult.type) + if(imageByUrlResult.type == ImageByUrlResult::Type::CACHED) { - case ImageByUrlResult::Type::CACHED: - printf("Downloaded image from url: %s\n", it->url.c_str()); - break; - case ImageByUrlResult::Type::FAILED_DOWNLOAD: - printf("Failed to download and load image from url: %s\n", it->url.c_str()); - break; + printf("Download %s from url: %s\n", imageByUrlResult.isGif ? "gif" : "image", it->url.c_str()); } } it = imageDownloadProcesses.erase(it); |