Commit Graph

12512 Commits

Author SHA1 Message Date
Florian Bruhin
0d5a33ef2a Update changelog 2017-06-29 23:21:10 +02:00
Florian Bruhin
d132b6ed71 Fix :scroll-page with --bottom-navigate on QtWebEngine
There were two issues here:

- The comparison was backwards, causing scroller.at_bottom() to always return
  true.
- When zoomed in, jsret['px']['y'] can be a float, which means we can be
  slightly off when checking the difference - math.ceil() fixes that.
2017-06-29 22:39:48 +02:00
Ryan Roden-Corrent
9c0c174534 Use builtin SortFilter regex functionality.
With the new completion API, we no longer need a custom filterAcceptsRow
function. This was necessary to handle the tree structure of the model,
but now we use a separate QSortFilterProxyModel for each category, so
the data it filters is flat. We can simplify the code by using the
builtin setFilterRegExp.

This changes the behavior a little, as now all list categories filter on
all columns. This should be beneficial if anything. For example, help
topics are now filtered on description in addition to name.

This also seems to slightly speed up filtering, according to the url
model benchmark.

Before:

----------------------------------------------- benchmark: 1 tests ----------------------------------------------
Name (time in s)                     Min     Max    Mean  StdDev  Median     IQR  Outliers(*)  Rounds  Iterations
-----------------------------------------------------------------------------------------------------------------
test_url_completion_benchmark     1.2806  1.3817  1.3195  0.0390  1.3068  0.0487          1;0       5           1
-----------------------------------------------------------------------------------------------------------------

After:

----------------------------------------------- benchmark: 1 tests ----------------------------------------------
Name (time in s)                     Min     Max    Mean  StdDev  Median     IQR  Outliers(*)  Rounds  Iterations
-----------------------------------------------------------------------------------------------------------------
test_url_completion_benchmark     1.1183  1.1508  1.1281  0.0132  1.1241  0.0142          1;0       5           1
-----------------------------------------------------------------------------------------------------------------
2017-06-29 12:44:02 -04:00
Jay Kamat
302961a86a
Refactor set_tab_pinned to take a tab widget.
See #2759
2017-06-28 22:22:33 -07:00
Florian Bruhin
f136f78802 Fix :undo documentation
See #2759
2017-06-28 22:41:08 +02:00
Florian Bruhin
a98a6ac0c8 travis: Write a sane sources.list
Also updates nodejs
2017-06-28 21:42:50 +02:00
Jay Kamat
4d1dbe11e8
Prompt when closing a pinned tab via the mouse
Closes #2761
2017-06-27 19:03:13 -07: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
Iordanis Grigoriou
0a09758be1 Add file path to download 2017-06-27 12:21:25 +02:00
Iordanis Grigoriou
5e2be8a44a Fix PEP-8 issue 2017-06-27 08:25:59 +02:00
Iordanis Grigoriou
8a5b48d374 Add suggested_fn argument to get_request 2017-06-26 23:21:32 +02:00
Florian Bruhin
5ec94f96fd Allow a trailing % for :zoom 2017-06-26 21:51:35 +02:00
Florian Bruhin
92d5f6c41d Ignore _remove_tab for crashed deleted tabs 2017-06-26 20:50:17 +02:00
Florian Bruhin
24caaea54d Handle OSError in SessionManager.delete 2017-06-26 19:52:07 +02:00
Florian Bruhin
130be2aedc Handle OSError when trying to delete autosave session 2017-06-26 19:47:54 +02:00
Ryan Roden-Corrent
62a849c2db Fix bugs introduced in test_models 2017-06-26 12:41:48 -04:00
Florian Bruhin
736dd77a6e Regenerate authors 2017-06-26 18:05:25 +02:00
Florian Bruhin
8a7610206e Merge branch 'master' of https://github.com/jupart/qutebrowser 2017-06-26 18:04:57 +02:00
pyup-bot
78c93e1225 Update pytest-rerunfailures from 2.1.0 to 2.2 2017-06-26 15:47:14 +02:00
pyup-bot
e8dac08a35 Update cheroot from 5.5.2 to 5.7.0 2017-06-26 15:47:13 +02:00
pyup-bot
6d1775fcd6 Update pylint from 1.7.1 to 1.7.2 2017-06-26 15:47:11 +02: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
Iordanis Grigoriou
a24d7f6686 Use page title for filename with :download 2017-06-26 12:25:03 +02:00
Ryan Roden-Corrent
866f4653c7 Fix spelling existant -> existent. 2017-06-25 22:14:38 -04:00
Justin Partain
cb67a911fa Remove recommendation to use '-c' command line argument, which doesn't exist 2017-06-21 10:56:25 -04:00
Marius
df6b8b7ff5 Update tabwidget.py 2017-06-21 09:03:15 +02:00
Ryan Roden-Corrent
6080830a8b Fix outdated docstring and pylint error. 2017-06-20 22:25:09 -04:00
Ryan Roden-Corrent
b722cc1dec Pass invalid index to [can]FetchMore.
For QSqlQueryModel, the argument should always be an invalid index:
http://doc.qt.io/qt-5/qsqlquerymodel.html#canFetchMore

For a QStandardItemModel, it doesn't matter. Either way, passing the
top-level parent index was wrong.
2017-06-20 22:11:53 -04:00
Ryan Roden-Corrent
63cb88a0f4 Use _cat_from_index in completionmodel.data.
Keep all the category lookup inside _cat_from_idx for easier refactoring
if the organization ever changes.
2017-06-20 22:08:23 -04:00
Ryan Roden-Corrent
0f585eda4f Bring history.py back to 100% coverage.
The code of debug_dump_history was tweaked to handle a possible
OSException that can be thrown by open, which I noticed while trying to
test it.
2017-06-20 21:41:43 -04:00
Marius
f3a2b84033 remove space 2017-06-20 23:58:23 +02:00
Marius
dfedddf0bd Wrap scroll button workaround in try/except
for older pyqt5 versions (5.2.1)
2017-06-20 23:55:11 +02:00
Marius
6e166d139a Fix alignment of scroll buttons in tab bar 2017-06-20 21:18:13 +02:00
Florian Bruhin
cb5cd1a910 Remove old test_commands.py 2017-06-20 15:20:32 +02:00
Florian Bruhin
994e8c692f Merge different FakeTabbedBrowser objects 2017-06-20 15:19:53 +02:00
Florian Bruhin
096b0a7a37 Remove unused import 2017-06-20 15:03:42 +02:00
Florian Bruhin
750ef834dc Make PyOpenGL a required dependency
Looks like the "black screen" issue isn't the only thing going wrong, some
people even report segfaults since the vendor check was added.
2017-06-20 13:05:53 +02:00
Florian Bruhin
73940a64bb Update docs 2017-06-20 12:46:55 +02:00
Florian Bruhin
cf3c7266aa Make show_error keyword-only 2017-06-20 12:45:36 +02:00
Florian Bruhin
06d4a24bd1 Merge branch 'master' of https://github.com/iordanisg/qutebrowser 2017-06-20 12:45:21 +02:00
Florian Bruhin
3a7a3909d7 Merge remote-tracking branch 'origin/pyup-scheduled-update-06-19-2017' 2017-06-20 12:44:05 +02:00
Florian Bruhin
038dcff4ba Ignore common URL issues while importing history
See #2646.

This ignores the "corrupted" Apple-lookalike URLs, comments and data: URLs.
2017-06-20 12:19:14 +02:00
Florian Bruhin
f838eb1bdc Use named formatting for queries in sql.py 2017-06-20 12:11:41 +02:00
Florian Bruhin
da875755d1 Add spaces after commas in SQL queries 2017-06-20 12:06:17 +02:00
Florian Bruhin
c1776bbf9d Add error message when query failed to prepare 2017-06-20 12:05:40 +02:00
Florian Bruhin
29ce1b3811 Add column order in SqlTable._insert_query
_insert_query gets called with a query and dict of values such as:

  {'val': 1, 'lucky': False, 'name': 'one'}

Via bindValues(), we only assign a placeholder in the query string to a value,
so we get a query with bindings like:

  INSERT INTO Foo values(:lucky,:val,:name)
  {':name': 'one', ':val': 1, ':lucky': False}

So what we're executing is something like:

  INSERT INTO Foo values(false,1,"one")

However, if the column order in the database doesn't happen to be the order
we're passing the values in, we get the wrong values in the wrong columns.

Instead, we now do:

  INSERT INTO Foo (lucky, val, name) values(false,1,"one")

Which inserts the values in the order we intended.

With Python 3.6, this just happened to work before because we always passed the
keyword arguments in the table column order, and in 3.6 dicts
(and thus **kwargs) happen to be ordered:
https://mail.python.org/pipermail/python-dev/2016-September/146327.html
2017-06-20 12:03:43 +02:00
Florian Bruhin
27c6aa00bd travis: Add group: edge 2017-06-19 18:15:35 +02:00
Iordanis Grigoriou
f0ff02fcb2 Avoid throwing exception when no last focused tab exists 2017-06-19 15:48:17 +02:00
pyup-bot
aa460a7abd Update hypothesis from 3.11.3 to 3.11.6 2017-06-19 15:46:21 +02:00