Merge lp:~mzanetti/reminders-app/fix-attaching-images into lp:reminders-app

Proposed by Michael Zanetti
Status: Merged
Approved by: Riccardo Padovani
Approved revision: 67
Merged at revision: 69
Proposed branch: lp:~mzanetti/reminders-app/fix-attaching-images
Merge into: lp:reminders-app
Diff against target: 34 lines (+5/-4)
2 files modified
src/app/qml/ui/EditNotePage.qml (+3/-2)
src/plugin/Evernote/note.cpp (+2/-2)
To merge this branch: bzr merge lp:~mzanetti/reminders-app/fix-attaching-images
Reviewer Review Type Date Requested Status
Riccardo Padovani Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+206816@code.launchpad.net

Commit message

fix attaching images

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Riccardo Padovani (rpadovani) wrote :

Doesn't work on mako.

I click the button in the toolbar and have this output:
http://paste.ubuntu.com/6951603/

Then I choose the photo and click on pick.
First of all, the gallery is open, and I have to return to the app using a swype.
In the app there is no photo.
The output on terminal after I pick the photo is:
http://paste.ubuntu.com/6951616/

review: Needs Fixing
Revision history for this message
Riccardo Padovani (rpadovani) wrote :

After a total reset of mako it works as expected.
Sorry for the delay!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/qml/ui/EditNotePage.qml'
2--- src/app/qml/ui/EditNotePage.qml 2014-02-05 10:14:57 +0000
3+++ src/app/qml/ui/EditNotePage.qml 2014-02-17 22:05:11 +0000
4@@ -47,8 +47,9 @@
5 target: priv.activeTransfer ? priv.activeTransfer : null
6 onStateChanged: {
7 if (priv.activeTransfer.state === ContentTransfer.Charged) {
8- print("attaching", priv.activeTransfer.items[0].url.toString())
9- note.attachFile(priv.insertPosition, priv.activeTransfer.items[0].url.toString())
10+ var file = priv.activeTransfer.items[0].url.toString()
11+ print("attaching file", file, "on note", note)
12+ note.attachFile(priv.insertPosition, file);
13 }
14 }
15 }
16
17=== modified file 'src/plugin/Evernote/note.cpp'
18--- src/plugin/Evernote/note.cpp 2014-02-05 17:26:54 +0000
19+++ src/plugin/Evernote/note.cpp 2014-02-17 22:05:11 +0000
20@@ -261,12 +261,12 @@
21
22 void Note::attachFile(int position, const QUrl &fileName)
23 {
24- QFile importedFile(fileName.toString());
25+ QFile importedFile(fileName.path());
26 if (!importedFile.exists()) {
27+ qWarning() << "File doesn't exist. Cannot attach.";
28 return;
29 }
30
31- qDebug() << "attaching file" << position << fileName;
32 Resource *resource = addResource(fileName.path());
33 m_content.attachFile(position, fileName.path(), resource->hash(), resource->type());
34 emit contentChanged();

Subscribers

People subscribed via source and target branches