using embedded resources

Bug #1768932 reported by djcj
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qpdfview
Fix Released
Wishlist
Adam Reichold

Bug Description

The html help files and compiled localizations can be read from Qt's embedded resources system. But that requires adding ":/" as prefix manually. I've attached a patch that does this automatically if qpdfview is build with -DSTATIC_RES, otherwise it'll look for external resource files like it already does.
This allows me to cross-compile a single static binary for Windows.

Revision history for this message
djcj (djcj) wrote :
Revision history for this message
Adam Reichold (adamreichold) wrote :

Hello djcj,

thank for your contribution! I would like to request that you make two changes to this patch:

* Instead of defining STATIC_RES and deriving RESPFX from that, just define RESOURCE_PREFIX to be empty by default and ":/" for embedded resources.

* The change seems incomplete? Usually I would like to do "qmake CONFIG+=static_resources" which does actually include an RCC manifest to really package these files as embedded resources and sets the necessary preprocessor definitions like RESOURCE_PREFIX.

Best regards,
Adam.

P.S.: Please consider using Launchpad's merge request feature to submit more complex changes as it greatly simplifies review and discussion and avoids having to open a bug report for each change even if it does not actually fix a bug.

Changed in qpdfview:
status: New → Incomplete
importance: Undecided → Wishlist
assignee: nobody → Adam Reichold (adamreichold)
milestone: none → 0.4.18
Revision history for this message
djcj (djcj) wrote :

Here's a new patch. It will now always check for embedded resources but only compile resources if configured with "qmake CONFIG+=with_staticresources".

Revision history for this message
Adam Reichold (adamreichold) wrote :

Hello again,

I do like the new patch, but the files {help,translations}.qrc seem to be missing from it?

Best regards,
Adam

Revision history for this message
djcj (djcj) wrote :

I couldn't figure out how to attach more than one file. It's just a list of the translation and help files. I've attached both files in a zip.

Changed in qpdfview:
status: Incomplete → Fix Committed
Changed in qpdfview:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.