Some requests may take a while to process in a highly zoomed region.
Since those requests are not yet finished, other requests to the same
region are likely to be made (specially if the user is scrolling fast)
and the generator will have to render the same region repeatedly.
Also when changing zoom rapidly some pixmaps can arrive at the tiles
manager when another request has already been posted. This pixmap is not
necessary anymore and should be discarded (the tiles manager will get a
new pixmap anyway).
The visible region was set in the PixmapRequest only a tiles manager was
available. Because of that the generator could check if it was supposed
to used tiles by simply checking if its normalized rect was null.
However is good to know the visible region even when a tiles manager is
not present. This way if the request is big enough to start a tiles
manager we already know the visible region and can change the
PixmapRequest accordingly.
Previously it was cleaned in FIFO order
I also moved the pixmap selection logic in a separate function, that
will be needed in the next patches.
Note: This behaviour is yet not optimal for the thumbnails panel,
because it is allowed to be at a page different than the current
viewport
It actually serves three purposes:
a) Make sure all the values are there (this should be always true, but doesn't hurt making sure) because if SwapFree was there but SwapTotal was not, it'd be a mess
b) add up things in order so we don't underflow, currently the code did process stuff as it came in the file, and it happens that SwapTotal appears before SwapFree in /proc/meminfo so it actually did "MemFree:" + "Buffers:" + "Cached:" - "SwapTotal:" + "SwapFree:", which can underflow if "MemFree:" + "Buffers:" + "Cached:" < "SwapTotal:"
c) Do not underflow at all, so if "MemFree:" + "Buffers:" + "Cached:" + "SwapFree:" < "SwapTotal:" we return 0 correctly not a zillion of free memory
Aurélien you might want to update gwenviews copy of this code (there's a few other bugfixes we did a while ago you didn't update either)
CCMAIL: agateau@kde.org
BUGS: 291129
The only affected generator is poppler (because it's the only one with
saving support).
Since version 0.20, Poppler can save annotations to PDF. If the user is
using an older version, this patch warns him that annotations are not
saved.
This patch makes sure that the file saved in the .okular file keeps
the original filename (and, in particular, the extension) even if the
user is re-exporting a .okular archive as .okular archive. Before this
patch, the file boundled in the .okular archive would be named like the
.okular file it was exported from (eg foo.okular instead of foo.pdf).
Note: Okular had no problems in reopening it, but advanced users
unpacking the ZIP file obtained a .okular file which is actually a
native file, and not an okular archive.
1) If the user had previously annotated the document with an old okular
version and the document contains existing annotations and no /Encrypt
(ie the case where annotation changes are no longer saved locally), make
Document::saveDocumentInfo write the original unmodified local
annotations back to XML, so that it seems that the original file was not
changed. If the user makes annotation changes, code from previous
patches already asks him to save them to a different document on close.
2) Ask "Save changes?" if the user has modified annotations in a .okular
archive.
BUG: 300197
3) Turned a "sorry" message in a "information" (with dontshowthisagain),
because now we also have the "Save changes?" prompt to inform the user.
4) Suppressed all annotation-related message boxes on document opening
This patch turns Okular into a ReadWritePart. Annotation editing is always
disabled if we're loaded as ReadOnlyPart, no matter the document type.
REVIEW: 105020
The only affected generator is poppler. Note that:
Document has /Encrypt <=iff=> SaveInterface supportsOption(SaveChanges) is false
This patch enforces the following behavior (and warns the user the first time
he edits an annotation).
- If the document has /Encrypt, warn that "Save as" is not available, but it's
possible to export as okular archive. New annotations will be automatically
saved to XML as usual.
Note that the previous patch already made all existing annotations uneditable,
because there's no way to save them.
- If the document has no /Encrypt and there are existing external annotations,
warn that changes won't be saved automatically. The user needs to "Save as" or
changes will be lost.
- If the document has no /Encrypt and there aren't existing external
annotations, don't show any warning. New annotations will be automatically saved
to XML as usual and to file if "Save as" is pressed.
Modification and removal of *external* annotations are disabled by this
patch. Note that this change doesn't remove any functionality, because they
have never been implemented (AnnotationProxy is defined by the previous
patch).
The #if0'd blocks will be enabled by a future patch that provides fallback
behavior for generators that don't support saving changes.
I did not have time to finish the poppler work and even if this will probably be good for using the poppler work, this adds new API and I don't want to commit to this since having a proper look at making it work
Sorry i failed to fulfill my promise
and implement it in the pdf generator, others welcome to implement the function
for other generators
svn path=/trunk/KDE/kdegraphics/okular/; revision=1114944
Luigi's mail says
********
The attached patch changes a bit the handling of document informations
and the informations shown in the info page.
- document path is added to the information and a button allows you to
toggle between to file name (default) and the complete path;
- the number of the page is added to the information set by
documentInfo() and not by the properties dialog (so the latter will not
modify datas);
- the order of the information shown is the fixed now (see
orderedProperties).
*********
Then there are a few things of my own since some const here and there and adding three values to Key enum
Also it fixes wish 208999
BUGS: 208999
svn path=/trunk/KDE/kdegraphics/okular/; revision=1049872
This allows a resolution, if set, of that named destination when opening a document.
CCBUG: 192032
svn path=/trunk/KDE/kdegraphics/okular/; revision=967542
(fixes potential crash because of references to potentially non-existing pages in the next open document)
svn path=/trunk/KDE/kdegraphics/okular/; revision=923020
fix crash when activating some of the toc items in the testcase of #176513 (still it would be nice to know why they are "void" items"...)
svn path=/trunk/KDE/kdegraphics/okular/; revision=890803
Few missing to be done in it:
- more checks when saving
- make it use a proper mimetype
CCBUG: 151614
svn path=/trunk/KDE/kdegraphics/okular/; revision=884597
- when there are no backends for handling the document mimetype, try harder using the mimetype from the file content only
- when the backend fails loading, try again with the backend that handles the mimetype of the file content
BUG: 166034
svn path=/trunk/KDE/kdegraphics/okular/; revision=881991
Provide ways to register & unregister the view from a Document, and to get/set the view capabilities.
svn path=/trunk/KDE/kdegraphics/okular/; revision=801657
Trigger its execution at the document loading, if there are "top level" scripts,
and when a script action is activated.
svn path=/trunk/KDE/kdegraphics/okular/; revision=796637
Works pretty well -- the only problem left is that when changing the search direction, the first match is the current match.
svn path=/trunk/KDE/kdegraphics/okular/; revision=785629
On the Document/Generator side, introduce a proper interface for the purpouse.
On the GUI side, add a new "Save As" function that save the changed document to a location.
The action is enabled only if the current backend can provide the functionality.
svn path=/trunk/KDE/kdegraphics/okular/; revision=784661
This way we can tell to "merge" in a smart way the new pixmap request with the enqueued ones of the same ID.
Add a (private) slot to refresh all the pixmaps of a page.
svn path=/trunk/KDE/kdegraphics/okular/; revision=783259
[the compressed versions are not in the "generator" .desktop files because okular can deal natively with any gzip- or bzip2- compressed version of the supported document types]
svn path=/trunk/KDE/kdegraphics/okular/; revision=755661
- 0..n-1 are the page indexes again
- -1 is for the fonts not reall belonging to a single page (or when no selective page extraction can be done)
svn path=/trunk/KDE/kdegraphics/okular/; revision=753866
This requires a generator to have a
MyGenerator(QObject *parent, const QVariantList &args)
constructor in order to be successfully loaded.
The OKULAR_EXPORT_PLUGIN macro was adapted, and the generators to provide it the about data; the protected Generator::setAboutData() is no more needed.
Remove the 'lib' prefix from plugins, unneeded now.
CCMAIL: okular-devel@kde.org
svn path=/trunk/KDE/kdegraphics/okular/; revision=744169
* Add FilePrinter class to enable printing via postscript files
* DJVU, PDF, and PS backends print FilePrinter
* All backends enable printing of bookmarked pages
* Print and Print Preview actions enabled/disabled depending on backends
printing ability
Note that FilePrinter only works on *NIX platforms with Cups, lpr, or lp.
svn path=/trunk/KDE/kdegraphics/okular/; revision=741990
This also fixed the problem of the lost rotation when reloading because of document change.
CCBUG: 151130
svn path=/trunk/KDE/kdegraphics/okular/; revision=731697
*** Note this is not a complete port, most of the generators use the
printFiles method which Qt 4.3 does not support, these have simply
been commented out until we find a solution. At least it removes
the dependency so we can remove from kdelibs.
svn path=/trunk/KDE/kdegraphics/okular/; revision=725660
adapted the poppler and the chm generators to use that, instead of fiddling with the settings class
svn path=/trunk/KDE/kdegraphics/okular/; revision=712614
- make the Generator internally keep an pointer to the private class Document, so we can access easily to the Document' stuff
svn path=/trunk/KDE/kdegraphics/okular/; revision=712498
Instead of manually requestion actions and other stuff, we just make the interface as gui client, requesting and integrating it in the part gui.
Also, rename the Generator's componentData() to ownComponentData() to avoid clashing with KXMLGUIClient.
svn path=/trunk/KDE/kdegraphics/okular/; revision=705933
* Update some copyright years and mail addresses
* Search does not block the GUI anymore YUHUUUUU
Well, it it does but it's almost unperceptible, that means the searching methods of Document no longer return a bool but a void and the Document::searchFinished signal is used to know if something was found, nothing was found or the user pressed the cancel button !YES! one can cancel search now :-)
* TextPage no longer holds the area and the current transformed area, it took TOO MUCH memory, now we transform the area each time, it's much more CPU intensive but i could not measure a time loss while searching big documents and i could measure HUNDREDS of MB of usage less.
* MICRO optimization: Change some code to not detach some containers
* I still don't have ADSL so this is something like a "blind" commit, Pino will check it compiles against current KDE, not against what's on my computers
svn path=/trunk/KDE/kdegraphics/okular/; revision=699701
- make the output looking more or less like before (using nospace() or removing the spaces)
- remove endl and '\n' at the end of debug outputs
- fixing the QDebug operator<<'s around
- isolate the debug area number of the core into a separate header, and apply it instead of the numbers found in textpage.cpp
svn path=/trunk/KDE/kdegraphics/okular/; revision=694667
Avoid crashing if the generators provides no information.
(Implements part (a) of KPDF #140109.)
svn path=/trunk/KDE/kdegraphics/okular/; revision=686290
disable the playing of external sounds for remote (non-local) documents;
simple compile fix in the embedded sound paying code
svn path=/trunk/KDE/kdegraphics/okular/; revision=686133
Instead of having a synchronous function that extracts all the information at once, use a function to read the fonts of a single page.
This way, we can get all the result step by step (aka page by page), and possibly in an asynchronous way.
The resuls of the font "scanning" are sent via signals, as well the end of the work.
So, instead of block waiting for the results of all the document at once, the Fonts tab in the properties dialog can have a progress bar with the progress, and the results (the fonts) that are added incrementally to the list.
Only two minor things are left:
- the process is always asynchronous at the moment, as the only generator that can provide this kind of information is the Poppler one (safe)
- there is no check for duplicate fonts
But they should be easy to solve.
svn path=/trunk/KDE/kdegraphics/okular/; revision=685002
When getting the result of a pixmap request for an observer that went away in the meanwhile, don't create a memory entry for the pixmap, as we assume the allocated pixmaps fifo holds only descriptors for valid observers.
(fixed KPDF #143951)
svn path=/trunk/KDE/kdegraphics/okular/; revision=665685
exception to this is the ActionDocumentAction, renamed to DocumentAction and whose id is DocAction
svn path=/trunk/KDE/kdegraphics/okular/; revision=660523