Summary:
Okular saves a new file with permissions 0600 completely ignoring the umask value. This is because it
makes use of QTemporaryFile which creates file with the said permissions and which then Okular copies
to the new location.
So to overcome this generate new file permissions using old mask value and change permissions of the
new file.
BUG: 392682
Test Plan:
Set umask to 0040
Open a pdf file from the same shell and save it under a new name.
Before patch:
file permisions -> 0600
After patch:
file permisions -> 0606
Reviewers: #okular, aacid
Tags: #okular
Differential Revision: https://phabricator.kde.org/D12049
Does not make sese to ask the user if he wants to go fullscreen on the
kile preview widget (or the milou preview widget, the other user of this
feature), and besides not making sense, it's crashing :D
BUGS: 390383
Summary:
When running okular with the parameter --print to directly open the print mode, it doesn't exit after acknowledging the print dialog. Hence adding --print_and_exit option exits Okular after acknowledging the print dialog and thus is useful for the command line batch processing or a Dolphin service as the issue suggests.
FEATURE: 318998
Test Plan:
1. open a file in Okular using the parameter --print. It will open Okular in print mode with the print dialog
2. Either print the file or cancel the print dialog
3. You will find that Okular stays open
4. Now using this patch, see for available options with the --help parameter. You will find --print_and_exit option
5. Now open a file in Okular using the parameter --print_and_exit. It will open Okular in print mode with the print dialog
6. Either print the file or cancel the print dialog
7. You will find that Okular closes after acknowledging the dialog
Reviewers: aacid, #okular, ngraham
Subscribers: ltoscano, ngraham, aacid, #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D10249
Applications using Okular as a KPart might set a file's mime type in the OpenUrlArguments.
Okular currently clears the arguments while opening a document. This revision fixes this, allowing
applications to actually pass a file's mime type to Okular.
BUG: 386600
Okular supports opening zipped files like document.pdf.gz by
transparently extracting them. However, since 559836c392 saving
annotations back was broken. This is because this commit tries to
prevent saving back changes to externally modified files to prevent data
loss. The way this is checked by comparing timestamps mistakenly
triggered for unchanged zipped files, too.
This can be solved by always comparing the before/after timestamps of
the actual file, instead of the timestamp of the temporary copy of the
extracted file. The change has to be done in two places so saving
repeatedly works too.
BUG: 338742
Test plan
gzip autotests/data/file1.pdf && okular file1.pdf.gz
Add annotation, saving works now instead of showing an error.
touch normal.pdf still triggers modification warning.
Differential Revision: https://phabricator.kde.org/D9580
Summary:
BUG: 388511
- Describe what's actually going to happen if you answer in the affirmative
- Use expressive button text with standard ok/cancel style icons
- Remove tooltips, since they're not needed when the buttons clearly indicate what will happen when you press them
Test Plan:
New dialog:
{F5626016}
Both buttons still work to do what they say they'll do.
Reviewers: #okular, aacid, rkflx
Reviewed By: rkflx
Subscribers: rkflx
Tags: #okular
Differential Revision: https://phabricator.kde.org/D9692
Summary:
Unfortunately, poppler (the only backed that supports saving) is not able
to save properly if the file is modified by a third party while it is opened
So we give the user a warning saying things went wrong and give him the option
to not reload/close, that way if there was something very important in the annotations
she added she can try to save them (even if by copy&paste the contents to a third program)
Reviewers: rkflx
Reviewed By: rkflx
Subscribers: ngraham, rkflx, ltoscano, #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D8863
Summary:
exec() is blocking and should not be used if possible.
Currently it makes impossible to interact with a 2nd okular window
if the first window has the Properties or Embedded Files dialog open.
It also causes a double delete crash when closing okular via dbus
while either of those dialogs is open.
We can use open() instead which does not block the event loop and fixes
both the problems.
Test Plan:
1. Open the Properties or Embedded Files dialog, then close okular via dbus.
2. Open two okular windows, then open the Properties or Embedded Files dialog in one of them and try to use the other window.
Reviewers: #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D8704
It was only used in tests as a way to "hide" warning dialogs, now we have a proper way to
close them, this way we make sure that dialogs are should when they should not not when they should not
Example, png files.
If you add an annotation and save and choose to lose changes, the annotation will still be around "in okular" but not on the file, so we need to mark the file as modified so that when the user tries to close he will get again the warning of "you're trying to save and will lose data" because otherwise the user may think the annotation actually was saved since he can see it
Summary: This is implemented using the Purpose framework.
BUG: 173896
Reviewers: aacid
Subscribers: #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D8244
Summary:
Files saved with QSaveFile don't get dirty. They are deleted and replaced.
Thus, inotify and KDirWatch don't emit a "dirty" signal (which is the correct behaviour).
Listening for the "created" signal of KDirWatch allows us to get notified on replaced files.
BUG: 384185
Test Plan:
Opened a markdown document in Okular.
Edited and saved the document with Kate.
The file is reloaded in Okular as expected.
Reviewers: aacid
Reviewed By: aacid
Subscribers: sander, rkflx, #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D7671