[for joe@retrovirus.com] Bug 324743, r=brettw. Result roots are closed by default.

This commit is contained in:
brettw%gmail.com 2006-01-31 03:05:02 +00:00
Родитель 2ba1e3e5e0
Коммит 97025a9fdc
5 изменённых файлов: 10 добавлений и 13 удалений

Просмотреть файл

@ -253,7 +253,9 @@ var PlacesController = {
options.setGroupingMode([Ci.nsINavHistoryQueryOptions.GROUP_BY_FOLDER], 1);
options.excludeItems = excludeItems;
options.expandQueries = expandQueries;
return this._hist.executeQuery(query, options);
var result = this._hist.executeQuery(query, options);
result.root.containerOpen = true;
return result;
},
/**
@ -1554,5 +1556,3 @@ PlacesEditItemTransaction.prototype = {
Determine the state of commands!
*/

Просмотреть файл

@ -36,6 +36,7 @@
options.setGroupingMode([Ci.nsINavHistoryQueryOptions.GROUP_BY_FOLDER], 1);
options.expandQueries = true;
this._result = this._places.executeQuery(query, options);
this._result.root.containerOpen = true;
this._rebuild();
]]></body>
</method>
@ -166,6 +167,7 @@
<body><![CDATA[
this._result = this._places.executeQueries(queries, queries.length,
options);
this._result.root.containerOpen = true;
this._rebuild();
]]></body>
</method>

Просмотреть файл

@ -508,8 +508,8 @@ interface nsINavHistoryResult : nsISupports
* This is the root of the results. It will either be a
* nsINavHistoryFolderResultNode (if the query is for bookmarks matching a
* single folder) or just a nsINavHistoryQueryResultNode (for everything
* else). The root node is open by default. Remember that you need to open
* all other containers for their contents to be valid.
* else). Remember that you need to open all containers for their contents
* to be valid.
*/
readonly attribute nsINavHistoryQueryResultNode root;
};

Просмотреть файл

@ -1684,12 +1684,6 @@ nsNavHistory::ExecuteQueries(nsINavHistoryQuery** aQueries, PRUint32 aQueryCount
getter_AddRefs(result));
NS_ENSURE_SUCCESS(rv, rv);
// Query result roots are open by default, but this needs to be done AFTER the result
// has been constructed. This step will actually run the query/populate the bookmark
// folder results.
rv = rootNode->OpenContainer();
NS_ENSURE_SUCCESS(rv, rv);
NS_ADDREF(*_retval = result);
return NS_OK;
}

Просмотреть файл

@ -4119,8 +4119,10 @@ NS_IMETHODIMP nsNavHistoryResult::GetCellText(PRInt32 row,
NS_IMETHODIMP nsNavHistoryResult::SetTree(nsITreeBoxObject* tree)
{
mTree = tree;
if (mTree)
if (mTree) {
mRootNode->SetContainerOpen(PR_TRUE);
SetTreeSortingIndicator();
}
// if there is no tree, BuildVisibleList will clear everything for us
return BuildVisibleList();
}
@ -4746,4 +4748,3 @@ nsNavHistoryResult::OnPageChanged(nsIURI *aURI,
ENUMERATE_HISTORY_OBSERVERS(OnPageChanged(aURI, aWhat, aValue));
return NS_OK;
}