Commit graph

19 commits

Author SHA1 Message Date
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 af52681993 Support more than latin1 chars on --find command line option
BUGS: 427596
2020-10-25 01:11:57 +02:00
Albert Astals Cid 19d98d6a74 Run clang-format
find . \( -name "*.cpp" -or -name "*.h"  -or -name "*.c"  -or -name "*.cc" \) -exec clang-format -i {} \;

If you reached this file doing a git blame, please see README.clang-format (added 2 commits in the future of this one)
2020-07-11 09:17:33 +02:00
Albert Astals Cid 96f00a4d29 CI: Enable clazy qstring-arg check 2020-02-19 23:44:37 +01:00
Joao Netto 716b234100 Implemented find function from console
Summary:
Implemented feature request to find from console.

BUG: 362038

Reviewers: #okular, aacid

Reviewed By: #okular, aacid

Subscribers: ngraham, aacid, yurchor, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D18144
2019-02-13 23:59:52 +01:00
Yuri Chornoivan c04ca1fa96 Fix minor EBN issues 2018-08-31 12:23:45 +03:00
Dileep Sankhla 09b7b079ac Option to exit after printing
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
2018-03-03 17:36:50 +01:00
Albert Astals Cid f467807506 Remove #ifdefs for Qt we require in cmake anyway 2017-01-16 00:36:08 +01:00
Albert Astals Cid b13fc1d3be Readd test for file existance when opening files with # on the path
BUGS: 373855
2017-01-16 00:33:25 +01:00
Martin T. H. Sandsmark ba1aeef06f Remove dead and unused code after porting to Qt5 QUrl 2016-07-24 19:14:29 +02:00
Olivier CHURLAUD e3e2b7c6e3 Register Okular to DBus to get back the "open in new tab" feature.
REVIEW: 128424
2016-07-12 21:14:55 +02:00
Martin T. H. Sandsmark 67e7ada311 Fix build without implicit cast to/from ascii
See the previous commits for details. This is the last part.
2016-07-11 22:11:43 +02:00
Montel Laurent 466eb79615 Use QStringLiteral 2015-10-29 13:37:11 +01:00
Alex Richardson ab700b2453 Restore the URL parsing behaviour in from before the KF5 port
This fixes shelltest

REVIEW: 124738
2015-08-28 19:03:59 +02:00
David Faure d98b4d9200 Make it possible to open URLs on the command-line again
by removing much cruft and using the shiny new QUrl::fromUserInput(2 args),
but since that requires Qt 5.4, also include a copy here if Qt is too "old".

Reviewed-By: Albert
Makes-Happy: Lukas
2014-09-11 18:26:10 +02:00
Frederik Gladhorn b79e706e56 Merge remote-tracking branch 'origin/master' into frameworks
Conflicts:
	generators/dvi/generator_dvi.cpp
	generators/ooo/generator_ooo.cpp
	part.cpp
	shell/main.cpp
	shell/shell.cpp
	shell/shell.h
	shell/shellutils.h
	tests/CMakeLists.txt
	ui/propertiesdialog.cpp
2014-08-14 13:35:43 +02:00
Rohan Garg bd36521c36 Port away from KUrl, pretify headers 2014-08-13 23:03:23 +02:00
Albert Astals Cid 61c830cb7a Pass the command line options properly when using tabs or unique instances
Use a QString to serialize the command line options other than urls to open so it can be easily passed around to every place that opens a new shell or tab or overrides the content in a unique instance.

BUGS: 334100
FIXED-IN: 4.14.0
REVIEW: 119595
2014-08-08 22:35:53 +02:00
Pino Toscano a355d9fea4 isolate the argument -> url conversion code in an own function in the ShellUtils namespace
make the function able to be reused in unit tests (ie adding a function hook for the filename existance check)

svn path=/trunk/KDE/kdegraphics/okular/; revision=1032962
2009-10-08 23:48:04 +00:00