Merge lp://qastaging/~artmello/webbrowser-app/webbrowser-app-fix_1484562 into lp://qastaging/webbrowser-app

Proposed by Arthur Mello
Status: Merged
Approved by: Olivier Tilloy
Approved revision: 1155
Merged at revision: 1148
Proposed branch: lp://qastaging/~artmello/webbrowser-app/webbrowser-app-fix_1484562
Merge into: lp://qastaging/webbrowser-app
Diff against target: 359 lines (+148/-53)
6 files modified
src/app/webbrowser/Browser.qml (+0/-1)
src/app/webbrowser/HistoryViewWide.qml (+60/-36)
src/app/webbrowser/history-model.cpp (+31/-0)
src/app/webbrowser/history-model.h (+2/-0)
tests/unittests/history-model/tst_HistoryModelTests.cpp (+11/-0)
tests/unittests/qml/tst_HistoryViewWide.qml (+44/-16)
To merge this branch: bzr merge lp://qastaging/~artmello/webbrowser-app/webbrowser-app-fix_1484562
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Olivier Tilloy Approve
Review via email: mp+268165@code.qastaging.launchpad.net

Commit message

Add support for removing history entries with delete key in HistoryViewWide

Description of the change

Add support for removing history entries with delete key in HistoryViewWide

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1141. By Arthur Mello

Improve qml tests

1142. By Arthur Mello

Merge with trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

If I press Delete repeatedly to manually delete all history entries for a given day (just tried with Today), the corresponding date entry in the left panel disappears as expected, however the right panel isn’t updated, it remains empty, until I focus the left panel with the left arrow and move up/down.
When the last entry is deleted, the selection should probably be reset to All History.

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1143. By Arthur Mello

Set left panel to "All History" when the last entry is deleted

1144. By Arthur Mello

Merge with trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

In the two new test functions, checking that the 'count' property of a spy is 0 right after calling clear() on that spy is useless. This is guaranteed to be true, by definition.

In onDeletePressed, if the left panel has active focus and the current index is 0 ("All History"), you could call historyModel.clearAll() instead of iterating through all the entries to delete them one by one.

Similarly, it might be interesting to add a 'clearByDate()' method to the history model to allow deleting all the entries for one given date, instead of iterating. This would be faster and cleaner.

review: Needs Fixing
1145. By Arthur Mello

Remove unnecessary checks

1146. By Arthur Mello

Use clearAll when deleting all entries from history

1147. By Arthur Mello

Add a removeEntriesByDate to the HistoryModel

1148. By Arthur Mello

Add unittests for the HistoryModel new method

1149. By Arthur Mello

Use signals to call changes on the history model to keep consistency

1150. By Arthur Mello

Add qml tests to HistoryViewWide

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

> 1149. By Arthur Mello 12 hours ago
> Use signals to call changes on the history model to keep consistency

Actually, I would have done the opposite: the history model is already exposed to the component, so there is no need to add signals (and the existing ones could be removed): calling methods on the model directly is absolutely fine, and makes the code easier to read. Unit tests won’t be able to monitor signal emissions, but they can still check that after deleting entries the count of the listviews is correctly updated.

Revision history for this message
Olivier Tilloy (osomon) wrote :

193 + dateTime.setTime(QTime(23, 59, 59));

The time should also include milliseconds (999).

review: Needs Fixing
1151. By Arthur Mello

Time used to rmeove entries from database should also include milliseconds

1152. By Arthur Mello

Merge with trunk

1153. By Arthur Mello

Stop using signals for changes on the HistoryModel

1154. By Arthur Mello

Update QML tests

Revision history for this message
Olivier Tilloy (osomon) wrote :

Not strictly necessary for tests to pass, but it would be better for the sake of completeness to re-implement the cleanup() method and have it clear historyMockModel.

1155. By Arthur Mello

Clean all history entries in the cleanup method

Revision history for this message
Olivier Tilloy (osomon) wrote :

Thanks, that looks good to me now.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to status/vote changes: