Make folder nodes just be a type of query node. Make nsNavHistoryResult inherit from QueryNode instead of ResultNode, to get rid of some redundancy. Bug 317878 / 314553, r=brettw.

Original committer: bryner%brianryner.com
Original revision: 1.7
Original date: 2005/11/29 00:35:31
This commit is contained in:
benjamin%smedbergs.us 2006-07-18 15:03:17 +00:00
parent 837ccb6d89
commit 3ce0176ab9

View File

@ -41,21 +41,6 @@
#include "nsNavHistory.h"
#include "nsBrowserCompsCID.h"
class nsNavBookmarks;
class nsNavFolderResultNode : public nsNavHistoryResultNode
{
public:
nsNavFolderResultNode() : nsNavHistoryResultNode(),
mBuiltChildren(PR_FALSE) { }
virtual nsresult BuildChildren(PRUint32 aOptions);
private:
friend class nsNavBookmarks;
PRBool mBuiltChildren;
};
class nsNavBookmarks : public nsINavBookmarksService,
public nsINavHistoryObserver
{
@ -77,6 +62,10 @@ public:
return sInstance;
}
nsresult QueryFolderChildren(nsINavHistoryQuery *aQuery,
nsINavHistoryQueryOptions *aOptions,
nsCOMArray<nsNavHistoryResultNode> *children);
private:
static nsNavBookmarks *sInstance;
@ -86,10 +75,10 @@ private:
PRInt32 aStartIndex, PRInt32 aEndIndex,
PRInt32 aDelta);
nsresult ResultNodeForFolder(PRInt64 aFolder,
nsINavHistoryQuery *aQuery,
nsINavHistoryQueryOptions *aOptions,
nsNavHistoryResultNode **aNode);
PRInt32 FolderCount(PRInt64 aFolder);
nsresult QueryFolderChildren(PRInt64 aFolder, PRUint32 aOptions,
nsCOMArray<nsNavHistoryResultNode>* aChildren);
nsNavHistory* History() { return nsNavHistory::GetHistoryService(); }
@ -109,8 +98,6 @@ private:
static const PRInt32 kGetFolderInfoIndex_Title;
nsCOMPtr<mozIStorageStatement> mDBGetChildren; // kGetInfoIndex_* results + kGetChildrenIndex_* results
nsCOMPtr<mozIStorageStatement> mDBGetItemChildren;
nsCOMPtr<mozIStorageStatement> mDBGetFolderChildren;
static const PRInt32 kGetChildrenIndex_Position;
static const PRInt32 kGetChildrenIndex_ItemChild;
static const PRInt32 kGetChildrenIndex_FolderChild;
@ -124,7 +111,5 @@ private:
nsCOMPtr<mozIStorageStatement> mDBFolderCount;
friend class nsNavFolderResultNode;
nsCOMPtr<nsIStringBundle> mBundle;
};