mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1115972 - Don't fall back to the Places icon for downloads without the target file name annotation. r=mak
This commit is contained in:
parent
fb58d9c234
commit
8976cce890
@ -58,8 +58,7 @@ const NOT_AVAILABLE = Number.MAX_VALUE;
|
||||
* - The DownloadsPlacesView object implements onDataItemStateChanged and
|
||||
* onDataItemChanged of the DownloadsView pseudo interface.
|
||||
* - The DownloadsPlacesView object adds itself as a places result observer and
|
||||
* calls this object's placesNodeIconChanged and placesNodeAnnotationChanged
|
||||
* from its callbacks.
|
||||
* calls this object's placesNodeAnnotationChanged from its callbacks.
|
||||
*
|
||||
* @param [optional] aDataItem
|
||||
* The data item of a the session download. Required if aPlacesNode is not set
|
||||
@ -175,13 +174,10 @@ DownloadElementShell.prototype = {
|
||||
}
|
||||
|
||||
if (this._placesNode) {
|
||||
// Try to extract an extension from the uri.
|
||||
let ext = this._downloadURIObj.QueryInterface(Ci.nsIURL).fileExtension;
|
||||
if (ext) {
|
||||
return "moz-icon://." + ext + "?size=32";
|
||||
}
|
||||
return this._placesNode.icon || "moz-icon://.unknown?size=32";
|
||||
return "moz-icon://.unknown?size=32";
|
||||
}
|
||||
|
||||
// Assert unreachable.
|
||||
if (this._dataItem) {
|
||||
throw new Error("Session-download items should always have a target file uri");
|
||||
}
|
||||
@ -514,12 +510,6 @@ DownloadElementShell.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
placesNodeIconChanged() {
|
||||
if (!this._dataItem) {
|
||||
this._element.setAttribute("image", this._getIcon());
|
||||
}
|
||||
},
|
||||
|
||||
placesNodeAnnotationChanged(aAnnoName) {
|
||||
this._annotations.delete(aAnnoName);
|
||||
if (!this._dataItem && this.active) {
|
||||
@ -1266,16 +1256,12 @@ DownloadsPlacesView.prototype = {
|
||||
this._removeHistoryDownloadFromView(aPlacesNode);
|
||||
},
|
||||
|
||||
nodeIconChanged(aNode) {
|
||||
this._forEachDownloadElementShellForURI(aNode.uri,
|
||||
des => des.placesNodeIconChanged());
|
||||
},
|
||||
|
||||
nodeAnnotationChanged(aNode, aAnnoName) {
|
||||
this._forEachDownloadElementShellForURI(aNode.uri,
|
||||
des => des.placesNodeAnnotationChanged(aAnnoName));
|
||||
},
|
||||
|
||||
nodeIconChanged() {},
|
||||
nodeTitleChanged() {},
|
||||
nodeKeywordChanged() {},
|
||||
nodeDateAddedChanged() {},
|
||||
|
Loading…
Reference in New Issue
Block a user