Commit graph

9149 commits

Author SHA1 Message Date
Albert Astals Cid
d9487fc764 Merge remote-tracking branch 'origin/release/20.12' 2020-12-06 19:13:23 +01:00
Albert Astals Cid
4f2c2b2714 Document::openRelativeFile: Double check the url changed when we asked to
If not, open did not succeed and the callers (for example open document
X in page A) would like to know so they don't have to do the "change to
part A" part.

BUGS: 429924
2020-12-06 17:33:34 +00:00
Christoph Feck
3c1b04da47 GIT_SILENT Upgrade release service version to 20.12.0. 2020-12-02 22:50:04 +01:00
Albert Astals Cid
e200d90de2 cmake: Modern way to link to tiff 2020-12-02 19:01:32 +01:00
Albert Astals Cid
43ae701345 cmake: Modern way to link to freetype 2020-12-02 19:00:18 +01:00
Albert Astals Cid
3cc7bdd1d7 cmake: Modern way to link to zlib 2020-12-02 18:57:49 +01:00
Albert Astals Cid
3129b642f9 cmake: Modern way to link to jpeg 2020-12-02 18:55:59 +01:00
Marat Radchenko
2aa9f18fe7 initial tables support for FictionBook 2020-11-29 23:12:37 +03:00
Friedrich W. H. Kossebau
48891b7203 ui.rc files: consistently use <gui> instead of deprecated <kpartgui> 2020-11-28 17:29:11 +01:00
Marat Radchenko
29ed5d1dd7 handle <subtitle> inside <cite> in FictionBook documents
(cherry picked from commit 2e3faa0052)
2020-11-28 02:20:30 +01:00
Marat Radchenko
2e3faa0052 handle <subtitle> inside <cite> in FictionBook documents 2020-11-27 10:25:34 +03:00
Marat Radchenko
9f7b45271f add support for <subtitle> tag in FictionBook
(cherry picked from commit bcdd5a996c)
2020-11-27 00:30:19 +01:00
Albert Astals Cid
6f761b9e3a Merge remote-tracking branch 'origin/release/20.12' 2020-11-27 00:29:36 +01:00
Albert Astals Cid
239827baad Rework how we open urls that have a #
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
2020-11-26 10:07:58 +00:00
Albert Astals Cid
023976ccfd Show annotation tip when selecting the tool in continuous mode
BUGS: 426782
2020-11-26 09:12:21 +00:00
l10n daemon script
a61977aa8a SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-11-26 10:02:48 +01:00
Albert Astals Cid
d2ae2c283d More fine tuning of the mime of the opened file
In fba90677fc we introduced a "if we're
told this is a text file let's check the mime of the content only since
text files never fail to open".

This extends it to anything that inherits from text now, so if you
rename a PDF file to bla.php it still tries to open as a pdf first and
if that files as a php file
2020-11-25 22:41:34 +00:00
Marat Radchenko
bcdd5a996c add support for <subtitle> tag in FictionBook 2020-11-25 11:16:50 +03:00
l10n daemon script
33483a10fa GIT_SILENT made messages (after extraction) 2020-11-25 08:38:49 +01:00
l10n daemon script
c9440a9160 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-11-25 06:34:22 +01:00
l10n daemon script
a752711872 GIT_SILENT made messages (after extraction) 2020-11-25 02:20:39 +01:00
Christoph Feck
639cd0b42d GIT_SILENT Upgrade release service version to 20.11.90. 2020-11-25 02:09:48 +01:00
Nate Graham
49a7caf64c Merge branch 'release/20.12' 2020-11-20 12:01:00 -07:00
David Hurka
c6a3275151 Fix QScroller crash on Qt < 5.14 and certain screen arrangements
QScrollerPrivate::setDpiFromWidget() before Qt 5.14 crashes
when the target widget does not intersect a physical screen,
because QDesktopWidget returns screen index `-1` in this case,
which leads to an out-of-range read from QApplication::screens(),
which leads to a segfault when reading from an invalid QScreen* pointer.

This adds a workaround that checks for the `-1` situation,
and then tries to resize PageView temporarily to intersect at least some screen.

BUG: 425188
FIXED-IN: 20.12
2020-11-20 18:01:20 +00:00
Alex Rosca
8ae95b29c8 Avoid unintentional accelerating flicks by reducing maximum flick time
When making a flick using the mouse or the touchscreen and then slowly
dragging the pages in the same direction with the flick, it unintentionally
reenters the flicking state after a mouse button release and it's quite
annoying. The commit reduces the maximum time before the next flick.

Steps to reproduce:
1) Flick in direction A.
2) While the view is coasting, decide that you want to stop close to the current position.
3) Grab the view (still coasting), and drag it slowly in direction A.
4) When you reached the desired point, stop your movement, and release the view.
5) QScroller interprets this release as “accelerating flick”,
   and makes the view coast faster in direction A.

Upstream bug is QTBUG-88249; QScroller ignores MinimumVelocity for accelerating flicks.
2020-11-20 17:54:07 +00:00
David Hurka
a83261db92 Merge branch 'release/20.12' into master 2020-11-18 20:35:53 +01:00
David Hurka
19d5dd8ec7 New part/ directory for okularpart sources from /, ui/, conf/
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
2020-11-18 19:32:56 +00:00
Matthias Möller
d605e913c4 Optimization of recolor mode 2020-11-18 10:51:40 +00:00
Alexander Lohnau
3c1fa441d9 Remove dead code
A lot of this code has been commented out for over
a decade and adds no value to the project.
It is only annoying when you look over it ;).

Same for the KNS2 support which was commented out.

Also some of the debug statements didn't even build
anymore, because the properties got removed/refactored.
2020-11-14 10:52:00 +01:00
Albert Astals Cid
6bd6714ab0 poppler: Use actual function calls instead of xml to create poppler annotations 2020-11-11 00:43:54 +00:00
Albert Astals Cid
becdc7c483 Revert the two last commits
f9841b0f8a and e0f45add55

They break the windows build, which shows there's something defenitely
fishy going on with the current code, but oh well, someone with more
time needs to figure out a proper solution
2020-11-11 01:31:47 +01:00
Albert Astals Cid
f9841b0f8a Remove kdocumentviewer
It was causing problems (Windows build fails) now that we enabled  -Wweak-vtables (and
probably before didn't work that much before, guessing that's why we had that if (doc)
in openFile)

This is the simplest solution, invokeMethod is not great but we already
use it, so it's not too terrible

The openDocument function was unused so remove it.

The other two solutions are:
 * Make KDocumentViewer be part of okularcore and then link the
   okularcore to the okular binary, not nice
 * Make another dynamic library that just contains the KDocumentViewer
   class, but i'd rather not add yet another library we have to install
   and take care of
2020-11-09 23:30:49 +01:00
Albert Astals Cid
e0f45add55 Enable -Wweak-vtables in clang
Read https://stackoverflow.com/a/23749273/11956287 for a full
explanation, but basically this is important for headers like the
interfaces/ and kdocumentviewer.h that are supposed to be used by third
partyies where it may happen that wrong things happen because the whole
class is inline in a header

For the classes that are defined in the .cpp or are not installed
headers this would not be necessary but it's not so hard to add a few
default defined destructors, so do that :)
2020-11-08 21:21:06 +00:00
Albert Astals Cid
f44eceba76 GIT_SILENT Upgrade release service version to 21.03.70. 2020-11-08 18:40:16 +01:00
Albert Astals Cid
1327fdd830 GIT_SILENT Upgrade release service version to 20.11.80. 2020-11-08 17:53:23 +01:00
David Hurka
055d5709c1 Merge branch 'release/20.08' into master 2020-11-08 02:05:10 +01:00
Kezi Olio
585340cef5 Fix back/forward navigation after clicking on a link
The condition was incorrect; we were ignoring history when not in the
middle of scrolling when we wanted to do the reverse.

BUG: 414701
FIXED-IN: 20.12
2020-11-02 19:58:08 -07:00
Nicolas Alvarez
d23422d04a gitlab-ci: use eatmydata in apt-get
apt-get uses several fsync() calls on each package it installs, and that's
very slow, especially on non-SSD. eatmydata turns fsync into no-op, which
makes package installation much faster (it can cause corruption if there's
power loss or similar, but that doesn't matter in CI where we throw away
the whole container anyway).

Currently the build_ubuntu_20_04 job in GitLab CI takes 8-9 minutes to
install dependencies. Using eatmydata it went down to 2 minutes.
2020-11-01 13:46:14 -03:00
David Hurka
08c4d4f712 Do not disable flick if cursor has been wrapped
BUG: 420556
FIXED-IN: 1.11.3
2020-11-01 12:05:31 +00:00
Christoph Feck
02c3bd691a GIT_SILENT Update Appstream for new release 2020-10-31 18:08:36 +01:00
Christoph Feck
0d416fb48e GIT_SILENT Upgrade release service version to 20.08.3. 2020-10-31 17:31:50 +01:00
Albert Astals Cid
eb548b006d Fix 3 small memory leaks 2020-10-29 07:49:47 +00:00
Albert Astals Cid
681f405390 Merge remote-tracking branch 'origin/release/20.08' 2020-10-29 00:47:39 +01:00
Albert Astals Cid
82590da11a Fix wrong memory access that may cause crash
When editing the quick annotations
2020-10-28 19:35:33 +01:00
Simone Gaiarin
5c3b67cad1 Save builtin and quick annotation tools separately
This should reduce the number of configuration reparses
2020-10-28 05:32:07 +00:00
Simone Gaiarin
580cbce837 Selectively reparse builtin and quick annotation tool configuration 2020-10-28 05:32:07 +00:00
Albert Astals Cid
91dbaa1f5b Set focus to the next current tab when closing the current tab
And by that it means giving the focus to the pageview which is most of
the fimes what we want. One could argue that if i had the focus on the
searchbar we should restore the focus there, but that makes not much
sense to me, since each tab is it's own world, at most one could say,
let's remember where the focus was in that tab the last time it was
focused and restore it there, but it seems a bit convoluted.

To be able of setting the focus to the pageview from the shell we need
to set up some focus proxies, so that part->widget (which is the sidebar)
ends up giving the focus to the pageview, which is what makes sense if
someone says "you part, set yourself the focus"

BUGS: 428257
2020-10-27 23:37:54 +01:00
Albert Astals Cid
a66a18b82b Merge remote-tracking branch 'origin/release/20.08' 2020-10-27 12:47:14 +01:00
Albert Astals Cid
924a5fb9fc Fix middle click on sidebar tab bar unloads the document.
Filter the exact widget we care about for middle mouse buttons

BUGS: 426613
2020-10-27 00:36:12 +01:00
Nate Graham
bd089ce093 Merge branch 'release/20.08' into master 2020-10-25 10:50:08 -06:00