~mutse-young/ubuntu-docviewer-app/trunk

« back to all changes in this revision

Viewing changes to src/app/qml/PdfView.qml

  • Committer: Tarmac
  • Author(s): Stefano Verzegnassi
  • Date: 2014-11-07 21:31:45 UTC
  • mfrom: (36.2.5 fix-1387651-1387023)
  • Revision ID: tarmac-20141107213145-wuq94o2ixasz51dd
* Fixed a problem with AppArmor while trying to get mime type for a file with QProcess and /usr/bin/file. (lp:1387651)
* Added creation date property in file-qml-plugin (lp:1387023)
* Workaround for an issue in poppler-qml-plugin (PDF pages were loaded twice)
* Now 'architecture' field value in manifest.json.in is set by CMake while building the project. Fixes: https://bugs.launchpad.net/bugs/1387023, https://bugs.launchpad.net/bugs/1387651.

Approved by David Planella, Ubuntu Phone Apps Jenkins Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
        id: pdfView
17
17
        anchors {
18
18
            fill: parent
19
 
            leftMargin: units.gu(2)
20
 
            rightMargin: units.gu(2)
 
19
            leftMargin: units.gu(1)
 
20
            rightMargin: units.gu(1)
21
21
        }
22
 
        spacing: units.gu(4)
 
22
        spacing: units.gu(2)
23
23
 
24
24
        clip: true
25
25
        focus: false
43
43
 
44
44
        model: Poppler {
45
45
            id: poppler
46
 
            path: file.path
 
46
 
 
47
            /* FIXME: Don't set 'path' property directly, but set it through onCompleted signal.
 
48
               By doing otherwise, PDF pages are loaded two times, but only
 
49
               the first delegates are working. Asking to the image provider
 
50
               to get the second ones makes the app instable.
 
51
               (e.g. We have a PDF document with 10 pages. The plugin loads
 
52
               them twice - 2x10 = 20 pages - but only the first 10 are shown.
 
53
               While trying to get the 11th, the app crashes). */
 
54
            Component.onCompleted: path = file.path
47
55
 
48
56
            onPagesLoaded: {
49
57
                activity.running = false;