limit history sync to the last 500 items; load snapshots from the right directory in the profile

This commit is contained in:
Dan Mills 2007-12-21 16:07:42 -08:00
Родитель b711a57bc5
Коммит c99138171c
2 изменённых файлов: 8 добавлений и 3 удалений

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

@ -503,6 +503,8 @@ Engine.prototype = {
if (status.GUID != this._snapshot.GUID) { if (status.GUID != this._snapshot.GUID) {
this._log.info("Remote/local sync GUIDs do not match. " + this._log.info("Remote/local sync GUIDs do not match. " +
"Forcing initial sync."); "Forcing initial sync.");
this._log.debug("Remote: " + status.GUID);
this._log.debug("Local: " + this._snapshot.GUID);
this._store.resetGUIDs(); this._store.resetGUIDs();
this._snapshot.data = {}; this._snapshot.data = {};
this._snapshot.version = -1; this._snapshot.version = -1;

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

@ -204,7 +204,8 @@ SnapshotStore.prototype = {
load: function SStore_load() { load: function SStore_load() {
let file = this._dirSvc.get("ProfD", Ci.nsIFile); let file = this._dirSvc.get("ProfD", Ci.nsIFile);
file.append("weave-snapshots"); file.append("weave");
file.append("snapshots");
file.append(this.filename); file.append(this.filename);
if (!file.exists()) if (!file.exists())
@ -605,8 +606,8 @@ HistoryStore.prototype = {
}, },
_removeCommand: function HistStore__removeCommand(command) { _removeCommand: function HistStore__removeCommand(command) {
this._log.info(" -> removing history entry: " + command.GUID); this._log.info(" -> NOT removing history entry: " + command.GUID);
this._browserHist.removePage(command.GUID); //this._browserHist.removePage(command.GUID);
}, },
_editCommand: function HistStore__editCommand(command) { _editCommand: function HistStore__editCommand(command) {
@ -619,6 +620,8 @@ HistoryStore.prototype = {
options = this._hsvc.getNewQueryOptions(); options = this._hsvc.getNewQueryOptions();
query.minVisits = 1; query.minVisits = 1;
options.maxResults = 500;
options.sortingMode = query.SORT_BY_LASTMODIFIED_DESCENDING;
options.queryType = options.QUERY_TYPE_HISTORY; options.queryType = options.QUERY_TYPE_HISTORY;
let root = this._hsvc.executeQuery(query, options).root; let root = this._hsvc.executeQuery(query, options).root;