Better enforce them now, so that the work to port doesn't increase over
time
Not a super fan of this for regular applications, but oh well the ship
has sailed
If an image URL contains a non-ASCII character (e.g. `kartöffelchen.jpg`), the html returned by the markdown parser contains the encoded path `kart%C3%B6ffelchen.jpg`. We must decode the path before checking if the image file exists.
QLinkedList is deprecated in later Qt5 and gone in Qt6
The 1:1 port is std::list but in this cases all we ever do
is create the lists, push back to them, and pass then around
to be read, for that a QList is more than enough
Make it more similar to how we handle the format event.
We pass the new value to processKeystrokeAction, that calls the script
and sets the new value for the form object according to the result. If
needed the widget is refreshed to reflect the new text
Also allows us not to compile a ./part/toggleactionmenu.cpp in the test, which seems to fix
the crashes in freebsd, makes some sense since we end up with two
ToggleActionMenu in the test, the one provided by the okularpart
library and the other compiled in
When the annotation is unchecked the previous mouse mode is restored.
The slot slotMouseNormalToggled is changed back to its original version
of slotSetMouseNormal given that we needed to pass the checked state
only to detach the annotations, and we do it in the lambda now.
BUG: 398108
BUG: 437377
FIXED-IN: 21.08
* Remove the ImplicitDefaultAction intelligence, so ToggleActionMenu is
not more than a KActionMenu with setDefaultAction().
* Instead, reset the default action when it gets removed from the menu().
This is done by filtering QActionEvent from menu().
* Add an autotest for ToggleActionMenu.
This replaces prior efforts to fix problems in ToggleActionMenu
in !245 and !254, following the discussion on the virtual meeting
at 2021-02-26.
6b26a2b4b and 1786e6c99 have already ported PageView and
AnnotationActionHandler to the simplified interface.
The coordinates in Viewport.rePos are normalized on the full page. In
two functions within pageview.cpp, these were treated as coordinates on
the cropped page.
CCBUG: 198427
This partially fixes the bug 198427 in the case that the cropping of the
target pages (and the pages around the target) is known at the time the
link is clicked. That is, it works if
- One uses 'Trim To Selection'
- One uses 'Trim To Margin' and has already viewed at the target
page(s).
In the case that the cropping of the page at the target is unknown, we
still end up at the wrong position.
The PixmapRequest constructor expected width and height in logical
pixels, and scaled them to device pixels. However, not knowing what
screen the request is for, it had to use qApp->devicePixelRatio()
for the scaling. That value may not be correct if not all screens
use the same scaling.
Fix this by introducing a new constructor that takes the device
pixel ratio as an additional argument, and deprecating the old
constructor.
Previously if it was a remote url that had # and a . after the # we
assumed the url had no fragment and everything was filename.
We don't do that anymore, what we do now is try to open the url as
parsed, i.e. before the # is the filename after is the fragment, and if
that fails we try to open everything as filename and nothing as
fragment.
Unfortunately given how kpart internals handle opening local vs remote
urls we need to do this in two places.
Also we have to remove the test that checked that the url was mangled at
the shell level because we don't do that anymore. Unfortunately can't
add a test for the new codepage since it would involve starting an http
server ^_^
Filenames:
source2e.pdf
foo#bar.pdf
What works:
* okular http://localhost/source2e.pdf#subsection.68.3
* okular file:///srv/http/source2e.pdf#subsection.68.3
* okular source2e.pdf#subsection.68.3 (in the /srv/http folder)
* okular source2e.pdf#2
* okular http://localhost/foo#bar.pdf
* okular file:///srv/http/foo#bar.pdf
* okular foo#bar.pdf (in the /srv/http folder)
What doesn't work:
* okular http://localhost/foo#bar.pdf#2
I think it's a fair limitation that if you want to open a file that contains # in the name and also use a # page marker you need to use the encoded url like okular http://localhost/foo%23bar.pdf#2
after all things like firefox will totally fail opening http://localhost/foo#bar.pdf and will just work if you give the encoded url
BUGS: 426976
Source files are no longer separated by UI and non-UI and similar,
but only by their build target.
* ui/ -> part/
* Move all source files from conf/ to part/
* Keep config skeleton definitions in conf/, needed for the mobile target too
* Move editdrawingtooldialogtest.h from conf/autotests/ to autotests/
* ui/data/icons/ -> icons/
* Move /part.cpp, /part.rc and similar files to part/
* Adapt include paths in source files
* Adapt CMakeLists.txt files (in / and in subdirectories)
* Adapt /Messages.sh
updateCursor() was called by wheelEvent(), which made sense,
because after the wheel event the page will have moved under the cursor.
With smooth scrolling, it makes less sense in wheelEvent(),
because at that point scrolling is still in the future.
scrollContentsBy() appears to be called on every scroll step.
(It is documented to be called at scrollbar value changes, so makes sense.)
This patch removes updateCursor() from wheelEvent(), but adds it to scrollContentsBy().
I did not check anything out with d->visibleItems, as was indicated it graphics/okular!176.
BUG: 421437
Bug 421159 involves a combination of scrolling with the scroll bar
and the mouse wheel. This patch adds an autotest for the bug,
to make sure it doesn't come back.