171 @param url URL to get icon for |
171 @param url URL to get icon for |
172 @type QUrl |
172 @type QUrl |
173 @return icon for the URL |
173 @return icon for the URL |
174 @rtype QIcon |
174 @rtype QIcon |
175 """ |
175 """ |
|
176 scheme2iconName = { |
|
177 "eric": "ericWeb", |
|
178 "about": "ericWeb", |
|
179 "qthelp": "qthelp", |
|
180 "file": "fileMisc", |
|
181 "abp": "adBlockPlus", |
|
182 "ftp": "network-server", |
|
183 } |
|
184 |
176 scheme = url.scheme() |
185 scheme = url.scheme() |
177 if scheme in ["eric", "about"]: |
186 iconName = scheme2iconName.get(scheme) |
178 return UI.PixmapCache.getIcon("ericWeb") |
187 if iconName: |
179 elif scheme == "qthelp": |
188 return UI.PixmapCache.getIcon(iconName) |
180 return UI.PixmapCache.getIcon("qthelp") |
|
181 elif scheme == "file": |
|
182 return UI.PixmapCache.getIcon("fileMisc") |
|
183 elif scheme == "abp": |
|
184 return UI.PixmapCache.getIcon("adBlockPlus") |
|
185 elif scheme == "ftp": |
|
186 return UI.PixmapCache.getIcon("network-server") |
|
187 |
189 |
188 self.load() |
190 self.load() |
189 |
191 |
190 urlStr = self.__urlToString(url) |
192 urlStr = self.__urlToString(url) |
191 if urlStr in self.__iconsDB: |
193 if urlStr in self.__iconsDB: |