GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — sqlitebrowser/src/IconCache.cpp at master · sqlitebrowser/sqlitebrowser Expand file tree/ Copy pathIconCache.cppMore file actions 22 lines (18 loc) · 731 Bytes / Copy pathIconCache.cppFile metadata and controls22 lines (18 loc) · 731 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 #include "IconCache.h" QIcon IconCache::null_icon; std::unordered_map<std::string, QIcon> IconCache::icons; const QIcon& IconCache::get(const std::string& name) { // Check if we already have an icon object with that name in the cache. If so, just return that auto it = icons.find(name); if(it != icons.end()) return it->second; // If now, try to load an icon with that name and insert it into the cache QIcon icon(":/icons/" + QString::fromStdString(name)); auto ins = icons.insert({name, icon}); // If the insertion was successful, return the inserted icon object. If it was not, return a null icon. if(ins.second) return ins.first->second; else return null_icon; } |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |