Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Reworked memory layout + misc improvements #22

Open
wants to merge 10 commits into from

1 participant

@stloeffler

Reworked QSharedPointer into (mostly) QWeakPointer and improve thread safety - this also fixed some memory problems and intermittent crashes.

Allow to reload files if changed on disk

Implement PDFDocumentWidget to make inclusion in main Tw easier

Add some unit testing

I think this should settle most of the show stoppers. How do you feel about merging it back into trunk and start a first testing round for the "general public"?

stloeffler added some commits
@stloeffler stloeffler Start implementation of PDFDocumentWidget b746296
@stloeffler stloeffler Make Document, Page, and the corresponding backend implementations th…
…read-safe

 - data access is now governed by the QReadWriteLock's _docLock and _pageLock
 - Pages can exist in a detached state where _parent == NULL (so a Document can
   discard them even when they are not destroyed, e.g., because another thread
   still holds a QSharedPointer to them)
 - some details and policies (for backend implementations) are collected in
   src/backends/ThreadSafetyREADME.md
153b367
@stloeffler stloeffler Use QWeakPointer instead of QSharedPointer for passing around referen…
…ces to Document and Page objects

Only the respective owner should hold a permanent QSharedPointer to ensure the owned object is destroyed when the owner is destroyed. Any other object should only hold a QWeakPointer (to be able to check validity) and "upgrade" that to a QSharedPointer temporarily (using toStrongRef()) while accessing data.
Page objects are typically owned by the corresponding Document.
Document objects are typically owned by a PDFDocumentScene object.
49e6f14
@stloeffler stloeffler Allow to reload a file if changed on disk
Whether a file is watched can be set using PDFDocumentScene::setWatchForDocumentChangesOnDisk() or its wrapper PDFDocumentWidget::setWatchForDocumentChangesOnDisk()
6e0c0d6
@stloeffler stloeffler Implement BackendInterface to allow a choice of backends at run-time
 - New backends should implement BackendInterface
 - Use the interfaces to create new documents by means of the newDocument() method
d5c970f
@stloeffler stloeffler Start implementing unit-tests using the QTest framework bfbec73
@stloeffler stloeffler Rename Poppler > PopplerQt4
It more accurately describes the framework/library used, and perhaps we'll add another backend based solely on the poppler library (and not on poppler-qt4) in the future.
503b502
@stloeffler stloeffler Fix MuPDF page sizes
The unit test failed because only rounded sizes were returned
5b87294
@stloeffler stloeffler Properly initialize Backend::Document::_meta_trapped dff9584
@stloeffler stloeffler Move everything into modules/QtPDF in preparation of migration to TeX…
…works trunk
bee00a1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 9, 2012
  1. @stloeffler
  2. @stloeffler

    Make Document, Page, and the corresponding backend implementations th…

    stloeffler authored
    …read-safe
    
     - data access is now governed by the QReadWriteLock's _docLock and _pageLock
     - Pages can exist in a detached state where _parent == NULL (so a Document can
       discard them even when they are not destroyed, e.g., because another thread
       still holds a QSharedPointer to them)
     - some details and policies (for backend implementations) are collected in
       src/backends/ThreadSafetyREADME.md
  3. @stloeffler

    Use QWeakPointer instead of QSharedPointer for passing around referen…

    stloeffler authored
    …ces to Document and Page objects
    
    Only the respective owner should hold a permanent QSharedPointer to ensure the owned object is destroyed when the owner is destroyed. Any other object should only hold a QWeakPointer (to be able to check validity) and "upgrade" that to a QSharedPointer temporarily (using toStrongRef()) while accessing data.
    Page objects are typically owned by the corresponding Document.
    Document objects are typically owned by a PDFDocumentScene object.
  4. @stloeffler

    Allow to reload a file if changed on disk

    stloeffler authored
    Whether a file is watched can be set using PDFDocumentScene::setWatchForDocumentChangesOnDisk() or its wrapper PDFDocumentWidget::setWatchForDocumentChangesOnDisk()
  5. @stloeffler

    Implement BackendInterface to allow a choice of backends at run-time

    stloeffler authored
     - New backends should implement BackendInterface
     - Use the interfaces to create new documents by means of the newDocument() method
Commits on Sep 11, 2012
  1. @stloeffler
  2. @stloeffler

    Rename Poppler > PopplerQt4

    stloeffler authored
    It more accurately describes the framework/library used, and perhaps we'll add another backend based solely on the poppler library (and not on poppler-qt4) in the future.
Commits on Sep 14, 2012
  1. @stloeffler

    Fix MuPDF page sizes

    stloeffler authored
    The unit test failed because only rounded sizes were returned
  2. @stloeffler
Commits on Feb 24, 2013
  1. @stloeffler
Something went wrong with that request. Please try again.