Merge lp:~ken-vandine/content-hub/lp1429695 into lp:content-hub

Proposed by Ken VanDine
Status: Merged
Approved by: Ken VanDine
Approved revision: 192
Merged at revision: 195
Proposed branch: lp:~ken-vandine/content-hub/lp1429695
Merge into: lp:content-hub
Diff against target: 29 lines (+9/-3)
1 file modified
import/Ubuntu/Content/contentpeer.cpp (+9/-3)
To merge this branch: bzr merge lp:~ken-vandine/content-hub/lp1429695
Reviewer Review Type Date Requested Status
Michael Sheldon (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+254599@code.launchpad.net

Commit message

When requesting an import from an unknown peer, abort the transfer. This is most likely to occur when requesting the default peer for a ContentType that has no default registered.

Description of the change

When requesting an import from an unknown peer, abort the transfer. This is most likely to occur when requesting the default peer for a ContentType that has no default registered.

To test this:
 * install the test click package[1]
 * launch it from the app scope
 * click the import ebook button and verify the state displayed below is "5"
 * click the import pictures button, select a picture from gallery and verify the state below is "4"

1. http://people.canonical.com/~kenvandine/lp1429695.ken-vandine_0.1_all.click

To post a comment you must log in.
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Are there any related MPs required for this MP to build/function as expected? Please list.

 * No

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)

 * Yes

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?

 * Yes

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/content-hub) on device or emulator?

 * Yes

If you changed the UI, was the change specified/approved by design?

 * No change

If you changed UI labels, did you update the pot file?

 * No change

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?

 * No change

192. By Ken VanDine

merged trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Approved, but with a note on one of the comments that might be a typo?

Did you perform an exploratory manual test run of the code change and any related functionality on device or emulator?

 * Yes

Did CI run pass? If not, please explain why.

 * Yes

Have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut?

 * Yes

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'import/Ubuntu/Content/contentpeer.cpp'
2--- import/Ubuntu/Content/contentpeer.cpp 2014-08-04 17:57:26 +0000
3+++ import/Ubuntu/Content/contentpeer.cpp 2015-03-30 16:20:53 +0000
4@@ -221,7 +221,6 @@
5 ContentTransfer *ContentPeer::request(ContentStore *store)
6 {
7 TRACE() << Q_FUNC_INFO;
8-
9 ContentHub *contentHub = ContentHub::instance();
10 ContentTransfer *qmlTransfer = NULL;
11 if(m_handler == ContentHandler::Source) {
12@@ -239,8 +238,15 @@
13 }
14
15 /* We only need to start it for import requests */
16- if (m_handler == ContentHandler::Source)
17- qmlTransfer->start();
18+ if (m_handler == ContentHandler::Source) {
19+ // If there peer isn't known, don't request content
20+ if (m_peer == cuc::Peer::unknown()) {
21+ qWarning() << "Unknown source for type:" << m_contentType;
22+ qmlTransfer->transfer()->abort();
23+ } else {
24+ qmlTransfer->start();
25+ }
26+ }
27
28 return qmlTransfer;
29 }

Subscribers

People subscribed via source and target branches