172 @return icon for the URL |
172 @return icon for the URL |
173 @rtype QIcon |
173 @rtype QIcon |
174 """ |
174 """ |
175 scheme = url.scheme() |
175 scheme = url.scheme() |
176 if scheme in ["eric", "about"]: |
176 if scheme in ["eric", "about"]: |
177 return UI.PixmapCache.getIcon("ericWeb.png") |
177 return UI.PixmapCache.getIcon("ericWeb") |
178 elif scheme == "qthelp": |
178 elif scheme == "qthelp": |
179 return UI.PixmapCache.getIcon("qthelp.png") |
179 return UI.PixmapCache.getIcon("qthelp") |
180 elif scheme == "file": |
180 elif scheme == "file": |
181 return UI.PixmapCache.getIcon("fileMisc.png") |
181 return UI.PixmapCache.getIcon("fileMisc") |
182 elif scheme == "abp": |
182 elif scheme == "abp": |
183 return UI.PixmapCache.getIcon("adBlockPlus.png") |
183 return UI.PixmapCache.getIcon("adBlockPlus") |
184 elif scheme == "ftp": |
184 elif scheme == "ftp": |
185 return UI.PixmapCache.getIcon("network-server.png") |
185 return UI.PixmapCache.getIcon("network-server") |
186 |
186 |
187 self.load() |
187 self.load() |
188 |
188 |
189 urlStr = self.__urlToString(url) |
189 urlStr = self.__urlToString(url) |
190 for iconUrlStr in self.__iconsDB: |
190 for iconUrlStr in self.__iconsDB: |
199 for iconUrlStr in self.__iconsDB: |
199 for iconUrlStr in self.__iconsDB: |
200 if iconUrlStr.startswith(urlStr): |
200 if iconUrlStr.startswith(urlStr): |
201 return self.__iconsDB[iconUrlStr] |
201 return self.__iconsDB[iconUrlStr] |
202 |
202 |
203 if scheme == "https": |
203 if scheme == "https": |
204 return UI.PixmapCache.getIcon("securityHigh32.png") |
204 return UI.PixmapCache.getIcon("securityHigh32") |
205 else: |
205 else: |
206 return UI.PixmapCache.getIcon("defaultIcon.png") |
206 return UI.PixmapCache.getIcon("defaultIcon") |
207 |
207 |
208 def clear(self): |
208 def clear(self): |
209 """ |
209 """ |
210 Public method to clear the icons cache. |
210 Public method to clear the icons cache. |
211 """ |
211 """ |