Merge lp:~jamesh/mediascanner2/qml-no-db-available into lp:mediascanner2
Status: | Merged |
---|---|
Approved by: | Michi Henning |
Approved revision: | 320 |
Merged at revision: | 319 |
Proposed branch: | lp:~jamesh/mediascanner2/qml-no-db-available |
Merge into: | lp:mediascanner2 |
Diff against target: |
135 lines (+67/-6) 5 files modified
src/extractor/CMakeLists.txt (+5/-1) src/qml/Ubuntu/MediaScanner.0.1/MediaStoreWrapper.cc (+18/-4) src/qml/Ubuntu/MediaScanner.0.1/StreamingModel.cc (+1/-1) test/CMakeLists.txt (+5/-0) test/test_qml_nodb.qml (+38/-0) |
To merge this branch: | bzr merge lp:~jamesh/mediascanner2/qml-no-db-available |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michi Henning (community) | Approve | ||
PS Jenkins bot (community) | continuous-integration | Approve | |
Review via email: mp+280422@code.launchpad.net |
Commit message
If the mediascanner index can not be opened, catch the exception in the QML plugin and act as if the database is empty. A warning is printed via Qt's logging framework. This prevents QML apps using mediascanner from terminating if there is a problem opening the media index.
Description of the change
If the mediascanner index can not be opened, allow construction of the QML MediaScannerWrapper class to succeed. Letting the exception propagate causes QML apps to terminate, so is not a helpful behaviour.
With this change, we now:
1. print a warning on construction.
2. print a warning if the MediaStoreWrapper's lookup() or query() methods are called and return zero/empty results.
3. Make the various model classes behave as if they are empty.
PASSED: Continuous integration, rev:319 jenkins. qa.ubuntu. com/job/ mediascanner2- ci/203/ jenkins. qa.ubuntu. com/job/ mediascanner2- vivid-amd64- ci/40 jenkins. qa.ubuntu. com/job/ mediascanner2- vivid-armhf- ci/40 jenkins. qa.ubuntu. com/job/ mediascanner2- vivid-armhf- ci/40/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mediascanner2- vivid-i386- ci/40 jenkins. qa.ubuntu. com/job/ mediascanner2- wily-amd64- ci/15 jenkins. qa.ubuntu. com/job/ mediascanner2- wily-armhf- ci/15 jenkins. qa.ubuntu. com/job/ mediascanner2- wily-armhf- ci/15/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mediascanner2- wily-i386- ci/15
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/mediascanne r2-ci/203/ rebuild
http://