Commit bd0d4c9b80 (Support *either* history *or* bookmarks in read_url
completions) added support for completion on bookmark user titles, but
disallows completion on both bookmarks and history.
With this commit the user can choose which kind of brokenness they
prefer by setting use_broken_bookmark_completion. It is expected that
this variable will be ignored and deprecated once QUERY_TYPE_UNIFIED
works.
---
Thank you very much for conkeror; it has made web browsing much less
irritating for me.
regards, David
modules/history.js | 23 ++++++++++++++++-------
1 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/modules/history.js b/modules/history.js
index 639f536..f10377b 100644
--- a/modules/history.js
+++ b/modules/history.js
@@ -9,6 +9,13 @@
const nav_history_service = Cc["@mozilla.org/browser/nav-history-service;1"]
.getService(Ci.nsINavHistoryService);
+define_variable("use_broken_bookmark_completion", true,
+ "If this is set to true, you can complete against bookmark " +
+ "user titles. However if both history and bookmark " +
+ "completion are selected, neither will work. If this is " +
+ "set to false the you may complete against both history " +
+ "and bookmarks, but not bookmark user titles.");
+
define_keywords("$use_webjumps", "$use_history", "$use_bookmarks");
function history_completer() {
keywords(arguments);
@@ -23,12 +30,14 @@ function history_completer() {
query.onlyBookmarked = true;
var options = nav_history_service.getNewQueryOptions();
options.sortingMode = options.SORT_BY_VISITCOUNT_DESCENDING;
- if (use_bookmarks && !use_history)
- options.queryType = options.QUERY_TYPE_BOOKMARKS;
- else if (use_history && !use_bookmarks)
- options.queryType = options.QUERY_TYPE_HISTORY;
- else
- options.queryType = options.QUERY_TYPE_UNIFIED; //WTF: not
implemented yet?
+ if (use_broken_bookmark_completion) {
+ if (use_bookmarks && !use_history)
+ options.queryType = options.QUERY_TYPE_BOOKMARKS;
+ else if (use_history && !use_bookmarks)
+ options.queryType = options.QUERY_TYPE_HISTORY;
+ else
+ options.queryType = options.QUERY_TYPE_UNIFIED; //WTF: not
implemented yet?
+ }
var root = nav_history_service.executeQuery(query, options).root;
root.containerOpen = true;
var history_count = root.childCount;
@@ -37,7 +46,7 @@ function history_completer() {
get_description: function (i) root.getChild(i).title,
get_input_state: function (i) [root.getChild(i).uri],
destroy: function () { root.containerOpen = false; }
- };
+ };
}
}
--
1.6.0.2.296.gfe33b.dirty
--
IMPORTANT: This email remains the property of the Australian Defence
Organisation and is subject to the jurisdiction of section 70 of the
CRIMES ACT 1914. If you have received this email in error, you are
requested to contact the sender and delete the email.
_______________________________________________
Conkeror mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/conkeror