~michael-sheldon/address-book-app/contact-share

« back to all changes in this revision

Viewing changes to src/imports/ContactShare/ContactSharePage.qml

  • Committer: Renato Araujo Oliveira Filho
  • Date: 2014-06-02 14:52:45 UTC
  • Revision ID: renato.filho@canonical.com-20140602145245-jx5sq313hoope712
Fixed vcard export url.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
        onPeerSelected: {
36
36
            picker.curTransfer = peer.request();
37
37
            if (picker.curTransfer.state === ContentHub.ContentTransfer.InProgress) {
38
 
                var vCardUrl = "/tmp/vcard_" + encodeURIComponent(contact.contactId) + ".vcard"
 
38
                var vCardUrl = "file:///tmp/vcard_" + encodeURIComponent(contact.contactId) + ".vcard"
39
39
                picker.contactModel.exportContacts(vCardUrl, [picker.contact])
40
40
            }
41
41
        }
47
47
        target: picker.contactModel
48
48
        onExportCompleted: {
49
49
            if (picker.curTransfer && (picker.curTransfer.state === ContentHub.ContentTransfer.InProgress)) {
50
 
                if (error !== ContactModel.ExportNoError) {
 
50
                if (error === ContactModel.ExportNoError) {
51
51
                    console.debug("Contact exported in:" + url)
52
52
                    picker.curTransfer.items = [ url ]
53
53
                    picker.curTransfer.state = ContentHub.ContentTransfer.Charged
54
54
                } else {
55
55
                    console.debug("Fail to export contact:" + error)
56
56
                    // TODO: notify error
57
 
                    vCardShare.state = ContentHub.ContentTransfer.Aborted
 
57
                    // picker.curTransfer = ContentHub.ContentTransfer.Aborted
58
58
                }
59
59
            }
60
60
            pageStack.pop()