mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-21 22:57:31 +09:00
[PALEMOON] Bug 1115971 - Don't fall back to the Places title for downloads without the target file name annotation
This commit is contained in:
parent
e4e51e5782
commit
7fce042c11
1 changed files with 7 additions and 20 deletions
|
|
@ -58,8 +58,8 @@ const NOT_AVAILABLE = Number.MAX_VALUE;
|
||||||
* - The DownloadsPlacesView object implements onDataItemStateChanged and
|
* - The DownloadsPlacesView object implements onDataItemStateChanged and
|
||||||
* onDataItemChanged of the DownloadsView pseudo interface.
|
* onDataItemChanged of the DownloadsView pseudo interface.
|
||||||
* - The DownloadsPlacesView object adds itself as a places result observer and
|
* - The DownloadsPlacesView object adds itself as a places result observer and
|
||||||
* calls this object's placesNodeIconChanged, placesNodeTitleChanged and
|
* calls this object's placesNodeIconChanged and placesNodeAnnotationChanged
|
||||||
* placeNodeAnnotationChanged from its callbacks.
|
* from its callbacks.
|
||||||
*
|
*
|
||||||
* @param [optional] aDataItem
|
* @param [optional] aDataItem
|
||||||
* The data item of a the session download. Required if aPlacesNode is not set
|
* The data item of a the session download. Required if aPlacesNode is not set
|
||||||
|
|
@ -287,9 +287,9 @@ DownloadElementShell.prototype = {
|
||||||
* - fileName: the downloaded file name on the file system. Set if filePath
|
* - fileName: the downloaded file name on the file system. Set if filePath
|
||||||
* is set.
|
* is set.
|
||||||
* - displayName: the user-facing label for the download. This is always
|
* - displayName: the user-facing label for the download. This is always
|
||||||
* set. If available, it's set to the downloaded file name. If not,
|
* set. If available, it's set to the downloaded file name. If not, this
|
||||||
* the places title for the download uri is used. As a last resort,
|
* means the download does not have Places metadata because it is very old,
|
||||||
* we fallback to the download uri.
|
* and in this rare case the download uri is used.
|
||||||
* - fileSize (only set for downloads which completed successfully):
|
* - fileSize (only set for downloads which completed successfully):
|
||||||
* the downloaded file size. For downloads done after the landing of
|
* the downloaded file size. For downloads done after the landing of
|
||||||
* bug 826991, this value is "static" - that is, it does not necessarily
|
* bug 826991, this value is "static" - that is, it does not necessarily
|
||||||
|
|
@ -337,7 +337,7 @@ DownloadElementShell.prototype = {
|
||||||
this._metaData.displayName = this._metaData.fileName;
|
this._metaData.displayName = this._metaData.fileName;
|
||||||
}
|
}
|
||||||
catch(ex) {
|
catch(ex) {
|
||||||
this._metaData.displayName = this._placesNode.title || this.downloadURI;
|
this._metaData.displayName = this.downloadURI;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -511,14 +511,6 @@ DownloadElementShell.prototype = {
|
||||||
this._element.setAttribute("image", this._getIcon());
|
this._element.setAttribute("image", this._getIcon());
|
||||||
},
|
},
|
||||||
|
|
||||||
placesNodeTitleChanged: function DES_placesNodeTitleChanged() {
|
|
||||||
// If there's a file path, we use the leaf name for the title.
|
|
||||||
if (!this._dataItem && this.active && !this.getDownloadMetaData().filePath) {
|
|
||||||
this._metaData = null;
|
|
||||||
this._updateDisplayNameAndIcon();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
placesNodeAnnotationChanged: function DES_placesNodeAnnotationChanged(aAnnoName) {
|
placesNodeAnnotationChanged: function DES_placesNodeAnnotationChanged(aAnnoName) {
|
||||||
this._annotations.delete(aAnnoName);
|
this._annotations.delete(aAnnoName);
|
||||||
if (!this._dataItem && this.active) {
|
if (!this._dataItem && this.active) {
|
||||||
|
|
@ -1264,12 +1256,7 @@ DownloadsPlacesView.prototype = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
nodeTitleChanged: function DPV_nodeTitleChanged(aNode, aNewTitle) {
|
nodeTitleChanged() {},
|
||||||
this._forEachDownloadElementShellForURI(aNode.uri, function(aDownloadElementShell) {
|
|
||||||
aDownloadElementShell.placesNodeTitleChanged();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
nodeKeywordChanged: function() {},
|
nodeKeywordChanged: function() {},
|
||||||
nodeDateAddedChanged: function() {},
|
nodeDateAddedChanged: function() {},
|
||||||
nodeLastModifiedChanged: function() {},
|
nodeLastModifiedChanged: function() {},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue