mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 705043 - Avoid cutting off Places URI titles unnecessarily. r=mak
This commit is contained in:
parent
2a55a7e9fc
commit
aaadc452b3
@ -1339,7 +1339,7 @@ PlacesTreeView.prototype = {
|
||||
// if they go through the "result" API.
|
||||
if (PlacesUtils.nodeIsSeparator(node))
|
||||
return "";
|
||||
return PlacesUIUtils.getBestTitle(node);
|
||||
return PlacesUIUtils.getBestTitle(node, true);
|
||||
case this.COLUMN_TYPE_TAGS:
|
||||
return node.tags;
|
||||
case this.COLUMN_TYPE_URI:
|
||||
|
@ -719,7 +719,7 @@ var PlacesUIUtils = {
|
||||
return aUrlString.substr(0, aUrlString.indexOf(":"));
|
||||
},
|
||||
|
||||
getBestTitle: function PUIU_getBestTitle(aNode) {
|
||||
getBestTitle: function PUIU_getBestTitle(aNode, aDoNotCutTitle) {
|
||||
var title;
|
||||
if (!aNode.title && PlacesUtils.uriTypes.indexOf(aNode.type) != -1) {
|
||||
// if node title is empty, try to set the label using host and filename
|
||||
@ -729,9 +729,13 @@ var PlacesUIUtils = {
|
||||
var host = uri.host;
|
||||
var fileName = uri.QueryInterface(Ci.nsIURL).fileName;
|
||||
// if fileName is empty, use path to distinguish labels
|
||||
title = host + (fileName ?
|
||||
(host ? "/" + this.ellipsis + "/" : "") + fileName :
|
||||
uri.path);
|
||||
if (aDoNotCutTitle) {
|
||||
title = host + uri.path;
|
||||
} else {
|
||||
title = host + (fileName ?
|
||||
(host ? "/" + this.ellipsis + "/" : "") + fileName :
|
||||
uri.path);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
// Use (no title) for non-standard URIs (data:, javascript:, ...)
|
||||
|
@ -336,7 +336,7 @@ var bookmarksObserver = {
|
||||
let cellText = tree.view.getCellText(aElementOrTreeIndex,
|
||||
tree.columns.getColumnAt(0));
|
||||
if (!aNewValue)
|
||||
return cellText == PlacesUIUtils.getBestTitle(tree.view.nodeForTreeIndex(aElementOrTreeIndex));
|
||||
return cellText == PlacesUIUtils.getBestTitle(tree.view.nodeForTreeIndex(aElementOrTreeIndex), true);
|
||||
return cellText == aNewValue;
|
||||
}
|
||||
else {
|
||||
|
Loading…
Reference in New Issue
Block a user