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
Родитель f3baed9e2d
Коммит c00c65302d
1 изменённых файлов: 6 добавлений и 21 удалений

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

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