Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix completion sorting #3237

Merged
merged 2 commits into from
Nov 3, 2017
Merged

Commits on Nov 3, 2017

  1. 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 qutebrowser#3156.
    rcorre committed Nov 3, 2017
    Configuration menu
    Copy the full SHA
    47447c0 View commit details
    Browse the repository at this point in the history
  2. 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.
    rcorre committed Nov 3, 2017
    Configuration menu
    Copy the full SHA
    a9926e4 View commit details
    Browse the repository at this point in the history