diff --git a/packages/packages.common b/packages/packages.common index 98a181e8..4506b6a6 100644 --- a/packages/packages.common +++ b/packages/packages.common @@ -1,523 +1,523 @@ # packages.common - list of packages for use with gpg4win -*- sh -*- # # The download script processes the statements here to # actually download the packages. The syntax is trivial: # # If the first non whitespace character of a line is #, the line is # considered a comment. If the first word of a line is "server", the # rest of the line will be taken as the base URL for following file # commands. If the first word of a line is "file" the rest of the # line will be appended to the current base URL (with a / as # delimiter). The statement "chk" is followed by the SHA256 checksum of # the last file. # # zlib # server https://gnupg.org/ftp/gcrypt # last-changed: 2022-04-07 # by: wk # verified: swdb file zlib/zlib-1.2.12.tar.gz chk 91844808532e5ce316b3c010929493c0244f3d37593afd6de04f71821d5136d9 # # GNU # server ftp://ftp.gnu.org/pub/gnu # last-changed: 2017-02-15 # by: ah # verified: Sig 68D9 4D8A AEEA D48A E7DC 5B90 4F49 4A94 2E46 16C2 file libiconv/libiconv-1.15.tar.gz chk ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc8913178 # last-changed: 2021-08-17 # by: ah (checksum added by ik) # verified: Sig 9001 B85A F9E1 B83D F1BD A942 F5BE 8B26 7C6A 406D file gettext/gettext-0.21.tar.xz chk d20fcbb537e02dcf1383197ba05bd0734ef7bf5db06bdb241eb69b7d16b73192 # last-changed: 2023-05-03 # by ah # verified: verification of checksum from both sf and libpng.org server https://downloads.sourceforge.net file libpng/libpng16/1.6.39/libpng-1.6.39.tar.xz chk 1f4696ce70b4ee5f85f1e1623dc1229b210029fa4b7aee573df3e2ba7b036937 # verified: verification of checksum from multiple sources server https://www.ijg.org name jpeg-9e.tar.gz file files/jpegsrc.v9e.tar.gz chk 4077d6a6a75aeb01884f708919d25934c93305e49f7e3f36db9129320e6f4f3d # last-changed: 2023-05-03 # by ah # verified: verification of checksum from multiple sources e.g. homebrew server https://github.com/uclouvain/openjpeg/archive/refs/tags/ name openjpeg-2.5.0.tar.gz file v2.5.0.tar.gz chk 0333806d6adecc6f7a91243b2b839ff4d2053823634d4f6ed7a59bc87409122a # last-changed: 2023-05-03 # by ah # verified: SIG B1FA7D81EEB8E66399178B9733EBBFC47B3DD87D server https://download.osgeo.org file libtiff/tiff-4.5.0.tar.xz chk dafac979c5e7b6c650025569c5a4e720995ba5f17bc17e6276d1f12427be267c # # GIMP stuff for W32 # server http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies # checked: 2012-03-28 wk - Not updated - not a security problem name pkgconfig-0.23.tar.gz file pkg-config-0.23.tar.gz chk 08a0e072d6a05419a58124db864f0685e6ac96e71b2875bf15ac12714e983b53 name pkgconfig-0.23.zip file pkg-config_0.23-3_win32.zip chk 677d6055494e24cad6c49eab33eee618ddc6ed65da827c8b5b7da761b4063278 server https://download.savannah.gnu.org/releases/ # last-changed: 2023-04-19 # by: ah # verified: SIG E30674707856409FF1948010BE6C3AAC63AD8E3F file freetype/freetype-2.13.0.tar.xz chk 5ee23abd047636c24b2d43c6625dcafc66661d1aca64dec9e0d05df29592624c # # SQLite # server https://www.sqlite.org # last changed: 2021-09-20 # by: ik # verified: SHA1 checksum on https://web.archive.org/web/20190228201545/https://www.sqlite.org/download.html name sqlite-3.27.2.tar.gz file 2019/sqlite-autoconf-3270200.tar.gz chk 50c39e85ea28b5ecfdb3f9e860afe9ba606381e21836b2849efca6a0bfe6ef6e # # Stripped down version of BZIP2 # (full source at http://bzip.org) # server ftp://ftp.g10code.com/g10code/bzip2 # checked: 2014-07-16 ah file bzip2-1.0.6-g10.tar.gz chk c2a9b3aec1a38d34b66106116a39f64b01d84f475fef75c40ea0bda0ea67ed07 # # GnuPG et al. # # All tarballs from this server are verified with an openpgp # signature made by "Werner Koch (dist sig)" or one of the other # gnupg main contributors. # Server changed from ftp to https by wk 2021-09-22 server https://gnupg.org/ftp/gcrypt # last changed 2023-04-11 # by wk # verified: swdb file libgpg-error/libgpg-error-1.47.tar.bz2 chk 9e3c670966b96ecc746c28c2c419541e3bcb787d1a73930f5e5f5e1bcbbb9bdb # last-changed: 2021-04-21 # by: ah # verified: distsigkey.gpg file libassuan/libassuan-2.5.5.tar.bz2 chk 8e8c2fcc982f9ca67dcbb1d95e2dc746b1739a4668bc20b3a3c5be632edb34e4 # last changed 2021-09-20 # by ik # verified: distsigkey.gpg file npth/npth-1.6.tar.bz2 chk 1393abd9adcf0762d34798dc34fdcf4d0d22a8410721e76f1e3afcd1daa4e2d1 # last changed 2022-12-19 # by ah # verified: Signature from: 6DAA6E64A76D2840571B4902528897B826403ADA file libksba/libksba-1.6.3.tar.bz2 chk 3f72c68db30971ebbf14367527719423f0a4d5f8103fc9f4a1c01a9fa440de5c # last changed 2022-04-07 # by wk # verified: swdb file ntbtls/ntbtls-0.3.1.tar.bz2 chk 8922181fef523b77b71625e562e4d69532278eabbd18bc74579dbe14135729ba #name gnupg-msi-2.3.1-beta18-20210420-src.tar.xz #file binary/gnupg-w32-2.3.1_20210420.tar.xz #chk e1a2dc705c940938b7bf7a17f521a41b1ef14139acd8860b2fd59aed2750aa3b #name gnupg-msi-2.3.1-20210420-bin.wixlib #file binary/gnupg-w32-2.3.1_20210420.wixlib #chk 133817a4c4d11996956676c5c200222839ee5dc16e9476bd682d4e68b33ef73e # pinentry # last changed: 2022-08-24 # by: wk # verified: swdb file pinentry/pinentry-1.2.1.tar.bz2 chk 457a185e5a85238fb945a955dc6352ab962dc8b48720b62fc9fa48c7540a4067 # last changed 2023-04-20 # by wk # verified: [build tree] file gpgme/gpgme-1.20.0.tar.bz2 chk 25a5785a5da356689001440926b94e967d02e13c49eb7743e35ef0cf22e42750 # last changed: 2021-01-07 # by: ah file scute/scute-1.7.0.tar.bz2 chk 437fe758b27c243a5ee2535c6b065ea1d09f2c9a02d83567d2f934bb6395c249 # GpgOL # last-changed: 2022-12-19 # by: ah # verified: build tree file gpgol/gpgol-2.5.6.tar.bz2 chk f4d05b53e57fc362437236aab71c50d8e3bd441cf48986512d04dfc89faaa3c1 # # GpgEX # # last-changed: 2022-11-18 # by: ah # verified: distsigkey.gpg #file gpgex/gpgex-1.0.10-beta5.tar.bz2 #chk f7e4c619aefed02dfbb07363a4435878a50999b290c60779e670fceb826e283e # # GnuPG utilities # server http://www.jabberwocky.com/software/paperkey # last-changed: 2017-12-05 # by: ah # verified: SIG 7D92 FD31 3AB6 F373 4CC5 9CA1 DB69 8D71 9924 2560 file paperkey-1.5.tar.gz chk c4737943083ce92e41faf13c27a9d608105b6285c0840dfb684a7ee294142ddf # # Kleopatra and dependencies # # Qt base # last changed: 2020-07-22 # by: ah # verified: HTTPS https://download.qt.io/official_releases/qt/5.15/5.15.2/submodules/qtbase-everywhere-src-5.15.2.tar.xz.sha256 server http://download.qt.io/official_releases/qt/ name qtbase-5.15.2.tar.xz file 5.15/5.15.2/submodules/qtbase-everywhere-src-5.15.2.tar.xz chk 909fad2591ee367993a75d7e2ea50ad4db332f05e1c38dd7a5a274e156a4e0f8 # Qt Tools # last changed: 2020-07-22 # by: ah # verified: HTTPS https://download.qt.io/official_releases/qt/5.15/5.15.2/submodules/qttools-everywhere-src-5.15.2.tar.xz.sha256 name qttools-5.15.2.tar.xz file 5.15/5.15.2/submodules/qttools-everywhere-src-5.15.2.tar.xz chk c189d0ce1ff7c739db9a3ace52ac3e24cb8fd6dbf234e49f075249b38f43c1cc # Qt Winextras # last changed: 2020-07-22 # by: ah # verified: HTTPS https://download.qt.io/official_releases/qt/5.15/5.15.2/submodules/qtwinextras-everywhere-src-5.15.2.tar.xz.sha256 name qtwinextras-5.15.2.tar.xz file 5.15/5.15.2/submodules/qtwinextras-everywhere-src-5.15.2.tar.xz chk 65b8272005dec00791ab7d81ab266d1e3313a3bbd8e54e546d984cf4c4ab550e # Qt X11 extras # last changed: 2021-09-20 # by: ik # verified: HTTPS https://download.qt.io/official_releases/qt/5.15/5.15.2/submodules/qtx11extras-everywhere-src-5.15.2.tar.xz.sha256 name qtx11extras-5.15.2.tar.xz file 5.15/5.15.2/submodules/qtx11extras-everywhere-src-5.15.2.tar.xz chk 7014702ee9a644a5a93da70848ac47c18851d4f8ed622b29a72eed9282fc6e3e # Qt WaylandClient # last changed: 2021-09-21 # by: ik # verified: HTTPS https://download.qt.io/official_releases/qt/5.15/5.15.2/submodules/qtwayland-everywhere-src-5.15.2.tar.xz.sha256 name qtwayland-5.15.2.tar.xz file 5.15/5.15.2/submodules/qtwayland-everywhere-src-5.15.2.tar.xz chk 193732229ff816f3aaab9a5e2f6bed71ddddbf1988ce003fe8dd84a92ce9aeb5 # Qt svg # last changed: 2020-07-22 # by: ah # verified: HTTPS https://download.qt.io/official_releases/qt/5.15/5.15.2/submodules/qtsvg-everywhere-src-5.15.2.tar.xz.sha256 name qtsvg-5.15.2.tar.xz file 5.15/5.15.2/submodules/qtsvg-everywhere-src-5.15.2.tar.xz chk 8bc3c2c1bc2671e9c67d4205589a8309b57903721ad14c60ea21a5d06acb585e # Qt translations # last changed: 2020-07-22 # by: ah # verified: HTTPS https://download.qt.io/official_releases/qt/5.15/5.15.2/submodules/qttranslations-everywhere-src-5.15.2.tar.xz.sha256 name qttranslations-5.15.2.tar.xz file 5.15/5.15.2/submodules/qttranslations-everywhere-src-5.15.2.tar.xz chk d5788e86257b21d5323f1efd94376a213e091d1e5e03b45a95dd052b5f570db8 # KDE Frameworks generated by gen-frameworks.sh # When outdated activate this link: #server https://download.kde.org/Attic/frameworks/ server https://download.kde.org/stable/frameworks ##### Paste Here ##### # # Don't forget to update gpg4win.mk.in with new version numbers # # extra-cmake-modules # last changed: 2023-03-22 # by: ah # verified: PGP Signed by ./kde-release-keys.gpg (created by gen-frameworks.sh) file 5.104/extra-cmake-modules-5.104.0.tar.xz chk e49eb21fdb66634b84cccbf6ba65eae3f8e0eee0dc72d50f627280f49df585d9 # kconfig # last changed: 2023-03-22 # by: ah # verified: PGP Signed by ./kde-release-keys.gpg (created by gen-frameworks.sh) file 5.104/kconfig-5.104.0.tar.xz chk b8e7a6b7b0e78e3eb01755a965d893bd95c231befeff10479243e5a182ec2938 # ki18n # last changed: 2023-03-22 # by: ah # verified: PGP Signed by ./kde-release-keys.gpg (created by gen-frameworks.sh) file 5.104/ki18n-5.104.0.tar.xz chk fe815b9e28c680fa472c7ab56e4d7934a8915f19409734a13433797a4be14ee1 # kwidgetsaddons # last changed: 2023-03-22 # by: ah # verified: PGP Signed by ./kde-release-keys.gpg (created by gen-frameworks.sh) file 5.104/kwidgetsaddons-5.104.0.tar.xz chk 4abbb552cd43e51ad2070d8780ca7112e2c9771c2258734ae4a97712b9123120 # kcompletion # last changed: 2023-03-22 # by: ah # verified: PGP Signed by ./kde-release-keys.gpg (created by gen-frameworks.sh) file 5.104/kcompletion-5.104.0.tar.xz chk b0ed0246871283df04c62f0df2b221e32911cb4d292d5ae42f860958032eb510 # kwindowsystem # last changed: 2023-03-22 # by: ah # verified: PGP Signed by ./kde-release-keys.gpg (created by gen-frameworks.sh) file 5.104/kwindowsystem-5.104.0.tar.xz chk 6b10ee354ebb7d2dfd6baa1374929d30811f8169c8233e55849e31e38e6af81a # kcoreaddons # last changed: 2023-03-22 # by: ah # verified: PGP Signed by ./kde-release-keys.gpg (created by gen-frameworks.sh) file 5.104/kcoreaddons-5.104.0.tar.xz chk ed760d4a7fed6c03480dcc3cfe621a49ac5ca9853c846080afe393f7ce794e40 # kcodecs # last changed: 2023-03-22 # by: ah # verified: PGP Signed by ./kde-release-keys.gpg (created by gen-frameworks.sh) file 5.104/kcodecs-5.104.0.tar.xz chk 7ec909f6865eba87a99b046a9aeaa6a83c01308ad1dda87be3f69e91a7909d6b # kconfigwidgets # last changed: 2023-03-22 # by: ah # verified: PGP Signed by ./kde-release-keys.gpg (created by gen-frameworks.sh) file 5.104/kconfigwidgets-5.104.0.tar.xz chk eb9014b813a1c8a18c78ef11be296964b31338e5237080a74234bf97ead64522 # kdbusaddons # last changed: 2023-03-22 # by: ah # verified: PGP Signed by ./kde-release-keys.gpg (created by gen-frameworks.sh) file 5.104/kdbusaddons-5.104.0.tar.xz chk 4c6add0481c407bc3768729e27e8644feba748c333872e62aaa3260338fd56b4 # kxmlgui # last changed: 2023-03-22 # by: ah # verified: PGP Signed by ./kde-release-keys.gpg (created by gen-frameworks.sh) file 5.104/kxmlgui-5.104.0.tar.xz chk f45d5a5411b3ca0197c1e4720c27c7d85e351aeee03aca861066e8db3c7c93e6 # kguiaddons # last changed: 2023-03-22 # by: ah # verified: PGP Signed by ./kde-release-keys.gpg (created by gen-frameworks.sh) file 5.104/kguiaddons-5.104.0.tar.xz chk fb8d8de25b684af6f9e9e893912664a18231486ac995d2522676018c3e93840d # kitemviews # last changed: 2023-03-22 # by: ah # verified: PGP Signed by ./kde-release-keys.gpg (created by gen-frameworks.sh) file 5.104/kitemviews-5.104.0.tar.xz chk 94920dc68c187319fa79c64e194e9ebecaef8c97fc4bd6aba342c18bc75a48bc # kitemmodels # last changed: 2023-03-22 # by: ah # verified: PGP Signed by ./kde-release-keys.gpg (created by gen-frameworks.sh) file 5.104/kitemmodels-5.104.0.tar.xz chk 0bac2fe2fc607443e3332911655ced5dd309e346f2f6a2ff3f29b2f45b7b18d7 # kiconthemes # last changed: 2023-03-22 # by: ah # verified: PGP Signed by ./kde-release-keys.gpg (created by gen-frameworks.sh) file 5.104/kiconthemes-5.104.0.tar.xz chk 70f4d9f950acdaa28b539838226ed1cff7e70cdcf177272185bac7c75a6cccdf # breeze-icons # last changed: 2023-03-22 # by: ah # verified: PGP Signed by ./kde-release-keys.gpg (created by gen-frameworks.sh) file 5.104/breeze-icons-5.104.0.tar.xz chk ff2dacc3fb6f1c7acd378638329f2e5b5fc4fdb3dab1321716d2d54b32eaae6a # karchive # last changed: 2023-03-22 # by: ah # verified: PGP Signed by ./kde-release-keys.gpg (created by gen-frameworks.sh) file 5.104/karchive-5.104.0.tar.xz chk b62f3dfe68691ad2917d0592d66ffc02cfbcc7571b7d1fb1d3fadd695534fd2e # kcrash # last changed: 2023-03-22 # by: ah # verified: PGP Signed by ./kde-release-keys.gpg (created by gen-frameworks.sh) file 5.104/kcrash-5.104.0.tar.xz chk 12d6004f9e2e51a9d74f044462753dd7410e10a40a1f6b07727dcd5b52a7ea96 # kio # last changed: 2023-03-22 # by: ah # verified: PGP Signed by ./kde-release-keys.gpg (created by gen-frameworks.sh) file 5.104/kio-5.104.0.tar.xz chk 5a8b93a5de72406fc4cc7b9aa4715be6d1d5264e617b26be257f5d0e26dde310 # kbookmarks # last changed: 2023-03-22 # by: ah # verified: PGP Signed by ./kde-release-keys.gpg (created by gen-frameworks.sh) file 5.104/kbookmarks-5.104.0.tar.xz chk 85e565590233cfc6dc8c3459717c327961e79c74199d4d1c2741b40946936354 # kservice # last changed: 2023-03-22 # by: ah # verified: PGP Signed by ./kde-release-keys.gpg (created by gen-frameworks.sh) file 5.104/kservice-5.104.0.tar.xz chk 215b109738ea5a10f97c4abbd3c9b9da58c826127708eddd34af345b4e8ad8a3 # solid # last changed: 2023-03-22 # by: ah # verified: PGP Signed by ./kde-release-keys.gpg (created by gen-frameworks.sh) file 5.104/solid-5.104.0.tar.xz chk 2a9a33bc71b4cafec35b9692bd7681a736eeb4e4b81c25f5bd87dbec38c143cf # kjobwidgets # last changed: 2023-03-22 # by: ah # verified: PGP Signed by ./kde-release-keys.gpg (created by gen-frameworks.sh) file 5.104/kjobwidgets-5.104.0.tar.xz chk 3b254124d3bf20666a514710fef8990325da2ade14f49368b1bed1256eb8fea1 # threadweaver # last changed: 2023-04-19 # by: ah # verified: PGP Signed by ./kde-release-keys.gpg (created by gen-frameworks.sh) file 5.104/threadweaver-5.104.0.tar.xz chk 963decfdf0cf780406eb585efdb213539a00cd16ae4dff2b2ffe8822a609a647 # kparts # last changed: 2023-04-19 # by: ah # verified: PGP Signed by ./kde-release-keys.gpg (created by gen-frameworks.sh) file 5.104/kparts-5.104.0.tar.xz chk 66a40646cc4890669991cc63d33803ec335b0c08b7aeb0476b2a852951e700cd ### END PASTE ### server http://download.kde.org/stable/release-service/ # kmime # last changed: 2022-02-01 # by: ah # verified: PGP Sig D81C0CB38EB725EF6691C385BB463350D6EF31EF #file 21.12.1/src/kmime-21.12.1.tar.xz #chk c1f4c06c61f6b4ddde7395b1cfb1f2411a32638e09c6f0a58c6557a7dffe4120 # # Snapshots stored on the GnuPG server # server https://gnupg.org/ftp/gcrypt/snapshots # gpgex # last changed: 2022-12-06 # by: aheinecke # verified: Tarball created by aheinecke. file gpgex/gpgex-1.0.10-beta5.tar.xz chk 2c227634528ef76bcca7fd4b7fe5c38a535f6e68bbe5b2cdc6cc4a74810b2dba # gpg4win-tools # last changed: 2022-08-29 # by: aheinecke # verified: Tarball created by aheinecke. file gpg4win-tools/gpg4win-tools-202208290924.tar.xz chk fe20b69d84893618625d76e55f772477a80628da98411c8bb9c1a5e01028b3f9 # kmime # last changed: 2023-03-22 # by: aheinecke # verified: Tarball created by aheinecke. file kmime/kmime-202303221649.tar.xz chk 0a26c6b7a1b921191e52ee17d8d131f606a1def9ed09e31074a1c7aed5c4c6b7 # libkleo # last changed: 2023-03-22 # by: aheinecke # verified: Tarball created by aheinecke. file libkleo/libkleo-202303221217.tar.xz chk 0dfe1000d56242c95b54dd59be831e4a11f6bf19b194c922e719638c5eef98fa # kleopatra # last changed: 2023-03-22 # by: aheinecke # verified: Tarball created by aheinecke. file kleopatra/kleopatra-202303221715.tar.xz chk 8b78bc7d5487db5ae6fa1addc9756f24922a9af8386210f453c015e3f0e30eab # Okular and dependencies # poppler -# last changed: 2023-04-25 +# last changed: 2023-05-04 # by: aheinecke # verified: Tarball created by aheinecke. -file poppler/poppler-202304252208.tar.xz -chk 541728005bd468f402be00da3e1949c8181112eb78015257e51c55d1e3de5b34 +file poppler/poppler-202305041410.tar.xz +chk ba2e334f1f1a7285a5b4af6280094f0664ff2348f3c041f77bd3e721e472a131 # okular -# last changed: 2023-04-25 +# last changed: 2023-05-04 # by: aheinecke # verified: Tarball created by aheinecke. -file okular/okular-202304252324.tar.xz -chk dca8ecab53724d3b293da02254df2d73d3115beb9890edc545ebaeea99d815d3 +file okular/okular-202305041409.tar.xz +chk 1bc74f8b35cc5fae5937eeda387742249fab878ec06c2e573e00efe0f90c7339 diff --git a/patches/okular/0001-WIP-Buildfix-with-reduced-depdencies.patch b/patches/okular/0001-WIP-Buildfix-with-reduced-depdencies.patch index e49245c1..001afc66 100755 --- a/patches/okular/0001-WIP-Buildfix-with-reduced-depdencies.patch +++ b/patches/okular/0001-WIP-Buildfix-with-reduced-depdencies.patch @@ -1,1088 +1,1068 @@ #! /bin/sh patch -p1 -l -f $* < $0 exit $? -From 5f06785155c2878fea6ba43db2eb9ef9c74a5197 Mon Sep 17 00:00:00 2001 +From a3eec4564cf4f65391af8010d5e48a80094065ea Mon Sep 17 00:00:00 2001 From: Andre Heinecke -Date: Tue, 25 Apr 2023 16:06:44 +0200 +Date: Thu, 4 May 2023 14:07:02 +0200 Subject: [PATCH] WIP: Buildfix with reduced depdencies This needs to be split up and cleaned up. -Easy ones: -Qt QML and Qt Quick - KTextWidgets should only remove the spellchecking and some undo behavior in Text annotations Phonon disables all Media features. KIOFileWidgets should functionally be replaced for Windows with native code but needs testing. DBus needs probably replacement by Kleopatras variant of KUniqueService for the same functionality. The CMake version requirement is just to allow compiling on debian stable. --- - CMakeLists.txt | 53 +++++++++++++++++++++++++------- + CMakeLists.txt | 52 +++++++++++++++++++++++++------- core/document.cpp | 13 ++++++++ part/annotwindow.cpp | 9 ++++++ part/annotwindow.h | 4 +++ part/dlgpresentation.cpp | 11 +++++++ part/formwidgets.cpp | 4 ++- part/formwidgets.h | 5 +++ - part/pageview.cpp | 22 +++++++++++-- + part/pageview.cpp | 22 ++++++++++++-- part/pageviewmouseannotation.cpp | 5 ++- part/pageviewutils.cpp | 6 ++++ part/part.cpp | 16 ++++++++++ part/part.h | 4 +++ part/presentationwidget.cpp | 38 ++++++++++++++++++----- shell/CMakeLists.txt | 7 ++++- shell/main.cpp | 1 - shell/okular_main.cpp | 11 +++++++ shell/shell.cpp | 9 +++++- shell/shell.h | 6 +++- shell/welcomescreen.cpp | 9 ++++++ - 19 files changed, 207 insertions(+), 26 deletions(-) + 19 files changed, 206 insertions(+), 26 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index 009924862..4f007bcf3 100644 +index 47c8832e1..69f1a0a85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.22) +cmake_minimum_required(VERSION 3.18) # KDE Application Version, managed by release script set (RELEASE_SERVICE_VERSION_MAJOR "23") -@@ -102,7 +102,7 @@ ecm_setup_version(${PROJECT_VERSION} - VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/core/version.h" - PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/Okular5ConfigVersion.cmake") - --find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS Core Test Widgets PrintSupport Svg Qml Quick) -+find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS Core Test Widgets PrintSupport Svg) - - if(ANDROID) - find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS AndroidExtras) @@ -147,8 +147,16 @@ if(KF5JS_FOUND) endif() if (BUILD_DESKTOP) - find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS DBus) - find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS Parts Crash IconThemes TextWidgets) + find_package(Qt5DBus ${QT_REQUIRED_VERSION} CONFIG) + if (Qt5DBus_FOUND) + add_definitions(-DHAVE_DBUS) + endif() + find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS Parts Crash IconThemes) + + find_package(KF5TextWidgets ${KF5_REQUIRED_VERSION} CONFIG) + if (KF5TextWidgets_FOUND) + add_definitions(-DHAVE_TEXTWIDGETS) + endif() find_package(KF5Purpose) set_okular_optional_package_properties(KF5Purpose PROPERTIES -@@ -169,6 +177,7 @@ if (BUILD_DESKTOP) - endif() - - if (BUILD_MOBILE) -+ find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS Qml Quick) - find_package(KF5Kirigami2) - set_package_properties(KF5Kirigami2 PROPERTIES - DESCRIPTION "A QtQuick based components set" -@@ -191,7 +200,14 @@ if(NOT WIN32 AND NOT ANDROID AND NOT APPLE) +@@ -192,7 +200,14 @@ if(NOT WIN32 AND NOT ANDROID AND NOT APPLE) else() set(HAVE_X11 FALSE) endif() -find_package(Phonon4Qt5 CONFIG REQUIRED) + +find_package(Phonon4Qt5 CONFIG) +set_okular_optional_package_properties(Phonon4Qt5 PROPERTIES + PURPOSE "Support for media files in okular.") +if (Phonon_FOUND) + add_definitions(-DHAVE_PHONON) + set(PHONON_LIB Phonon::phonon4qt) +endif() set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/modules) -@@ -315,11 +331,16 @@ endif(NOT WIN32) +@@ -316,11 +331,16 @@ endif(NOT WIN32) # okularcore +if (Phonon_FOUND) +set(media_SRCS + core/audioplayer.cpp +) +endif() + set(okularcore_SRCS core/action.cpp core/annotations.cpp core/area.cpp - core/audioplayer.cpp core/bookmarkmanager.cpp core/chooseenginedialog.cpp core/document.cpp -@@ -352,7 +373,9 @@ set(okularcore_SRCS +@@ -353,7 +373,9 @@ set(okularcore_SRCS core/script/event.cpp core/synctex/synctex_parser.c core/synctex/synctex_parser_utils.c + ${media_SRCS} ) + qt5_add_resources(okularcore_SRCS core/script/builtin.qrc ) -@@ -435,7 +458,7 @@ PRIVATE +@@ -436,7 +458,7 @@ PRIVATE KF5::I18n KF5::ThreadWeaver KF5::Bookmarks - Phonon::phonon4qt5 + ${PHONON_LIB} Qt5::Svg ${MATH_LIB} ZLIB::ZLIB -@@ -479,6 +502,13 @@ install(FILES conf/okular.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR}) +@@ -480,6 +502,13 @@ install(FILES conf/okular.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR}) install(FILES conf/okular_core.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR}) install(FILES core/okularGenerator.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR}) +if (Phonon_FOUND) +set(additional_phonon_SRCS + part/snapshottaker.cpp + part/videowidget.cpp +) +endif() + if(BUILD_DESKTOP) # okularpart set(okularpart_SRCS -@@ -541,15 +571,14 @@ if(BUILD_DESKTOP) +@@ -542,15 +571,14 @@ if(BUILD_DESKTOP) part/searchwidget.cpp part/sidebar.cpp part/side_reviews.cpp - part/snapshottaker.cpp part/thumbnaillist.cpp part/toc.cpp part/toggleactionmenu.cpp - part/videowidget.cpp part/layers.cpp part/signaturepartutils.cpp part/signaturepropertiesdialog.cpp part/signaturepanel.cpp + ${additional_phonon_SRCS} ) + ki18n_wrap_ui(okularpart_SRCS part/selectcertificatedialog.ui) - if (Qt5TextToSpeech_FOUND) -@@ -565,21 +594,23 @@ generate_export_header(okularpart BASE_NAME okularpart) +@@ -567,21 +595,23 @@ generate_export_header(okularpart BASE_NAME okularpart) target_link_libraries(okularpart okularcore ${MATH_LIB} Qt5::Svg - Phonon::phonon4qt5 + ${PHONON_LIB} KF5::Archive KF5::Bookmarks KF5::I18n KF5::IconThemes KF5::ItemViews KF5::KIOCore - KF5::KIOFileWidgets KF5::KIOWidgets KF5::Parts KF5::Solid KF5::WindowSystem - KF5::TextWidgets ) +if(KF5TextWidgets_FOUND) + target_link_libraries(okularpart KF5::TextWidgets) +endif() + if(KF5Wallet_FOUND) target_link_libraries(okularpart KF5::Wallet) endif() diff --git a/core/document.cpp b/core/document.cpp -index 234243480..d996a40f0 100644 +index b1b6c94d3..cd6a5f066 100644 --- a/core/document.cpp +++ b/core/document.cpp @@ -70,8 +70,10 @@ #include "action.h" #include "annotations.h" #include "annotations_p.h" +#ifdef HAVE_PHONON #include "audioplayer.h" #include "audioplayer_p.h" +#endif #include "bookmarkmanager.h" #include "chooseenginedialog_p.h" #include "debug_p.h" @@ -2576,7 +2578,9 @@ Document::OpenResult Document::openDocument(const QString &docFile, const QUrl & d->m_nextDocumentDestination = QString(); } +#ifdef HAVE_PHONON AudioPlayer::instance()->d->m_currentDocument = fromFileDescriptor ? QUrl() : d->m_url; +#endif const QStringList docScripts = d->m_generator->metaData(QStringLiteral("DocumentScripts"), QStringLiteral("JavaScript")).toStringList(); if (!docScripts.isEmpty()) { @@ -2648,8 +2652,10 @@ void Document::closeDocument() d->m_fontThread = nullptr; } +#ifdef HAVE_PHONON // stop any audio playback AudioPlayer::instance()->stopPlaybacks(); +#endif // close the current document and save document info if a document is still opened if (d->m_generator && d->m_pagesVector.size() > 0) { @@ -2773,7 +2779,9 @@ void Document::closeDocument() d->m_documentInfo = DocumentInfo(); d->m_documentInfoAskedKeys.clear(); +#ifdef HAVE_PHONON AudioPlayer::instance()->d->m_currentDocument = QUrl(); +#endif d->m_undoStack->clear(); d->m_docdataMigrationNeeded = false; @@ -4304,10 +4312,12 @@ void Document::processAction(const Action *action) } } break; +#ifdef HAVE_PHONON case Action::Sound: { const SoundAction *linksound = static_cast(action); AudioPlayer::instance()->playSound(linksound->sound(), linksound); } break; +#endif case Action::Script: { const ScriptAction *linkscript = static_cast(action); @@ -4317,6 +4327,7 @@ void Document::processAction(const Action *action) d->m_scripter->execute(linkscript->scriptType(), linkscript->script()); } break; +#ifdef HAVE_PHONON case Action::Movie: Q_EMIT processMovieAction(static_cast(action)); break; @@ -4331,6 +4342,8 @@ void Document::processAction(const Action *action) Q_EMIT processRenditionAction(static_cast(action)); } break; +#endif + case Action::BackendOpaque: { d->m_generator->opaqueAction(static_cast(action)); } break; diff --git a/part/annotwindow.cpp b/part/annotwindow.cpp index 68bc16f4d..c77c42697 100644 --- a/part/annotwindow.cpp +++ b/part/annotwindow.cpp @@ -13,7 +13,12 @@ // qt/kde includes #include #include +#ifdef HAVE_TEXTWIDGETS #include +#else +#include +#define KTextEdit QTextEdit +#endif #include #include #include @@ -21,9 +26,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -234,7 +241,9 @@ AnnotWindow::AnnotWindow(QWidget *parent, Okular::Annotation *annot, Okular::Doc connect(textEdit, &KTextEdit::textChanged, this, &AnnotWindow::slotsaveWindowText); connect(textEdit, &KTextEdit::cursorPositionChanged, this, &AnnotWindow::slotsaveWindowText); +#ifdef HAVE_TEXTWIDGETS connect(textEdit, &KTextEdit::aboutToShowContextMenu, this, &AnnotWindow::slotUpdateUndoAndRedoInContextMenu); +#endif connect(m_document, &Okular::Document::annotationContentsChangedByUndoRedo, this, &AnnotWindow::slotHandleContentsChangedByUndoRedo); if (!canEditAnnotation) { diff --git a/part/annotwindow.h b/part/annotwindow.h index 8f48e698a..8d99b1ebd 100644 --- a/part/annotwindow.h +++ b/part/annotwindow.h @@ -25,6 +25,10 @@ namespace GuiUtils class LatexRenderer; } +#ifndef HAVE_TEXTWIDGETS +#define KTextEdit QTextEdit +#endif + class KTextEdit; class MovableTitle; class QMenu; diff --git a/part/dlgpresentation.cpp b/part/dlgpresentation.cpp index 5dd763b3f..4b4d6c5e2 100644 --- a/part/dlgpresentation.cpp +++ b/part/dlgpresentation.cpp @@ -10,7 +10,13 @@ #include #include + +#ifdef HAVE_TEXTWIDGETS #include +#else +#include +#define KPluralHandlingSpinBox QSpinBox +#endif #include #include @@ -35,7 +41,12 @@ DlgPresentation::DlgPresentation(QWidget *parent) KPluralHandlingSpinBox *advanceTime = new KPluralHandlingSpinBox(this); advanceTime->setPrefix(i18nc("Spinbox prefix: Advance automatically: every n seconds", "every ")); +#ifdef HAVE_TEXTWIDGETS advanceTime->setSuffix(ki18ncp("Advance every %1 seconds", " second", " seconds")); +#else + advanceTime->setPrefix(i18nc("Spinbox suffix: Advance automatically: every n seconds", " seconds")); +#endif + advanceTime->setObjectName(QStringLiteral("kcfg_SlidesAdvanceTime")); QHBoxLayout *advanceAutomaticallyLayout = new QHBoxLayout(); diff --git a/part/formwidgets.cpp b/part/formwidgets.cpp index c2291e4c6..cc737ea9c 100644 --- a/part/formwidgets.cpp +++ b/part/formwidgets.cpp @@ -614,14 +614,16 @@ TextAreaEdit::TextAreaEdit(Okular::FormFieldText *text, PageView *pageView) , FormWidgetIface(this, text) { setAcceptRichText(text->isRichText()); +#ifdef HAVE_TEXTWIDGETS setCheckSpellingEnabled(text->canBeSpellChecked()); + connect(this, &KTextEdit::aboutToShowContextMenu, this, &TextAreaEdit::slotUpdateUndoAndRedoInContextMenu); +#endif setAlignment(text->textAlignment()); setPlainText(text->text()); setUndoRedoEnabled(false); connect(this, &QTextEdit::textChanged, this, &TextAreaEdit::slotChanged); connect(this, &QTextEdit::cursorPositionChanged, this, &TextAreaEdit::slotChanged); - connect(this, &KTextEdit::aboutToShowContextMenu, this, &TextAreaEdit::slotUpdateUndoAndRedoInContextMenu); m_prevCursorPos = textCursor().position(); m_prevAnchorPos = textCursor().anchor(); m_editing = false; diff --git a/part/formwidgets.h b/part/formwidgets.h index ea0d2fef8..e59276593 100644 --- a/part/formwidgets.h +++ b/part/formwidgets.h @@ -13,7 +13,12 @@ #include "core/area.h" #include "core/form.h" +#ifdef HAVE_TEXTWIDGETS #include +#else +#include +#define KTextEdit QTextEdit +#endif #include #include #include diff --git a/part/pageview.cpp b/part/pageview.cpp -index 8e0206ef1..20119da5e 100644 +index 3872dd29f..0bf051981 100644 --- a/part/pageview.cpp +++ b/part/pageview.cpp @@ -83,12 +83,14 @@ #include "tts.h" #endif #include "core/action.h" -#include "core/audioplayer.h" #include "core/document_p.h" #include "core/form.h" #include "core/generator.h" #include "core/misc.h" +#ifdef HAVE_PHONON +#include "core/audioplayer.h" #include "core/movie.h" +#endif #include "core/page.h" #include "core/page_p.h" #include "core/sourcereference.h" -@@ -1128,6 +1130,7 @@ void PageView::selectAll() +@@ -1138,6 +1140,7 @@ void PageView::selectAll() void PageView::createAnnotationsVideoWidgets(PageViewItem *item, const QList &annotations) { +#ifdef HAVE_PHONON qDeleteAll(item->videoWidgets()); item->videoWidgets().clear(); -@@ -1152,6 +1155,7 @@ void PageView::createAnnotationsVideoWidgets(PageViewItem *item, const QList &pageSet, int setupFlag +@@ -1216,6 +1220,7 @@ void PageView::notifySetup(const QVector &pageSet, int setupFlag // For the video widgets we don't really care about reusing them since they don't contain much info so just // create them again +#ifdef HAVE_PHONON createAnnotationsVideoWidgets(item, pageSet[i]->annotations()); const QHash videoWidgets = item->videoWidgets(); for (VideoWidget *vw : videoWidgets) { -@@ -1219,6 +1224,7 @@ void PageView::notifySetup(const QVector &pageSet, int setupFlag +@@ -1229,6 +1234,7 @@ void PageView::notifySetup(const QVector &pageSet, int setupFlag vw->show(); vw->hide(); } +#endif } } -@@ -1576,12 +1582,14 @@ void PageView::notifyCurrentPageChanged(int previous, int current) +@@ -1586,12 +1592,14 @@ void PageView::notifyCurrentPageChanged(int previous, int current) { if (previous != -1) { PageViewItem *item = d->items.at(previous); +#ifdef HAVE_PHONON if (item) { const QHash videoWidgetsList = item->videoWidgets(); for (VideoWidget *videoWidget : videoWidgetsList) { videoWidget->pageLeft(); } } +#endif // On close, run the widget scripts, needed for running animated PDF const Okular::Page *page = d->document->page(previous); -@@ -1596,12 +1604,14 @@ void PageView::notifyCurrentPageChanged(int previous, int current) +@@ -1606,12 +1614,14 @@ void PageView::notifyCurrentPageChanged(int previous, int current) if (current != -1) { PageViewItem *item = d->items.at(current); +#ifdef HAVE_PHONON if (item) { const QHash videoWidgetsList = item->videoWidgets(); for (VideoWidget *videoWidget : videoWidgetsList) { videoWidget->pageEntered(); } } +#endif // update zoom text and factor if in a ZoomFit/* zoom mode if (d->zoomMode != ZoomFixed) { -@@ -4360,6 +4370,7 @@ QMenu *PageView::createProcessLinkMenu(PageViewItem *item, const QPoint eventPos +@@ -4370,6 +4380,7 @@ QMenu *PageView::createProcessLinkMenu(PageViewItem *item, const QPoint eventPos // creating the menu and its actions QAction *processLink = menu->addAction(i18n("Follow This Link")); processLink->setObjectName(QStringLiteral("ProcessLinkAction")); +#ifdef HAVE_PHONON if (link->actionType() == Okular::Action::Sound) { processLink->setText(i18n("Play this Sound")); if (Okular::AudioPlayer::instance()->state() == Okular::AudioPlayer::PlayingState) { -@@ -4367,6 +4378,7 @@ QMenu *PageView::createProcessLinkMenu(PageViewItem *item, const QPoint eventPos +@@ -4377,6 +4388,7 @@ QMenu *PageView::createProcessLinkMenu(PageViewItem *item, const QPoint eventPos connect(actStopSound, &QAction::triggered, []() { Okular::AudioPlayer::instance()->stopPlaybacks(); }); } } +#endif if (dynamic_cast(link)) { QAction *actCopyLinkLocation = menu->addAction(QIcon::fromTheme(QStringLiteral("edit-copy")), i18n("Copy Link Address")); -@@ -4667,6 +4679,8 @@ void PageView::slotRequestVisiblePixmaps(int newValue) +@@ -4677,6 +4689,8 @@ void PageView::slotRequestVisiblePixmaps(int newValue) Okular::NormalizedRect r = fwi->rect(); fwi->moveTo(qRound(i->uncroppedGeometry().left() + i->uncroppedWidth() * r.left) + 1 - viewportRect.left(), qRound(i->uncroppedGeometry().top() + i->uncroppedHeight() * r.top) + 1 - viewportRect.top()); } + +#ifdef HAVE_PHONON const QHash videoWidgets = i->videoWidgets(); for (VideoWidget *vw : videoWidgets) { const Okular::NormalizedRect r = vw->normGeometry(); -@@ -4677,7 +4691,7 @@ void PageView::slotRequestVisiblePixmaps(int newValue) +@@ -4687,7 +4701,7 @@ void PageView::slotRequestVisiblePixmaps(int newValue) vw->pageLeft(); } } - +#endif if (!i->isVisible()) { continue; } -@@ -5307,6 +5321,7 @@ void PageView::externalKeyPressEvent(QKeyEvent *e) +@@ -5317,6 +5331,7 @@ void PageView::externalKeyPressEvent(QKeyEvent *e) void PageView::slotProcessMovieAction(const Okular::MovieAction *action) { +#ifdef HAVE_PHONON const Okular::MovieAnnotation *movieAnnotation = action->annotation(); if (!movieAnnotation) { return; -@@ -5346,10 +5361,12 @@ void PageView::slotProcessMovieAction(const Okular::MovieAction *action) +@@ -5356,10 +5371,12 @@ void PageView::slotProcessMovieAction(const Okular::MovieAction *action) vw->play(); break; }; +#endif } void PageView::slotProcessRenditionAction(const Okular::RenditionAction *action) { +#ifdef HAVE_PHONON Okular::Movie *movie = action->movie(); if (!movie) { return; -@@ -5390,6 +5407,7 @@ void PageView::slotProcessRenditionAction(const Okular::RenditionAction *action) +@@ -5400,6 +5417,7 @@ void PageView::slotProcessRenditionAction(const Okular::RenditionAction *action) default: return; }; +#endif } void PageView::slotFitWindowToPage() diff --git a/part/pageviewmouseannotation.cpp b/part/pageviewmouseannotation.cpp index 1e2edaaff..73649ff87 100644 --- a/part/pageviewmouseannotation.cpp +++ b/part/pageviewmouseannotation.cpp @@ -647,6 +647,7 @@ void MouseAnnotation::processAction(const AnnotationDescription &ad) Okular::Annotation *ann = ad.annotation; PageViewItem *pageItem = ad.pageViewItem; +#ifdef HAVE_PHONON if (ann->subType() == Okular::Annotation::AMovie) { VideoWidget *vw = pageItem->videoWidgets().value(static_cast(ann)->movie()); vw->show(); @@ -655,7 +656,9 @@ void MouseAnnotation::processAction(const AnnotationDescription &ad) VideoWidget *vw = pageItem->videoWidgets().value(static_cast(ann)->movie()); vw->show(); vw->play(); - } else if (ann->subType() == Okular::Annotation::AScreen) { + } else +#endif + if (ann->subType() == Okular::Annotation::AScreen) { m_document->processAction(static_cast(ann)->action()); } else if (ann->subType() == Okular::Annotation::AFileAttachment) { const Okular::FileAttachmentAnnotation *fileAttachAnnot = static_cast(ann); diff --git a/part/pageviewutils.cpp b/part/pageviewutils.cpp index 3da2fb52c..d42e74cfd 100644 --- a/part/pageviewutils.cpp +++ b/part/pageviewutils.cpp @@ -14,6 +14,8 @@ #include #include #include +#include +#include // local includes #include "core/form.h" @@ -128,10 +130,12 @@ void PageViewItem::setWHZC(int w, int h, double z, const Okular::NormalizedRect Okular::NormalizedRect r = fwi->rect(); fwi->setWidthHeight(qRound(fabs(r.right - r.left) * m_uncroppedGeometry.width()), qRound(fabs(r.bottom - r.top) * m_uncroppedGeometry.height())); } +#ifdef HAVE_PHONON for (VideoWidget *vw : qAsConst(m_videoWidgets)) { const Okular::NormalizedRect r = vw->normGeometry(); vw->resize(qRound(fabs(r.right - r.left) * m_uncroppedGeometry.width()), qRound(fabs(r.bottom - r.top) * m_uncroppedGeometry.height())); } +#endif } void PageViewItem::moveTo(int x, int y) @@ -146,10 +150,12 @@ void PageViewItem::moveTo(int x, int y) Okular::NormalizedRect r = (*it)->rect(); (*it)->moveTo(qRound(x + m_uncroppedGeometry.width() * r.left) + 1, qRound(y + m_uncroppedGeometry.height() * r.top) + 1); } +#ifdef HAVE_PHONON for (VideoWidget *vw : qAsConst(m_videoWidgets)) { const Okular::NormalizedRect r = vw->normGeometry(); vw->move(qRound(x + m_uncroppedGeometry.width() * r.left) + 1, qRound(y + m_uncroppedGeometry.height() * r.top) + 1); } +#endif } void PageViewItem::setVisible(bool visible) diff --git a/part/part.cpp b/part/part.cpp -index c6301fd73..493c4b8f7 100644 +index d5a620947..652da35cd 100644 --- a/part/part.cpp +++ b/part/part.cpp @@ -34,10 +34,13 @@ #include #include #include +#include +#include #include #include #include #include +#include #include #include #include @@ -123,6 +126,11 @@ #include #include +#ifdef Q_OS_WIN +#include +#include +#endif + #ifdef OKULAR_KEEP_FILE_OPEN class FileKeeper { @@ -321,6 +329,7 @@ Part::Part(QWidget *parentWidget, QObject *parent, const QVariantList &args) setupConfigSkeleton(args, componentName()); +#ifdef HAVE_DBUS numberOfParts++; if (numberOfParts == 1) { m_registerDbusName = QStringLiteral("/okular"); @@ -328,6 +337,7 @@ Part::Part(QWidget *parentWidget, QObject *parent, const QVariantList &args) m_registerDbusName = QStringLiteral("/okular%1").arg(numberOfParts); } QDBusConnection::sessionBus().registerObject(m_registerDbusName, this, QDBusConnection::ExportScriptableSlots); +#endif // connect the started signal to tell the job the mimetypes we like, // and get some more information from it @@ -984,7 +994,9 @@ void Part::setupActions() Part::~Part() { +#ifdef HAVE_DBUS QDBusConnection::sessionBus().unregisterObject(m_registerDbusName); +#endif m_document->removeObserver(this); -@@ -3848,7 +3860,11 @@ void Part::setEditorCmd(const QString &editorCmd) +@@ -3871,7 +3883,11 @@ void Part::setEditorCmd(const QString &editorCmd) void Part::slotOpenContainingFolder() { +#ifdef Q_OS_WIN + ShellExecuteW(NULL, L"explore", (wchar_t *)localFilePath().utf16(), NULL, NULL, SW_SHOWDEFAULT); +#else KIO::highlightInFileManager({QUrl(localFilePath())}); +#endif } } // namespace Okular diff --git a/part/part.h b/part/part.h index c880d4747..f463d1ada 100644 --- a/part/part.h +++ b/part/part.h @@ -20,7 +20,11 @@ #include #include #include +#ifdef HAVE_DBUS #include // krazy:exclude=includes +#else +#define Q_NOREPLY +#endif #include #include diff --git a/part/presentationwidget.cpp b/part/presentationwidget.cpp index bd5192c53..81e069195 100644 --- a/part/presentationwidget.cpp +++ b/part/presentationwidget.cpp @@ -7,9 +7,6 @@ #include "presentationwidget.h" // qt/kde includes -#include -#include -#include #include #include @@ -39,6 +36,9 @@ #include #ifdef Q_OS_LINUX +#include +#include +#include #include #include // For ::close() for sleep inhibition #endif @@ -51,10 +51,13 @@ #include "annotationtools.h" #include "core/action.h" #include "core/annotations.h" +#ifdef HAVE_PHONON #include "core/audioplayer.h" +#include "core/movie.h" +#include "videowidget.h" +#endif #include "core/document.h" #include "core/generator.h" -#include "core/movie.h" #include "core/page.h" #include "drawingtoolactions.h" #include "gui/debug_ui.h" @@ -64,7 +67,6 @@ #include "presentationsearchbar.h" #include "settings.h" #include "settings_core.h" -#include "videowidget.h" // comment this to disable the top-right progress indicator #define ENABLE_PROGRESS_OVERLAY @@ -76,7 +78,9 @@ struct PresentationFrame { ~PresentationFrame() { +#ifdef HAVE_PHONON qDeleteAll(videoWidgets); +#endif } PresentationFrame(const PresentationFrame &) = delete; @@ -94,17 +98,21 @@ struct PresentationFrame { } geometry.setRect((width - pageWidth) / 2, (height - pageHeight) / 2, pageWidth, pageHeight); +#ifdef HAVE_PHONON for (VideoWidget *vw : qAsConst(videoWidgets)) { const Okular::NormalizedRect r = vw->normGeometry(); QRect vwgeom = r.geometry(geometry.width(), geometry.height()); vw->resize(vwgeom.size()); vw->move(geometry.topLeft() + vwgeom.topLeft()); } +#endif } const Okular::Page *page; QRect geometry; +#ifdef HAVE_PHONON QHash videoWidgets; +#endif std::vector drawings; }; @@ -256,8 +264,10 @@ PresentationWidget::PresentationWidget(QWidget *parent, Okular::Document *doc, D connect(m_nextPageTimer, &QTimer::timeout, this, &PresentationWidget::slotNextPage); setPlayPauseIcon(); +#ifdef HAVE_PHONON connect(m_document, &Okular::Document::processMovieAction, this, &PresentationWidget::slotProcessMovieAction); connect(m_document, &Okular::Document::processRenditionAction, this, &PresentationWidget::slotProcessRenditionAction); +#endif // handle cursor appearance as specified in configuration if (Okular::Settings::slidesCursor() == Okular::Settings::EnumSlidesCursor::HiddenDelay) { @@ -286,8 +296,10 @@ PresentationWidget::~PresentationWidget() // allow power management saver again allowPowerManagement(); +#ifdef HAVE_PHONON // stop the audio playbacks Okular::AudioPlayer::instance()->stopPlaybacks(); +#endif // remove our highlights if (m_searchBar) { @@ -331,6 +343,7 @@ void PresentationWidget::notifySetup(const QVector &pageSet, int for (const Okular::Page *page : pageSet) { PresentationFrame *frame = new PresentationFrame(); frame->page = page; +#ifdef HAVE_PHONON const QList annotations = page->annotations(); for (Okular::Annotation *a : annotations) { if (a->subType() == Okular::Annotation::AMovie) { @@ -355,6 +368,7 @@ void PresentationWidget::notifySetup(const QVector &pageSet, int } } } +#endif frame->recalcGeometry(m_width, m_height, screenRatio); // add the frame to the vector m_frames.push_back(frame); @@ -401,13 +415,14 @@ void PresentationWidget::notifyCurrentPageChanged(int previousPage, int currentP { if (previousPage != -1) { // stop video playback +#ifdef HAVE_PHONON for (VideoWidget *vw : qAsConst(m_frames[previousPage]->videoWidgets)) { vw->stop(); vw->pageLeft(); } - // stop audio playback, if any Okular::AudioPlayer::instance()->stopPlaybacks(); +#endif // perform the page closing action, if any if (m_document->page(previousPage)->pageAction(Okular::Page::Closing)) { @@ -474,10 +489,12 @@ void PresentationWidget::notifyCurrentPageChanged(int previousPage, int currentP } } +#ifdef HAVE_PHONON // start autoplay video playback for (VideoWidget *vw : qAsConst(m_frames[m_frameIndex]->videoWidgets)) { vw->pageEntered(); } +#endif } } @@ -673,6 +690,7 @@ void PresentationWidget::mousePressEvent(QMouseEvent *e) const Okular::Annotation *annotation = getAnnotation(e->x(), e->y()); if (annotation) { +#ifdef HAVE_PHONON if (annotation->subType() == Okular::Annotation::AMovie) { const Okular::MovieAnnotation *movieAnnotation = static_cast(annotation); @@ -687,7 +705,9 @@ void PresentationWidget::mousePressEvent(QMouseEvent *e) vw->show(); vw->play(); return; - } else if (annotation->subType() == Okular::Annotation::AScreen) { + } +#endif + if (annotation->subType() == Okular::Annotation::AScreen) { m_document->processAction(static_cast(annotation)->action()); return; } @@ -2258,6 +2278,7 @@ void PresentationWidget::initTransition(const Okular::PageTransition *transition void PresentationWidget::slotProcessMovieAction(const Okular::MovieAction *action) { +#ifdef HAVE_PHONON const Okular::MovieAnnotation *movieAnnotation = action->annotation(); if (!movieAnnotation) { return; @@ -2290,10 +2311,12 @@ void PresentationWidget::slotProcessMovieAction(const Okular::MovieAction *actio vw->play(); break; }; +#endif } void PresentationWidget::slotProcessRenditionAction(const Okular::RenditionAction *action) { +#ifdef HAVE_PHONON Okular::Movie *movie = action->movie(); if (!movie) { return; @@ -2327,6 +2350,7 @@ void PresentationWidget::slotProcessRenditionAction(const Okular::RenditionActio default: return; }; +#endif } void PresentationWidget::slotTogglePlayPause() diff --git a/shell/CMakeLists.txt b/shell/CMakeLists.txt index 597f0b74c..7b83323e3 100644 --- a/shell/CMakeLists.txt +++ b/shell/CMakeLists.txt @@ -23,7 +23,12 @@ ecm_add_app_icon(okular_SRCS ICONS ${ICONS_SRCS}) add_executable(okular ${okular_SRCS}) -target_link_libraries(okular KF5::I18n KF5::Parts KF5::WindowSystem KF5::Crash KF5::IconThemes Qt5::DBus) +target_link_libraries(okular KF5::I18n KF5::Parts KF5::WindowSystem KF5::Crash KF5::IconThemes) + +if(TARGET Qt5::DBus) + target_link_libraries(okular Qt5::DBus) +endif() + if(TARGET KF5::Activities) target_compile_definitions(okular PUBLIC -DWITH_KACTIVITIES=1) diff --git a/shell/main.cpp b/shell/main.cpp index 35f3aea65..dd08abeaf 100644 --- a/shell/main.cpp +++ b/shell/main.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include diff --git a/shell/okular_main.cpp b/shell/okular_main.cpp index c23f46356..78ed04936 100644 --- a/shell/okular_main.cpp +++ b/shell/okular_main.cpp @@ -16,8 +16,11 @@ #include #include #include +#ifdef HAVE_DBUS #include +#endif #include +#include #include "config-okular.h" #if HAVE_X11 @@ -47,6 +50,7 @@ static bool attachUniqueInstance(const QStringList &paths, const QString &serial return false; } +#ifdef HAVE_DBUS QDBusInterface iface(QStringLiteral("org.kde.okular"), QStringLiteral("/okularshell"), QStringLiteral("org.kde.okular")); if (!iface.isValid()) { return false; @@ -64,6 +68,7 @@ static bool attachUniqueInstance(const QStringList &paths, const QString &serial if (!ShellUtils::noRaise(serializedOptions)) { iface.call(QStringLiteral("tryRaise"), startupId()); } +#endif return true; } @@ -81,6 +86,7 @@ static bool attachExistingInstance(const QStringList &paths, const QString &seri return false; } +#ifdef HAVE_DBUS // If DBus isn't running, we can't attach to an existing instance. auto *sessionInterface = QDBusConnection::sessionBus().interface(); if (!sessionInterface) { @@ -113,6 +119,7 @@ static bool attachExistingInstance(const QStringList &paths, const QString &seri if (!bestService) { return false; } +#endif for (const QString &arg : paths) { // Copy stdin to temporary file which can be opened by the existing @@ -142,11 +149,13 @@ static bool attachExistingInstance(const QStringList &paths, const QString &seri path = ShellUtils::urlFromArg(arg, ShellUtils::qfileExistFunc(), page).url(); } +#ifdef HAVE_DBUS // Returns false if it can't fit another document const QDBusReply reply = bestService->call(QStringLiteral("openDocument"), path, serializedOptions); if (!reply.isValid() || !reply.value()) { return false; } +#endif } if (!ShellUtils::editorCmd(serializedOptions).isEmpty()) { @@ -156,7 +165,9 @@ static bool attachExistingInstance(const QStringList &paths, const QString &seri exit(1); } +#ifdef HAVE_DBUS bestService->call(QStringLiteral("tryRaise"), startupId()); +#endif return true; } diff --git a/shell/shell.cpp b/shell/shell.cpp -index 3685f6116..f72429caf 100644 +index 970dafb82..cbf68d419 100644 --- a/shell/shell.cpp +++ b/shell/shell.cpp @@ -36,11 +36,15 @@ #include #include #include +#ifdef HAVE_DBUS #include +#endif #include #include #include #include +#include +#include #include #include #include @@ -237,6 +241,7 @@ Shell::Shell(const QString &serializedOptions) readSettings(); m_unique = ShellUtils::unique(serializedOptions); +#ifdef HAVE_DBUS if (m_unique) { m_unique = QDBusConnection::sessionBus().registerService(QStringLiteral("org.kde.okular")); if (!m_unique) { @@ -258,7 +263,7 @@ Shell::Shell(const QString &serializedOptions) } QDBusConnection::sessionBus().registerObject(QStringLiteral("/okularshell"), this, QDBusConnection::ExportScriptableSlots); - +#endif // Make sure that the welcome scren is visible on startup. showWelcomeScreen(); } else { @@ -333,9 +338,11 @@ Shell::~Shell() } m_tabs.clear(); } +#ifdef HAVE_DBUS if (m_unique) { QDBusConnection::sessionBus().unregisterService(QStringLiteral("org.kde.okular")); } +#endif delete m_tabWidget; } diff --git a/shell/shell.h b/shell/shell.h index facffe33b..a864cb72e 100644 --- a/shell/shell.h +++ b/shell/shell.h @@ -20,7 +20,11 @@ #include #include -#include // krazy:exclude=includes +#ifdef HAVE_DBUS +#include // krazy:exclude=include +#else +#define Q_NOREPLY +#endif #include "welcomescreen.h" diff --git a/shell/welcomescreen.cpp b/shell/welcomescreen.cpp index 128abd7a2..ead12eb7c 100644 --- a/shell/welcomescreen.cpp +++ b/shell/welcomescreen.cpp @@ -21,6 +21,11 @@ #include "recentitemsmodel.h" +#ifdef Q_OS_WIN +#include +#include +#endif + class RecentsListItemDelegate : public QStyledItemDelegate { Q_OBJECT @@ -78,7 +83,11 @@ public: showDirectoryAction->setIcon(QIcon::fromTheme(QStringLiteral("document-open-folder"))); connect(showDirectoryAction, &QAction::triggered, this, [item]() { if (item->url.isLocalFile()) { +#ifdef Q_OS_WIN + ShellExecuteW(NULL, L"explore", (wchar_t *)item->url.toLocalFile().utf16(), NULL, NULL, SW_SHOWDEFAULT); +#else KIO::highlightInFileManager({item->url}); +#endif } }); menu.addAction(showDirectoryAction); -- -2.40.0 +2.40.1