Commit Graph

3153 Commits

Author SHA1 Message Date
Ryan Roden-Corrent
71b71dbc58 Merge remote-tracking branch 'upstream/master' into HEAD 2017-08-06 18:13:49 -04:00
Florian Bruhin
49b858e359 Add more variants of fake apple URL to ignored ones 2017-08-01 16:00:53 +02:00
Florian Bruhin
695769d1b4 Merge pull request #2875 from rcorre/obsolete-signals
Remove obsolete signals.
2017-07-29 20:30:25 +02: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
8e34b54cd7 Remove obsolete signals.
The added/removed signals for the urlmark managers are no longer used as
the completion models are generated on-the-fly. The changed signal is
still needed so the save-manager knows when to trigger a write to disk.

Also removes session_manager.update_completion, which is no longer
needed for the same reason as above.

keyconf.changed cannot be removed, as it is still wired up to
basekeyparser.

Resolves #2874.
2017-07-29 13:09:10 -04: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
Florian Bruhin
a942613d7f Use ctypes instead of PyOpenGL for QtWebEngine Nvidia workaround
Fixes #2821
2017-07-27 09:22:12 +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
Florian Bruhin
5ecda25fdb Fix renderer process test for older Qt versions 2017-07-25 17:35:42 +02:00
Florian Bruhin
792a01ba6d Try to stabilize renderer process test 2017-07-25 16:56:38 +02: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
07b2fde2de Mark test_version as flaky
Sometimes it fails on Travis with empty output for no apparent reason
2017-07-24 08:05:51 +02: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
Florian Bruhin
837ee5c626 Merge pull request #2846 from rcorre/completion-fixes
Completion fixes
2017-07-24 07:27:11 +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
Florian Bruhin
56b4989f44 Fix tests for QProcess changes 2017-07-23 22:10:50 +02: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
Florian Bruhin
fba25338be Merge pull request #2295 from rcorre/really_complete
Completion refactor V3
2017-07-21 15:05:43 +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
Florian Bruhin
0f85898137 Add a config version to the YAML file 2017-07-19 08:22:00 +02: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
Florian Bruhin
cbf9da0b7e Set window.navigator.languages correctly 2017-07-13 21:24:17 +02:00
Ryan Roden-Corrent
8745f80d90 Fix qute://history SQL bug.
The javascript history page was requesting the new start_time in ms, but
the python code was expecting seconds. This is fixed by removing all the
millisecond translations in the python code and only translating to
milliseconds in the javascript code that formats dates.
2017-07-13 08:54:21 -04:00
Ryan Roden-Corrent
1aed2470e5 SQL code review.
- Fix flake8
- history.clear should also clear completion table
- call _resize_columns in set_model, not set_pattern
- add more unit-testing for the history completion table
2017-07-12 22:14:27 -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
Florian Bruhin
1e58c87380 Improve test for messageview timeout 2017-07-11 09:25:53 +02:00
Florian Bruhin
a91e6c3405 Fix test_adblock on Windows
We can't simply have an absolute filename as URL path there, so we only deal
with paths relative to tmpdir in the URLs now.
2017-07-10 22:22:44 +02:00
Florian Bruhin
237362663a Fix test_configfiles.test_init on Windows 2017-07-10 20:37:36 +02:00
Florian Bruhin
ac8fb03b80 Fix lint 2017-07-10 20:37:30 +02:00
Yashar Shahi
a631c971d9 Add tests for show messages longer
Add tests for "Show messages longer if there are multiple of them."
2017-07-10 20:52:42 +04:30
Florian Bruhin
135fb042da Make settings from qute://settings persistent 2017-07-10 18:04:39 +02:00
Florian Bruhin
e81dcccace Add a test for a None currentWidget with backforward widget 2017-07-10 09:29:45 +02:00
Florian Bruhin
5fb6cb713b Hide back/forward widget when there's no text 2017-07-10 07:59:56 +02:00
Florian Bruhin
0e8175b8eb Update docstrings/docs 2017-07-09 23:27:34 +02:00
Daniel Hahler
b3a9e09d6c Add statusline widget for back/forward indicator
Fixes https://github.com/qutebrowser/qutebrowser/issues/2737.
2017-07-09 22:38:44 +02:00
Florian Bruhin
bb567a61b6 Fix ipc test coverage 2017-07-09 22:09:31 +02:00
Florian Bruhin
84c2289aa5 Merge branch 'master' of https://github.com/iordanisg/qutebrowser 2017-07-09 12:56:52 +02:00
Florian Bruhin
cd063c74d9 Why is my commit -a broken 2017-07-09 12:54:19 +02:00
Florian Bruhin
6a2163d36f ipc: Remove support for connecting to legacy servers 2017-07-09 12:49:47 +02:00
Florian Bruhin
915cd5f016 Fix long lines 2017-07-09 11:51:22 +02: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