When a redirect occurs, the item is saved in history with a -r suffix
now. When opening qutebrowser that's picked up and the item is hidden
from completion.
- Rename HistoryEntry to Entry
- Move history line parsing from WebHistory.async_read to Entry.from_str
- Improve errors for invalid history lines
- Pass history directory/filename from the outside to WebHistory
- Clear temp history after reading it when async_read is done
This makes it possible to switch to an alternative implementation if
there are weird issues like #1568. Some users might also prefer the
slightly better performance over more accurate hints.
For some reason the behaviour of QHostAddress("31c3").isValid() changed
with Qt 5.6.1: https://bugreports.qt.io/browse/QTBUG-53983
This causes the test to fail because Qt thinks this is a valid IP, so we
think it's a valid URL.
For some reason, sometimes on Travis the history file we read is empty.
I have no idea why though, as we successfully wait until ":save saved
history" is logged, and that is working fine.
Let's just mark the test as flaky for now so we can move on.
Clicking actually works fine without the strip() as _resolve_url is
never called in that case, so we need to do something which actually
needs the URL as well.
There were two different issues here:
- `\n` rather than `os.linesep` was used, which caused the "generated"
file to have less data in it than expected
- A final `os.linesep` (or `\n`) was missing, but that was cancelled out
by a off-by-one error when slicing, so wasn't an issue until we tried
with \r\n endings.
This won't hurt and will help with some poorly formatted sites
including blank spaces around the url (e.g. the Previous link in a
dashboard make with CDash 2.0.2).
Otherwise history tests could fail because waiting for
"Saved to *history" waited for a previous line, not the newest one.
It also doesn't make any sense to save stuff anyways.