Commit Graph

278 Commits

Author SHA1 Message Date
Ryan Roden-Corrent
b610563e7f Don't show current window for :tab-give/:tab-take.
Resolves #3144.
2017-12-03 08:03:54 -05:00
Florian Bruhin
e9be357104 Merge remote-tracking branch 'origin/pr/3352' 2017-12-02 14:37:01 +01:00
Ryan Roden-Corrent
b6dcd4d387 Reapply "Hide quickmark/bookmark completion if empty."
This reverts commit e72e8b8556.

Now that the SQL category works in isolation, it is possible to hide
quickmarks/bookmarks when those categories are empty.

Fixes #960
2017-11-28 07:21:26 -05:00
Ryan Roden-Corrent
40e4e73e36 Ensure HistoryCategory works in isolation.
While QSortFilterProxyModel emits layoutChanged when changing the
pattern, QSqlQueryModel emits modelReset. As only layoutChanged was
connected, a HistoryCategory would only work in a model that also had at
least one ListCategory.

The simplest solution is to have the parent model emit the signal
directly. This also emits a single signal on a pattern change rather
that one for each child model.

Resolves #3016.
2017-11-27 11:49:32 -05:00
Florian Bruhin
75a8938e83 Add flake8-bugbear 2017-11-26 21:50:12 +01:00
Panagiotis Ktistakis
2bb8d404d2 Adjust :bind completion tests 2017-11-26 14:07:41 +02:00
Florian Bruhin
404f9ea1d0 Merge remote-tracking branch 'origin/pr/3290' 2017-11-15 07:31:10 +01:00
Florian Bruhin
e72e8b8556 Revert "Hide quickmark/bookmark completion if empty."
This reverts commit 23716f1212.

See #3016
Fixes #3288
Reopens #960
2017-11-14 13:29:58 +01:00
Ryan Roden-Corrent
b72343d126 Yank selected text with completion-item-yank.
If text is highlighted in the status command bar, completion-item-yank
should yank that rather than the selected completion item.

Resolves #3281.
2017-11-13 13:25:18 -05:00
Florian Bruhin
8057f5c281 Set __tracebackhide__ for _check_completions 2017-11-13 09:02:16 +01:00
Florian Bruhin
f6cc6677dd Remove hiding of commands
This was often confusing for people - let's instead just hide commands which are
not available in normal mode.
2017-11-13 09:02:16 +01:00
Ryan Roden-Corrent
23716f1212 Hide quickmark/bookmark completion if empty.
If there are no quickmarks/bookmarks, hide the entire category in url
completion. Note that this only hides the category if
quickmarks/bookmarks is empty to begin with. An empty category is still
shown if the completion pattern filters out all items in that category.

See #960.
2017-11-12 22:28:49 -05:00
Ryan Roden-Corrent
bb63f9fd92 Implement completion-item-yank.
Yank the text from the first column of the completion menu.
Resolves #1588.
2017-11-05 11:07:38 -05:00
Florian Bruhin
0f28804032
Merge pull request #3237 from rcorre/completionsort
Fix completion sorting
2017-11-03 14:36:42 +01:00
Ryan Roden-Corrent
a9926e44f0 Don't check date string in test_histcategory.
We really just need to check that the row exists here, the date doesn't
matter. Checking the date here is actually flaky with regards to time.
When running locally at 11:50 EST, it failed with:

```
assert self._model.data(self._model.index(row, col)) == item
AssertionError: assert '1969-12-31' == '1970-01-01'
- 1969-12-31
+ 1970-01-01
```

It was wrong to assume that an atime of 0 would always format to
1970-01-01.
2017-11-02 22:10:00 -04:00
Ryan Roden-Corrent
47447c047a Ensure completions are sorted after filtering.
I previously removed the sorting logic from SortFilter thinking it was
unnecessary if we construct the model with a sorted list. However, this
only worked when no pattern was set, and the items are misordered as
soon as a pattern is input.

This patch reintroduces alpha-sorting, which can be disabled by passing
sort=False to the ListCategory constructor. The session completion test
had to be tweaked as it simulated the incorrect assumption that the
session list is not alpha-ordered; sessions come out of the
session-manager pre-sorted so we may as well use alpha-sorting in the
session completion model.

Resolves #3156.
2017-11-02 22:10:00 -04:00
Luca Benci
c28d681736 Change test to avoid calling private functions 2017-11-02 19:42:33 +01:00
Luca Benci
35597a7c01 Change tests for trailing-space behaviour change 2017-10-31 23:15:11 +01:00
Luca Benci
249164eb9b Fix test_quickcomplete_flicker
The test needed to be fixed because of how the completer behaviour
changed.

Before:
completer always scheduled a completion update on selection changed,
but the updates themselves were ignored if not needed.

Now:
completer only schedules completion updates when actually needed, but
never ignores a completion update.

So, before it was correct to check whether `set_model` was called, now
we must check if the completion was actually scheduled. This can be
done by checking the parameters with which `_change_completed_part`
is called, since a completion is scheduled only when `immediate=True`
2017-10-27 22:25:41 +02:00
Michael Hoang
249e497d36 Add test for window completion 2017-10-11 17:18:13 +11:00
Florian Bruhin
42550cd2e6 Merge remote-tracking branch 'origin/pr/3048' 2017-10-04 06:47:48 +02:00
Florian Bruhin
22088d9f7b Remove --force for :bind and config.bind(...)
Turns out --force is just in the way for most people, and at least for default
bindings it's easy to reset them.

Also, it makes :config-source fail when config.py contains keybindings.

Closes #3049
2017-10-03 20:43:38 +02:00
Florian Bruhin
3772084cbf Adjust test_histcategory for NOT NULL constraints 2017-10-03 10:28:36 +02:00
Florian Bruhin
6573888dc6 Fix :bind completion with invalid commands
Now that Command doesn't validate things anymore, we can't rely on parsing to
work.
2017-09-27 11:10:25 +02:00
Florian Bruhin
4e46c34e5a Use .assert_not_called() for mocks 2017-09-22 19:58:38 +02:00
Florian Bruhin
cb57525f69 Fix whitespace 2017-09-21 13:43:30 +02:00
Ryan Roden-Corrent
f9440b8026 Use CommandParser for configmodel.bind.
The parsing bind() did manually is now available through CommandParser.
Resolves #2952.

This also adds a unit test for the case when there is no current
binding, as I broke that while working on this and there was no test to
catch it :)
2017-09-20 07:05:38 -04:00
Florian Bruhin
62b30af12a Fix unit tests for end2end SQL change 2017-09-17 11:49:42 +02:00
Florian Bruhin
4f6e085be8 Quote a completed value if it contains " 2017-09-15 22:17:38 +02:00
Ryan Roden-Corrent
63e0574411 Remove stray FIXME:conf 2017-09-07 07:32:46 -04:00
Ryan Roden-Corrent
a5ecb75fcd Really avoid flakiness in test_models.
Ensure the OrderedDict is actually ordered consistently.
2017-09-05 07:52:42 -04:00
Ryan Roden-Corrent
fc02216754 Avoid flakiness in test_models.
Ensure config values are ordered consistently by using an OrderedDict.
2017-09-04 16:30:54 -04:00
Ryan Roden-Corrent
0d78c72018 Remove config dependency from get_cmd_completions.
In order to really resolve the python3.4 circular import, this should
take the completion info as an argument and not depend on the config
module.
2017-09-04 15:00:35 -04:00
Ryan Roden-Corrent
3bfa01f0d0 Pass CompletionInfo to completion functions.
In python3.4, there is a circular dependency between the config module
and configmodel.bind. This is resolved by dependency injection. The
config/keyconfig instances are embedded in a struct passed to every
completion function, so the functions no longer depend on the modules.

This will also enable completion functions to access other previously
inaccessible info, such as the window id.
See #2814.
2017-09-04 14:01:48 -04:00
Ryan Roden-Corrent
111846a909 Merge remote-tracking branch 'upstream/master' into configmerge 2017-08-20 21:18:47 -04:00
Ryan Roden-Corrent
b5a6583559 Fix pylint/flake8/vulture errors. 2017-08-20 21:12:38 -04:00
Ryan Roden-Corrent
90c49b3fe7 Move bind completion to configmodels.
When in miscmodels, the config module was unable to find the function.
It appears to be some sort of circular import issue:

```
  File "/home/rcorre/projects/contrib/qutebrowser/qutebrowser/app.py", line 44, in <module>
    from qutebrowser.completion.models import miscmodels
  File "/home/rcorre/projects/contrib/qutebrowser/qutebrowser/completion/models/miscmodels.py", line 24, in <module>
    from qutebrowser.completion.models import completionmodel, listcategory, util
  File "/home/rcorre/projects/contrib/qutebrowser/qutebrowser/completion/models/util.py", line 24, in <module>
    from qutebrowser.config import config
  File "/home/rcorre/projects/contrib/qutebrowser/qutebrowser/config/config.py", line 223, in <module>
    class ConfigCommands:
  File "/home/rcorre/projects/contrib/qutebrowser/qutebrowser/config/config.py", line 314, in ConfigCommands
    @cmdutils.argument('command', completion=miscmodels.bind)
AttributeError: module 'qutebrowser.completion.models.miscmodels' has no attribute 'bind'
```

As configmodel imports util (and thereby config as well) it is unclear
to me why moving bind() to configmodel actually fixes this, but it does.
2017-08-20 21:12:38 -04:00
Ryan Roden-Corrent
0286e9ddf2 Fix completion tests after config merge. 2017-08-20 21:12:38 -04:00
Ryan Roden-Corrent
5ea420b49b Fix startup crashes after config merge.
Get qutebrowser to the point where it can at least start

- Declare _messages earlier in MessageView.__init__ so it is set before
  the config trigger tries to access it.
- Remove unused configmodel completion functions
- Move bind completion to configmodel to avoid a circular import with
  the config module
- Fix some config accesses (forgot to use .val)
- Fix old Completion.CompletionKind references
2017-08-09 07:28:22 -04:00
Ryan Roden-Corrent
71b71dbc58 Merge remote-tracking branch 'upstream/master' into HEAD 2017-08-06 18:13:49 -04:00
Ryan Roden-Corrent
6e025c1bb0 Don't perform alphabetical sort in listcategory.
Instead, expect the data to be given in the desired order. Completion
functions should sort their data _if_ they want it sorted in the
completion. This has a few implications:

- {book,quick}marks appear in the same order they do in the text file.
  This means users can rearrange their mark files for custom sorting.
  Fixes #2354
- Sessions are sorted as they appear in the session manager
- Tabs are sorted numerically, not alphabetically (Fixes #2883)

Note that prefix-based filter sorting is still performed, so items
starting with the filter pattern come first.
2017-08-06 10:00:18 -04:00
Florian Bruhin
ba92ea9fb4 Merge pull request #2873 from rcorre/completion-del-marks
Support delete from :{quick,book}mark-load.
2017-07-29 19:27:25 +02:00
Ryan Roden-Corrent
1ab7bb83cc Support delete from :{quick,book}mark-load.
Pressing ctrl-d in the completion menu for
:quickmark-load/:bookmark-load  will now delete the selected
quickmark/bookmark.

Resolves #2840.
2017-07-29 12:49:20 -04:00
Ryan Roden-Corrent
c6cb6ccd07 Fix fetch/delete sql category bug.
Fixes #2868, where pressing <shift-tab> then <ctrl-d> in history
completion (with > 256 items) would cause later items to disappear (and
cause a crash if you try to delete again).

Cause:
Scrolling to the bottom would fetch an additional 256 items (in addition
to the 256 that are fetched at first). Deleting causes the query to
re-run, but it only fetches the initial 256 items, so the current index
is now invalid.

Fix:
After deleting from the history category, call fetchMore until it has
enough rows populated that the current index is valid.
2017-07-28 09:07:30 -04:00
Florian Bruhin
8f63bb1edc Merge pull request #2853 from rcorre/fix-completionview
Expand history completion results if on last index.
2017-07-27 12:31:01 +02:00
Ryan Roden-Corrent
32fa1ff1e9 Expand history completion results if on last index.
When tabbing to the last index of history completion, call expandAll
which will call fetchMore to retrieve more query results, if available.

Calling fetchMore directly will not update the view, and for some
reason self.expand(idx.parent()) and
self.expand(self.model().index(idx.row(), 0)) did not work, so I'm using
expandAll.

Fixes #2841.
2017-07-26 07:46:12 -04:00
Ryan Roden-Corrent
1929883485 Fix bind completion for bindings with arguments.
When a key is bound to a command line that includes one or more
arguments to a command, bind completion should show the whole command
for the "Current" category, and use only the command name to look up the
description.

Fixes #2859, where a crash was caused by looking up the description by
the full command text rather than just the name.
2017-07-25 12:55:44 -04:00
Ryan Roden-Corrent
f09423efe5 Abort resizeEvent if model is None.
Some reports came in that a resizeEvent was causing a crash due to the
model being none in the CompletionView.

Fixes #2854.
2017-07-24 08:16:14 -04:00
Florian Bruhin
df3ba278e9 Merge pull request #2852 from rcorre/fix-max-items
Fix web-history-max-items-crash.
2017-07-24 07:29:15 +02:00
Ryan Roden-Corrent
2ad4cdd729 Fix web-history-max-items-crash.
Fixes #2849, where pressing 'o' with web-history-max-items set and no
history items would cause a crash as the query result is empty.
2017-07-23 21:17:22 -04:00
Ryan Roden-Corrent
ff9efe22ae Fix unused imports and removeRow override.
Override removeRows instead of removeRow.

> removeRow is not virtual in C++, so if this gets called by Qt
> internally for some reason, it wouldn't use the overloaded version -
> so I think it'd be better to implement removeRows and then use
> removeRow without overloading that

- The-Compiler
2017-07-23 17:30:09 -04:00
Ryan Roden-Corrent
b61691684e Clear selection when setting completion pattern.
It doesn't make sense to have an active selection while you are
filtering by entering text. You should be in one of two states:

1. Tabbing through completions (valid selection)
2. Entering a filter pattern (invalid selection)

Fixes #2843, where a crash would occur after the following:

1. tab to an item other than the first
2. <backspace>
3. re-type last character
4. <ctrl-d>

This would try to delete an out of range index.
2017-07-22 18:06:16 -04:00
Ryan Roden-Corrent
bc21904fef Fix completion-item-del on undeletable item.
Even though no item was deleted, it was manipulating the completion
model because beginRemoveRows was called before the exception was
raised.

This fixes that problem by moving the removal logic (and delete_func
check) into the parent model, so it can check whether deletion is
possible before calling beginRemoveRows.

Fixes #2839.
2017-07-22 17:16:35 -04:00
Florian Bruhin
118a7942a5 Add maximum bound for web-history-max-items
sqlite can't handle values bigger than uint64_t for LIMIT.
2017-07-21 18:30:12 +02:00
Florian Bruhin
544094ba72 Use simpler way of preventing History completion 2017-07-21 17:55:47 +02:00
Florian Bruhin
6660297871 Fix new completion with web-history-max-items set to 0
We get no last_atime limit at all otherwise:

qutebrowser.misc.sql.SqlException: Failed to prepare query "SELECT url, title,
strftime('%Y-%m-%d', last_atime, 'unixepoch', 'localtime') FROM
CompletionHistory WHERE (url LIKE :pat escape '\' or title LIKE :pat escape '\')
AND last_atime >= ORDER BY last_atime DESC": "near "ORDER": syntax error Unable
to execute statement"
2017-07-21 17:11:38 +02:00
Ryan Roden-Corrent
0eb347186c Add 'localtime' to sql history query.
We need to tell sqlite to convert the timestamps to localtime during
formatting, otherwise it formats them as though you are in UTC.

Also fix up a few uses of mktime.
2017-07-20 09:06:29 -04:00
Ryan Roden-Corrent
c32d452786 Add LIMIT to history query.
For performance, re-introduce web-history-max-items.
As the history query has now become a very specific multi-part query and
history completion was the only consumer of SqlCategory, SqlCategory is
now replaced by a HistoryCategory class.
2017-07-16 18:13:51 -04:00
Ryan Roden-Corrent
ea459a1eca SQL code review fixes.
- Ignore invalid variable name in flake8 (pylint already checks this and
  we don't want to have to double-ignore)
- Fix and test completion bug with `:set asdf `
- Remove unused import
- Use `assert not func.called` instead of `func.assert_not_called` for
  backwards compatibility
2017-07-12 08:19:31 -04:00
Ryan Roden-Corrent
182d067ff8 SQL code review fixes.
- Fix comment and empty line check in _parse_entry
- connect layoutAboutToBeChanged signal
- assert sort_order is None if sort_by is None
- modify sql init failure message to ask about Qt sqlite support.
2017-07-11 08:07:48 -04:00
Ryan Roden-Corrent
cf4ac1a5b7 SQL code review changes.
- use mocker.Mock instead of mock.Mock to avoid an extra import
- attach model to validator sooner so it can validate changes in the
  model during the test
2017-07-08 16:34:38 -04:00
Ryan Roden-Corrent
f9f8900fe9 More sql code review fixes.
- remove outdated comment
- fix sql init error message
- clean up history text import code
- fix test_history file path in coverage check
- use real web history, not stub, for completion model tests
- use qtmodeltester in sql/list_category tests
- test url encoding in history tests
- fix test_clear by using a callable mock
- remove test_debug_dump_history_oserror as the check is now the same as
  for the file not existing
- rename nonempty to data in test_completionmodel
- add more delete_cur_item tests
- test empty option/value completion
2017-07-08 09:57:32 -04:00
Ryan Roden-Corrent
81f5b7115f Add spec=[] to two mock functions in tests. 2017-07-05 08:44:56 -04:00
Florian Bruhin
0cdd3ff82f Update some more references to old config options 2017-07-04 16:46:02 +02:00
Florian Bruhin
cff61fa0bc Fix pylint
This also reverts commit 8df0b063be.
2017-07-04 15:34:10 +02:00
Florian Bruhin
22b0f2fd24 Various simple test updates for new config
test_cache
test_cookies
test_webkitelem
test_cmdutils
test_runners
test_completionwidget
test_messageview
test_editor
test_miscwidgets
test_sessions
test_urlutils
test_utils
test_prompt
statusbar/test_*
test_cmdhistory
test_tabwidget
test_tab
test_downloads
test_networkmanager
2017-07-04 15:08:04 +02:00
Florian Bruhin
7dd5e4b2e6 Skip broken completion tests
This skips test_completer and test_models - we'll reintroduce them when merging
the new completion.
2017-07-04 15:08:04 +02:00
Florian Bruhin
ac64ea287a Rename tabs.new_position/_explicit to .related/.unrelated 2017-07-04 15:08:03 +02:00
Ryan Roden-Corrent
1e1335aa5e Make various SQL code review changes.
- Fix outdated comments
- Use mock specs when possible
- More precise error message check in test_import_txt_invalid.
- Fix copyright message
- Tweak missing pyqt error message
- Dead code: remove group_by and where from sqlcategory.
  With the new separate completion table, these are no longer used.
- Move test_history out of webkit/. History is no longer purely webkit
  related, it could be webengine.
2017-07-03 09:45:08 -04:00
Ryan Roden-Corrent
a34df34208 Fix various test/flake8/pylint errors. 2017-07-03 08:12:47 -04:00
Ryan Roden-Corrent
c1f5e77fc6 Implement "Current" completion for bind.
When binding a key, the first row will be the current binding if the key
is already bound. This should make it easier for users to tell when they
are binding a key that is already bound, and what it is bound to.
2017-06-29 21:44:44 -04:00
Ryan Roden-Corrent
6ac940fa32 Fix pylint/coverage errors.
Ensure 100% coverage for sqlcategory and history, and fix some linter
errors
2017-06-27 12:33:51 -04:00
Ryan Roden-Corrent
f06880c6e2 Fix history completion delete function.
In order to update SqlQueryModel's rowCount after re-running the query,
we must call setQuery again.
2017-06-27 08:42:10 -04:00
Ryan Roden-Corrent
62a849c2db Fix bugs introduced in test_models 2017-06-26 12:41:48 -04:00
Ryan Roden-Corrent
46161c3af0 Refactor delete_cur_item.
Taking the completion widget as an argument was overly complex.
The process now looks like:

1. CompletionView gets deletion request
2. CompletionView passes selected index to CompletionModel
3. CompletionModel passes the row data to the owning category
4. The category runs its custom completion function.

This also fixes a bug. With the switch to the hybrid (list/sql)
completion model, the view was no longer updating when items were
deleted. This fixes that by ensuring the correct signals are emitted.

The SQL model must be refreshed by running the query. We could try using
a SqlTableModel so we can call removeRows instead.

The test for deleting a url fails because qmodeltester claims the length
of the query model is still 3.
2017-06-26 08:57:36 -04:00
Ryan Roden-Corrent
c7a18a8b8d Fix tests for recent sql changes 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
4e87773d89 Use a dict instead of named params for insert.
This allows replace to be a named parameter and allows consolidating
some duplicate code between various insert methods.

This also fixes some tests that broke because batch insert was broken.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
679e001a48 Separate sqlcategory title from table name.
Also fix a number of sql/completion tests that were failing.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
22b7b21d5a Use named placeholders for sql queries. 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
6fc61d12fc Assorted small fixes for sql code review. 2017-06-19 07:44:11 -04:00
Florian Bruhin
57d96a4512 Add a CompletionHistory instead of HistoryVisits table 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
565ba23f8c Don't instantiate completion models nedlessly.
For real this time. A mistake on the last commit like this meant models
were still spuriously instantiated.
Now that the completion model is reused, the layoutChanged signal needs
to be forwarded through, otherwise the view will not update.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
a01c76db54 Remove 'group by' from url completion query.
This seemed to have a significant performance impact. Removing it means
that instead of just seeing the most recent atime for a given url, you
will see multiple entries.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
c297f047d2 Don't regenerate completion model needlessly.
If the completion model would stay the same, just keep it and update the
filter pattern rather than instantiating a new model each time the
pattern changes.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
2cd02be7b1 Remove CompletionModel.columns_to_filter.
Instead set this on inidividual categories, as that is where it actually
gets used. This makes it easier for SqlCompletionCategory to reuse a
prepared query (as it gets the filter field names in its constructor).
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
8fb6f45bec Don't set pattern in SqlCategory constructor.
This will be called by the Completer after construction anyways, this
was a duplicate call that could be expensive.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
cf89ffa971 Fix pylint/flake8 errors 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
2c501f7fb7 Fix url completion benchmark.
Still had old code from pre-SQL era.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
e67da51662 Use prepared SQL queries. 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
71191f10a2 Only complete most recent atime for url.
The history completion query is extended to pick only the most recent item for
a given url.

The tests in test_models now check for ordering of elements.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
8ff45331df Clean up sql implementation.
Now that sql is only used for history (not quickmarks/bookmarks) a number of
functions are no longer needed. In addition, primary key support was removed as
we actually need to support multiple entries for the same url with different
access times. The completion model will have to handle this by selecting
something like (url, title, max(atime)).

This also fixes up a number of tests that were broken with the last few
sql-related commits.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
b47c3b6a60 Test deleting a history entry from completion.
Deleting a history entry should do nothing, but we want a test to ensure this
and get 100% branch coverage for urlmodel.

This also un-skips the bookmark/quickmark tests.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
2eea115b3a Rename sqlcategory and add to perfect_files.
There was a typo in the file name.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
5dce6fa494 Fix pylint/flake8 errors 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
f95dff4d9e Decouple categories from completionmodel.
Instead of add_list and add_sqltable, the completion model now supports
add_category, and callees either pass in a SqlCategory or ListCategory. This
makes unit testing much easier.

This also folds CompletionFilterModel into the ListCategory class.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
1d54688b0b Revert "Use SQL completer for quickmarks/bookmarks."
This reverts commit bcf1520132df84552f69419f3b1cbf3ede20ccad.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
e3a33ca427 Implement a hybrid list/sql completion model.
Now all completion models are of a single type called CompletionModel.
This model combines one or more categories. A category can either be a
ListCategory or a SqlCategory.

This simplifies the API, and will allow the use of models that combine simple
list-based and sql sources. This is important for two reasons:

- Adding searchengines to url completion
- Using an on-disk sqlite database for history, while keeping bookmarks and
  quickmars as text files.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
921211bbaa Remove web-history-max-items.
This was a performance optimization that shouldn't be needed with the new SQL
history backend. This also removes support for the LIMIT feature from SqlTable
as it only existed to support web-history-max-items.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
99c9b2d396 Fix two small mistakes after SQL code review.
urlmodel is now sorted, so the test had to be adjusted. Also remove one unused
import.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
c4c5723a61 Sort history completion entries by atime. 2017-06-19 07:44:11 -04:00