From 6d337c3ede372422ab6adbcc02a4b06c5d52f3a5 Mon Sep 17 00:00:00 2001 From: Boris Pek Date: Mon, 18 Mar 2024 21:56:49 +0300 Subject: [PATCH] Current version of Psi+ is 1.5.1700 It is based on: * psi: 33c6541f * plugins: 3134d80 * psimedia: 9fd3307 * resources: 2ef1865 --- .pre-commit-config.yaml | 2 +- 3rdparty/http-parser/README.md | 3 + 3rdparty/http-parser/fuzzers/fuzz_url.c | 14 + 3rdparty/http-parser/http_parser.c | 29 +- 3rdparty/http-parser/http_parser.h | 12 +- 3rdparty/http-parser/test.c | 155 +++++++- 3rdparty/qite/libqite/qite.cpp | 4 + 3rdparty/qite/libqite/qite.h | 4 +- 3rdparty/qite/libqite/qiteaudio.cpp | 27 +- 3rdparty/qite/libqite/qiteaudio.h | 6 +- 3rdparty/qite/libqite/qiteaudiorecorder.cpp | 45 +-- 3rdparty/qite/libqite/qiteaudiorecorder.h | 31 +- 3rdparty/qite/mainwindow.cpp | 6 +- 3rdparty/qite/mainwindow.h | 6 +- CMakeLists.txt | 13 +- cmake/modules/FindQca.cmake | 14 +- iris/3rdparty/stringprep/stringprep.cpp | 8 +- iris/src/irisnet/corelib/objectsession.cpp | 12 + .../irisnet/noncore/cutestuff/httppoll.cpp | 2 +- iris/src/irisnet/noncore/ice176.cpp | 7 +- iris/src/irisnet/noncore/stunbinding.cpp | 20 +- iris/src/irisnet/noncore/stuntypes.cpp | 3 +- iris/src/irisnet/noncore/tcpportreserver.h | 2 +- iris/src/xmpp/jid/jid.cpp | 4 +- iris/src/xmpp/jid/jid.h | 6 +- iris/src/xmpp/xmpp-core/tlshandler.cpp | 2 +- iris/src/xmpp/xmpp-im/jingle-application.h | 6 +- iris/src/xmpp/xmpp-im/jingle-ft.h | 2 +- iris/src/xmpp/xmpp-im/jingle-ibb.h | 4 +- iris/src/xmpp/xmpp-im/jingle-ice.cpp | 11 +- iris/src/xmpp/xmpp-im/jingle-ice.h | 4 +- iris/src/xmpp/xmpp-im/jingle-s5b.h | 4 +- iris/src/xmpp/xmpp-im/jingle-sctp.h | 3 +- iris/src/xmpp/xmpp-im/jingle-session.cpp | 8 +- iris/src/xmpp/xmpp-im/jingle-session.h | 2 +- iris/src/xmpp/xmpp-im/jingle.cpp | 6 +- iris/src/xmpp/xmpp-im/jingle.h | 2 +- iris/src/xmpp/xmpp-im/s5b.cpp | 2 +- iris/src/xmpp/xmpp-im/s5b.h | 2 +- iris/src/xmpp/xmpp-im/xmpp_hash.cpp | 2 +- iris/src/xmpp/xmpp-im/xmpp_xmlcommon.cpp | 4 + plugins/cmake/modules/variables.cmake | 4 + .../screenshotplugin/CMakeLists.txt | 26 +- .../screenshotplugin/changelog.txt | 0 .../screenshotplugin/controller.cpp | 0 .../screenshotplugin/controller.h | 0 .../screenshotplugin/defines.h | 0 .../screenshotplugin/editserverdlg.cpp | 0 .../screenshotplugin/editserverdlg.h | 0 .../screenshotplugin/editserverdlg.ui | 0 .../screenshotplugin/icons/copy.png | Bin .../screenshotplugin/icons/crop.png | Bin .../screenshotplugin/icons/draw.png | Bin .../screenshotplugin/icons/frame.png | Bin .../screenshotplugin/icons/palette.png | Bin .../screenshotplugin/icons/paste.png | Bin .../screenshotplugin/icons/print.png | Bin .../screenshotplugin/icons/screenshot.png | Bin .../screenshotplugin/icons/undo.png | Bin .../screenshotplugin/options.cpp | 0 .../screenshotplugin/options.h | 0 .../screenshotplugin/optionsdlg.cpp | 0 .../screenshotplugin/optionsdlg.h | 0 .../screenshotplugin/optionsdlg.ui | 0 .../screenshotplugin/optionswidget.cpp | 0 .../screenshotplugin/optionswidget.h | 0 .../screenshotplugin/optionswidget.ui | 0 .../screenshotplugin/pixmapwidget.cpp | 0 .../screenshotplugin/pixmapwidget.h | 0 .../screenshotplugin/proxysettingsdlg.cpp | 0 .../screenshotplugin/proxysettingsdlg.h | 0 .../screenshotplugin/proxysettingsdlg.ui | 0 .../screenshotplugin/psiplugin.json | 0 .../screenshotplugin/qxt/LICENSE | 0 .../screenshotplugin/qxt/core/qxtglobal.cpp | 0 .../screenshotplugin/qxt/core/qxtglobal.h | 0 .../qxt/gui/qxtwindowsystem.cpp | 0 .../qxt/gui/qxtwindowsystem.h | 0 .../qxt/gui/qxtwindowsystem_mac.cpp | 0 .../qxt/gui/qxtwindowsystem_mac.h | 0 .../qxt/gui/qxtwindowsystem_win.cpp | 0 .../qxt/gui/qxtwindowsystem_x11.cpp | 0 .../screenshotplugin/qxt/gui/x11info.cpp | 0 .../screenshotplugin/qxt/gui/x11info.h | 0 .../screenshotplugin/screenshot.cpp | 0 .../screenshotplugin/screenshot.h | 0 .../screenshotplugin/screenshot.ui | 0 .../screenshotplugin/screenshoticonset.cpp | 0 .../screenshotplugin/screenshoticonset.h | 0 .../screenshotplugin/screenshotoptions.cpp | 0 .../screenshotplugin/screenshotoptions.h | 0 .../screenshotplugin/screenshotoptions.ui | 0 .../screenshotplugin/screenshotplugin.cpp | 0 .../screenshotplugin/screenshotplugin.png | Bin .../screenshotplugin/screenshotplugin.pro | 0 .../screenshotplugin/screenshotplugin.qrc | 0 .../screenshotplugin/server.cpp | 0 .../screenshotplugin/server.h | 0 .../screenshotplugin/toolbar.cpp | 0 .../screenshotplugin/toolbar.h | 0 .../dev/battleshipgameplugin/CMakeLists.txt | 14 +- .../noughtsandcrossesplugin/CMakeLists.txt | 6 +- plugins/generic/CMakeLists.txt | 7 - .../generic/attentionplugin/CMakeLists.txt | 8 +- .../generic/autoreplyplugin/CMakeLists.txt | 6 +- .../birthdayreminderplugin/CMakeLists.txt | 10 +- plugins/generic/chessplugin/CMakeLists.txt | 10 +- plugins/generic/cleanerplugin/CMakeLists.txt | 10 +- .../clientswitcherplugin/CMakeLists.txt | 8 +- .../conferenceloggerplugin/CMakeLists.txt | 8 +- .../contentdownloaderplugin/CMakeLists.txt | 10 +- .../generic/enummessagesplugin/CMakeLists.txt | 8 +- .../generic/extendedmenuplugin/CMakeLists.txt | 10 +- .../extendedoptionsplugin/CMakeLists.txt | 6 +- .../generic/gomokugameplugin/CMakeLists.txt | 10 +- .../historykeeperplugin/CMakeLists.txt | 6 +- plugins/generic/imageplugin/CMakeLists.txt | 8 +- .../generic/imagepreviewplugin/CMakeLists.txt | 12 +- .../generic/jabberdiskplugin/CMakeLists.txt | 8 +- plugins/generic/juickplugin/CMakeLists.txt | 10 +- .../messagefilterplugin/CMakeLists.txt | 10 +- plugins/generic/omemoplugin/CMakeLists.txt | 12 +- plugins/generic/openpgpplugin/CMakeLists.txt | 10 +- plugins/generic/otrplugin/CMakeLists.txt | 10 +- .../pepchangenotifyplugin/CMakeLists.txt | 8 +- .../generic/qipxstatusesplugin/CMakeLists.txt | 6 +- plugins/generic/skinsplugin/CMakeLists.txt | 10 +- plugins/generic/stopspamplugin/CMakeLists.txt | 8 +- .../generic/storagenotesplugin/CMakeLists.txt | 10 +- .../generic/translateplugin/CMakeLists.txt | 6 +- .../generic/videostatusplugin/CMakeLists.txt | 23 +- .../videostatusplugin/videostatusplugin.cpp | 8 +- plugins/generic/watcherplugin/CMakeLists.txt | 10 +- plugins/variables.cmake.in | 3 + src/CMakeLists.txt | 6 +- src/accountregdlg.cpp | 2 +- src/avcall/CMakeLists.txt | 2 +- src/avcall/jinglertp.cpp | 4 +- src/chatview_webkit.cpp | 21 +- src/chatviewtheme.cpp | 4 +- src/chatviewtheme_p.h | 2 +- src/coloropt.cpp | 4 +- src/coloropt.h | 4 +- src/contactlistdragview.cpp | 24 +- src/contactlistview.cpp | 4 + src/contactlistviewdelegate.cpp | 4 + src/discodlg.cpp | 7 +- src/edbsqlite.cpp | 7 + src/filesharingdownloader.cpp | 2 +- src/filesharingdownloader.h | 3 +- src/filesharinghttpproxy.cpp | 4 +- src/filesharingmanager.h | 2 +- src/filesharingnamproxy.cpp | 2 +- src/filetransdlg.cpp | 2 +- src/groupchattopicdlg.cpp | 6 +- src/infodlg.cpp | 2 +- src/jsutil.cpp | 26 ++ src/libpsi/dialogs/CMakeLists.txt | 24 -- src/libpsi/tools/zip/minizip/ioapi.h | 213 ----------- src/libpsi/tools/zip/minizip/zip.h | 362 ------------------ src/main.cpp | 6 +- src/messageview.h | 24 +- src/mucconfigdlg.cpp | 3 +- src/multifiletransferdelegate.cpp | 4 + src/multifiletransferdlg.h | 3 +- src/multifiletransferitem.h | 5 +- src/options/CMakeLists.txt | 2 +- src/options/opt_appearance.cpp | 9 +- src/options/opt_appearance_misc.ui | 143 +++---- src/options/opt_chat.cpp | 4 +- src/privacy/CMakeLists.txt | 2 +- src/profiledlg.cpp | 25 +- src/psiaccount.cpp | 25 +- src/psicontactlistview.cpp | 16 + src/psidbusnotifier.cpp | 19 +- src/psioptionseditor.cpp | 58 ++- src/registrationdlg.cpp | 2 +- src/svgiconengine.cpp | 14 +- src/sxe/CMakeLists.txt | 2 +- src/sxe/sxerecord.cpp | 2 +- src/theme_p.cpp | 4 +- src/tools/CMakeLists.txt | 2 + .../tools/atomicxmlfile/atomicxmlfile.cpp | 0 .../tools/atomicxmlfile/atomicxmlfile.h | 0 .../tools/globalshortcut/NDKeyboardLayout.h | 0 .../tools/globalshortcut/NDKeyboardLayout.m | 0 .../globalshortcut/globalshortcutmanager.cpp | 0 .../globalshortcut/globalshortcutmanager.h | 0 .../globalshortcutmanager_haiku.cpp | 0 .../globalshortcutmanager_mac.mm | 0 .../globalshortcutmanager_stub.cpp | 0 .../globalshortcutmanager_win.cpp | 0 .../globalshortcutmanager_x11.cpp | 18 +- .../globalshortcut/globalshortcuttrigger.h | 0 .../tools/growlnotifier/ChangeLog | 0 .../tools/growlnotifier/growlnotifier.cpp | 0 .../tools/growlnotifier/growlnotifier.h | 0 .../tools/growlnotifier/growlnotifier.mm | 0 .../tools/growlnotifier/growltest.cpp | 3 +- src/{libpsi => }/tools/idle/idle.cpp | 0 src/{libpsi => }/tools/idle/idle.h | 0 src/{libpsi => }/tools/idle/idle_mac.cpp | 0 src/{libpsi => }/tools/idle/idle_win.cpp | 0 src/{libpsi => }/tools/idle/idle_x11.cpp | 23 +- src/{libpsi => }/tools/iodeviceopener.cpp | 0 src/{libpsi => }/tools/iodeviceopener.h | 0 src/{libpsi => }/tools/languagemanager.cpp | 27 +- src/{libpsi => }/tools/languagemanager.h | 0 .../libpsi_tools.cmake} | 11 - src/{libpsi => }/tools/mac_dock/docktest.cpp | 0 src/{libpsi => }/tools/mac_dock/mac_dock.h | 0 src/{libpsi => }/tools/mac_dock/mac_dock.mm | 0 .../tools/mac_dock/privateqt_mac.h | 2 +- .../tools/mac_dock/privateqt_mac.mm | 0 src/{libpsi => }/tools/maybe.h | 0 src/tools/optionstree/optionstree.h | 5 +- src/tools/optionstree/optionstreereader.cpp | 66 +++- src/tools/optionstree/optionstreewriter.cpp | 24 ++ src/tools/optionstree/varianttree.cpp | 68 +++- src/{libpsi => }/tools/priorityvalidator.cpp | 0 src/{libpsi => }/tools/priorityvalidator.h | 0 .../tools/simplecli/simplecli.cpp | 0 src/{libpsi => }/tools/simplecli/simplecli.h | 0 .../tools/spellchecker/aspellchecker.cpp | 0 .../tools/spellchecker/aspellchecker.h | 0 .../tools/spellchecker/enchantchecker.cpp | 0 .../tools/spellchecker/enchantchecker.h | 0 .../tools/spellchecker/hunspellchecker.cpp | 0 .../tools/spellchecker/hunspellchecker.h | 0 .../tools/spellchecker/macspellchecker.h | 0 .../tools/spellchecker/macspellchecker.mm | 0 .../tools/spellchecker/spellchecker.cpp | 0 .../tools/spellchecker/spellchecker.h | 0 .../tools/spellchecker/spellhighlighter.cpp | 0 .../tools/spellchecker/spellhighlighter.h | 0 .../tools/systemwatch/systemwatch.cpp | 0 .../tools/systemwatch/systemwatch.h | 0 .../tools/systemwatch/systemwatch_mac.cpp | 0 .../tools/systemwatch/systemwatch_mac.h | 0 .../tools/systemwatch/systemwatch_unix.cpp | 0 .../tools/systemwatch/systemwatch_unix.h | 0 .../tools/systemwatch/systemwatch_win.cpp | 0 .../tools/systemwatch/systemwatch_win.h | 0 .../tools/unittest/iodeviceopenertest.cpp | 0 src/{libpsi => }/tools/zip/CMakeLists.txt | 0 src/{libpsi => }/tools/zip/minizip/Makefile | 0 .../tools/zip/minizip/Makefile.am | 22 +- .../tools/zip/minizip/MiniZip64_Changes.txt | 1 - .../tools/zip/minizip/MiniZip64_info.txt | 3 +- .../tools/zip/minizip/configure.ac | 14 +- src/{libpsi => }/tools/zip/minizip/crypt.h | 88 ++--- src/{libpsi => }/tools/zip/minizip/ioapi.c | 0 src/tools/zip/minizip/ioapi.h | 208 ++++++++++ src/{libpsi => }/tools/zip/minizip/iowin32.c | 0 src/{libpsi => }/tools/zip/minizip/iowin32.h | 9 +- src/{libpsi => }/tools/zip/minizip/miniunz.c | 0 .../tools/zip/minizip/miniunzip.1 | 0 src/{libpsi => }/tools/zip/minizip/minizip.1 | 1 - src/{libpsi => }/tools/zip/minizip/minizip.c | 0 .../tools/zip/minizip/minizip.pc.in | 0 src/{libpsi => }/tools/zip/minizip/mztools.c | 0 src/{libpsi => }/tools/zip/minizip/mztools.h | 9 +- src/{libpsi => }/tools/zip/minizip/unzip.c | 0 src/{libpsi => }/tools/zip/minizip/unzip.h | 242 +++++------- src/{libpsi => }/tools/zip/minizip/zip.c | 0 src/tools/zip/minizip/zip.h | 267 +++++++++++++ src/{libpsi => }/tools/zip/zip.cpp | 0 src/{libpsi => }/tools/zip/zip.h | 0 src/webview.cpp | 68 ++-- src/webview.h | 1 + src/whiteboarding/wbdlg.cpp | 8 +- src/whiteboarding/wbwidget.cpp | 17 +- src/widgets/CMakeLists.txt | 7 +- src/widgets/emojidb.cpp | 230 ++++++++--- src/widgets/emojiregistry.cpp | 3 +- .../grepshortcutkeydialog.cpp | 0 .../grepshortcutkeydialog.h | 0 .../grepshortcutkeydialog.ui | 0 src/widgets/iconselect.cpp | 12 +- src/widgets/iconwidget.cpp | 26 +- src/widgets/tabbar.cpp | 11 +- src/widgets/typeaheadfind.cpp | 9 + src/x11windowsystem.cpp | 2 + src/x11windowsystem.h | 1 + src/xmlconsole.cpp | 2 +- version | 2 +- 286 files changed, 1935 insertions(+), 1530 deletions(-) create mode 100644 3rdparty/http-parser/fuzzers/fuzz_url.c rename plugins/{generic => deprecated}/screenshotplugin/CMakeLists.txt (83%) rename plugins/{generic => deprecated}/screenshotplugin/changelog.txt (100%) rename plugins/{generic => deprecated}/screenshotplugin/controller.cpp (100%) rename plugins/{generic => deprecated}/screenshotplugin/controller.h (100%) rename plugins/{generic => deprecated}/screenshotplugin/defines.h (100%) rename plugins/{generic => deprecated}/screenshotplugin/editserverdlg.cpp (100%) rename plugins/{generic => deprecated}/screenshotplugin/editserverdlg.h (100%) rename plugins/{generic => deprecated}/screenshotplugin/editserverdlg.ui (100%) rename plugins/{generic => deprecated}/screenshotplugin/icons/copy.png (100%) rename plugins/{generic => deprecated}/screenshotplugin/icons/crop.png (100%) rename plugins/{generic => deprecated}/screenshotplugin/icons/draw.png (100%) rename plugins/{generic => deprecated}/screenshotplugin/icons/frame.png (100%) rename plugins/{generic => deprecated}/screenshotplugin/icons/palette.png (100%) rename plugins/{generic => deprecated}/screenshotplugin/icons/paste.png (100%) rename plugins/{generic => deprecated}/screenshotplugin/icons/print.png (100%) rename plugins/{generic => deprecated}/screenshotplugin/icons/screenshot.png (100%) rename plugins/{generic => deprecated}/screenshotplugin/icons/undo.png (100%) rename plugins/{generic => deprecated}/screenshotplugin/options.cpp (100%) rename plugins/{generic => deprecated}/screenshotplugin/options.h (100%) rename plugins/{generic => deprecated}/screenshotplugin/optionsdlg.cpp (100%) rename plugins/{generic => deprecated}/screenshotplugin/optionsdlg.h (100%) rename plugins/{generic => deprecated}/screenshotplugin/optionsdlg.ui (100%) rename plugins/{generic => deprecated}/screenshotplugin/optionswidget.cpp (100%) rename plugins/{generic => deprecated}/screenshotplugin/optionswidget.h (100%) rename plugins/{generic => deprecated}/screenshotplugin/optionswidget.ui (100%) rename plugins/{generic => deprecated}/screenshotplugin/pixmapwidget.cpp (100%) rename plugins/{generic => deprecated}/screenshotplugin/pixmapwidget.h (100%) rename plugins/{generic => deprecated}/screenshotplugin/proxysettingsdlg.cpp (100%) rename plugins/{generic => deprecated}/screenshotplugin/proxysettingsdlg.h (100%) rename plugins/{generic => deprecated}/screenshotplugin/proxysettingsdlg.ui (100%) rename plugins/{generic => deprecated}/screenshotplugin/psiplugin.json (100%) rename plugins/{generic => deprecated}/screenshotplugin/qxt/LICENSE (100%) rename plugins/{generic => deprecated}/screenshotplugin/qxt/core/qxtglobal.cpp (100%) rename plugins/{generic => deprecated}/screenshotplugin/qxt/core/qxtglobal.h (100%) rename plugins/{generic => deprecated}/screenshotplugin/qxt/gui/qxtwindowsystem.cpp (100%) rename plugins/{generic => deprecated}/screenshotplugin/qxt/gui/qxtwindowsystem.h (100%) rename plugins/{generic => deprecated}/screenshotplugin/qxt/gui/qxtwindowsystem_mac.cpp (100%) rename plugins/{generic => deprecated}/screenshotplugin/qxt/gui/qxtwindowsystem_mac.h (100%) rename plugins/{generic => deprecated}/screenshotplugin/qxt/gui/qxtwindowsystem_win.cpp (100%) rename plugins/{generic => deprecated}/screenshotplugin/qxt/gui/qxtwindowsystem_x11.cpp (100%) rename plugins/{generic => deprecated}/screenshotplugin/qxt/gui/x11info.cpp (100%) rename plugins/{generic => deprecated}/screenshotplugin/qxt/gui/x11info.h (100%) rename plugins/{generic => deprecated}/screenshotplugin/screenshot.cpp (100%) rename plugins/{generic => deprecated}/screenshotplugin/screenshot.h (100%) rename plugins/{generic => deprecated}/screenshotplugin/screenshot.ui (100%) rename plugins/{generic => deprecated}/screenshotplugin/screenshoticonset.cpp (100%) rename plugins/{generic => deprecated}/screenshotplugin/screenshoticonset.h (100%) rename plugins/{generic => deprecated}/screenshotplugin/screenshotoptions.cpp (100%) rename plugins/{generic => deprecated}/screenshotplugin/screenshotoptions.h (100%) rename plugins/{generic => deprecated}/screenshotplugin/screenshotoptions.ui (100%) rename plugins/{generic => deprecated}/screenshotplugin/screenshotplugin.cpp (100%) rename plugins/{generic => deprecated}/screenshotplugin/screenshotplugin.png (100%) rename plugins/{generic => deprecated}/screenshotplugin/screenshotplugin.pro (100%) rename plugins/{generic => deprecated}/screenshotplugin/screenshotplugin.qrc (100%) rename plugins/{generic => deprecated}/screenshotplugin/server.cpp (100%) rename plugins/{generic => deprecated}/screenshotplugin/server.h (100%) rename plugins/{generic => deprecated}/screenshotplugin/toolbar.cpp (100%) rename plugins/{generic => deprecated}/screenshotplugin/toolbar.h (100%) delete mode 100644 src/libpsi/dialogs/CMakeLists.txt delete mode 100644 src/libpsi/tools/zip/minizip/ioapi.h delete mode 100644 src/libpsi/tools/zip/minizip/zip.h rename src/{libpsi => }/tools/atomicxmlfile/atomicxmlfile.cpp (100%) rename src/{libpsi => }/tools/atomicxmlfile/atomicxmlfile.h (100%) rename src/{libpsi => }/tools/globalshortcut/NDKeyboardLayout.h (100%) rename src/{libpsi => }/tools/globalshortcut/NDKeyboardLayout.m (100%) rename src/{libpsi => }/tools/globalshortcut/globalshortcutmanager.cpp (100%) rename src/{libpsi => }/tools/globalshortcut/globalshortcutmanager.h (100%) rename src/{libpsi => }/tools/globalshortcut/globalshortcutmanager_haiku.cpp (100%) rename src/{libpsi => }/tools/globalshortcut/globalshortcutmanager_mac.mm (100%) rename src/{libpsi => }/tools/globalshortcut/globalshortcutmanager_stub.cpp (100%) rename src/{libpsi => }/tools/globalshortcut/globalshortcutmanager_win.cpp (100%) rename src/{libpsi => }/tools/globalshortcut/globalshortcutmanager_x11.cpp (97%) rename src/{libpsi => }/tools/globalshortcut/globalshortcuttrigger.h (100%) rename src/{libpsi => }/tools/growlnotifier/ChangeLog (100%) rename src/{libpsi => }/tools/growlnotifier/growlnotifier.cpp (100%) rename src/{libpsi => }/tools/growlnotifier/growlnotifier.h (100%) rename src/{libpsi => }/tools/growlnotifier/growlnotifier.mm (100%) rename src/{libpsi => }/tools/growlnotifier/growltest.cpp (98%) rename src/{libpsi => }/tools/idle/idle.cpp (100%) rename src/{libpsi => }/tools/idle/idle.h (100%) rename src/{libpsi => }/tools/idle/idle_mac.cpp (100%) rename src/{libpsi => }/tools/idle/idle_win.cpp (100%) rename src/{libpsi => }/tools/idle/idle_x11.cpp (88%) rename src/{libpsi => }/tools/iodeviceopener.cpp (100%) rename src/{libpsi => }/tools/iodeviceopener.h (100%) rename src/{libpsi => }/tools/languagemanager.cpp (92%) rename src/{libpsi => }/tools/languagemanager.h (100%) rename src/{libpsi/tools/CMakeLists.txt => tools/libpsi_tools.cmake} (93%) rename src/{libpsi => }/tools/mac_dock/docktest.cpp (100%) rename src/{libpsi => }/tools/mac_dock/mac_dock.h (100%) rename src/{libpsi => }/tools/mac_dock/mac_dock.mm (100%) rename src/{libpsi => }/tools/mac_dock/privateqt_mac.h (98%) rename src/{libpsi => }/tools/mac_dock/privateqt_mac.mm (100%) rename src/{libpsi => }/tools/maybe.h (100%) rename src/{libpsi => }/tools/priorityvalidator.cpp (100%) rename src/{libpsi => }/tools/priorityvalidator.h (100%) rename src/{libpsi => }/tools/simplecli/simplecli.cpp (100%) rename src/{libpsi => }/tools/simplecli/simplecli.h (100%) rename src/{libpsi => }/tools/spellchecker/aspellchecker.cpp (100%) rename src/{libpsi => }/tools/spellchecker/aspellchecker.h (100%) rename src/{libpsi => }/tools/spellchecker/enchantchecker.cpp (100%) rename src/{libpsi => }/tools/spellchecker/enchantchecker.h (100%) rename src/{libpsi => }/tools/spellchecker/hunspellchecker.cpp (100%) rename src/{libpsi => }/tools/spellchecker/hunspellchecker.h (100%) rename src/{libpsi => }/tools/spellchecker/macspellchecker.h (100%) rename src/{libpsi => }/tools/spellchecker/macspellchecker.mm (100%) rename src/{libpsi => }/tools/spellchecker/spellchecker.cpp (100%) rename src/{libpsi => }/tools/spellchecker/spellchecker.h (100%) rename src/{libpsi => }/tools/spellchecker/spellhighlighter.cpp (100%) rename src/{libpsi => }/tools/spellchecker/spellhighlighter.h (100%) rename src/{libpsi => }/tools/systemwatch/systemwatch.cpp (100%) rename src/{libpsi => }/tools/systemwatch/systemwatch.h (100%) rename src/{libpsi => }/tools/systemwatch/systemwatch_mac.cpp (100%) rename src/{libpsi => }/tools/systemwatch/systemwatch_mac.h (100%) rename src/{libpsi => }/tools/systemwatch/systemwatch_unix.cpp (100%) rename src/{libpsi => }/tools/systemwatch/systemwatch_unix.h (100%) rename src/{libpsi => }/tools/systemwatch/systemwatch_win.cpp (100%) rename src/{libpsi => }/tools/systemwatch/systemwatch_win.h (100%) rename src/{libpsi => }/tools/unittest/iodeviceopenertest.cpp (100%) rename src/{libpsi => }/tools/zip/CMakeLists.txt (100%) rename src/{libpsi => }/tools/zip/minizip/Makefile (100%) rename src/{libpsi => }/tools/zip/minizip/Makefile.am (80%) rename src/{libpsi => }/tools/zip/minizip/MiniZip64_Changes.txt (99%) rename src/{libpsi => }/tools/zip/minizip/MiniZip64_info.txt (99%) rename src/{libpsi => }/tools/zip/minizip/configure.ac (85%) rename src/{libpsi => }/tools/zip/minizip/crypt.h (52%) rename src/{libpsi => }/tools/zip/minizip/ioapi.c (100%) create mode 100644 src/tools/zip/minizip/ioapi.h rename src/{libpsi => }/tools/zip/minizip/iowin32.c (100%) rename src/{libpsi => }/tools/zip/minizip/iowin32.h (65%) rename src/{libpsi => }/tools/zip/minizip/miniunz.c (100%) rename src/{libpsi => }/tools/zip/minizip/miniunzip.1 (100%) rename src/{libpsi => }/tools/zip/minizip/minizip.1 (99%) rename src/{libpsi => }/tools/zip/minizip/minizip.c (100%) rename src/{libpsi => }/tools/zip/minizip/minizip.pc.in (100%) rename src/{libpsi => }/tools/zip/minizip/mztools.c (100%) rename src/{libpsi => }/tools/zip/minizip/mztools.h (64%) rename src/{libpsi => }/tools/zip/minizip/unzip.c (100%) rename src/{libpsi => }/tools/zip/minizip/unzip.h (55%) rename src/{libpsi => }/tools/zip/minizip/zip.c (100%) create mode 100644 src/tools/zip/minizip/zip.h rename src/{libpsi => }/tools/zip/zip.cpp (100%) rename src/{libpsi => }/tools/zip/zip.h (100%) rename src/{libpsi/dialogs => widgets}/grepshortcutkeydialog.cpp (100%) rename src/{libpsi/dialogs => widgets}/grepshortcutkeydialog.h (100%) rename src/{libpsi/dialogs => widgets}/grepshortcutkeydialog.ui (100%) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bb11c0a33..347dd9af6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks -exclude: '^3rdparty|COPYING|.gitmodules' +exclude: '^3rdparty|COPYING|.gitmodules|src/libpsi/tools/zip/minizip' repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.1.0 diff --git a/3rdparty/http-parser/README.md b/3rdparty/http-parser/README.md index b265d7171..e38d3a578 100644 --- a/3rdparty/http-parser/README.md +++ b/3rdparty/http-parser/README.md @@ -1,6 +1,9 @@ HTTP Parser =========== +http-parser is [**not** actively maintained](https://github.com/nodejs/http-parser/issues/522). +New projects and projects looking to migrate should consider [llhttp](https://github.com/nodejs/llhttp). + [![Build Status](https://api.travis-ci.org/nodejs/http-parser.svg?branch=master)](https://travis-ci.org/nodejs/http-parser) This is a parser for HTTP messages written in C. It parses both requests and diff --git a/3rdparty/http-parser/fuzzers/fuzz_url.c b/3rdparty/http-parser/fuzzers/fuzz_url.c new file mode 100644 index 000000000..eca11a2ed --- /dev/null +++ b/3rdparty/http-parser/fuzzers/fuzz_url.c @@ -0,0 +1,14 @@ +#include +#include +#include +#include "http_parser.h" + +int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + struct http_parser_url u; + http_parser_url_init(&u); + http_parser_parse_url((char*)data, size, 0, &u); + http_parser_parse_url((char*)data, size, 1, &u); + + return 0; +} diff --git a/3rdparty/http-parser/http_parser.c b/3rdparty/http-parser/http_parser.c index 95ff42f78..9be003e73 100644 --- a/3rdparty/http-parser/http_parser.c +++ b/3rdparty/http-parser/http_parser.c @@ -653,6 +653,8 @@ size_t http_parser_execute (http_parser *parser, const char *status_mark = 0; enum state p_state = (enum state) parser->state; const unsigned int lenient = parser->lenient_http_headers; + const unsigned int allow_chunked_length = parser->allow_chunked_length; + uint32_t nread = parser->nread; /* We're in an error state. Don't bother doing anything. */ @@ -731,7 +733,7 @@ size_t http_parser_execute (http_parser *parser, if (ch == CR || ch == LF) break; parser->flags = 0; - parser->extra_flags = 0; + parser->uses_transfer_encoding = 0; parser->content_length = ULLONG_MAX; if (ch == 'H') { @@ -769,7 +771,7 @@ size_t http_parser_execute (http_parser *parser, if (ch == CR || ch == LF) break; parser->flags = 0; - parser->extra_flags = 0; + parser->uses_transfer_encoding = 0; parser->content_length = ULLONG_MAX; if (ch == 'H') { @@ -927,7 +929,7 @@ size_t http_parser_execute (http_parser *parser, if (ch == CR || ch == LF) break; parser->flags = 0; - parser->extra_flags = 0; + parser->uses_transfer_encoding = 0; parser->content_length = ULLONG_MAX; if (UNLIKELY(!IS_ALPHA(ch))) { @@ -1341,7 +1343,7 @@ size_t http_parser_execute (http_parser *parser, parser->header_state = h_general; } else if (parser->index == sizeof(TRANSFER_ENCODING)-2) { parser->header_state = h_transfer_encoding; - parser->extra_flags |= F_TRANSFER_ENCODING >> 8; + parser->uses_transfer_encoding = 1; } break; @@ -1801,14 +1803,19 @@ size_t http_parser_execute (http_parser *parser, REEXECUTE(); } - /* Cannot us transfer-encoding and a content-length header together + /* Cannot use transfer-encoding and a content-length header together per the HTTP specification. (RFC 7230 Section 3.3.3) */ - if ((parser->extra_flags & (F_TRANSFER_ENCODING >> 8)) && + if ((parser->uses_transfer_encoding == 1) && (parser->flags & F_CONTENTLENGTH)) { /* Allow it for lenient parsing as long as `Transfer-Encoding` is - * not `chunked` + * not `chunked` or allow_length_with_encoding is set */ - if (!lenient || (parser->flags & F_CHUNKED)) { + if (parser->flags & F_CHUNKED) { + if (!allow_chunked_length) { + SET_ERRNO(HPE_UNEXPECTED_CONTENT_LENGTH); + goto error; + } + } else if (!lenient) { SET_ERRNO(HPE_UNEXPECTED_CONTENT_LENGTH); goto error; } @@ -1889,7 +1896,7 @@ size_t http_parser_execute (http_parser *parser, /* chunked encoding - ignore Content-Length header, * prepare for a chunk */ UPDATE_STATE(s_chunk_size_start); - } else if (parser->extra_flags & (F_TRANSFER_ENCODING >> 8)) { + } else if (parser->uses_transfer_encoding == 1) { if (parser->type == HTTP_REQUEST && !lenient) { /* RFC 7230 3.3.3 */ @@ -2165,7 +2172,7 @@ http_message_needs_eof (const http_parser *parser) } /* RFC 7230 3.3.3, see `s_headers_almost_done` */ - if ((parser->extra_flags & (F_TRANSFER_ENCODING >> 8)) && + if ((parser->uses_transfer_encoding == 1) && (parser->flags & F_CHUNKED) == 0) { return 1; } @@ -2517,7 +2524,7 @@ http_parser_parse_url(const char *buf, size_t buflen, int is_connect, end = buf + off + len; /* NOTE: The characters are already validated and are in the [0-9] range */ - assert(off + len <= buflen && "Port number overflow"); + assert((size_t) (off + len) <= buflen && "Port number overflow"); v = 0; for (p = buf + off; p < end; p++) { v *= 10; diff --git a/3rdparty/http-parser/http_parser.h b/3rdparty/http-parser/http_parser.h index df8825260..3772b3994 100644 --- a/3rdparty/http-parser/http_parser.h +++ b/3rdparty/http-parser/http_parser.h @@ -41,6 +41,8 @@ typedef __int32 int32_t; typedef unsigned __int32 uint32_t; typedef __int64 int64_t; typedef unsigned __int64 uint64_t; +#elif (defined(__sun) || defined(__sun__)) && defined(__SunOS_5_9) +#include #else #include #endif @@ -225,7 +227,6 @@ enum flags , F_UPGRADE = 1 << 5 , F_SKIPBODY = 1 << 6 , F_CONTENTLENGTH = 1 << 7 - , F_TRANSFER_ENCODING = 1 << 8 /* Never set in http_parser.flags */ }; @@ -300,11 +301,16 @@ struct http_parser { unsigned int state : 7; /* enum state from http_parser.c */ unsigned int header_state : 7; /* enum header_state from http_parser.c */ unsigned int index : 5; /* index into current matcher */ - unsigned int extra_flags : 2; + unsigned int uses_transfer_encoding : 1; /* Transfer-Encoding header is present */ + unsigned int allow_chunked_length : 1; /* Allow headers with both + * `Content-Length` and + * `Transfer-Encoding: chunked` set */ unsigned int lenient_http_headers : 1; uint32_t nread; /* # bytes read in various scenarios */ - uint64_t content_length; /* # bytes in body (0 if no Content-Length header) */ + uint64_t content_length; /* # bytes in body. `(uint64_t) -1` (all bits one) + * if no Content-Length header. + */ /** READ-ONLY **/ unsigned short http_major; diff --git a/3rdparty/http-parser/test.c b/3rdparty/http-parser/test.c index 798342451..3f7c77b34 100644 --- a/3rdparty/http-parser/test.c +++ b/3rdparty/http-parser/test.c @@ -74,6 +74,7 @@ struct message { unsigned short http_major; unsigned short http_minor; + uint64_t content_length; int message_begin_cb_called; int headers_complete_cb_called; @@ -81,6 +82,7 @@ struct message { int status_cb_called; int message_complete_on_eof; int body_is_final; + int allow_chunked_length; }; static int currently_parsing_eof; @@ -108,6 +110,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/test" ,.request_url= "/test" + ,.content_length= -1 ,.num_headers= 3 ,.headers= { { "User-Agent", "curl/7.18.0 (i486-pc-linux-gnu) libcurl/7.18.0 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.1" } @@ -139,6 +142,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/favicon.ico" ,.request_url= "/favicon.ico" + ,.content_length= -1 ,.num_headers= 8 ,.headers= { { "Host", "0.0.0.0=5000" } @@ -168,6 +172,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/dumbluck" ,.request_url= "/dumbluck" + ,.content_length= -1 ,.num_headers= 1 ,.headers= { { "aaaaaaaaaaaaa", "++++++++++" } @@ -190,6 +195,7 @@ const struct message requests[] = ,.request_path= "/forums/1/topics/2375" /* XXX request url does include fragment? */ ,.request_url= "/forums/1/topics/2375?page=1#posts-17408" + ,.content_length= -1 ,.num_headers= 0 ,.body= "" } @@ -208,6 +214,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/get_no_headers_no_body/world" ,.request_url= "/get_no_headers_no_body/world" + ,.content_length= -1 ,.num_headers= 0 ,.body= "" } @@ -227,6 +234,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/get_one_header_no_body" ,.request_url= "/get_one_header_no_body" + ,.content_length= -1 ,.num_headers= 1 ,.headers= { { "Accept" , "*/*" } @@ -250,6 +258,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/get_funky_content_length_body_hello" ,.request_url= "/get_funky_content_length_body_hello" + ,.content_length= 5 ,.num_headers= 1 ,.headers= { { "conTENT-Length" , "5" } @@ -274,6 +283,7 @@ const struct message requests[] = ,.fragment= "hey" ,.request_path= "/post_identity_body_world" ,.request_url= "/post_identity_body_world?q=search#hey" + ,.content_length= 5 ,.num_headers= 2 ,.headers= { { "Accept", "*/*" } @@ -300,6 +310,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/post_chunked_all_your_base" ,.request_url= "/post_chunked_all_your_base" + ,.content_length= -1 ,.num_headers= 1 ,.headers= { { "Transfer-Encoding" , "chunked" } @@ -328,6 +339,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/two_chunks_mult_zero_end" ,.request_url= "/two_chunks_mult_zero_end" + ,.content_length= -1 ,.num_headers= 1 ,.headers= { { "Transfer-Encoding", "chunked" } @@ -358,6 +370,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/chunked_w_trailing_headers" ,.request_url= "/chunked_w_trailing_headers" + ,.content_length= -1 ,.num_headers= 3 ,.headers= { { "Transfer-Encoding", "chunked" } @@ -388,6 +401,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/chunked_w_nonsense_after_length" ,.request_url= "/chunked_w_nonsense_after_length" + ,.content_length= -1 ,.num_headers= 1 ,.headers= { { "Transfer-Encoding", "chunked" } @@ -410,6 +424,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/with_\"stupid\"_quotes" ,.request_url= "/with_\"stupid\"_quotes?foo=\"bar\"" + ,.content_length= -1 ,.num_headers= 0 ,.headers= { } ,.body= "" @@ -436,6 +451,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/test" ,.request_url= "/test" + ,.content_length= -1 ,.num_headers= 3 ,.headers= { { "Host", "0.0.0.0:5000" } , { "User-Agent", "ApacheBench/2.3" } @@ -459,6 +475,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/test.cgi" ,.request_url= "/test.cgi?foo=bar?baz" + ,.content_length= -1 ,.num_headers= 0 ,.headers= {} ,.body= "" @@ -480,6 +497,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/test" ,.request_url= "/test" + ,.content_length= -1 ,.num_headers= 0 ,.headers= { } ,.body= "" @@ -507,6 +525,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/demo" ,.request_url= "/demo" + ,.content_length= -1 ,.num_headers= 7 ,.upgrade="Hot diggity dogg" ,.headers= { { "Host", "example.com" } @@ -538,6 +557,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "" ,.request_url= "0-home0.netscape.com:443" + ,.content_length= -1 ,.num_headers= 2 ,.upgrade="some data\r\nand yet even more data" ,.headers= { { "User-agent", "Mozilla/1.1N" } @@ -560,6 +580,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/test" ,.request_url= "/test" + ,.content_length= -1 ,.num_headers= 0 ,.headers= {} ,.body= "" @@ -579,6 +600,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/" ,.request_url= "/" + ,.content_length= -1 ,.num_headers= 0 ,.headers= {} ,.body= "" @@ -601,6 +623,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "*" ,.request_url= "*" + ,.content_length= -1 ,.num_headers= 3 ,.headers= { { "HOST", "239.255.255.250:1900" } , { "MAN", "\"ssdp:discover\"" } @@ -636,6 +659,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/" ,.request_url= "/" + ,.content_length= -1 ,.num_headers= 5 ,.headers= { { "Line1", "abc\tdef ghi\t\tjkl mno \t \tqrs" } , { "Line2", "line2\t" } @@ -662,6 +686,7 @@ const struct message requests[] = ,.request_path= "" ,.request_url= "http://hypnotoad.org?hail=all" ,.host= "hypnotoad.org" + ,.content_length= -1 ,.num_headers= 0 ,.headers= { } ,.body= "" @@ -683,6 +708,7 @@ const struct message requests[] = ,.request_url= "http://hypnotoad.org:1234?hail=all" ,.host= "hypnotoad.org" ,.port= 1234 + ,.content_length= -1 ,.num_headers= 0 ,.headers= { } ,.body= "" @@ -704,6 +730,7 @@ const struct message requests[] = ,.request_url= "http://hypnotoad.org:1234" ,.host= "hypnotoad.org" ,.port= 1234 + ,.content_length= -1 ,.num_headers= 0 ,.headers= { } ,.body= "" @@ -728,6 +755,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/file.txt" ,.request_url= "/file.txt" + ,.content_length= 10 ,.num_headers= 4 ,.headers= { { "Host", "www.example.com" } , { "Content-Type", "application/example" } @@ -753,6 +781,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "" ,.request_url= "HOME0.NETSCAPE.COM:443" + ,.content_length= -1 ,.num_headers= 2 ,.upgrade="" ,.headers= { { "User-agent", "Mozilla/1.1N" } @@ -777,6 +806,7 @@ const struct message requests[] = ,.fragment= "narf" ,.request_path= "/δ¶/δt/pope" ,.request_url= "/δ¶/δt/pope?q=1#narf" + ,.content_length= -1 ,.num_headers= 1 ,.headers= { {"Host", "github.com" } } @@ -799,6 +829,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "" ,.request_url= "home_0.netscape.com:443" + ,.content_length= -1 ,.num_headers= 2 ,.upgrade="" ,.headers= { { "User-agent", "Mozilla/1.1N" } @@ -826,6 +857,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/" ,.request_url= "/" + ,.content_length= 4 ,.num_headers= 3 ,.upgrade= 0 ,.headers= { { "Host", "www.example.com" } @@ -854,6 +886,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/" ,.request_url= "/" + ,.content_length= 4 ,.num_headers= 4 ,.upgrade= 0 ,.headers= { { "Host", "www.example.com" } @@ -879,6 +912,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/file.txt" ,.request_url= "/file.txt" + ,.content_length= -1 ,.num_headers= 1 ,.headers= { { "Host", "www.example.com" } } ,.body= "" @@ -899,6 +933,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/" ,.request_url= "/" + ,.content_length= -1 ,.num_headers= 1 ,.headers= { { "Host", "www.example.com" } } ,.body= "" @@ -920,6 +955,7 @@ const struct message requests[] = ,.host= "hypnotoad.org" ,.userinfo= "a%12:b!&*$" ,.port= 1234 + ,.content_length= -1 ,.num_headers= 0 ,.headers= { } ,.body= "" @@ -952,6 +988,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/" ,.request_url= "/" + ,.content_length= -1 ,.num_headers= 5 ,.headers= { { "Line1", "abc\tdef ghi\t\tjkl mno \t \tqrs" } , { "Line2", "line2\t" } @@ -985,6 +1022,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/demo" ,.request_url= "/demo" + ,.content_length= -1 ,.num_headers= 7 ,.upgrade="Hot diggity dogg" ,.headers= { { "Host", "example.com" } @@ -1015,6 +1053,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/demo" ,.request_url= "/demo" + ,.content_length= -1 ,.num_headers= 2 ,.upgrade="Hot diggity dogg" ,.headers= { { "Connection", "keep-alive, upgrade" } @@ -1040,6 +1079,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/demo" ,.request_url= "/demo" + ,.content_length= -1 ,.num_headers= 2 ,.upgrade="Hot diggity dogg" ,.headers= { { "Connection", "keep-alive, upgrade" } @@ -1066,6 +1106,7 @@ const struct message requests[] = ,.method= HTTP_POST ,.request_path= "/demo" ,.request_url= "/demo" + ,.content_length= 15 ,.num_headers= 4 ,.upgrade="Hot diggity dogg" ,.headers= { { "Host", "example.com" } @@ -1091,6 +1132,7 @@ const struct message requests[] = ,.http_minor= 0 ,.method= HTTP_CONNECT ,.request_url= "foo.bar.com:443" + ,.content_length= 10 ,.num_headers= 3 ,.upgrade="blarfcicle" ,.headers= { { "User-agent", "Mozilla/1.1N" } @@ -1121,6 +1163,7 @@ const struct message requests[] = ,.request_url= "/images/my_dog.jpg" ,.query_string= "" ,.fragment= "" + ,.content_length= -1 ,.num_headers= 3 ,.headers= { { "Host", "example.com" } , { "Link", "; rel=\"tag\"" } @@ -1145,6 +1188,7 @@ const struct message requests[] = ,.request_url= "/images/my_dog.jpg" ,.query_string= "" ,.fragment= "" + ,.content_length= -1 ,.num_headers= 2 ,.headers= { { "Host", "example.com" } , { "Link", "; rel=\"tag\"" } @@ -1167,12 +1211,13 @@ const struct message requests[] = ,.request_url= "/music/sweet/music" ,.query_string= "" ,.fragment= "" + ,.content_length= -1 ,.num_headers= 1 ,.headers= { { "Host", "example.com" } } ,.body= "" } -#define SOURCE_ICE_REQUEST 42 +#define SOURCE_ICE_REQUEST 43 , {.name = "source request" ,.type= HTTP_REQUEST ,.raw= "SOURCE /music/sweet/music ICE/1.0\r\n" @@ -1187,12 +1232,13 @@ const struct message requests[] = ,.request_url= "/music/sweet/music" ,.query_string= "" ,.fragment= "" + ,.content_length= -1 ,.num_headers= 1 ,.headers= { { "Host", "example.com" } } ,.body= "" } -#define POST_MULTI_TE_LAST_CHUNKED 43 +#define POST_MULTI_TE_LAST_CHUNKED 44 , {.name= "post - multi coding transfer-encoding chunked body" ,.type= HTTP_REQUEST ,.raw= "POST / HTTP/1.1\r\n" @@ -1210,6 +1256,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/" ,.request_url= "/" + ,.content_length= -1 ,.num_headers= 1 ,.headers= { { "Transfer-Encoding" , "deflate, chunked" } @@ -1219,7 +1266,7 @@ const struct message requests[] = ,.chunk_lengths= { 0x1e } } -#define POST_MULTI_LINE_TE_LAST_CHUNKED 44 +#define POST_MULTI_LINE_TE_LAST_CHUNKED 45 , {.name= "post - multi line coding transfer-encoding chunked body" ,.type= HTTP_REQUEST ,.raw= "POST / HTTP/1.1\r\n" @@ -1238,6 +1285,7 @@ const struct message requests[] = ,.fragment= "" ,.request_path= "/" ,.request_url= "/" + ,.content_length= -1 ,.num_headers= 1 ,.headers= { { "Transfer-Encoding" , "deflate, chunked" } @@ -1246,6 +1294,37 @@ const struct message requests[] = ,.num_chunks_complete= 2 ,.chunk_lengths= { 0x1e } } + +#define CHUNKED_CONTENT_LENGTH 46 +, {.name= "chunked with content-length set, allow_chunked_length flag is set" + ,.type= HTTP_REQUEST + ,.raw= "POST /chunked_w_content_length HTTP/1.1\r\n" + "Content-Length: 10\r\n" + "Transfer-Encoding: chunked\r\n" + "\r\n" + "5; ilovew3;whattheluck=aretheseparametersfor\r\nhello\r\n" + "6; blahblah; blah\r\n world\r\n" + "0\r\n" + "\r\n" + ,.allow_chunked_length = 1 + ,.should_keep_alive= TRUE + ,.message_complete_on_eof= FALSE + ,.http_major= 1 + ,.http_minor= 1 + ,.method= HTTP_POST + ,.query_string= "" + ,.fragment= "" + ,.request_path= "/chunked_w_content_length" + ,.request_url= "/chunked_w_content_length" + ,.content_length= 10 + ,.num_headers= 2 + ,.headers={ { "Content-Length", "10"} + , { "Transfer-Encoding", "chunked" } + } + ,.body= "hello world" + ,.num_chunks_complete= 3 + ,.chunk_lengths= { 5, 6 } + } }; /* * R E S P O N S E S * */ @@ -1275,6 +1354,7 @@ const struct message responses[] = ,.http_minor= 1 ,.status_code= 301 ,.response_status= "Moved Permanently" + ,.content_length= 219 ,.num_headers= 8 ,.headers= { { "Location", "http://www.google.com/" } @@ -1324,6 +1404,7 @@ const struct message responses[] = ,.http_minor= 1 ,.status_code= 200 ,.response_status= "OK" + ,.content_length= -1 ,.num_headers= 5 ,.headers= { { "Date", "Tue, 04 Aug 2009 07:59:32 GMT" } @@ -1353,6 +1434,7 @@ const struct message responses[] = ,.http_minor= 1 ,.status_code= 404 ,.response_status= "Not Found" + ,.content_length= -1 ,.num_headers= 0 ,.headers= {} ,.body_size= 0 @@ -1368,6 +1450,7 @@ const struct message responses[] = ,.http_major= 1 ,.http_minor= 1 ,.status_code= 301 + ,.content_length= -1 ,.response_status= "" ,.num_headers= 0 ,.headers= {} @@ -1395,6 +1478,7 @@ const struct message responses[] = ,.http_minor= 1 ,.status_code= 200 ,.response_status= "OK" + ,.content_length= -1 ,.num_headers= 2 ,.headers= { {"Content-Type", "text/plain" } @@ -1422,6 +1506,7 @@ const struct message responses[] = ,.http_minor= 1 ,.status_code= 200 ,.response_status= "OK" + ,.content_length= -1 ,.num_headers= 2 ,.headers= { {"Content-Type", "text/html; charset=utf-8" } @@ -1446,6 +1531,7 @@ const struct message responses[] = ,.http_minor= 1 ,.status_code= 200 ,.response_status= "OK" + ,.content_length= 11 ,.num_headers= 4 ,.headers= { {"Content-Type", "text/html; charset=UTF-8" } @@ -1472,6 +1558,7 @@ const struct message responses[] = ,.http_minor= 1 ,.status_code= 200 ,.response_status= "OK" + ,.content_length= 0 ,.num_headers= 4 ,.headers= { {"Server", "DCLK-AdSvr" } @@ -1505,6 +1592,7 @@ const struct message responses[] = ,.http_minor= 0 ,.status_code= 301 ,.response_status= "Moved Permanently" + ,.content_length= 0 ,.num_headers= 9 ,.headers= { { "Date", "Thu, 03 Jun 2010 09:56:32 GMT" } @@ -1544,6 +1632,7 @@ const struct message responses[] = ,.http_minor= 1 ,.status_code= 200 ,.response_status= "OK" + ,.content_length= -1 ,.num_headers= 11 ,.headers= { { "Date", "Tue, 28 Sep 2010 01:14:13 GMT" } @@ -1578,6 +1667,7 @@ const struct message responses[] = ,.http_minor= 1 ,.status_code= 500 ,.response_status= "Oriëntatieprobleem" + ,.content_length= 0 ,.num_headers= 3 ,.headers= { { "Date", "Fri, 5 Nov 2010 23:07:12 GMT+2" } @@ -1599,6 +1689,7 @@ const struct message responses[] = ,.http_minor= 9 ,.status_code= 200 ,.response_status= "OK" + ,.content_length= -1 ,.num_headers= 0 ,.headers= {} @@ -1622,6 +1713,7 @@ const struct message responses[] = ,.http_minor= 1 ,.status_code= 200 ,.response_status= "OK" + ,.content_length= -1 ,.num_headers= 1 ,.headers= { { "Content-Type", "text/plain" } @@ -1641,6 +1733,7 @@ const struct message responses[] = ,.http_minor= 0 ,.status_code= 200 ,.response_status= "OK" + ,.content_length= -1 ,.num_headers= 1 ,.headers= { { "Connection", "keep-alive" } @@ -1661,6 +1754,7 @@ const struct message responses[] = ,.http_minor= 0 ,.status_code= 204 ,.response_status= "No content" + ,.content_length= -1 ,.num_headers= 1 ,.headers= { { "Connection", "keep-alive" } @@ -1680,6 +1774,7 @@ const struct message responses[] = ,.http_minor= 1 ,.status_code= 200 ,.response_status= "OK" + ,.content_length= -1 ,.num_headers= 0 ,.headers={} ,.body_size= 0 @@ -1697,6 +1792,7 @@ const struct message responses[] = ,.http_minor= 1 ,.status_code= 204 ,.response_status= "No content" + ,.content_length= -1 ,.num_headers= 0 ,.headers={} ,.body_size= 0 @@ -1715,6 +1811,7 @@ const struct message responses[] = ,.http_minor= 1 ,.status_code= 204 ,.response_status= "No content" + ,.content_length= -1 ,.num_headers= 1 ,.headers= { { "Connection", "close" } @@ -1737,6 +1834,7 @@ const struct message responses[] = ,.http_minor= 1 ,.status_code= 200 ,.response_status= "OK" + ,.content_length= -1 ,.num_headers= 1 ,.headers= { { "Transfer-Encoding", "chunked" } @@ -1767,6 +1865,7 @@ const struct message responses[] = ,.http_minor= 1 ,.status_code= 200 ,.response_status= "OK" + ,.content_length= 16 ,.num_headers= 7 ,.headers= { { "Server", "Microsoft-IIS/6.0" } @@ -1805,6 +1904,7 @@ const struct message responses[] = ,.http_minor= 1 ,.status_code= 301 ,.response_status= "MovedPermanently" + ,.content_length= -1 ,.num_headers= 9 ,.headers= { { "Date", "Wed, 15 May 2013 17:06:33 GMT" } , { "Server", "Server" } @@ -1821,7 +1921,7 @@ const struct message responses[] = ,.chunk_lengths= { 1 } } -#define EMPTY_REASON_PHRASE_AFTER_SPACE 20 +#define EMPTY_REASON_PHRASE_AFTER_SPACE 21 , {.name= "empty reason phrase after space" ,.type= HTTP_RESPONSE ,.raw= "HTTP/1.1 200 \r\n" @@ -1832,12 +1932,13 @@ const struct message responses[] = ,.http_minor= 1 ,.status_code= 200 ,.response_status= "" + ,.content_length= -1 ,.num_headers= 0 ,.headers= {} ,.body= "" } -#define CONTENT_LENGTH_X 21 +#define CONTENT_LENGTH_X 22 , {.name= "Content-Length-X" ,.type= HTTP_RESPONSE ,.raw= "HTTP/1.1 200 OK\r\n" @@ -1854,6 +1955,7 @@ const struct message responses[] = ,.http_minor= 1 ,.status_code= 200 ,.response_status= "OK" + ,.content_length= -1 ,.num_headers= 2 ,.headers= { { "Content-Length-X", "0" } , { "Transfer-Encoding", "chunked" } @@ -1863,7 +1965,7 @@ const struct message responses[] = ,.chunk_lengths= { 2 } } -#define HTTP_101_RESPONSE_WITH_UPGRADE_HEADER 22 +#define HTTP_101_RESPONSE_WITH_UPGRADE_HEADER 23 , {.name= "HTTP 101 response with Upgrade header" ,.type= HTTP_RESPONSE ,.raw= "HTTP/1.1 101 Switching Protocols\r\n" @@ -1878,6 +1980,7 @@ const struct message responses[] = ,.status_code= 101 ,.response_status= "Switching Protocols" ,.upgrade= "proto" + ,.content_length= -1 ,.num_headers= 2 ,.headers= { { "Connection", "upgrade" } @@ -1885,7 +1988,7 @@ const struct message responses[] = } } -#define HTTP_101_RESPONSE_WITH_UPGRADE_HEADER_AND_CONTENT_LENGTH 23 +#define HTTP_101_RESPONSE_WITH_UPGRADE_HEADER_AND_CONTENT_LENGTH 24 , {.name= "HTTP 101 response with Upgrade and Content-Length header" ,.type= HTTP_RESPONSE ,.raw= "HTTP/1.1 101 Switching Protocols\r\n" @@ -1903,6 +2006,7 @@ const struct message responses[] = ,.response_status= "Switching Protocols" ,.body= "body" ,.upgrade= "proto" + ,.content_length= 4 ,.num_headers= 3 ,.headers= { { "Connection", "upgrade" } @@ -1911,7 +2015,7 @@ const struct message responses[] = } } -#define HTTP_101_RESPONSE_WITH_UPGRADE_HEADER_AND_TRANSFER_ENCODING 24 +#define HTTP_101_RESPONSE_WITH_UPGRADE_HEADER_AND_TRANSFER_ENCODING 25 , {.name= "HTTP 101 response with Upgrade and Transfer-Encoding header" ,.type= HTTP_RESPONSE ,.raw= "HTTP/1.1 101 Switching Protocols\r\n" @@ -1934,6 +2038,7 @@ const struct message responses[] = ,.response_status= "Switching Protocols" ,.body= "body" ,.upgrade= "proto" + ,.content_length= -1 ,.num_headers= 3 ,.headers= { { "Connection", "upgrade" } @@ -1944,7 +2049,7 @@ const struct message responses[] = ,.chunk_lengths= { 2, 2 } } -#define HTTP_200_RESPONSE_WITH_UPGRADE_HEADER 25 +#define HTTP_200_RESPONSE_WITH_UPGRADE_HEADER 26 , {.name= "HTTP 200 response with Upgrade header" ,.type= HTTP_RESPONSE ,.raw= "HTTP/1.1 200 OK\r\n" @@ -1960,6 +2065,7 @@ const struct message responses[] = ,.response_status= "OK" ,.body= "body" ,.upgrade= NULL + ,.content_length= -1 ,.num_headers= 2 ,.headers= { { "Connection", "upgrade" } @@ -1967,7 +2073,7 @@ const struct message responses[] = } } -#define HTTP_200_RESPONSE_WITH_UPGRADE_HEADER_AND_CONTENT_LENGTH 26 +#define HTTP_200_RESPONSE_WITH_UPGRADE_HEADER_AND_CONTENT_LENGTH 27 , {.name= "HTTP 200 response with Upgrade and Content-Length header" ,.type= HTTP_RESPONSE ,.raw= "HTTP/1.1 200 OK\r\n" @@ -1982,6 +2088,7 @@ const struct message responses[] = ,.http_minor= 1 ,.status_code= 200 ,.response_status= "OK" + ,.content_length= 4 ,.num_headers= 3 ,.body= "body" ,.upgrade= NULL @@ -1992,7 +2099,7 @@ const struct message responses[] = } } -#define HTTP_200_RESPONSE_WITH_UPGRADE_HEADER_AND_TRANSFER_ENCODING 27 +#define HTTP_200_RESPONSE_WITH_UPGRADE_HEADER_AND_TRANSFER_ENCODING 28 , {.name= "HTTP 200 response with Upgrade and Transfer-Encoding header" ,.type= HTTP_RESPONSE ,.raw= "HTTP/1.1 200 OK\r\n" @@ -2012,6 +2119,7 @@ const struct message responses[] = ,.http_minor= 1 ,.status_code= 200 ,.response_status= "OK" + ,.content_length= -1 ,.num_headers= 3 ,.body= "body" ,.upgrade= NULL @@ -2023,7 +2131,7 @@ const struct message responses[] = ,.num_chunks_complete= 3 ,.chunk_lengths= { 2, 2 } } -#define HTTP_200_MULTI_TE_NOT_LAST_CHUNKED 28 +#define HTTP_200_MULTI_TE_NOT_LAST_CHUNKED 29 , {.name= "HTTP 200 response with `chunked` being *not last* Transfer-Encoding" ,.type= HTTP_RESPONSE ,.raw= "HTTP/1.1 200 OK\r\n" @@ -2039,6 +2147,7 @@ const struct message responses[] = ,.http_minor= 1 ,.status_code= 200 ,.response_status= "OK" + ,.content_length= -1 ,.num_headers= 1 ,.headers= { { "Transfer-Encoding", "chunked, identity" } } @@ -2202,6 +2311,7 @@ headers_complete_cb (http_parser *p) messages[num_messages].status_code = parser.status_code; messages[num_messages].http_major = parser.http_major; messages[num_messages].http_minor = parser.http_minor; + messages[num_messages].content_length = parser.content_length; messages[num_messages].headers_complete_cb_called = TRUE; messages[num_messages].should_keep_alive = http_should_keep_alive(&parser); return 0; @@ -2650,6 +2760,7 @@ message_eq (int index, int connect, const struct message *expected) MESSAGE_CHECK_NUM_EQ(expected, m, http_major); MESSAGE_CHECK_NUM_EQ(expected, m, http_minor); + MESSAGE_CHECK_NUM_EQ(expected, m, content_length); if (expected->type == HTTP_REQUEST) { MESSAGE_CHECK_NUM_EQ(expected, m, method); @@ -3503,6 +3614,9 @@ test_message (const struct message *message) size_t msg1len; for (msg1len = 0; msg1len < raw_len; msg1len++) { parser_init(message->type); + if (message->allow_chunked_length) { + parser.allow_chunked_length = 1; + } size_t read; const char *msg1 = message->raw; @@ -3944,6 +4058,11 @@ test_multiple3 (const struct message *r1, const struct message *r2, const struct strcat(total, r3->raw); parser_init(r1->type); + if (r1->allow_chunked_length || + r2->allow_chunked_length || + r3->allow_chunked_length) { + parser.allow_chunked_length = 1; + } size_t read; @@ -4146,6 +4265,9 @@ test_message_pause (const struct message *msg) size_t nread; parser_init(msg->type); + if (msg->allow_chunked_length) { + parser.allow_chunked_length = 1; + } do { nread = parse_pause(buf, buflen); @@ -4221,7 +4343,13 @@ main (void) printf("http_parser v%u.%u.%u (0x%06lx)\n", major, minor, patch, version); printf("sizeof(http_parser) = %u\n", (unsigned int)sizeof(http_parser)); - assert(sizeof(http_parser) == 4 + 4 + 8 + 2 + 2 + 4 + sizeof(void *)); + +#if defined(__i386__) || defined(__x86_64__) + /* Should be 32 on both 32 bits and 64 bits x86 because of struct padding, + * see https://github.com/nodejs/http-parser/issues/507. + */ + assert(sizeof(http_parser) == 32); +#endif //// API test_preserve_data(); @@ -4351,6 +4479,7 @@ main (void) ,.http_minor= 0 ,.status_code= 200 ,.response_status= "OK" + ,.content_length= -1 ,.num_headers= 2 ,.headers= { { "Transfer-Encoding", "chunked" } diff --git a/3rdparty/qite/libqite/qite.cpp b/3rdparty/qite/libqite/qite.cpp index fcca81ff3..56d6e8c1f 100644 --- a/3rdparty/qite/libqite/qite.cpp +++ b/3rdparty/qite/libqite/qite.cpp @@ -151,7 +151,11 @@ bool InteractiveText::eventFilter(QObject *obj, QEvent *event) if (event->type() == QEvent::MouseButtonPress) { pos = static_cast(event)->pos(); } else { +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) pos = static_cast(event)->pos(); +#else + pos = static_cast(event)->position().toPoint(); +#endif } if (event->type() == QEvent::HoverEnter || event->type() == QEvent::HoverMove diff --git a/3rdparty/qite/libqite/qite.h b/3rdparty/qite/libqite/qite.h index 5a2eefde7..828611220 100644 --- a/3rdparty/qite/libqite/qite.h +++ b/3rdparty/qite/libqite/qite.h @@ -60,7 +60,7 @@ class InteractiveTextElementController : public QObject, public QTextObjectInter enum class EventType { Enter, Leave, Move, Click }; class Event { public: - QEvent * qevent; + QEvent *qevent; EventType type; QPoint pos; // relative to element. last position for "Leave" }; @@ -107,7 +107,7 @@ private slots: void trackVisibility(); private: - QTextEdit * _textEdit = nullptr; + QTextEdit *_textEdit = nullptr; int _baseObjectType; int _objectType; quint32 _uniqueElementId = 0; // just a sequence number diff --git a/3rdparty/qite/libqite/qiteaudio.cpp b/3rdparty/qite/libqite/qiteaudio.cpp index afe793928..a0af406b3 100644 --- a/3rdparty/qite/libqite/qiteaudio.cpp +++ b/3rdparty/qite/libqite/qiteaudio.cpp @@ -74,8 +74,7 @@ class AudioMessageFormat : public InteractiveTextFormat { Q_DECLARE_OPERATORS_FOR_FLAGS(AudioMessageFormat::Flags) AudioMessageFormat::AudioMessageFormat(int objectType, ElementId id, const QUrl &url, ITEMediaOpener *mediaOpener, - quint32 position, const Flags &state) : - InteractiveTextFormat(objectType, id) + quint32 position, const Flags &state) : InteractiveTextFormat(objectType, id) { setProperty(Url, url); setProperty(MediaOpener, QVariant::fromValue(mediaOpener)); @@ -330,7 +329,7 @@ void ITEAudioController::drawITE(QPainter *painter, const QRectF &rect, int posI painter->drawRect(hcolRect); } } -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) } else if (hg.type() == QVariant::String) { #else } else if (hg.typeId() == QMetaType::QString) { @@ -402,10 +401,10 @@ bool ITEAudioController::mouseEvent(const Event &event, const QRect &rect, QText activePlayers.insert(playerId, player); ITEMediaOpener *opener = format.mediaOpener(); QUrl url = format.url(); - QIODevice * stream = opener ? opener->open(url) : nullptr; + QIODevice *stream = opener ? opener->open(url) : nullptr; if (stream) connect(player, &QMediaPlayer::destroyed, this, [opener, stream]() { opener->close(stream); }); -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) player->setMedia(url, stream); #else player->setSourceDevice(stream, url); @@ -445,7 +444,7 @@ bool ITEAudioController::mouseEvent(const Event &event, const QRect &rect, QText auto title = player->metaData(QMediaMetaData::Title).toString(); #else connect(player, &QMediaPlayer::metaDataChanged, this, [this, player]() { - auto title = player->metaData().value(QMediaMetaData::Title).toString(); + auto title = player->metaData().value(QMediaMetaData::Title).toString(); #endif if (title.isEmpty()) { @@ -458,7 +457,12 @@ bool ITEAudioController::mouseEvent(const Event &event, const QRect &rect, QText return; } auto format = AudioMessageFormat::fromCharFormat(cursor.charFormat().toCharFormat()); + +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) if (format.metaData().type() == QVariant::List) { +#else + if (format.metaData().typeId() == QMetaType::QVariantList) { +#endif return; // seems we have amplitudes already } format.setMetaData(title); @@ -473,7 +477,7 @@ bool ITEAudioController::mouseEvent(const Event &event, const QRect &rect, QText connect(player, static_cast( &QMediaPlayer::metaDataChanged), - [=](const QString &key, const QVariant &value) { + [=](const QString &key, const QVariant &value) { if (key != QMediaMetaData::Comment) { return; } @@ -482,9 +486,8 @@ bool ITEAudioController::mouseEvent(const Event &event, const QRect &rect, QText connect(player, &QMediaPlayer::metaDataChanged, this, [=]() { auto comment = player->metaData().value(QMediaMetaData::Comment).toString(); #endif - int index = 0; - if (comment.isEmpty() - || !comment.startsWith(QLatin1String("AMPLDIAGSTART")) + int index = 0; + if (comment.isEmpty() || !comment.startsWith(QLatin1String("AMPLDIAGSTART")) || (index = comment.indexOf("AMPLDIAGEND")) == -1) { return; // In comment we keep amplitudes. We don't expect anything else } @@ -525,7 +528,9 @@ bool ITEAudioController::mouseEvent(const Event &event, const QRect &rect, QText [=](QMediaPlayer::Error error) { qDebug() << "Error occurred:" << error; }); #else QObject::connect(player, &QMediaPlayer::errorOccurred, this, - [=](QMediaPlayer::Error error, const QString &errorString) { qDebug() << "Error occurred:" << errorString; }); + [=](QMediaPlayer::Error error, const QString &errorString) { + qDebug() << "Error occurred:" << errorString; + }); #endif } // player->setVolume(0); diff --git a/3rdparty/qite/libqite/qiteaudio.h b/3rdparty/qite/libqite/qiteaudio.h index 0a9dd6349..ad7b348ef 100644 --- a/3rdparty/qite/libqite/qiteaudio.h +++ b/3rdparty/qite/libqite/qiteaudio.h @@ -35,7 +35,7 @@ class ITEAudioController : public InteractiveTextElementController { QCursor _cursor; QMap activePlayers; - QNetworkAccessManager * nam = nullptr; + QNetworkAccessManager *nam = nullptr; // geometry QSize elementSize; @@ -56,7 +56,7 @@ class ITEAudioController : public InteractiveTextElementController { void updateGeomtry(); public: -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) using PlaybackState = QMediaPlayer::State; #else using PlaybackState = QMediaPlayer::PlaybackState; @@ -71,7 +71,7 @@ class ITEAudioController : public InteractiveTextElementController { void drawITE(QPainter *painter, const QRectF &rect, int posInDocument, const QTextFormat &format); QTextCharFormat makeFormat(const QUrl &audioSrc, ITEMediaOpener *mediaOpener) const; - void insert(const QUrl & audioSrc, + void insert(const QUrl &audioSrc, ITEMediaOpener *mediaOpener = nullptr); // add new media to textedit. see QMediaPlayer::setMedia QCursor cursor(); // cursor form after last mose events diff --git a/3rdparty/qite/libqite/qiteaudiorecorder.cpp b/3rdparty/qite/libqite/qiteaudiorecorder.cpp index e863072ca..ec9c6538b 100644 --- a/3rdparty/qite/libqite/qiteaudiorecorder.cpp +++ b/3rdparty/qite/libqite/qiteaudiorecorder.cpp @@ -23,30 +23,30 @@ under the License. #include #include -//#include +// #include #include -//#include +// #include #include #include #include #include -#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include #endif #include #include #include #include -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) -# include -# define QtRecorder QAudioRecorder +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) +#include +#define QtRecorder QAudioRecorder #else -# include -# include -# include -# include -# include -# define QtRecorder QMediaRecorder +#include +#include +#include +#include +#include +#define QtRecorder QMediaRecorder #endif #if 0 @@ -121,8 +121,7 @@ AudioRecorder::AudioRecorder(QObject *parent) : QObject(parent) //_probe = new QAudioProbe(this); //_probe->setSource(_recorder); - -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) QAudioEncoderSettings audioSettings; audioSettings.setCodec("audio/x-opus"); audioSettings.setQuality(QMultimedia::HighQuality); @@ -148,7 +147,7 @@ AudioRecorder::AudioRecorder(QObject *parent) : QObject(parent) connect(_recorder, &QtRecorder::durationChanged, this, [this](qint64 duration) { _duration = duration; }); -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) connect(_recorder, &QtRecorder::stateChanged, this, [this]() { auto recorderState = _recorder->state(); #else @@ -214,13 +213,13 @@ AudioRecorder::AudioRecorder(QObject *parent) : QObject(parent) #else if (_isTmpFile) { QString fn = _recorder->outputLocation().toLocalFile(); - QFile f(fn); + QFile f(fn); f.open(QIODevice::ReadOnly); _audioData = f.readAll(); f.close(); f.remove(); } else { - QFile metaFile(_recorder->outputLocation().toLocalFile()+".amplitudes"); + QFile metaFile(_recorder->outputLocation().toLocalFile() + ".amplitudes"); if (metaFile.open(QIODevice::WriteOnly)) { metaFile.write(columns.join(",").toLatin1()); metaFile.close(); @@ -287,11 +286,9 @@ AudioRecorder::AudioRecorder(QObject *parent) : QObject(parent) }); #endif -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) connect(_recorder, static_cast(&QMediaRecorder::error), this, - [this](QMediaRecorder::Error error) { - emit this->error(_recorder->errorString()); - }); + [this](QMediaRecorder::Error error) { emit this->error(_recorder->errorString()); }); connect(_recorder, &QMediaRecorder::statusChanged, this, [this](QMediaRecorder::Status status) { if (status == QMediaRecorder::RecordingStatus) { @@ -300,9 +297,7 @@ AudioRecorder::AudioRecorder(QObject *parent) : QObject(parent) }); #else connect(_recorder, &QMediaRecorder::errorOccurred, this, - [this](QMediaRecorder::Error error, const QString &errorString) { - emit this->error(errorString); - }); + [this](QMediaRecorder::Error error, const QString &errorString) { emit this->error(errorString); }); #endif } @@ -358,7 +353,7 @@ void AudioRecorder::stop() void AudioRecorder::cleanup() { _destroying = true; -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) if (_recorder->state() == QtRecorder::RecordingState) #else if (_recorder->recorderState() == QtRecorder::RecordingState) diff --git a/3rdparty/qite/libqite/qiteaudiorecorder.h b/3rdparty/qite/libqite/qiteaudiorecorder.h index bea9fbf8b..c0d422473 100644 --- a/3rdparty/qite/libqite/qiteaudiorecorder.h +++ b/3rdparty/qite/libqite/qiteaudiorecorder.h @@ -22,8 +22,7 @@ under the License. #include - -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) class QAudioRecorder; #else class QMediaRecorder; @@ -71,24 +70,24 @@ class AudioRecorder : public QObject { public slots: private: -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) QAudioRecorder *_recorder = nullptr; #else - QAudioInput *_audioInput = nullptr; + QAudioInput *_audioInput = nullptr; QMediaCaptureSession *_captureSession = nullptr; - QMediaRecorder *_recorder = nullptr; + QMediaRecorder *_recorder = nullptr; #endif - //QAudioProbe * _probe; - Quantum _quantum; - QByteArray _amplitudes; - QByteArray _compressedHistorgram; - QByteArray _audioData; - QTimer * _maxDurationTimer = nullptr; - qint64 _duration; - int _maxDuration = -1; - quint8 _maxVolume; - bool _destroying = false; - bool _isTmpFile = false; + // QAudioProbe * _probe; + Quantum _quantum; + QByteArray _amplitudes; + QByteArray _compressedHistorgram; + QByteArray _audioData; + QTimer *_maxDurationTimer = nullptr; + qint64 _duration; + int _maxDuration = -1; + quint8 _maxVolume; + bool _destroying = false; + bool _isTmpFile = false; }; #endif // QITEAUDIORECORDER_H diff --git a/3rdparty/qite/mainwindow.cpp b/3rdparty/qite/mainwindow.cpp index 249e7ec1d..d46123367 100644 --- a/3rdparty/qite/mainwindow.cpp +++ b/3rdparty/qite/mainwindow.cpp @@ -58,11 +58,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi auto musicDir = QStandardPaths::writableLocation(QStandardPaths::MusicLocation); - auto nameFilters = QStringList() << "*.aac" - << "*.flac" - << "*.mp3" - << "*.ogg" - << "*.webm"; + auto nameFilters = QStringList() << "*.aac" << "*.flac" << "*.mp3" << "*.ogg" << "*.webm"; QDirIterator it(musicDir, nameFilters, QDir::Files | QDir::NoSymLinks, QDirIterator::Subdirectories); QStringList files; int count = 2000; diff --git a/3rdparty/qite/mainwindow.h b/3rdparty/qite/mainwindow.h index 5bc62414e..0e621ec3c 100644 --- a/3rdparty/qite/mainwindow.h +++ b/3rdparty/qite/mainwindow.h @@ -40,9 +40,9 @@ private slots: void recordMic(); private: - Ui::MainWindow * ui; - QAction * recordAction; - AudioRecorder * recorder = nullptr; + Ui::MainWindow *ui; + QAction *recordAction; + AudioRecorder *recorder = nullptr; ITEAudioController *atc; }; diff --git a/CMakeLists.txt b/CMakeLists.txt index 56ae3190f..27aac6e0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,6 @@ set(SBM_LIST ${PROJECT_SOURCE_DIR}/3rdparty/qhttp/qhttp.pro ${PROJECT_SOURCE_DIR}/3rdparty/qite/qite.pro ${PROJECT_SOURCE_DIR}/iris/CMakeLists.txt - ${PROJECT_SOURCE_DIR}/src/libpsi/tools/CMakeLists.txt ) foreach(submodule ${SBM_LIST}) if(NOT EXISTS "${submodule}") @@ -39,12 +38,12 @@ foreach(submodule ${SBM_LIST}) endforeach() set( DEFAULT_BUNDLED_QCA OFF ) -if (APPLE OR MSVC) +if (APPLE OR ((MSVC OR USE_MXE) OR BUNDLED_IRIS_ALL)) set( DEFAULT_BUNDLED_QCA ON ) endif() set( DEFAULT_BUNDLED_USRSCTP OFF ) -if (APPLE OR (MSVC OR USE_MXE)) +if (APPLE OR ((MSVC OR USE_MXE) OR BUNDLED_IRIS_ALL)) set( DEFAULT_BUNDLED_USRSCTP ON ) endif() @@ -177,10 +176,6 @@ if(USE_CRASH) add_definitions(-DUSE_CRASH) endif() -if(IRIS_BUNDLED_QCA) - add_definitions(-DQCA_STATIC) -endif() - # Detect MXE cross-compilation if(EXISTS "${CMAKE_TOOLCHAIN_FILE}") string(TOLOWER ${CMAKE_TOOLCHAIN_FILE} TOOLCHAIN_FILE) @@ -290,6 +285,10 @@ if (BUNDLED_IRIS_ALL) set(IRIS_BUNDLED_USRSCTP ON) endif() +if(IRIS_BUNDLED_QCA) + add_definitions(-DQCA_STATIC) +endif() + # Copy a list of files from one directory to another. Only full paths. function(copy SOURCE DEST TARGET) if(EXISTS ${SOURCE}) diff --git a/cmake/modules/FindQca.cmake b/cmake/modules/FindQca.cmake index cdd885026..8dcb760ef 100644 --- a/cmake/modules/FindQca.cmake +++ b/cmake/modules/FindQca.cmake @@ -1,5 +1,5 @@ #============================================================================= -# Copyright 2016-2017 Psi+ Project, Vitaly Tonkacheyev +# Copyright 2016-2020 Psi+ Project, Vitaly Tonkacheyev # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -34,11 +34,11 @@ if (Qca_INCLUDE_DIR AND Qca_LIBRARY) endif() set(EXTRA_PATH_SUFFIXES - qt5/Qca-qt5/QtCrypto - Qca-qt5/QtCrypto - qt5/QtCrypto - qt/Qca-qt5/QtCrypto - lib/qca-qt5.framework/Versions/2/Headers + qt${QT_DEFAULT_MAJOR_VERSION}/Qca-qt${QT_DEFAULT_MAJOR_VERSION}/QtCrypto + Qca-qt${QT_DEFAULT_MAJOR_VERSION}/QtCrypto + qt${QT_DEFAULT_MAJOR_VERSION}/QtCrypto + qt/Qca-qt${QT_DEFAULT_MAJOR_VERSION}/QtCrypto + lib/qca-qt${QT_DEFAULT_MAJOR_VERSION}.framework/Versions/2/Headers ) find_path( @@ -52,7 +52,7 @@ find_path( find_library( Qca_LIBRARY - NAMES qca-qt5${D} + NAMES qca-qt${QT_DEFAULT_MAJOR_VERSION}${D} HINTS ${QCA_DIR}/lib ${QCA_DIR}/bin diff --git a/iris/3rdparty/stringprep/stringprep.cpp b/iris/3rdparty/stringprep/stringprep.cpp index f5793f69a..d7f581ba5 100644 --- a/iris/3rdparty/stringprep/stringprep.cpp +++ b/iris/3rdparty/stringprep/stringprep.cpp @@ -101,7 +101,7 @@ static int stringprep_apply_table_to_string(QVector &ucs4, const Stringpre { std::ptrdiff_t pos; size_t i, maplen; - uint32_t * src = ucs4.data(); /* points to unprocessed data */ + uint32_t *src = ucs4.data(); /* points to unprocessed data */ size_t srclen = ucs4.size(); /* length of unprocessed data */ while ((pos = stringprep_find_string_in_table(src, srclen, &i, table, table_size)) != -1) { @@ -177,7 +177,8 @@ int stringprep_4i(QString &input, Stringprep_profile_flags flags, const Stringpr /* Profile requires NFKC, but callee asked for no NFKC. */ return STRINGPREP_FLAG_ERROR; - ucs4vector = QString::fromUcs4(ucs4vector.data(), ucs4vector.length()) + static_assert(sizeof(char32_t) == sizeof(uint)); + ucs4vector = QString::fromUcs4(reinterpret_cast(ucs4vector.data()), ucs4vector.length()) .normalized(QString::NormalizationForm_KC) .toUcs4(); break; @@ -264,7 +265,8 @@ int stringprep_4i(QString &input, Stringprep_profile_flags flags, const Stringpr } } - input = QString::fromUcs4(ucs4vector.data(), ucs4vector.size()); + static_assert(sizeof(char32_t) == sizeof(uint)); + input = QString::fromUcs4(reinterpret_cast(ucs4vector.data()), ucs4vector.size()); return STRINGPREP_OK; } diff --git a/iris/src/irisnet/corelib/objectsession.cpp b/iris/src/irisnet/corelib/objectsession.cpp index b3ee2d301..ade6f7171 100644 --- a/iris/src/irisnet/corelib/objectsession.cpp +++ b/iris/src/irisnet/corelib/objectsession.cpp @@ -55,7 +55,11 @@ class ObjectSessionPrivate : public QObject { void clearArgs() { for (int n = 0; n < args.count(); ++n) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) QMetaType::destroy(args[n].type, args[n].data); +#else + QMetaType(args[n].type).destroy(args[n].data); +#endif args.clear(); } @@ -78,7 +82,11 @@ class ObjectSessionPrivate : public QObject { break; Argument arg; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) arg.type = QMetaType::type(arg_name[n]); +#else + arg.type = QMetaType::fromName(arg_name[n]).id(); +#endif if (!arg.type) { clearArgs(); return false; @@ -149,7 +157,11 @@ private slots: QGenericArgument arg[10]; for (int n = 0; n < call->args.count(); ++n) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) arg[n] = QGenericArgument(QMetaType::typeName(call->args[n].type), call->args[n].data); +#else + arg[n] = QGenericArgument(QMetaType(call->args[n].type).name(), call->args[n].data); +#endif bool ok; ok = QMetaObject::invokeMethod(call->obj, call->method.data(), Qt::DirectConnection, arg[0], arg[1], arg[2], diff --git a/iris/src/irisnet/noncore/cutestuff/httppoll.cpp b/iris/src/irisnet/noncore/cutestuff/httppoll.cpp index 54ecfffff..84fb8703a 100644 --- a/iris/src/irisnet/noncore/cutestuff/httppoll.cpp +++ b/iris/src/irisnet/noncore/cutestuff/httppoll.cpp @@ -848,7 +848,7 @@ void HttpProxyGetStream::sock_readyRead() void HttpProxyGetStream::processData(const QByteArray &block) { - printf("processData: %d bytes\n", block.size()); + printf("processData: %lld bytes\n", qsizetype(block.size())); if (!d->inHeader) { emit dataReady(block); return; diff --git a/iris/src/irisnet/noncore/ice176.cpp b/iris/src/irisnet/noncore/ice176.cpp index 387aa3b12..e5870e262 100644 --- a/iris/src/irisnet/noncore/ice176.cpp +++ b/iris/src/irisnet/noncore/ice176.cpp @@ -453,7 +453,8 @@ class Ice176::Private : public QObject { } this->remoteCandidates += remoteCandidates; - iceDebug("adding %d remote candidates. total=%d", remoteCandidates.count(), this->remoteCandidates.count()); + iceDebug("adding %lld remote candidates. total=%lld", qsizetype(remoteCandidates.count()), + qsizetype(this->remoteCandidates.count())); doPairing(localCandidates, remoteCandidates); } @@ -508,7 +509,7 @@ class Ice176::Private : public QObject { void addChecklistPairs(const QList> &pairs) { #ifdef ICE_DEBUG - iceDebug("%d new pairs", pairs.count()); + iceDebug("%lld new pairs", qsizetype(pairs.count())); for (auto &p : pairs) p->logNew = true; #endif @@ -549,7 +550,7 @@ class Ice176::Private : public QObject { while (checkList.pairs.count() > max_pairs) checkList.pairs.removeLast(); #ifdef ICE_DEBUG - iceDebug("%d after pruning (just new below):", checkList.pairs.count()); + iceDebug("%lld after pruning (just new below):", qsizetype(checkList.pairs.count())); for (auto &p : checkList.pairs) { if (p->logNew) iceDebug("C%d, %s", p->local->componentId, qPrintable(*p)); diff --git a/iris/src/irisnet/noncore/stunbinding.cpp b/iris/src/irisnet/noncore/stunbinding.cpp index 15bda2ea5..b40de9263 100644 --- a/iris/src/irisnet/noncore/stunbinding.cpp +++ b/iris/src/irisnet/noncore/stunbinding.cpp @@ -28,12 +28,12 @@ class StunBinding::Private : public QObject { Q_OBJECT public: - StunBinding *q; - StunTransactionPool::Ptr pool; - QScopedPointer trans; - TransportAddress stunAddr; - TransportAddress addr; - QString errorString; + StunBinding *q; + StunTransactionPool::Ptr pool; + std::unique_ptr trans; + TransportAddress stunAddr; + TransportAddress addr; + QString errorString; bool use_extPriority = false, use_extIceControlling = false, use_extIceControlled = false; quint32 extPriority = 0; bool extUseCandidate = false; @@ -52,9 +52,9 @@ class StunBinding::Private : public QObject { stunAddr = _addr; trans.reset(new StunTransaction()); - connect(trans.data(), &StunTransaction::createMessage, this, &Private::trans_createMessage); - connect(trans.data(), &StunTransaction::finished, this, &Private::trans_finished); - connect(trans.data(), &StunTransaction::error, this, &Private::trans_error); + connect(trans.get(), &StunTransaction::createMessage, this, &Private::trans_createMessage); + connect(trans.get(), &StunTransaction::finished, this, &Private::trans_finished); + connect(trans.get(), &StunTransaction::error, this, &Private::trans_error); if (!stuser.isEmpty()) { trans->setShortTermUsername(stuser); @@ -70,7 +70,7 @@ class StunBinding::Private : public QObject { { if (!trans) return; - auto t = trans.take(); + auto t = trans.release(); t->disconnect(this); t->cancel(); // will self-delete the transaction either on incoming or timeout // just in case those too diff --git a/iris/src/irisnet/noncore/stuntypes.cpp b/iris/src/irisnet/noncore/stuntypes.cpp index fe0cbb392..4a35daffb 100644 --- a/iris/src/irisnet/noncore/stuntypes.cpp +++ b/iris/src/irisnet/noncore/stuntypes.cpp @@ -624,7 +624,8 @@ namespace StunTypes { if (!val.isEmpty()) out += QString(" = %1").arg(val); } else - out += QString::asprintf(" Unknown attribute (0x%04x) of %d bytes", a.type, a.value.size()); + out += QString::asprintf(" Unknown attribute (0x%04x) of %lld bytes", a.type, + qsizetype(a.value.size())); } } else out += "\n (None)"; diff --git a/iris/src/irisnet/noncore/tcpportreserver.h b/iris/src/irisnet/noncore/tcpportreserver.h index 16275203a..bece3be40 100644 --- a/iris/src/irisnet/noncore/tcpportreserver.h +++ b/iris/src/irisnet/noncore/tcpportreserver.h @@ -123,7 +123,7 @@ class TcpPortScope : public QObject { private: struct Private; - QScopedPointer d; + std::unique_ptr d; }; /** diff --git a/iris/src/xmpp/jid/jid.cpp b/iris/src/xmpp/jid/jid.cpp index 12e455c75..5295e58bc 100644 --- a/iris/src/xmpp/jid/jid.cpp +++ b/iris/src/xmpp/jid/jid.cpp @@ -31,7 +31,7 @@ using namespace XMPP; //---------------------------------------------------------------------------- // StringPrepCache //---------------------------------------------------------------------------- -QScopedPointer StringPrepCache::_instance; +std::unique_ptr StringPrepCache::_instance; bool StringPrepCache::nameprep(const QString &in, int maxbytes, QString &out) { @@ -155,7 +155,7 @@ StringPrepCache *StringPrepCache::instance() irisNetAddPostRoutine(cleanup); // REVIEW probably not necessary since heap will be deallocated with destructors #endif } - return _instance.data(); + return _instance.get(); } StringPrepCache::StringPrepCache() { } diff --git a/iris/src/xmpp/jid/jid.h b/iris/src/xmpp/jid/jid.h index e7c1a3a81..44a3dfbb2 100644 --- a/iris/src/xmpp/jid/jid.h +++ b/iris/src/xmpp/jid/jid.h @@ -22,8 +22,8 @@ #include #include -#include #include +#include namespace XMPP { class StringPrepCache { @@ -41,8 +41,8 @@ class StringPrepCache { QHash resourceprep_table; QHash saslprep_table; - static QScopedPointer _instance; - static StringPrepCache *instance(); + static std::unique_ptr _instance; + static StringPrepCache *instance(); StringPrepCache(); }; diff --git a/iris/src/xmpp/xmpp-core/tlshandler.cpp b/iris/src/xmpp/xmpp-core/tlshandler.cpp index 807afe6d2..fdb48c2d6 100644 --- a/iris/src/xmpp/xmpp-core/tlshandler.cpp +++ b/iris/src/xmpp/xmpp-core/tlshandler.cpp @@ -195,7 +195,7 @@ static bool cert_match_domain(const QString &certname, const QString &acedomain) #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) if (!QRegExp(p1, Qt::CaseSensitive, QRegExp::Wildcard).exactMatch(p2)) #else - // note, wildcards a by default anchored. so exact match + // note, wildcards are by default anchored. so exact match if (!QRegularExpression::fromWildcard(p1, Qt::CaseSensitive).match(p2).hasMatch()) #endif return false; diff --git a/iris/src/xmpp/xmpp-im/jingle-application.h b/iris/src/xmpp/xmpp-im/jingle-application.h index cd3b06cb7..3b0edbbc2 100644 --- a/iris/src/xmpp/xmpp-im/jingle-application.h +++ b/iris/src/xmpp/xmpp-im/jingle-application.h @@ -79,7 +79,7 @@ namespace XMPP { namespace Jingle { inline Origin senders() const { return _senders; } inline QString contentName() const { return _contentName; } inline QSharedPointer transport() const { return _transport; } - inline TransportSelector *transportSelector() const { return _transportSelector.data(); } + inline TransportSelector *transportSelector() const { return _transportSelector.get(); } bool isRemote() const; inline bool isLocal() const { return !isRemote(); } inline ApplicationFlags flags() const { return _flags; } @@ -185,8 +185,8 @@ namespace XMPP { namespace Jingle { Origin _senders; // current transport. either local or remote. has info about origin and state - QSharedPointer _transport; - QScopedPointer _transportSelector; + QSharedPointer _transport; + std::unique_ptr _transportSelector; // if transport-replace is in progress. will be set to true when accepted by both sides. PendingTransportReplace _pendingTransportReplace = PendingTransportReplace::None; diff --git a/iris/src/xmpp/xmpp-im/jingle-ft.h b/iris/src/xmpp/xmpp-im/jingle-ft.h index bc9ab6f05..589622cbb 100644 --- a/iris/src/xmpp/xmpp-im/jingle-ft.h +++ b/iris/src/xmpp/xmpp-im/jingle-ft.h @@ -133,7 +133,7 @@ namespace XMPP { namespace Jingle { namespace FileTransfer { private: class Private; - QScopedPointer d; + std::unique_ptr d; }; class Manager : public XMPP::Jingle::ApplicationManager { diff --git a/iris/src/xmpp/xmpp-im/jingle-ibb.h b/iris/src/xmpp/xmpp-im/jingle-ibb.h index 7020a5195..6dbdba133 100644 --- a/iris/src/xmpp/xmpp-im/jingle-ibb.h +++ b/iris/src/xmpp/xmpp-im/jingle-ibb.h @@ -50,7 +50,7 @@ namespace Jingle { namespace IBB { friend class Manager; struct Private; - QScopedPointer d; + std::unique_ptr d; }; class Manager; @@ -91,7 +91,7 @@ namespace Jingle { namespace IBB { private: struct Private; - QScopedPointer d; + std::unique_ptr d; }; } // namespace IBB } // namespace Jingle diff --git a/iris/src/xmpp/xmpp-im/jingle-ice.cpp b/iris/src/xmpp/xmpp-im/jingle-ice.cpp index fc63726a1..f60a49f41 100644 --- a/iris/src/xmpp/xmpp-im/jingle-ice.cpp +++ b/iris/src/xmpp/xmpp-im/jingle-ice.cpp @@ -33,10 +33,7 @@ #include "xmpp_client.h" #include "xmpp_externalservicediscovery.h" #include "xmpp_serverinfomanager.h" -#include "xmpp_xmlcommon.h" -#include -#include #include #include @@ -452,7 +449,7 @@ namespace XMPP { namespace Jingle { namespace ICE { int proxiesInDiscoCount = 0; QVector components; QList pendingLocalCandidates; // cid to candidate mapping - QScopedPointer remoteState; + std::unique_ptr remoteState; // QString sid; // Transport::Mode mode = Transport::Tcp; @@ -638,7 +635,7 @@ namespace XMPP { namespace Jingle { namespace ICE { return; } - auto manager = dynamic_cast(q->pad()->manager())->d.data(); + auto manager = dynamic_cast(q->pad()->manager())->d.get(); stunBindPort = manager->stunBindPort; stunRelayUdpPort = manager->stunRelayUdpPort; stunRelayTcpPort = manager->stunRelayTcpPort; @@ -659,7 +656,7 @@ namespace XMPP { namespace Jingle { namespace ICE { void startIce() { - auto manager = dynamic_cast(q->_pad->manager())->d.data(); + auto manager = dynamic_cast(q->_pad->manager())->d.get(); if (!stunBindAddr.isNull() && stunBindPort > 0) qDebug("STUN service: %s;%d", qPrintable(stunBindAddr.toString()), stunBindPort); @@ -707,7 +704,7 @@ namespace XMPP { namespace Jingle { namespace ICE { [this](const QList &candidates) { pendingActions |= NewCandidate; pendingLocalCandidates += candidates; - qDebug("discovered %d local candidates", candidates.size()); + qDebug("discovered %lld local candidates", qsizetype(candidates.size())); for (auto const &c : candidates) { qDebug(" - %s:%d", qPrintable(c.ip.toString()), c.port); } diff --git a/iris/src/xmpp/xmpp-im/jingle-ice.h b/iris/src/xmpp/xmpp-im/jingle-ice.h index 58f858a4d..990d8b086 100644 --- a/iris/src/xmpp/xmpp-im/jingle-ice.h +++ b/iris/src/xmpp/xmpp-im/jingle-ice.h @@ -60,7 +60,7 @@ namespace Jingle { namespace ICE { friend class Manager; class Private; - QScopedPointer d; + std::unique_ptr d; }; class Pad : public TransportManagerPad { @@ -129,7 +129,7 @@ namespace Jingle { namespace ICE { private: friend class Transport; class Private; - QScopedPointer d; + std::unique_ptr d; }; } // namespace Ice } // namespace Jingle diff --git a/iris/src/xmpp/xmpp-im/jingle-s5b.h b/iris/src/xmpp/xmpp-im/jingle-s5b.h index 913761794..00dddaa34 100644 --- a/iris/src/xmpp/xmpp-im/jingle-s5b.h +++ b/iris/src/xmpp/xmpp-im/jingle-s5b.h @@ -152,7 +152,7 @@ namespace Jingle { namespace S5B { friend class Manager; class Private; - QScopedPointer d; + std::unique_ptr d; }; class Pad : public TransportManagerPad { @@ -212,7 +212,7 @@ namespace Jingle { namespace S5B { private: class Private; - QScopedPointer d; + std::unique_ptr d; }; } // namespace S5B } // namespace Jingle diff --git a/iris/src/xmpp/xmpp-im/jingle-sctp.h b/iris/src/xmpp/xmpp-im/jingle-sctp.h index 92dab3dc7..0ac2d1eee 100644 --- a/iris/src/xmpp/xmpp-im/jingle-sctp.h +++ b/iris/src/xmpp/xmpp-im/jingle-sctp.h @@ -25,7 +25,6 @@ #include #include #include -#include #include @@ -95,7 +94,7 @@ namespace XMPP { namespace Jingle { namespace SCTP { void newIncomingChannel(); private: - QScopedPointer d; + std::unique_ptr d; }; }}} diff --git a/iris/src/xmpp/xmpp-im/jingle-session.cpp b/iris/src/xmpp/xmpp-im/jingle-session.cpp index f03234067..f5ea68982 100644 --- a/iris/src/xmpp/xmpp-im/jingle-session.cpp +++ b/iris/src/xmpp/xmpp-im/jingle-session.cpp @@ -306,7 +306,7 @@ namespace XMPP { namespace Jingle { } QMultiMap updates; - qDebug("jingle-doStep: %d applications have updates", signalingContent.size()); + qDebug("jingle-doStep: %lld applications have updates", qsizetype(signalingContent.size())); for (auto app : std::as_const(signalingContent)) { auto updateType = app->evaluateOutgoingUpdate(); if (updateType.action != Action::NoAction) { @@ -510,7 +510,7 @@ namespace XMPP { namespace Jingle { return result { Unsupported, trReason == Reason::NoReason ? Reason::UnsupportedApplications : trReason, nullptr }; } - QScopedPointer app(appPad->manager()->startApplication(appPad, c.name, c.creator, c.senders)); + std::unique_ptr app(appPad->manager()->startApplication(appPad, c.name, c.creator, c.senders)); if (!app) return result { Unparsed, Reason::Success, nullptr }; @@ -522,10 +522,10 @@ namespace XMPP { namespace Jingle { } if (app->setTransport(std::get<2>(trpr))) { - return result { Ok, Reason::Success, app.take() }; + return result { Ok, Reason::Success, app.release() }; } // TODO We can do transport-replace in all cases where std::get<1>(trpr) != NoReason - return result { Unsupported, Reason::IncompatibleParameters, app.take() }; + return result { Unsupported, Reason::IncompatibleParameters, app.release() }; } typedef std::tuple, QList> diff --git a/iris/src/xmpp/xmpp-im/jingle-session.h b/iris/src/xmpp/xmpp-im/jingle-session.h index 07425323a..8f60683e2 100644 --- a/iris/src/xmpp/xmpp-im/jingle-session.h +++ b/iris/src/xmpp/xmpp-im/jingle-session.h @@ -95,7 +95,7 @@ namespace XMPP { namespace Jingle { bool updateFromXml(Action action, const QDomElement &jingleEl); class Private; - QScopedPointer d; + std::unique_ptr d; }; }} diff --git a/iris/src/xmpp/xmpp-im/jingle.cpp b/iris/src/xmpp/xmpp-im/jingle.cpp index 4819c8669..20ae9c15e 100644 --- a/iris/src/xmpp/xmpp-im/jingle.cpp +++ b/iris/src/xmpp/xmpp-im/jingle.cpp @@ -533,9 +533,9 @@ namespace XMPP { namespace Jingle { //---------------------------------------------------------------------------- class Manager::Private { public: - XMPP::Client *client; - Manager *manager; - QScopedPointer pushTask; + XMPP::Client *client; + Manager *manager; + std::unique_ptr pushTask; // ns -> application std::map> applicationManagers; // ns -> parser function diff --git a/iris/src/xmpp/xmpp-im/jingle.h b/iris/src/xmpp/xmpp-im/jingle.h index 9763926d7..845977b8f 100644 --- a/iris/src/xmpp/xmpp-im/jingle.h +++ b/iris/src/xmpp/xmpp-im/jingle.h @@ -377,7 +377,7 @@ namespace Jingle { Session *incomingSessionInitiate(const Jid &from, const Jingle &jingle, const QDomElement &jingleEl); class Private; - QScopedPointer d; + std::unique_ptr d; }; Origin negateOrigin(Origin o); diff --git a/iris/src/xmpp/xmpp-im/s5b.cpp b/iris/src/xmpp/xmpp-im/s5b.cpp index c0b9b18a9..0398ac631 100644 --- a/iris/src/xmpp/xmpp-im/s5b.cpp +++ b/iris/src/xmpp/xmpp-im/s5b.cpp @@ -2229,7 +2229,7 @@ S5BServer::S5BServer(QTcpServer *serverSocket) : TcpPortServer(serverSocket), d( S5BServer::~S5BServer() { - // basically to make QScopedPointer happy + // basically to make std::unique_ptr happy } void S5BServer::writeUDP(const QHostAddress &addr, quint16 port, const QByteArray &data) diff --git a/iris/src/xmpp/xmpp-im/s5b.h b/iris/src/xmpp/xmpp-im/s5b.h index 5343d3e7b..5fff63b4c 100644 --- a/iris/src/xmpp/xmpp-im/s5b.h +++ b/iris/src/xmpp/xmpp-im/s5b.h @@ -254,7 +254,7 @@ class S5BServer : public TcpPortServer { private: struct Private; - QScopedPointer d; + std::unique_ptr d; }; class JT_S5B : public Task { diff --git a/iris/src/xmpp/xmpp-im/xmpp_hash.cpp b/iris/src/xmpp/xmpp-im/xmpp_hash.cpp index 558e0bcf5..decfb0e46 100644 --- a/iris/src/xmpp/xmpp-im/xmpp_hash.cpp +++ b/iris/src/xmpp/xmpp-im/xmpp_hash.cpp @@ -172,7 +172,7 @@ bool Hash::compute(const QByteArray &ba) if (!v_data.isEmpty()) return true; - qDebug("failed to compute %s hash for %d bytes", qPrintable(stringType()), ba.size()); + qDebug("failed to compute %s hash for %lld bytes", qPrintable(stringType()), qsizetype(ba.size())); return false; } diff --git a/iris/src/xmpp/xmpp-im/xmpp_xmlcommon.cpp b/iris/src/xmpp/xmpp-im/xmpp_xmlcommon.cpp index 590080f8e..e0f29c8e0 100644 --- a/iris/src/xmpp/xmpp-im/xmpp_xmlcommon.cpp +++ b/iris/src/xmpp/xmpp-im/xmpp_xmlcommon.cpp @@ -445,8 +445,12 @@ void readColorEntry(const QDomElement &e, const QString &name, QColor *v) QDomElement tag = e.firstChildElement(name); if (tag.isNull()) return; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) QColor c; c.setNamedColor(tagContent(tag)); +#else + auto c = QColor::fromString(tagContent(tag)); +#endif if (c.isValid()) *v = c; } diff --git a/plugins/cmake/modules/variables.cmake b/plugins/cmake/modules/variables.cmake index d97aed982..560d15023 100644 --- a/plugins/cmake/modules/variables.cmake +++ b/plugins/cmake/modules/variables.cmake @@ -12,6 +12,10 @@ get_filename_component(ABS_INCLUDES_DIR "${CMAKE_CURRENT_LIST_DIR}/../include" A set(CMAKE_CXX_STANDARD 17) +if("${QT_DEFAULT_MAJOR_VERSION}" STREQUAL "") + set(QT_DEFAULT_MAJOR_VERSION 5) +endif() + if( NOT WIN32 ) set( LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" ) set( PLUGINS_PATH "lib${LIB_SUFFIX}/${MAIN_PROGRAM_NAME}/plugins" CACHE STRING "Install suffix for plugins" ) diff --git a/plugins/generic/screenshotplugin/CMakeLists.txt b/plugins/deprecated/screenshotplugin/CMakeLists.txt similarity index 83% rename from plugins/generic/screenshotplugin/CMakeLists.txt rename to plugins/deprecated/screenshotplugin/CMakeLists.txt index 84e890d4a..70e9deec1 100644 --- a/plugins/generic/screenshotplugin/CMakeLists.txt +++ b/plugins/deprecated/screenshotplugin/CMakeLists.txt @@ -113,22 +113,24 @@ set ( _RSCS ${PLUGIN}.qrc ) -find_package( Qt5 COMPONENTS Widgets Xml Network PrintSupport REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml Network PrintSupport REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml - Qt5::Network - Qt5::PrintSupport + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Network + Qt${QT_DEFAULT_MAJOR_VERSION}::PrintSupport ) if( UNIX AND NOT( APPLE OR CYGWIN OR HAIKU ) ) - find_package( Qt5 COMPONENTS X11Extras REQUIRED ) - set(QT_DEPLIBS - ${QT_DEPLIBS} - Qt5::X11Extras - ) + if(QT_DEFAULT_MAJOR_VERSION GREATER_EQUAL 6) + find_package( Qt6 COMPONENTS Gui REQUIRED) + list(APPEND QT_DEPLIBS Qt6::Gui) + else() + find_package( Qt5 COMPONENTS X11Extras REQUIRED ) + list(APPEND QT_DEPLIBS Qt5::X11Extras) + endif() endif() -qt5_wrap_ui(UIS ${_UIS}) -qt5_add_resources(RSCS ${_RSCS}) +qt_wrap_ui(UIS ${_UIS}) +qt_add_resources(RSCS ${_RSCS}) if(WIN32) set(LIB_TYPE "MODULE") diff --git a/plugins/generic/screenshotplugin/changelog.txt b/plugins/deprecated/screenshotplugin/changelog.txt similarity index 100% rename from plugins/generic/screenshotplugin/changelog.txt rename to plugins/deprecated/screenshotplugin/changelog.txt diff --git a/plugins/generic/screenshotplugin/controller.cpp b/plugins/deprecated/screenshotplugin/controller.cpp similarity index 100% rename from plugins/generic/screenshotplugin/controller.cpp rename to plugins/deprecated/screenshotplugin/controller.cpp diff --git a/plugins/generic/screenshotplugin/controller.h b/plugins/deprecated/screenshotplugin/controller.h similarity index 100% rename from plugins/generic/screenshotplugin/controller.h rename to plugins/deprecated/screenshotplugin/controller.h diff --git a/plugins/generic/screenshotplugin/defines.h b/plugins/deprecated/screenshotplugin/defines.h similarity index 100% rename from plugins/generic/screenshotplugin/defines.h rename to plugins/deprecated/screenshotplugin/defines.h diff --git a/plugins/generic/screenshotplugin/editserverdlg.cpp b/plugins/deprecated/screenshotplugin/editserverdlg.cpp similarity index 100% rename from plugins/generic/screenshotplugin/editserverdlg.cpp rename to plugins/deprecated/screenshotplugin/editserverdlg.cpp diff --git a/plugins/generic/screenshotplugin/editserverdlg.h b/plugins/deprecated/screenshotplugin/editserverdlg.h similarity index 100% rename from plugins/generic/screenshotplugin/editserverdlg.h rename to plugins/deprecated/screenshotplugin/editserverdlg.h diff --git a/plugins/generic/screenshotplugin/editserverdlg.ui b/plugins/deprecated/screenshotplugin/editserverdlg.ui similarity index 100% rename from plugins/generic/screenshotplugin/editserverdlg.ui rename to plugins/deprecated/screenshotplugin/editserverdlg.ui diff --git a/plugins/generic/screenshotplugin/icons/copy.png b/plugins/deprecated/screenshotplugin/icons/copy.png similarity index 100% rename from plugins/generic/screenshotplugin/icons/copy.png rename to plugins/deprecated/screenshotplugin/icons/copy.png diff --git a/plugins/generic/screenshotplugin/icons/crop.png b/plugins/deprecated/screenshotplugin/icons/crop.png similarity index 100% rename from plugins/generic/screenshotplugin/icons/crop.png rename to plugins/deprecated/screenshotplugin/icons/crop.png diff --git a/plugins/generic/screenshotplugin/icons/draw.png b/plugins/deprecated/screenshotplugin/icons/draw.png similarity index 100% rename from plugins/generic/screenshotplugin/icons/draw.png rename to plugins/deprecated/screenshotplugin/icons/draw.png diff --git a/plugins/generic/screenshotplugin/icons/frame.png b/plugins/deprecated/screenshotplugin/icons/frame.png similarity index 100% rename from plugins/generic/screenshotplugin/icons/frame.png rename to plugins/deprecated/screenshotplugin/icons/frame.png diff --git a/plugins/generic/screenshotplugin/icons/palette.png b/plugins/deprecated/screenshotplugin/icons/palette.png similarity index 100% rename from plugins/generic/screenshotplugin/icons/palette.png rename to plugins/deprecated/screenshotplugin/icons/palette.png diff --git a/plugins/generic/screenshotplugin/icons/paste.png b/plugins/deprecated/screenshotplugin/icons/paste.png similarity index 100% rename from plugins/generic/screenshotplugin/icons/paste.png rename to plugins/deprecated/screenshotplugin/icons/paste.png diff --git a/plugins/generic/screenshotplugin/icons/print.png b/plugins/deprecated/screenshotplugin/icons/print.png similarity index 100% rename from plugins/generic/screenshotplugin/icons/print.png rename to plugins/deprecated/screenshotplugin/icons/print.png diff --git a/plugins/generic/screenshotplugin/icons/screenshot.png b/plugins/deprecated/screenshotplugin/icons/screenshot.png similarity index 100% rename from plugins/generic/screenshotplugin/icons/screenshot.png rename to plugins/deprecated/screenshotplugin/icons/screenshot.png diff --git a/plugins/generic/screenshotplugin/icons/undo.png b/plugins/deprecated/screenshotplugin/icons/undo.png similarity index 100% rename from plugins/generic/screenshotplugin/icons/undo.png rename to plugins/deprecated/screenshotplugin/icons/undo.png diff --git a/plugins/generic/screenshotplugin/options.cpp b/plugins/deprecated/screenshotplugin/options.cpp similarity index 100% rename from plugins/generic/screenshotplugin/options.cpp rename to plugins/deprecated/screenshotplugin/options.cpp diff --git a/plugins/generic/screenshotplugin/options.h b/plugins/deprecated/screenshotplugin/options.h similarity index 100% rename from plugins/generic/screenshotplugin/options.h rename to plugins/deprecated/screenshotplugin/options.h diff --git a/plugins/generic/screenshotplugin/optionsdlg.cpp b/plugins/deprecated/screenshotplugin/optionsdlg.cpp similarity index 100% rename from plugins/generic/screenshotplugin/optionsdlg.cpp rename to plugins/deprecated/screenshotplugin/optionsdlg.cpp diff --git a/plugins/generic/screenshotplugin/optionsdlg.h b/plugins/deprecated/screenshotplugin/optionsdlg.h similarity index 100% rename from plugins/generic/screenshotplugin/optionsdlg.h rename to plugins/deprecated/screenshotplugin/optionsdlg.h diff --git a/plugins/generic/screenshotplugin/optionsdlg.ui b/plugins/deprecated/screenshotplugin/optionsdlg.ui similarity index 100% rename from plugins/generic/screenshotplugin/optionsdlg.ui rename to plugins/deprecated/screenshotplugin/optionsdlg.ui diff --git a/plugins/generic/screenshotplugin/optionswidget.cpp b/plugins/deprecated/screenshotplugin/optionswidget.cpp similarity index 100% rename from plugins/generic/screenshotplugin/optionswidget.cpp rename to plugins/deprecated/screenshotplugin/optionswidget.cpp diff --git a/plugins/generic/screenshotplugin/optionswidget.h b/plugins/deprecated/screenshotplugin/optionswidget.h similarity index 100% rename from plugins/generic/screenshotplugin/optionswidget.h rename to plugins/deprecated/screenshotplugin/optionswidget.h diff --git a/plugins/generic/screenshotplugin/optionswidget.ui b/plugins/deprecated/screenshotplugin/optionswidget.ui similarity index 100% rename from plugins/generic/screenshotplugin/optionswidget.ui rename to plugins/deprecated/screenshotplugin/optionswidget.ui diff --git a/plugins/generic/screenshotplugin/pixmapwidget.cpp b/plugins/deprecated/screenshotplugin/pixmapwidget.cpp similarity index 100% rename from plugins/generic/screenshotplugin/pixmapwidget.cpp rename to plugins/deprecated/screenshotplugin/pixmapwidget.cpp diff --git a/plugins/generic/screenshotplugin/pixmapwidget.h b/plugins/deprecated/screenshotplugin/pixmapwidget.h similarity index 100% rename from plugins/generic/screenshotplugin/pixmapwidget.h rename to plugins/deprecated/screenshotplugin/pixmapwidget.h diff --git a/plugins/generic/screenshotplugin/proxysettingsdlg.cpp b/plugins/deprecated/screenshotplugin/proxysettingsdlg.cpp similarity index 100% rename from plugins/generic/screenshotplugin/proxysettingsdlg.cpp rename to plugins/deprecated/screenshotplugin/proxysettingsdlg.cpp diff --git a/plugins/generic/screenshotplugin/proxysettingsdlg.h b/plugins/deprecated/screenshotplugin/proxysettingsdlg.h similarity index 100% rename from plugins/generic/screenshotplugin/proxysettingsdlg.h rename to plugins/deprecated/screenshotplugin/proxysettingsdlg.h diff --git a/plugins/generic/screenshotplugin/proxysettingsdlg.ui b/plugins/deprecated/screenshotplugin/proxysettingsdlg.ui similarity index 100% rename from plugins/generic/screenshotplugin/proxysettingsdlg.ui rename to plugins/deprecated/screenshotplugin/proxysettingsdlg.ui diff --git a/plugins/generic/screenshotplugin/psiplugin.json b/plugins/deprecated/screenshotplugin/psiplugin.json similarity index 100% rename from plugins/generic/screenshotplugin/psiplugin.json rename to plugins/deprecated/screenshotplugin/psiplugin.json diff --git a/plugins/generic/screenshotplugin/qxt/LICENSE b/plugins/deprecated/screenshotplugin/qxt/LICENSE similarity index 100% rename from plugins/generic/screenshotplugin/qxt/LICENSE rename to plugins/deprecated/screenshotplugin/qxt/LICENSE diff --git a/plugins/generic/screenshotplugin/qxt/core/qxtglobal.cpp b/plugins/deprecated/screenshotplugin/qxt/core/qxtglobal.cpp similarity index 100% rename from plugins/generic/screenshotplugin/qxt/core/qxtglobal.cpp rename to plugins/deprecated/screenshotplugin/qxt/core/qxtglobal.cpp diff --git a/plugins/generic/screenshotplugin/qxt/core/qxtglobal.h b/plugins/deprecated/screenshotplugin/qxt/core/qxtglobal.h similarity index 100% rename from plugins/generic/screenshotplugin/qxt/core/qxtglobal.h rename to plugins/deprecated/screenshotplugin/qxt/core/qxtglobal.h diff --git a/plugins/generic/screenshotplugin/qxt/gui/qxtwindowsystem.cpp b/plugins/deprecated/screenshotplugin/qxt/gui/qxtwindowsystem.cpp similarity index 100% rename from plugins/generic/screenshotplugin/qxt/gui/qxtwindowsystem.cpp rename to plugins/deprecated/screenshotplugin/qxt/gui/qxtwindowsystem.cpp diff --git a/plugins/generic/screenshotplugin/qxt/gui/qxtwindowsystem.h b/plugins/deprecated/screenshotplugin/qxt/gui/qxtwindowsystem.h similarity index 100% rename from plugins/generic/screenshotplugin/qxt/gui/qxtwindowsystem.h rename to plugins/deprecated/screenshotplugin/qxt/gui/qxtwindowsystem.h diff --git a/plugins/generic/screenshotplugin/qxt/gui/qxtwindowsystem_mac.cpp b/plugins/deprecated/screenshotplugin/qxt/gui/qxtwindowsystem_mac.cpp similarity index 100% rename from plugins/generic/screenshotplugin/qxt/gui/qxtwindowsystem_mac.cpp rename to plugins/deprecated/screenshotplugin/qxt/gui/qxtwindowsystem_mac.cpp diff --git a/plugins/generic/screenshotplugin/qxt/gui/qxtwindowsystem_mac.h b/plugins/deprecated/screenshotplugin/qxt/gui/qxtwindowsystem_mac.h similarity index 100% rename from plugins/generic/screenshotplugin/qxt/gui/qxtwindowsystem_mac.h rename to plugins/deprecated/screenshotplugin/qxt/gui/qxtwindowsystem_mac.h diff --git a/plugins/generic/screenshotplugin/qxt/gui/qxtwindowsystem_win.cpp b/plugins/deprecated/screenshotplugin/qxt/gui/qxtwindowsystem_win.cpp similarity index 100% rename from plugins/generic/screenshotplugin/qxt/gui/qxtwindowsystem_win.cpp rename to plugins/deprecated/screenshotplugin/qxt/gui/qxtwindowsystem_win.cpp diff --git a/plugins/generic/screenshotplugin/qxt/gui/qxtwindowsystem_x11.cpp b/plugins/deprecated/screenshotplugin/qxt/gui/qxtwindowsystem_x11.cpp similarity index 100% rename from plugins/generic/screenshotplugin/qxt/gui/qxtwindowsystem_x11.cpp rename to plugins/deprecated/screenshotplugin/qxt/gui/qxtwindowsystem_x11.cpp diff --git a/plugins/generic/screenshotplugin/qxt/gui/x11info.cpp b/plugins/deprecated/screenshotplugin/qxt/gui/x11info.cpp similarity index 100% rename from plugins/generic/screenshotplugin/qxt/gui/x11info.cpp rename to plugins/deprecated/screenshotplugin/qxt/gui/x11info.cpp diff --git a/plugins/generic/screenshotplugin/qxt/gui/x11info.h b/plugins/deprecated/screenshotplugin/qxt/gui/x11info.h similarity index 100% rename from plugins/generic/screenshotplugin/qxt/gui/x11info.h rename to plugins/deprecated/screenshotplugin/qxt/gui/x11info.h diff --git a/plugins/generic/screenshotplugin/screenshot.cpp b/plugins/deprecated/screenshotplugin/screenshot.cpp similarity index 100% rename from plugins/generic/screenshotplugin/screenshot.cpp rename to plugins/deprecated/screenshotplugin/screenshot.cpp diff --git a/plugins/generic/screenshotplugin/screenshot.h b/plugins/deprecated/screenshotplugin/screenshot.h similarity index 100% rename from plugins/generic/screenshotplugin/screenshot.h rename to plugins/deprecated/screenshotplugin/screenshot.h diff --git a/plugins/generic/screenshotplugin/screenshot.ui b/plugins/deprecated/screenshotplugin/screenshot.ui similarity index 100% rename from plugins/generic/screenshotplugin/screenshot.ui rename to plugins/deprecated/screenshotplugin/screenshot.ui diff --git a/plugins/generic/screenshotplugin/screenshoticonset.cpp b/plugins/deprecated/screenshotplugin/screenshoticonset.cpp similarity index 100% rename from plugins/generic/screenshotplugin/screenshoticonset.cpp rename to plugins/deprecated/screenshotplugin/screenshoticonset.cpp diff --git a/plugins/generic/screenshotplugin/screenshoticonset.h b/plugins/deprecated/screenshotplugin/screenshoticonset.h similarity index 100% rename from plugins/generic/screenshotplugin/screenshoticonset.h rename to plugins/deprecated/screenshotplugin/screenshoticonset.h diff --git a/plugins/generic/screenshotplugin/screenshotoptions.cpp b/plugins/deprecated/screenshotplugin/screenshotoptions.cpp similarity index 100% rename from plugins/generic/screenshotplugin/screenshotoptions.cpp rename to plugins/deprecated/screenshotplugin/screenshotoptions.cpp diff --git a/plugins/generic/screenshotplugin/screenshotoptions.h b/plugins/deprecated/screenshotplugin/screenshotoptions.h similarity index 100% rename from plugins/generic/screenshotplugin/screenshotoptions.h rename to plugins/deprecated/screenshotplugin/screenshotoptions.h diff --git a/plugins/generic/screenshotplugin/screenshotoptions.ui b/plugins/deprecated/screenshotplugin/screenshotoptions.ui similarity index 100% rename from plugins/generic/screenshotplugin/screenshotoptions.ui rename to plugins/deprecated/screenshotplugin/screenshotoptions.ui diff --git a/plugins/generic/screenshotplugin/screenshotplugin.cpp b/plugins/deprecated/screenshotplugin/screenshotplugin.cpp similarity index 100% rename from plugins/generic/screenshotplugin/screenshotplugin.cpp rename to plugins/deprecated/screenshotplugin/screenshotplugin.cpp diff --git a/plugins/generic/screenshotplugin/screenshotplugin.png b/plugins/deprecated/screenshotplugin/screenshotplugin.png similarity index 100% rename from plugins/generic/screenshotplugin/screenshotplugin.png rename to plugins/deprecated/screenshotplugin/screenshotplugin.png diff --git a/plugins/generic/screenshotplugin/screenshotplugin.pro b/plugins/deprecated/screenshotplugin/screenshotplugin.pro similarity index 100% rename from plugins/generic/screenshotplugin/screenshotplugin.pro rename to plugins/deprecated/screenshotplugin/screenshotplugin.pro diff --git a/plugins/generic/screenshotplugin/screenshotplugin.qrc b/plugins/deprecated/screenshotplugin/screenshotplugin.qrc similarity index 100% rename from plugins/generic/screenshotplugin/screenshotplugin.qrc rename to plugins/deprecated/screenshotplugin/screenshotplugin.qrc diff --git a/plugins/generic/screenshotplugin/server.cpp b/plugins/deprecated/screenshotplugin/server.cpp similarity index 100% rename from plugins/generic/screenshotplugin/server.cpp rename to plugins/deprecated/screenshotplugin/server.cpp diff --git a/plugins/generic/screenshotplugin/server.h b/plugins/deprecated/screenshotplugin/server.h similarity index 100% rename from plugins/generic/screenshotplugin/server.h rename to plugins/deprecated/screenshotplugin/server.h diff --git a/plugins/generic/screenshotplugin/toolbar.cpp b/plugins/deprecated/screenshotplugin/toolbar.cpp similarity index 100% rename from plugins/generic/screenshotplugin/toolbar.cpp rename to plugins/deprecated/screenshotplugin/toolbar.cpp diff --git a/plugins/generic/screenshotplugin/toolbar.h b/plugins/deprecated/screenshotplugin/toolbar.h similarity index 100% rename from plugins/generic/screenshotplugin/toolbar.h rename to plugins/deprecated/screenshotplugin/toolbar.h diff --git a/plugins/dev/battleshipgameplugin/CMakeLists.txt b/plugins/dev/battleshipgameplugin/CMakeLists.txt index dc56954ab..6be8ebbfc 100644 --- a/plugins/dev/battleshipgameplugin/CMakeLists.txt +++ b/plugins/dev/battleshipgameplugin/CMakeLists.txt @@ -63,17 +63,17 @@ set( _UIS set( _RSCS ${PLUGIN}.qrc ) -find_package( Qt5 COMPONENTS Widgets Xml REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml REQUIRED ) add_definitions( - ${Qt5Widgets_DEFINITIONS} - ${Qt5Xml_DEFINITIONS} + ${Qt${QT_DEFAULT_MAJOR_VERSION}Widgets_DEFINITIONS} + ${Qt${QT_DEFAULT_MAJOR_VERSION}Xml_DEFINITIONS} ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml ) -qt5_wrap_ui(UIS ${_UIS}) -qt5_add_resources(RSCS ${_RSCS}) +qt_wrap_ui(UIS ${_UIS}) +qt_add_resources(RSCS ${_RSCS}) if(WIN32) set(LIB_TYPE "MODULE") diff --git a/plugins/dev/noughtsandcrossesplugin/CMakeLists.txt b/plugins/dev/noughtsandcrossesplugin/CMakeLists.txt index 31b2d2ea0..6887e2d5f 100644 --- a/plugins/dev/noughtsandcrossesplugin/CMakeLists.txt +++ b/plugins/dev/noughtsandcrossesplugin/CMakeLists.txt @@ -41,10 +41,10 @@ set( _SRCS tictac.cpp ) -find_package( Qt5 COMPONENTS Widgets Xml REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml ) if(WIN32) diff --git a/plugins/generic/CMakeLists.txt b/plugins/generic/CMakeLists.txt index ff9c8b591..3b7b313d9 100644 --- a/plugins/generic/CMakeLists.txt +++ b/plugins/generic/CMakeLists.txt @@ -31,13 +31,6 @@ set( plugins_list watcherplugin ) -if((WIN32 OR APPLE) OR USE_X11 AND (NOT HAIKU)) - # qxt library is buildable only in Linux, *BSD, Windows and macOS - list(APPEND plugins_list - screenshotplugin - ) -endif() - if(NOT APPLE AND (NOT HAIKU) AND (WIN32 OR USE_X11)) list(APPEND plugins_list videostatusplugin diff --git a/plugins/generic/attentionplugin/CMakeLists.txt b/plugins/generic/attentionplugin/CMakeLists.txt index 2ae5fa306..7c4185d7f 100644 --- a/plugins/generic/attentionplugin/CMakeLists.txt +++ b/plugins/generic/attentionplugin/CMakeLists.txt @@ -41,12 +41,12 @@ set( _SRCS set( _UIS options.ui ) -find_package( Qt5 COMPONENTS Widgets Xml REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml ) -qt5_wrap_ui(UIS ${_UIS}) +qt_wrap_ui(UIS ${_UIS}) if(WIN32) set(LIB_TYPE "MODULE") diff --git a/plugins/generic/autoreplyplugin/CMakeLists.txt b/plugins/generic/autoreplyplugin/CMakeLists.txt index 92cb34f03..7a0e332aa 100644 --- a/plugins/generic/autoreplyplugin/CMakeLists.txt +++ b/plugins/generic/autoreplyplugin/CMakeLists.txt @@ -36,10 +36,10 @@ endif() set( _SRCS ${PLUGIN}.cpp ) -find_package( Qt5 COMPONENTS Widgets Xml REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml ) if(WIN32) diff --git a/plugins/generic/birthdayreminderplugin/CMakeLists.txt b/plugins/generic/birthdayreminderplugin/CMakeLists.txt index bd9f756f6..f98195b1c 100644 --- a/plugins/generic/birthdayreminderplugin/CMakeLists.txt +++ b/plugins/generic/birthdayreminderplugin/CMakeLists.txt @@ -41,13 +41,13 @@ set( _UIS set( _RSCS ${PLUGIN}.qrc ) -find_package( Qt5 COMPONENTS Widgets Xml REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml ) -qt5_add_resources(RSCS ${_RSCS}) -qt5_wrap_ui(UIS ${_UIS}) +qt_add_resources(RSCS ${_RSCS}) +qt_wrap_ui(UIS ${_UIS}) if(WIN32) set(LIB_TYPE "MODULE") diff --git a/plugins/generic/chessplugin/CMakeLists.txt b/plugins/generic/chessplugin/CMakeLists.txt index f737f6249..4fcaa8e23 100644 --- a/plugins/generic/chessplugin/CMakeLists.txt +++ b/plugins/generic/chessplugin/CMakeLists.txt @@ -60,13 +60,13 @@ set ( _RSCS ${PLUGIN}.qrc ) -find_package( Qt5 COMPONENTS Widgets Xml REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml ) -qt5_wrap_ui(UIS ${_UIS}) -qt5_add_resources(RSCS ${_RSCS}) +qt_wrap_ui(UIS ${_UIS}) +qt_add_resources(RSCS ${_RSCS}) if(WIN32) set(LIB_TYPE "MODULE") diff --git a/plugins/generic/cleanerplugin/CMakeLists.txt b/plugins/generic/cleanerplugin/CMakeLists.txt index e3d3efda4..824e12b16 100644 --- a/plugins/generic/cleanerplugin/CMakeLists.txt +++ b/plugins/generic/cleanerplugin/CMakeLists.txt @@ -56,13 +56,13 @@ set( _RSCS ${PLUGIN}.qrc ) -find_package( Qt5 COMPONENTS Widgets Xml REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml ) -qt5_wrap_ui(UIS ${_UIS}) -qt5_add_resources(RSCS ${_RSCS}) +qt_wrap_ui(UIS ${_UIS}) +qt_add_resources(RSCS ${_RSCS}) if(WIN32) set(LIB_TYPE "MODULE") diff --git a/plugins/generic/clientswitcherplugin/CMakeLists.txt b/plugins/generic/clientswitcherplugin/CMakeLists.txt index bc5f4388d..7ed33bbce 100644 --- a/plugins/generic/clientswitcherplugin/CMakeLists.txt +++ b/plugins/generic/clientswitcherplugin/CMakeLists.txt @@ -43,12 +43,12 @@ set( _SRCS set( _UIS options.ui ) -find_package( Qt5 COMPONENTS Widgets Xml REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml ) -qt5_wrap_ui(UIS ${_UIS}) +qt_wrap_ui(UIS ${_UIS}) if(WIN32) set(LIB_TYPE "MODULE") diff --git a/plugins/generic/conferenceloggerplugin/CMakeLists.txt b/plugins/generic/conferenceloggerplugin/CMakeLists.txt index 08a182578..6791865d8 100644 --- a/plugins/generic/conferenceloggerplugin/CMakeLists.txt +++ b/plugins/generic/conferenceloggerplugin/CMakeLists.txt @@ -44,12 +44,12 @@ set( _SRCS set( _RSCS ${PLUGIN}.qrc ) -find_package( Qt5 COMPONENTS Widgets Xml REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml ) -qt5_add_resources(RSCS ${_RSCS}) +qt_add_resources(RSCS ${_RSCS}) if(WIN32) set(LIB_TYPE "MODULE") diff --git a/plugins/generic/contentdownloaderplugin/CMakeLists.txt b/plugins/generic/contentdownloaderplugin/CMakeLists.txt index 2199bb9f8..412710de6 100644 --- a/plugins/generic/contentdownloaderplugin/CMakeLists.txt +++ b/plugins/generic/contentdownloaderplugin/CMakeLists.txt @@ -47,13 +47,13 @@ set( _SRCS set( _UIS form.ui ) -find_package( Qt5 COMPONENTS Widgets Xml Network REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml Network REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml - Qt5::Network + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Network ) -qt5_wrap_ui(UIS ${_UIS}) +qt_wrap_ui(UIS ${_UIS}) if(WIN32) set(LIB_TYPE "MODULE") diff --git a/plugins/generic/enummessagesplugin/CMakeLists.txt b/plugins/generic/enummessagesplugin/CMakeLists.txt index ea06568b5..df9b24452 100644 --- a/plugins/generic/enummessagesplugin/CMakeLists.txt +++ b/plugins/generic/enummessagesplugin/CMakeLists.txt @@ -42,12 +42,12 @@ set( _SRCS set( _UIS options.ui ) -find_package( Qt5 COMPONENTS Widgets Xml REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml ) -qt5_wrap_ui(UIS ${_UIS}) +qt_wrap_ui(UIS ${_UIS}) if(WIN32) set(LIB_TYPE "MODULE") diff --git a/plugins/generic/extendedmenuplugin/CMakeLists.txt b/plugins/generic/extendedmenuplugin/CMakeLists.txt index 16c70c0e2..84cf5dbb1 100644 --- a/plugins/generic/extendedmenuplugin/CMakeLists.txt +++ b/plugins/generic/extendedmenuplugin/CMakeLists.txt @@ -42,13 +42,13 @@ set( _RSCS ${PLUGIN}.qrc ) -find_package( Qt5 COMPONENTS Widgets Xml REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml ) -qt5_wrap_ui(UIS ${_UIS}) -qt5_add_resources(RSCS ${_RSCS}) +qt_wrap_ui(UIS ${_UIS}) +qt_add_resources(RSCS ${_RSCS}) if(WIN32) set(LIB_TYPE "MODULE") diff --git a/plugins/generic/extendedoptionsplugin/CMakeLists.txt b/plugins/generic/extendedoptionsplugin/CMakeLists.txt index 968aa7119..abb36f7a7 100644 --- a/plugins/generic/extendedoptionsplugin/CMakeLists.txt +++ b/plugins/generic/extendedoptionsplugin/CMakeLists.txt @@ -36,10 +36,10 @@ set( _SRCS ${PLUGIN}.cpp syntaxhighlighter.cpp ) -find_package( Qt5 COMPONENTS Widgets Xml REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml ) if(WIN32) diff --git a/plugins/generic/gomokugameplugin/CMakeLists.txt b/plugins/generic/gomokugameplugin/CMakeLists.txt index b8c96ee37..c7636a505 100644 --- a/plugins/generic/gomokugameplugin/CMakeLists.txt +++ b/plugins/generic/gomokugameplugin/CMakeLists.txt @@ -67,13 +67,13 @@ set( _RSCS ${PLUGIN}.qrc ) -find_package( Qt5 COMPONENTS Widgets Xml REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml ) -qt5_wrap_ui(UIS ${_UIS}) -qt5_add_resources(RSCS ${_RSCS}) +qt_wrap_ui(UIS ${_UIS}) +qt_add_resources(RSCS ${_RSCS}) if(WIN32) set(LIB_TYPE "MODULE") diff --git a/plugins/generic/historykeeperplugin/CMakeLists.txt b/plugins/generic/historykeeperplugin/CMakeLists.txt index 2c344538d..06df643a9 100644 --- a/plugins/generic/historykeeperplugin/CMakeLists.txt +++ b/plugins/generic/historykeeperplugin/CMakeLists.txt @@ -35,10 +35,10 @@ endif() set( _SRCS ${PLUGIN}.cpp ) -find_package( Qt5 COMPONENTS Widgets Xml REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml ) if(WIN32) diff --git a/plugins/generic/imageplugin/CMakeLists.txt b/plugins/generic/imageplugin/CMakeLists.txt index 0fae7a500..9fb6f6fd9 100644 --- a/plugins/generic/imageplugin/CMakeLists.txt +++ b/plugins/generic/imageplugin/CMakeLists.txt @@ -39,12 +39,12 @@ set( _RSCS ${PLUGIN}.qrc ) -find_package( Qt5 COMPONENTS Widgets Xml REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml ) -qt5_add_resources(RSCS ${_RSCS}) +qt_add_resources(RSCS ${_RSCS}) if(WIN32) set(LIB_TYPE "MODULE") diff --git a/plugins/generic/imagepreviewplugin/CMakeLists.txt b/plugins/generic/imagepreviewplugin/CMakeLists.txt index 7b9c225fe..9756f2332 100644 --- a/plugins/generic/imagepreviewplugin/CMakeLists.txt +++ b/plugins/generic/imagepreviewplugin/CMakeLists.txt @@ -60,14 +60,14 @@ set( _UIS options.ui ) -find_package(Qt5 COMPONENTS Widgets Xml Network REQUIRED) +find_package(Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml Network REQUIRED) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml - Qt5::Network + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Network ) -qt5_wrap_ui(UIS ${_UIS}) -qt5_add_resources(RSCS ${_RSCS}) +qt_wrap_ui(UIS ${_UIS}) +qt_add_resources(RSCS ${_RSCS}) if(WIN32) set(LIB_TYPE "MODULE") diff --git a/plugins/generic/jabberdiskplugin/CMakeLists.txt b/plugins/generic/jabberdiskplugin/CMakeLists.txt index 72eafef82..c581d6eb9 100644 --- a/plugins/generic/jabberdiskplugin/CMakeLists.txt +++ b/plugins/generic/jabberdiskplugin/CMakeLists.txt @@ -54,12 +54,12 @@ set( _UIS options.ui jd_mainwin.ui ) -find_package( Qt5 COMPONENTS Widgets Xml REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml ) -qt5_wrap_ui(UIS ${_UIS}) +qt_wrap_ui(UIS ${_UIS}) if(WIN32) set(LIB_TYPE "MODULE") diff --git a/plugins/generic/juickplugin/CMakeLists.txt b/plugins/generic/juickplugin/CMakeLists.txt index 75053b5c4..e203f7722 100644 --- a/plugins/generic/juickplugin/CMakeLists.txt +++ b/plugins/generic/juickplugin/CMakeLists.txt @@ -49,14 +49,14 @@ set( _UIS juickjidlist.ui settings.ui ) -find_package(Qt5 COMPONENTS Widgets Xml Network REQUIRED) +find_package(Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml Network REQUIRED) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml - Qt5::Network + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Network ) -qt5_wrap_ui(UIS ${_UIS}) +qt_wrap_ui(UIS ${_UIS}) if(WIN32) set(LIB_TYPE "MODULE") diff --git a/plugins/generic/messagefilterplugin/CMakeLists.txt b/plugins/generic/messagefilterplugin/CMakeLists.txt index 696f23b3c..52b753846 100644 --- a/plugins/generic/messagefilterplugin/CMakeLists.txt +++ b/plugins/generic/messagefilterplugin/CMakeLists.txt @@ -43,13 +43,13 @@ set( _RSCS resources.qrc ) -find_package( Qt5 COMPONENTS Widgets Xml REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml ) -qt5_wrap_ui(UIS ${_UIS}) -qt5_add_resources(RSCS ${_RSCS}) +qt_wrap_ui(UIS ${_UIS}) +qt_add_resources(RSCS ${_RSCS}) if(WIN32) set(LIB_TYPE "MODULE") diff --git a/plugins/generic/omemoplugin/CMakeLists.txt b/plugins/generic/omemoplugin/CMakeLists.txt index 9f5f5fda4..a6ec20cb6 100644 --- a/plugins/generic/omemoplugin/CMakeLists.txt +++ b/plugins/generic/omemoplugin/CMakeLists.txt @@ -37,7 +37,7 @@ if(NOT PLUGINS_INSTALL_PATH) set(PLUGINS_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/${PLUGINS_PATH}") endif() -find_package(Qt5 COMPONENTS Network Widgets Xml Sql REQUIRED) +find_package(Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Network Widgets Xml Sql REQUIRED) find_package(OpenSSL COMPONENTS Crypto REQUIRED) find_package(SignalProtocolC REQUIRED) @@ -83,13 +83,13 @@ set(SOURCES src/configwidget.cpp ) -qt5_add_resources(RESOURCES omemoplugin.qrc) +qt_add_resources(RESOURCES omemoplugin.qrc) set(QT_DEPLIBS - Qt5::Network - Qt5::Widgets - Qt5::Xml - Qt5::Sql + Qt${QT_DEFAULT_MAJOR_VERSION}::Network + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Sql ) if(WIN32) diff --git a/plugins/generic/openpgpplugin/CMakeLists.txt b/plugins/generic/openpgpplugin/CMakeLists.txt index 5fcb2aadf..c6d2b3852 100644 --- a/plugins/generic/openpgpplugin/CMakeLists.txt +++ b/plugins/generic/openpgpplugin/CMakeLists.txt @@ -69,13 +69,13 @@ set( _RSCS resources/resources.qrc ) -find_package( Qt5 COMPONENTS Widgets Xml REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml ) -qt5_wrap_ui(UIS ${_UIS}) -qt5_add_resources(RSCS ${_RSCS}) +qt_wrap_ui(UIS ${_UIS}) +qt_add_resources(RSCS ${_RSCS}) if(WIN32) set(LIB_TYPE "MODULE") diff --git a/plugins/generic/otrplugin/CMakeLists.txt b/plugins/generic/otrplugin/CMakeLists.txt index 9b6640365..36cd74272 100644 --- a/plugins/generic/otrplugin/CMakeLists.txt +++ b/plugins/generic/otrplugin/CMakeLists.txt @@ -99,13 +99,13 @@ set( _RSCS ${PLUGIN}.qrc ) -find_package( Qt5 COMPONENTS Widgets Xml Concurrent REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml Concurrent REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml - Qt5::Concurrent + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Concurrent ) -qt5_add_resources(RSCS ${_RSCS}) +qt_add_resources(RSCS ${_RSCS}) if(WIN32) set(LIB_TYPE "MODULE") diff --git a/plugins/generic/pepchangenotifyplugin/CMakeLists.txt b/plugins/generic/pepchangenotifyplugin/CMakeLists.txt index 81de553e5..f86b831f4 100644 --- a/plugins/generic/pepchangenotifyplugin/CMakeLists.txt +++ b/plugins/generic/pepchangenotifyplugin/CMakeLists.txt @@ -38,12 +38,12 @@ set( _SRCS set( _UIS options.ui ) -find_package( Qt5 COMPONENTS Widgets Xml REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml ) -qt5_wrap_ui(UIS ${_UIS}) +qt_wrap_ui(UIS ${_UIS}) if(WIN32) set(LIB_TYPE "MODULE") diff --git a/plugins/generic/qipxstatusesplugin/CMakeLists.txt b/plugins/generic/qipxstatusesplugin/CMakeLists.txt index a32335cc1..e0e0e9236 100644 --- a/plugins/generic/qipxstatusesplugin/CMakeLists.txt +++ b/plugins/generic/qipxstatusesplugin/CMakeLists.txt @@ -35,10 +35,10 @@ endif() set( _SRCS ${PLUGIN}.cpp ) -find_package( Qt5 COMPONENTS Widgets Xml REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml ) if(WIN32) diff --git a/plugins/generic/skinsplugin/CMakeLists.txt b/plugins/generic/skinsplugin/CMakeLists.txt index c36301401..52815067e 100644 --- a/plugins/generic/skinsplugin/CMakeLists.txt +++ b/plugins/generic/skinsplugin/CMakeLists.txt @@ -50,13 +50,13 @@ set( _RSCS ${PLUGIN}.qrc ) -find_package( Qt5 COMPONENTS Widgets Xml REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml ) -qt5_wrap_ui(UIS ${_UIS}) -qt5_add_resources(RSCS ${_RSCS}) +qt_wrap_ui(UIS ${_UIS}) +qt_add_resources(RSCS ${_RSCS}) if(WIN32) set(LIB_TYPE "MODULE") diff --git a/plugins/generic/stopspamplugin/CMakeLists.txt b/plugins/generic/stopspamplugin/CMakeLists.txt index 702a50c8a..569a13ae5 100644 --- a/plugins/generic/stopspamplugin/CMakeLists.txt +++ b/plugins/generic/stopspamplugin/CMakeLists.txt @@ -50,12 +50,12 @@ set( _SRCS set( _UIS options.ui ) -find_package( Qt5 COMPONENTS Widgets Xml REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml ) -qt5_wrap_ui(UIS ${_UIS}) +qt_wrap_ui(UIS ${_UIS}) if(WIN32) set(LIB_TYPE "MODULE") diff --git a/plugins/generic/storagenotesplugin/CMakeLists.txt b/plugins/generic/storagenotesplugin/CMakeLists.txt index 88a12b708..ce89a4801 100644 --- a/plugins/generic/storagenotesplugin/CMakeLists.txt +++ b/plugins/generic/storagenotesplugin/CMakeLists.txt @@ -55,13 +55,13 @@ set( _UIS set( _RSCS ${PLUGIN}.qrc ) -find_package( Qt5 COMPONENTS Widgets Xml REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml ) -qt5_wrap_ui(UIS ${_UIS}) -qt5_add_resources(RSCS ${_RSCS}) +qt_wrap_ui(UIS ${_UIS}) +qt_add_resources(RSCS ${_RSCS}) if(WIN32) set(LIB_TYPE "MODULE") diff --git a/plugins/generic/translateplugin/CMakeLists.txt b/plugins/generic/translateplugin/CMakeLists.txt index 9174e9b5a..76350b639 100644 --- a/plugins/generic/translateplugin/CMakeLists.txt +++ b/plugins/generic/translateplugin/CMakeLists.txt @@ -35,10 +35,10 @@ endif() set( _SRCS ${PLUGIN}.cpp ) -find_package( Qt5 COMPONENTS Widgets Xml REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml ) if(WIN32) diff --git a/plugins/generic/videostatusplugin/CMakeLists.txt b/plugins/generic/videostatusplugin/CMakeLists.txt index 3e7b2c288..58f9c3241 100644 --- a/plugins/generic/videostatusplugin/CMakeLists.txt +++ b/plugins/generic/videostatusplugin/CMakeLists.txt @@ -54,26 +54,31 @@ set( _SRCS set( _UIS options.ui ) -find_package( Qt5 COMPONENTS Widgets Xml REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml ) if( UNIX AND NOT( APPLE OR CYGWIN OR HAIKU ) ) - find_package( Qt5 COMPONENTS DBus X11Extras REQUIRED ) + if(QT_DEFAULT_MAJOR_VERSION GREATER_EQUAL 6) + find_package( Qt6 COMPONENTS Gui REQUIRED ) + list(APPEND QT_DEPLIBS Qt6::Gui) + else() + #find_package( Qt5 COMPONENTS X11Extras REQUIRED ) + #list(APPEND QT_DEPLIBS Qt5::X11Extras) + endif() + find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS DBus REQUIRED ) find_package( XCB REQUIRED ) add_definitions( -DHAVE_DBUS ) - set(QT_DEPLIBS - ${QT_DEPLIBS} - Qt5::DBus - Qt5::X11Extras + list( APPEND QT_DEPLIBS + Qt${QT_DEFAULT_MAJOR_VERSION}::DBus ${XCB_LIBRARY} ) endif() -qt5_wrap_ui(UIS ${_UIS}) +qt_wrap_ui(UIS ${_UIS}) if(WIN32) set(LIB_TYPE "MODULE") diff --git a/plugins/generic/videostatusplugin/videostatusplugin.cpp b/plugins/generic/videostatusplugin/videostatusplugin.cpp index dbb17b5b8..e957a9641 100644 --- a/plugins/generic/videostatusplugin/videostatusplugin.cpp +++ b/plugins/generic/videostatusplugin/videostatusplugin.cpp @@ -212,7 +212,7 @@ bool VideoStatusChanger::enable() if (item.contains("mplayer")) { playerGMPlayer_ = option; } - for (const QString &service : qAsConst(services_)) { + for (const QString &service : std::as_const(services_)) { if (service.contains(item, Qt::CaseInsensitive)) { connectToBus(service); } @@ -247,7 +247,7 @@ bool VideoStatusChanger::disable() fullST.stop(); #ifdef HAVE_DBUS //отключаем прослушку активных плееров - for (const QString &player : qAsConst(services_)) { + for (const QString &player : std::as_const(services_)) { disconnectFromBus(player); } //отключаеся от шины @@ -541,7 +541,11 @@ void VideoStatusChanger::asyncCallFinished(QDBusPendingCallWatcher *watcher) return; } QVariant reply = msg.arguments().constFirst(); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) if (reply.type() != QVariant::Int) { +#else + if (reply.typeId() != QMetaType::Int) { +#endif return; } else { int stat = reply.toInt(); diff --git a/plugins/generic/watcherplugin/CMakeLists.txt b/plugins/generic/watcherplugin/CMakeLists.txt index 0b3f25587..1a1f5ffd3 100644 --- a/plugins/generic/watcherplugin/CMakeLists.txt +++ b/plugins/generic/watcherplugin/CMakeLists.txt @@ -55,13 +55,13 @@ set ( _RSCS resources.qrc ) -find_package( Qt5 COMPONENTS Widgets Xml REQUIRED ) +find_package( Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Widgets Xml REQUIRED ) set(QT_DEPLIBS - Qt5::Widgets - Qt5::Xml + Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets + Qt${QT_DEFAULT_MAJOR_VERSION}::Xml ) -qt5_wrap_ui(UIS ${_UIS}) -qt5_add_resources(RSCS ${_RSCS}) +qt_wrap_ui(UIS ${_UIS}) +qt_add_resources(RSCS ${_RSCS}) if(WIN32) set(LIB_TYPE "MODULE") diff --git a/plugins/variables.cmake.in b/plugins/variables.cmake.in index 6aca16aaf..85b503bfe 100644 --- a/plugins/variables.cmake.in +++ b/plugins/variables.cmake.in @@ -5,3 +5,6 @@ set( MAIN_PROGRAM_NAME "@SHARE_SUFF@" CACHE STRING "Name of main client" ) add_definitions( -DQT_PLUGIN ) include_directories("@plugins_includes_dir@") set(CMAKE_CXX_STANDARD 17) +if("${QT_DEFAULT_MAJOR_VERSION}" STREQUAL "") + set(QT_DEFAULT_MAJOR_VERSION 5) +endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index eb19b720e..fd62099d6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -285,8 +285,6 @@ add_subdirectory(avcall) add_subdirectory(psimedia) add_subdirectory(contactmanager) add_subdirectory(tools) -add_subdirectory(libpsi/dialogs) -add_subdirectory(libpsi/tools) add_subdirectory(widgets) add_subdirectory(sxe) add_subdirectory(whiteboarding) @@ -495,7 +493,6 @@ target_link_libraries(${PROJECT_NAME} ) target_link_libraries(${PROJECT_NAME} - options Certificates psimedia contactmanager @@ -503,11 +500,10 @@ target_link_libraries(${PROJECT_NAME} whiteboarding sxe tools - libpsi_dialogs - libpsi_tools widgets privacy tabs + options AutoUpdater ) diff --git a/src/accountregdlg.cpp b/src/accountregdlg.cpp index 26bc8a55f..a4a981aa8 100644 --- a/src/accountregdlg.cpp +++ b/src/accountregdlg.cpp @@ -104,7 +104,7 @@ void AccountRegDlg::done(int r) { if (ui_.busy->isActive()) { int n = QMessageBox::information(this, tr("Warning"), tr("Are you sure you want to cancel the registration?"), - tr("&Yes"), tr("&No")); + QMessageBox::Yes | QMessageBox::No); if (n != 0) return; } diff --git a/src/avcall/CMakeLists.txt b/src/avcall/CMakeLists.txt index 77546af0a..ad788973e 100644 --- a/src/avcall/CMakeLists.txt +++ b/src/avcall/CMakeLists.txt @@ -34,5 +34,5 @@ set(FORMS qt_wrap_ui(UI_FORMS ${FORMS}) add_library(avcall STATIC ${SOURCES} ${HEADERS} ${UI_FORMS}) add_dependencies(avcall build_ui_files) -target_link_libraries(avcall ${QT_LIBRARIES} ${iris_LIB} libpsi_tools widgets) +target_link_libraries(avcall ${QT_LIBRARIES} ${iris_LIB} tools widgets) target_include_directories(avcall PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/src/avcall/jinglertp.cpp b/src/avcall/jinglertp.cpp index cfee67a88..b6ad00ae3 100644 --- a/src/avcall/jinglertp.cpp +++ b/src/avcall/jinglertp.cpp @@ -601,7 +601,7 @@ class JingleRtpPrivate : public QObject { iceA_status.remotePassword = audioContent->trans.pass; } - printf("audio candidates=%d\n", audioContent->trans.candidates.count()); + printf("audio candidates=%lld\n", qsizetype(audioContent->trans.candidates.count())); iceA_status.remoteCandidates += audioContent->trans.candidates; } if (videoContent) { @@ -610,7 +610,7 @@ class JingleRtpPrivate : public QObject { iceV_status.remotePassword = videoContent->trans.pass; } - printf("video candidates=%d\n", videoContent->trans.candidates.count()); + printf("video candidates=%lld\n", qsizetype(videoContent->trans.candidates.count())); iceV_status.remoteCandidates += videoContent->trans.candidates; } diff --git a/src/chatview_webkit.cpp b/src/chatview_webkit.cpp index a90b126eb..bd96188e4 100644 --- a/src/chatview_webkit.cpp +++ b/src/chatview_webkit.cpp @@ -43,7 +43,6 @@ #include #include -#include #include #include #include @@ -55,7 +54,9 @@ #include #include #ifdef WEBENGINE -#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include +#elif QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) #include #endif #include @@ -223,6 +224,7 @@ class ChatViewJSObject : public ChatViewThemeSession { { QFont f = static_cast(parent())->font(); QString weight = "normal"; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) switch (f.weight()) { case QFont::Light: weight = "lighter"; @@ -231,12 +233,16 @@ class ChatViewJSObject : public ChatViewThemeSession { weight = "bold"; break; case QFont::Bold: + case QFont::ExtraBold: weight = "bolder"; break; case QFont::Black: weight = "900"; break; } +#else + weight = QString::number(f.weight()); +#endif // Workaround. WebKit works only with 96dpi // Need to convert point size to pixel size @@ -387,7 +393,9 @@ ChatView::ChatView(QWidget *parent) : QFrame(parent), d(new ChatViewPrivate) d->jsObject = new ChatViewJSObject(this); /* It's a session bridge between html and c++ part */ d->webView = new WebView(this); d->webView->setFocusPolicy(Qt::NoFocus); + auto page = new ChatViewPage(d->webView); d->webView->setPage(new ChatViewPage(d->webView)); + d->webView->connectPageActions(); d->quoteAction = new QAction(tr("Quote"), this); d->quoteAction->setShortcut(QKeySequence(tr("Ctrl+S"))); @@ -499,14 +507,14 @@ void ChatView::setAccount(PsiAccount *acc) void ChatView::contextMenuEvent(QContextMenuEvent *e) { -#if defined(WEBENGINE) && QT_VERSION < QT_VERSION_CHECK(5, 7, 0) - Q_UNUSED(e) - qDebug("Can't check menu hit point. Calling default handler"); -#else QUrl linkUrl; #ifdef WEBENGINE +#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0) + linkUrl = d->webView->lastContextMenuRequest()->linkUrl(); +#else QWebEngineContextMenuData cmd = d->webView->page()->contextMenuData(); linkUrl = cmd.linkUrl(); +#endif #else linkUrl = d->webView->page()->mainFrame()->hitTestContent(e->pos()).linkUrl(); #endif @@ -514,7 +522,6 @@ void ChatView::contextMenuEvent(QContextMenuEvent *e) emit showNM(linkUrl.path().mid(1)); e->accept(); } -#endif } bool ChatView::focusNextPrevChild(bool next) { return QWidget::focusNextPrevChild(next); } diff --git a/src/chatviewtheme.cpp b/src/chatviewtheme.cpp index f28208803..53d76980e 100644 --- a/src/chatviewtheme.cpp +++ b/src/chatviewtheme.cpp @@ -19,7 +19,6 @@ #include "chatviewtheme.h" -#include "avatars.h" #include "chatviewtheme_p.h" #include "chatviewthemeprovider.h" #include "chatviewthemeprovider_priv.h" @@ -39,7 +38,6 @@ #include #include #include -#include #ifdef WEBENGINE #include #include @@ -613,7 +611,7 @@ QString ChatViewThemeJSUtil::formatDate(const QDateTime &dt, const QString &form QString ChatViewThemeJSUtil::strftime(const QDateTime &dt, const QString &format) const { char str[256]; - time_t t = dt.toTime_t(); + time_t t = dt.toSecsSinceEpoch(); int s = int(::strftime(str, 256, format.toLocal8Bit(), localtime(&t))); if (s) { return QString::fromLocal8Bit(str, s); diff --git a/src/chatviewtheme_p.h b/src/chatviewtheme_p.h index 113c01b5a..6f70ac20f 100644 --- a/src/chatviewtheme_p.h +++ b/src/chatviewtheme_p.h @@ -45,7 +45,7 @@ class ChatViewJSLoader : public QObject { QHash _sessions; Q_PROPERTY(QString themeId READ themeId CONSTANT) - Q_PROPERTY(QString isMuc READ isMuc CONSTANT) + Q_PROPERTY(bool isMuc READ isMuc CONSTANT) Q_PROPERTY(QString serverUrl READ serverUrl CONSTANT) signals: diff --git a/src/coloropt.cpp b/src/coloropt.cpp index e71a1c969..12f078945 100644 --- a/src/coloropt.cpp +++ b/src/coloropt.cpp @@ -94,9 +94,9 @@ ColorOpt *ColorOpt::instance() { if (!instance_) instance_.reset(new ColorOpt()); - return instance_.data(); + return instance_.get(); } void ColorOpt::reset() { instance_.reset(nullptr); } -QScopedPointer ColorOpt::instance_; +std::unique_ptr ColorOpt::instance_; diff --git a/src/coloropt.h b/src/coloropt.h index 4ce4d94e2..7150940ea 100644 --- a/src/coloropt.h +++ b/src/coloropt.h @@ -52,6 +52,6 @@ private slots: void optionChanged(const QString &opt); private: - static QScopedPointer instance_; - QHash colors; + static std::unique_ptr instance_; + QHash colors; }; diff --git a/src/contactlistdragview.cpp b/src/contactlistdragview.cpp index 657159178..cb5896e85 100644 --- a/src/contactlistdragview.cpp +++ b/src/contactlistdragview.cpp @@ -301,14 +301,22 @@ bool ContactListDragView::supportsDropOnIndex(QDropEvent *e, const QModelIndex & static void updateDefaultDropAction(QDropEvent *e) { +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) if (e->keyboardModifiers() == Qt::NoModifier) { +#else + if (e->modifiers() == Qt::NoModifier) { +#endif e->setDropAction(Qt::MoveAction); } } static void acceptDropAction(QDropEvent *e) { +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) if (e->keyboardModifiers() == Qt::NoModifier) { +#else + if (e->modifiers() == Qt::NoModifier) { +#endif if (e->dropAction() != Qt::MoveAction) { // qWarning("acceptDropAction(): e->dropAction() != Qt::MoveAction"); return; @@ -322,7 +330,11 @@ static void acceptDropAction(QDropEvent *e) void ContactListDragView::dragMoveEvent(QDragMoveEvent *e) { - QModelIndex index = indexAt(e->pos()); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + QModelIndex index = indexAt(e->pos()); +#else + QModelIndex index = indexAt(e->position().toPoint()); +#endif dropIndicatorRect_ = QRect(); dropIndicatorPosition_ = OnViewport; @@ -373,7 +385,11 @@ void ContactListDragView::dropEvent(QDropEvent *e) { updateDefaultDropAction(e); - QModelIndex index = indexAt(e->pos()); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + QModelIndex index = indexAt(e->pos()); +#else + QModelIndex index = indexAt(e->position().toPoint()); +#endif dropIndicatorRect_ = QRect(); if (dropIndicatorPosition_ == OnViewport || !supportsDropOnIndex(e, index)) { @@ -409,7 +425,11 @@ QAbstractItemView::DropIndicatorPosition ContactListDragView::dropPosition(QDrop QModelIndex group = itemToReorderGroup(selection, index); if (group.isValid()) { QRect rect = groupVisualRect(group); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) if (e->pos().y() >= rect.center().y()) { +#else + if (e->position().toPoint().y() >= rect.center().y()) { +#endif return BelowItem; } else { return AboveItem; diff --git a/src/contactlistview.cpp b/src/contactlistview.cpp index f6bc2d4b3..36fe70238 100644 --- a/src/contactlistview.cpp +++ b/src/contactlistview.cpp @@ -251,7 +251,11 @@ void ContactListView::keyPressEvent(QKeyEvent *event) if (item->isGroup()) { toggleExpandedState(currentIndex()); } else { +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) QContextMenuEvent e(QContextMenuEvent::Keyboard, visualRect(currentIndex()).center()); +#else + QContextMenuEvent e(QContextMenuEvent::Keyboard, visualRect(currentIndex()).center(), QCursor::pos()); +#endif QCoreApplication::sendEvent(this, &e); } } else { diff --git a/src/contactlistviewdelegate.cpp b/src/contactlistviewdelegate.cpp index 3e573c7e4..efb39da36 100644 --- a/src/contactlistviewdelegate.cpp +++ b/src/contactlistviewdelegate.cpp @@ -438,7 +438,11 @@ QPixmap ContactListViewDelegate::Private::statusPixmap(const QModelIndex &index, QVariant alertData = index.data(ContactListModel::AlertPictureRole); QIcon alert; if (alertData.isValid()) { +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) if (alertData.type() == QVariant::Icon) { +#else + if (alertData.typeId() == QMetaType::QIcon) { +#endif alert = qvariant_cast(alertData); } } diff --git a/src/discodlg.cpp b/src/discodlg.cpp index d3e602f9d..95c9f3e05 100644 --- a/src/discodlg.cpp +++ b/src/discodlg.cpp @@ -93,7 +93,12 @@ PsiIcon category2icon(PsiAccount *acc, const Jid &jid, const QString &category, if (acc->bookmarkManager()->isBookmarked(jid)) { static QImage img; if (img.isNull()) { - auto is = int(qApp->fontMetrics().height() * EqTextIconK + .5); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + const auto fontSize = qApp->fontMetrics().height(); +#else + const auto fontSize = QFontMetrics(qApp->font()).height(); +#endif + auto is = int(fontSize * EqTextIconK + .5); img = icon.pixmap(QSize(is, is)).toImage(); QPainter p(&img); PsiIcon bicon = IconsetFactory::icon("psi/bookmark_remove"); diff --git a/src/edbsqlite.cpp b/src/edbsqlite.cpp index 5f00eae73..2dc03bbcf 100644 --- a/src/edbsqlite.cpp +++ b/src/edbsqlite.cpp @@ -472,10 +472,17 @@ bool EDBSqLite::appendEvent(const QString &accId, const XMPP::Jid &jid, const Ps } query->bindValue(":extra_data", extraData); } else { +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) query->bindValue(":subject", QVariant(QVariant::String)); query->bindValue(":m_text", QVariant(QVariant::String)); query->bindValue(":lang", QVariant(QVariant::String)); query->bindValue(":extra_data", QVariant(QVariant::String)); +#else + query->bindValue(":subject", QVariant(QMetaType::fromType())); + query->bindValue(":m_text", QVariant(QMetaType::fromType())); + query->bindValue(":lang", QVariant(QMetaType::fromType())); + query->bindValue(":extra_data", QVariant(QMetaType::fromType())); +#endif } bool res = query->exec(); return res; diff --git a/src/filesharingdownloader.cpp b/src/filesharingdownloader.cpp index 852a503ab..7835c124a 100644 --- a/src/filesharingdownloader.cpp +++ b/src/filesharingdownloader.cpp @@ -400,7 +400,7 @@ class FileShareDownloader::Private : public QObject { Jingle::FileTransfer::File file; QList jids; QStringList uris; // sorted from low priority to high. - QScopedPointer tmpFile; + std::unique_ptr tmpFile; QString dstFileName; QString lastError; qint64 rangeStart = 0; diff --git a/src/filesharingdownloader.h b/src/filesharingdownloader.h index b32000d72..d2decf02a 100644 --- a/src/filesharingdownloader.h +++ b/src/filesharingdownloader.h @@ -20,6 +20,7 @@ #pragma once #include +#include class PsiAccount; @@ -71,5 +72,5 @@ class FileShareDownloader : public QIODevice { private: class Private; - QScopedPointer d; + std::unique_ptr d; }; diff --git a/src/filesharinghttpproxy.cpp b/src/filesharinghttpproxy.cpp index 092dd1f0f..37caf05f6 100644 --- a/src/filesharinghttpproxy.cpp +++ b/src/filesharinghttpproxy.cpp @@ -153,7 +153,7 @@ void FileSharingHttpProxy::setupHeaders(qint64 fileSize, QString contentType, QD { if (lastModified.isValid()) response->addHeader("Last-Modified", lastModified.toString(Qt::RFC2822Date).toLatin1()); - if (contentType.count()) + if (contentType.size()) response->addHeader("Content-Type", contentType.toLatin1()); bool keepAlive = true; @@ -291,7 +291,7 @@ void FileSharingHttpProxy::transfer() } else { response->write(data); } - qDebug("FSP transferred %d bytes of %lld bytes", data.size(), toTransfer); + qDebug("FSP transferred %lld bytes of %lld bytes", data.size(), toTransfer); } else { qDebug("FSP we have to wait for readyRead or disconnected"); } diff --git a/src/filesharingmanager.h b/src/filesharingmanager.h index a3523c47e..35e5c3ca5 100644 --- a/src/filesharingmanager.h +++ b/src/filesharingmanager.h @@ -98,7 +98,7 @@ public slots: private: class Private; - QScopedPointer d; + std::unique_ptr d; }; class FileSharingDeviceOpener : public ITEMediaOpener { diff --git a/src/filesharingnamproxy.cpp b/src/filesharingnamproxy.cpp index 2f8669160..208f2d4f8 100644 --- a/src/filesharingnamproxy.cpp +++ b/src/filesharingnamproxy.cpp @@ -154,7 +154,7 @@ void FileSharingNAMReply::setupHeaders(qint64 fileSize, QString contentType, QDa { if (lastModified.isValid()) setRawHeader("Last-Modified", lastModified.toString(Qt::RFC2822Date).toLatin1()); - if (contentType.count()) + if (contentType.size()) setRawHeader("Content-Type", contentType.toLatin1()); bool keepAlive = true; diff --git a/src/filetransdlg.cpp b/src/filetransdlg.cpp index 742be8306..5055d767e 100644 --- a/src/filetransdlg.cpp +++ b/src/filetransdlg.cpp @@ -649,7 +649,7 @@ void FileRequestDlg::done(int r) { if (busy->isActive()) { int n = QMessageBox::information(this, tr("Warning"), tr("Are you sure you want to cancel the transfer?"), - tr("&Yes"), tr("&No")); + QMessageBox::Yes | QMessageBox::No); if (n != 0) return; diff --git a/src/groupchattopicdlg.cpp b/src/groupchattopicdlg.cpp index 6c22d598a..270b48b1a 100644 --- a/src/groupchattopicdlg.cpp +++ b/src/groupchattopicdlg.cpp @@ -15,7 +15,7 @@ GroupchatTopicDlg::GroupchatTopicDlg(GCMainDlg *parent) : m_ui->setupUi(this); QKeySequence sendKey = ShortcutManager::instance()->shortcut("chat.send"); if (sendKey == QKeySequence(Qt::Key_Enter) || sendKey == QKeySequence(Qt::Key_Return)) { - sendKey = QKeySequence(Qt::CTRL + Qt::Key_Return); + sendKey = QKeySequence(Qt::CTRL | Qt::Key_Return); } m_ui->buttonBox->button(QDialogButtonBox::Ok)->setShortcut(sendKey); @@ -139,7 +139,11 @@ void GroupchatTopicDlg::populateCountryAndScript() for (auto const &loc : locales) { if (loc != QLocale::c()) { scripts.insert(QLocale::scriptToString(loc.script()), loc.script()); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) countries.insert(QLocale::countryToString(loc.country()), loc.country()); +#else + countries.insert(QLocale::territoryToString(loc.territory()), loc.territory()); +#endif } } m_addLangUi->cmbScript->setVisible(scripts.count() > 1); diff --git a/src/infodlg.cpp b/src/infodlg.cpp index 8bb8bd141..47505490b 100644 --- a/src/infodlg.cpp +++ b/src/infodlg.cpp @@ -358,7 +358,7 @@ bool InfoWidget::aboutToClose() ? tr("You have not published conference information changes.\nAre you sure you want to discard them?") : tr("You have not published your account information changes.\nAre you sure you want to discard " "them?"), - tr("Close and discard"), tr("Don't close")); + QMessageBox::Discard | QMessageBox::No); if (n != 0) { return false; } diff --git a/src/jsutil.cpp b/src/jsutil.cpp index 99ccd4b1e..0f51da503 100644 --- a/src/jsutil.cpp +++ b/src/jsutil.cpp @@ -26,14 +26,24 @@ QString JSUtil::variant2js(const QVariant &value) { QString strVal; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) switch (value.type()) { case QVariant::String: case QVariant::Color: +#else + switch (value.typeId()) { + case QMetaType::QString: + case QMetaType::QColor: +#endif strVal = value.toString(); escapeString(strVal); strVal = QString("\"%1\"").arg(strVal); break; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) case QVariant::StringList: { +#else + case QMetaType::QStringList: { +#endif QStringList sl = value.toStringList(); for (int i = 0; i < sl.count(); i++) { escapeString(sl[i]); @@ -41,7 +51,11 @@ QString JSUtil::variant2js(const QVariant &value) } strVal = QString("[%1]").arg(sl.join(",")); } break; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) case QVariant::List: { +#else + case QMetaType::QVariantList: { +#endif QStringList sl; auto vl = value.toList(); sl.reserve(vl.size()); @@ -50,13 +64,25 @@ QString JSUtil::variant2js(const QVariant &value) } strVal = QString("[%1]").arg(sl.join(",")); } break; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) case QVariant::DateTime: +#else + case QMetaType::QDateTime: +#endif strVal = QString("new Date(%1)").arg(value.toDateTime().toString("yyyy,M-1,d,h,m,s")); break; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) case QVariant::Date: +#else + case QMetaType::QDate: +#endif strVal = QString("new Date(%1)").arg(value.toDate().toString("yyyy,M-1,d")); break; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) case QVariant::Map: +#else + case QMetaType::QVariantMap: +#endif strVal = QString::fromUtf8(QJsonDocument::fromVariant(value).toJson(QJsonDocument::Compact)); break; default: diff --git a/src/libpsi/dialogs/CMakeLists.txt b/src/libpsi/dialogs/CMakeLists.txt deleted file mode 100644 index 7b34c3efa..000000000 --- a/src/libpsi/dialogs/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -unset(HEADERS) -unset(FORMS) -unset(SOURCES) -unset(UI_FORMS) -unset(EXTRA_LDFLAGS) - -include_directories(libpsi/dialogs) - -list(APPEND HEADERS - grepshortcutkeydialog.h - ) - -list(APPEND SOURCES - grepshortcutkeydialog.cpp - ) - -list(APPEND FORMS - grepshortcutkeydialog.ui - ) - -qt_wrap_ui(UI_FORMS ${FORMS}) -add_library(libpsi_dialogs STATIC ${HEADERS} ${SOURCES} ${UI_FORMS}) -target_link_libraries(libpsi_dialogs ${QT_LIBRARIES}) -target_include_directories(libpsi_dialogs PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/src/libpsi/tools/zip/minizip/ioapi.h b/src/libpsi/tools/zip/minizip/ioapi.h deleted file mode 100644 index 544a0e992..000000000 --- a/src/libpsi/tools/zip/minizip/ioapi.h +++ /dev/null @@ -1,213 +0,0 @@ -/* ioapi.h -- IO base function header for compress/uncompress .zip - part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) - - Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) - - Modifications for Zip64 support - Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - - For more info read MiniZip_info.txt - - Changes - - Oct-2009 - Defined ZPOS64_T to fpos_t on windows and u_int64_t on linux. (might need to find a better why for this) - Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would work on linux. - More if/def section may be needed to support other platforms - Oct-2009 - Defined fxxxx64 calls to normal fopen/ftell/fseek so they would compile on windows. - (but you should use iowin32.c for windows instead) - -*/ - -#ifndef _ZLIBIOAPI64_H -#define _ZLIBIOAPI64_H - -#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) - - // Linux needs this to support file operation on files larger then 4+GB - // But might need better if/def to select just the platforms that needs them. - - #ifndef __USE_FILE_OFFSET64 - #define __USE_FILE_OFFSET64 - #endif - #ifndef __USE_LARGEFILE64 - #define __USE_LARGEFILE64 - #endif - #ifndef _LARGEFILE64_SOURCE - #define _LARGEFILE64_SOURCE - #endif - #ifndef _FILE_OFFSET_BIT - #define _FILE_OFFSET_BIT 64 - #endif - -#endif - -#include -#include -#include "zlib.h" - -#if defined(USE_FILE32API) || defined(__HAIKU__) -#define fopen64 fopen -#define ftello64 ftell -#define fseeko64 fseek -#else -#ifdef __FreeBSD__ -#define fopen64 fopen -#define ftello64 ftello -#define fseeko64 fseeko -#endif -#ifdef _MSC_VER - #define fopen64 fopen - #if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC))) - #define ftello64 _ftelli64 - #define fseeko64 _fseeki64 - #else // old MSC - #define ftello64 ftell - #define fseeko64 fseek - #endif -#endif -#endif - -/* -#ifndef ZPOS64_T - #ifdef _WIN32 - #define ZPOS64_T fpos_t - #else - #include - #define ZPOS64_T uint64_t - #endif -#endif -*/ - -#ifdef HAVE_MINIZIP64_CONF_H -#include "mz64conf.h" -#endif - -/* a type choosen by DEFINE */ -#ifdef HAVE_64BIT_INT_CUSTOM -typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T; -#else -#ifdef HAS_STDINT_H -#include "stdint.h" -typedef uint64_t ZPOS64_T; -#else - -/* Maximum unsigned 32-bit value used as placeholder for zip64 */ -#define MAXU32 0xffffffff - -#if defined(_MSC_VER) || defined(__BORLANDC__) -typedef unsigned __int64 ZPOS64_T; -#else -typedef unsigned long long int ZPOS64_T; -#endif -#endif -#endif - - - -#ifdef __cplusplus -extern "C" { -#endif - - -#define ZLIB_FILEFUNC_SEEK_CUR (1) -#define ZLIB_FILEFUNC_SEEK_END (2) -#define ZLIB_FILEFUNC_SEEK_SET (0) - -#define ZLIB_FILEFUNC_MODE_READ (1) -#define ZLIB_FILEFUNC_MODE_WRITE (2) -#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) - -#define ZLIB_FILEFUNC_MODE_EXISTING (4) -#define ZLIB_FILEFUNC_MODE_CREATE (8) - - -#ifndef ZCALLBACK - #if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) - #define ZCALLBACK CALLBACK - #else - #define ZCALLBACK - #endif -#endif - - - - -typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); -typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); -typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); -typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); -typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); - -typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); -typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); - - -/* here is the "old" 32 bits structure structure */ -typedef struct zlib_filefunc_def_s -{ - open_file_func zopen_file; - read_file_func zread_file; - write_file_func zwrite_file; - tell_file_func ztell_file; - seek_file_func zseek_file; - close_file_func zclose_file; - testerror_file_func zerror_file; - voidpf opaque; -} zlib_filefunc_def; - -// Workaround for cppcheck error: syntax error -#ifndef ZPOS64_T -typedef unsigned long long int ZPOS64_T; -#endif - -typedef ZPOS64_T (ZCALLBACK *tell64_file_func) OF((voidpf opaque, voidpf stream)); -typedef long (ZCALLBACK *seek64_file_func) OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); -typedef voidpf (ZCALLBACK *open64_file_func) OF((voidpf opaque, const void* filename, int mode)); - -typedef struct zlib_filefunc64_def_s -{ - open64_file_func zopen64_file; - read_file_func zread_file; - write_file_func zwrite_file; - tell64_file_func ztell64_file; - seek64_file_func zseek64_file; - close_file_func zclose_file; - testerror_file_func zerror_file; - voidpf opaque; -} zlib_filefunc64_def; - -void fill_fopen64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def)); -void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); - -/* now internal definition, only for zip.c and unzip.h */ -typedef struct zlib_filefunc64_32_def_s -{ - zlib_filefunc64_def zfile_func64; - open_file_func zopen32_file; - tell_file_func ztell32_file; - seek_file_func zseek32_file; -} zlib_filefunc64_32_def; - - -#define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) -#define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) -//#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream)) -//#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode)) -#define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream)) -#define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream)) - -voidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode)); -long call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin)); -ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream)); - -void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32); - -#define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode))) -#define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream))) -#define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(filestream),(pos),(mode))) - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/libpsi/tools/zip/minizip/zip.h b/src/libpsi/tools/zip/minizip/zip.h deleted file mode 100644 index 8aaebb623..000000000 --- a/src/libpsi/tools/zip/minizip/zip.h +++ /dev/null @@ -1,362 +0,0 @@ -/* zip.h -- IO on .zip files using zlib - Version 1.1, February 14h, 2010 - part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) - - Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) - - Modifications for Zip64 support - Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - - For more info read MiniZip_info.txt - - --------------------------------------------------------------------------- - - Condition of use and distribution are the same than zlib : - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - --------------------------------------------------------------------------- - - Changes - - See header of zip.h - -*/ - -#ifndef _zip12_H -#define _zip12_H - -#ifdef __cplusplus -extern "C" { -#endif - -//#define HAVE_BZIP2 - -#ifndef _ZLIB_H -#include "zlib.h" -#endif - -#ifndef _ZLIBIOAPI_H -#include "ioapi.h" -#endif - -#ifdef HAVE_BZIP2 -#include "bzlib.h" -#endif - -#define Z_BZIP2ED 12 - -#if defined(STRICTZIP) || defined(STRICTZIPUNZIP) -/* like the STRICT of WIN32, we define a pointer that cannot be converted - from (void*) without cast */ -typedef struct TagzipFile__ { int unused; } zipFile__; -typedef zipFile__ *zipFile; -#else -typedef voidp zipFile; -#endif - -#define ZIP_OK (0) -#define ZIP_EOF (0) -#define ZIP_ERRNO (Z_ERRNO) -#define ZIP_PARAMERROR (-102) -#define ZIP_BADZIPFILE (-103) -#define ZIP_INTERNALERROR (-104) - -#ifndef DEF_MEM_LEVEL -# if MAX_MEM_LEVEL >= 8 -# define DEF_MEM_LEVEL 8 -# else -# define DEF_MEM_LEVEL MAX_MEM_LEVEL -# endif -#endif -/* default memLevel */ - -/* tm_zip contain date/time info */ -typedef struct tm_zip_s -{ - uInt tm_sec; /* seconds after the minute - [0,59] */ - uInt tm_min; /* minutes after the hour - [0,59] */ - uInt tm_hour; /* hours since midnight - [0,23] */ - uInt tm_mday; /* day of the month - [1,31] */ - uInt tm_mon; /* months since January - [0,11] */ - uInt tm_year; /* years - [1980..2044] */ -} tm_zip; - -typedef struct -{ - tm_zip tmz_date; /* date in understandable format */ - uLong dosDate; /* if dos_date == 0, tmu_date is used */ -/* uLong flag; */ /* general purpose bit flag 2 bytes */ - - uLong internal_fa; /* internal file attributes 2 bytes */ - uLong external_fa; /* external file attributes 4 bytes */ -} zip_fileinfo; - -typedef const char* zipcharpc; - - -#define APPEND_STATUS_CREATE (0) -#define APPEND_STATUS_CREATEAFTER (1) -#define APPEND_STATUS_ADDINZIP (2) - -extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append)); -extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append)); -/* - Create a zipfile. - pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on - an Unix computer "zlib/zlib113.zip". - if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip - will be created at the end of the file. - (useful if the file contain a self extractor code) - if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will - add files in existing zip (be sure you don't add file that doesn't exist) - If the zipfile cannot be opened, the return value is NULL. - Else, the return value is a zipFile Handle, usable with other function - of this zip package. -*/ - -/* Note : there is no delete function into a zipfile. - If you want delete file into a zipfile, you must open a zipfile, and create another - Of couse, you can use RAW reading and writing to copy the file you did not want delte -*/ - -extern zipFile ZEXPORT zipOpen2 OF((const char *pathname, - int append, - zipcharpc* globalcomment, - zlib_filefunc_def* pzlib_filefunc_def)); - -extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname, - int append, - zipcharpc* globalcomment, - zlib_filefunc64_def* pzlib_filefunc_def)); - -extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level)); - -extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level, - int zip64)); - -/* - Open a file in the ZIP for writing. - filename : the filename in zip (if NULL, '-' without quote will be used - *zipfi contain supplemental information - if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local - contains the extrafield data the the local header - if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global - contains the extrafield data the the local header - if comment != NULL, comment contain the comment string - method contain the compression method (0 for store, Z_DEFLATED for deflate) - level contain the level of compression (can be Z_DEFAULT_COMPRESSION) - zip64 is set to 1 if a zip64 extended information block should be added to the local file header. - this MUST be '1' if the uncompressed size is >= 0xffffffff. - -*/ - - -extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level, - int raw)); - - -extern int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level, - int raw, - int zip64)); -/* - Same than zipOpenNewFileInZip, except if raw=1, we write raw file - */ - -extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level, - int raw, - int windowBits, - int memLevel, - int strategy, - const char* password, - uLong crcForCrypting)); - -extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level, - int raw, - int windowBits, - int memLevel, - int strategy, - const char* password, - uLong crcForCrypting, - int zip64 - )); - -/* - Same than zipOpenNewFileInZip2, except - windowBits,memLevel,,strategy : see parameter strategy in deflateInit2 - password : crypting password (NULL for no crypting) - crcForCrypting : crc of file to compress (needed for crypting) - */ - -extern int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level, - int raw, - int windowBits, - int memLevel, - int strategy, - const char* password, - uLong crcForCrypting, - uLong versionMadeBy, - uLong flagBase - )); - - -extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level, - int raw, - int windowBits, - int memLevel, - int strategy, - const char* password, - uLong crcForCrypting, - uLong versionMadeBy, - uLong flagBase, - int zip64 - )); -/* - Same than zipOpenNewFileInZip4, except - versionMadeBy : value for Version made by field - flag : value for flag field (compression level info will be added) - */ - - -extern int ZEXPORT zipWriteInFileInZip OF((zipFile file, - const void* buf, - unsigned len)); -/* - Write data in the zipfile -*/ - -extern int ZEXPORT zipCloseFileInZip OF((zipFile file)); -/* - Close the current file in the zipfile -*/ - -extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file, - uLong uncompressed_size, - uLong crc32)); - -extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file, - ZPOS64_T uncompressed_size, - uLong crc32)); - -/* - Close the current file in the zipfile, for file opened with - parameter raw=1 in zipOpenNewFileInZip2 - uncompressed_size and crc32 are value for the uncompressed size -*/ - -extern int ZEXPORT zipClose OF((zipFile file, - const char* global_comment)); -/* - Close the zipfile -*/ - - -extern int ZEXPORT zipRemoveExtraInfoBlock OF((char* pData, int* dataLen, short sHeader)); -/* - zipRemoveExtraInfoBlock - Added by Mathias Svensson - - Remove extra information block from a extra information data for the local file header or central directory header - - It is needed to remove ZIP64 extra information blocks when before data is written if using RAW mode. - - 0x0001 is the signature header for the ZIP64 extra information blocks - - usage. - Remove ZIP64 Extra information from a central director extra field data - zipRemoveExtraInfoBlock(pCenDirExtraFieldData, &nCenDirExtraFieldDataLen, 0x0001); - - Remove ZIP64 Extra information from a Local File Header extra field data - zipRemoveExtraInfoBlock(pLocalHeaderExtraFieldData, &nLocalHeaderExtraFieldDataLen, 0x0001); -*/ - -#ifdef __cplusplus -} -#endif - -#endif /* _zip64_H */ diff --git a/src/main.cpp b/src/main.cpp index d3153c8c9..caac750e1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -204,9 +204,9 @@ void PsiMain::chooseProfile() PsiIconset::instance()->loadSystem(); while (1) { - QScopedPointer w(new ProfileOpenDlg(lastProfile, - TranslationManager::instance()->availableTranslations(), - TranslationManager::instance()->currentLanguage())); + std::unique_ptr w(new ProfileOpenDlg(lastProfile, + TranslationManager::instance()->availableTranslations(), + TranslationManager::instance()->currentLanguage())); w->ck_auto->setChecked(autoOpen); int r = w->exec(); // lang change diff --git a/src/messageview.h b/src/messageview.h index 63f5f56c9..c00715da0 100644 --- a/src/messageview.h +++ b/src/messageview.h @@ -26,16 +26,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) -#define SET_QFLAG(flags, flag, state) \ - if (state) \ - flags |= flag; \ - else \ - flags &= ~flag -#else -#define SET_QFLAG(flags, flag, state) flags.setFlag(flag, state) -#endif - class MessageView { public: enum Type { @@ -96,19 +86,19 @@ class MessageView { inline const Flags &flags() const { return _flags; } - inline void setAlert(bool state = true) { SET_QFLAG(_flags, Alert, state); } + inline void setAlert(bool state = true) { _flags.setFlag(Alert, state); } inline bool isAlert() const { return bool(_flags & Alert); } - inline void setLocal(bool state = true) { SET_QFLAG(_flags, Local, state); } + inline void setLocal(bool state = true) { _flags.setFlag(Local, state); } inline bool isLocal() const { return bool(_flags & Local); } - inline void setEmote(bool state = true) { SET_QFLAG(_flags, Emote, state); } + inline void setEmote(bool state = true) { _flags.setFlag(Emote, state); } inline bool isEmote() const { return bool(_flags & Emote); } - inline void setSpooled(bool state = true) { SET_QFLAG(_flags, Spooled, state); } + inline void setSpooled(bool state = true) { _flags.setFlag(Spooled, state); } inline bool isSpooled() const { return bool(_flags & Spooled); } - inline void setAwaitingReceipt(bool b = true) { SET_QFLAG(_flags, AwaitingReceipt, b); } + inline void setAwaitingReceipt(bool b = true) { _flags.setFlag(AwaitingReceipt, b); } inline bool isAwaitingReceipt() const { return bool(_flags & AwaitingReceipt); } - inline void setStatusChangeHidden(bool b = true) { SET_QFLAG(_flags, HideStatusChange, b); } + inline void setStatusChangeHidden(bool b = true) { _flags.setFlag(HideStatusChange, b); } inline bool isStatusChangeHidden() const { return bool(_flags & HideStatusChange); } - inline void setJoinLeaveHidden(bool b = true) { SET_QFLAG(_flags, HideJoinLeave, b); } + inline void setJoinLeaveHidden(bool b = true) { _flags.setFlag(HideJoinLeave, b); } inline bool isJoinLeaveHidden() const { return bool(_flags & HideJoinLeave); } inline void setStatus(int s) { _status = s; } diff --git a/src/mucconfigdlg.cpp b/src/mucconfigdlg.cpp index 3e53cb15f..fb5126e0b 100644 --- a/src/mucconfigdlg.cpp +++ b/src/mucconfigdlg.cpp @@ -224,7 +224,8 @@ void MUCConfigDlg::apply() void MUCConfigDlg::destroy() { int i = QMessageBox::warning(this, tr("Destroy room"), - tr("Are you absolutely certain you want to destroy this room?"), tr("Yes"), tr("No")); + tr("Are you absolutely certain you want to destroy this room?"), + QMessageBox::Yes | QMessageBox::No); if (i == 0) { manager_->destroy(); } diff --git a/src/multifiletransferdelegate.cpp b/src/multifiletransferdelegate.cpp index 764e31f08..57ed47598 100644 --- a/src/multifiletransferdelegate.cpp +++ b/src/multifiletransferdelegate.cpp @@ -312,7 +312,11 @@ bool MultiFileTransferDelegate::editorEvent(QEvent *event, QAbstractItemModel *m connect(menu->addAction(tr("Open Destination Folder")), &QAction::triggered, this, [model, index]() { model->setData(index, 1, MultiFileTransferModel::OpenDirRole); }); } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) menu->popup(me->globalPos()); +#else + menu->popup(me->globalPosition().toPoint()); +#endif return true; } return false; diff --git a/src/multifiletransferdlg.h b/src/multifiletransferdlg.h index 4b8422cc6..a5117eeb9 100644 --- a/src/multifiletransferdlg.h +++ b/src/multifiletransferdlg.h @@ -21,7 +21,6 @@ #define MULTIFILETRANSFERDLG_H #include -#include class MultiFileTransferItem; class PsiAccount; @@ -83,7 +82,7 @@ class MultiFileTransferDlg : public QDialog { private: Ui::MultiFileTransferDlg *ui; class Private; - QScopedPointer d; + std::unique_ptr d; }; #endif // MULTIFILETRANSFERDLG_H diff --git a/src/multifiletransferitem.h b/src/multifiletransferitem.h index 40058c4f0..10fe6b2da 100644 --- a/src/multifiletransferitem.h +++ b/src/multifiletransferitem.h @@ -21,8 +21,7 @@ #define MULTIFILETRANSFERITEM_H #include "multifiletransfermodel.h" - -#include +#include class MultiFileTransferItem : public QObject { Q_OBJECT @@ -71,7 +70,7 @@ public slots: private: friend class MultiFileTransferModel; struct Private; - QScopedPointer d; + std::unique_ptr d; }; #endif // MULTIFILETRANSFERITEM_H diff --git a/src/options/CMakeLists.txt b/src/options/CMakeLists.txt index 1f71a275d..60a99c713 100644 --- a/src/options/CMakeLists.txt +++ b/src/options/CMakeLists.txt @@ -108,5 +108,5 @@ list(APPEND FORMS qt_wrap_ui(UI_FORMS ${FORMS}) add_library(options STATIC ${SOURCES} ${HEADERS} ${UI_FORMS}) -target_link_libraries(options ${QT_LIBRARIES} tools widgets tabs libpsi_dialogs) +target_link_libraries(options ${QT_LIBRARIES} tools widgets tabs) target_include_directories(options PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/src/options/opt_appearance.cpp b/src/options/opt_appearance.cpp index 42a6b10c5..78b3db638 100644 --- a/src/options/opt_appearance.cpp +++ b/src/options/opt_appearance.cpp @@ -27,7 +27,14 @@ class OptAppearanceUI : public QWidget, public Ui::OptAppearance { class OptAppearanceMiscUI : public QWidget, public Ui::OptAppearanceMisc { public: - OptAppearanceMiscUI() : QWidget() { setupUi(this); } + OptAppearanceMiscUI() : QWidget() + { + // we could do that in UI. but see https://bugreports.qt.io/browse/QTBUG-123373 + QObject::connect(sl_rosterop, &QSlider::valueChanged, lb_rosterop_val, qOverload(&QLabel::setNum)); + QObject::connect(sl_chatdlgop, &QSlider::valueChanged, lb_chatdlgop_val, qOverload(&QLabel::setNum)); + + setupUi(this); + } }; //---------------------------------------------------------------------------- diff --git a/src/options/opt_appearance_misc.ui b/src/options/opt_appearance_misc.ui index 7c1e3f1e5..8cdf33054 100644 --- a/src/options/opt_appearance_misc.ui +++ b/src/options/opt_appearance_misc.ui @@ -1,10 +1,8 @@ - - - - + + OptAppearanceMisc - - + + 0 0 @@ -12,38 +10,38 @@ 189 - + OptAppearanceMiscUI - - - 9 - - + + 6 + + 9 + - - + + Headings - - + + 8 - + 6 - - - + + + Slim group headings - - - + + + Outline headings @@ -52,85 +50,85 @@ - - + + Opacity - - + + 8 - + 6 - - - + + + 10 - + 100 - + Qt::Horizontal - - - + + + 30 0 - + 100 - + Qt::AlignCenter - - - + + + 10 - + 100 - + Qt::Horizontal - - - + + + Roster opacity: - - - + + + 30 0 - + 100 - + Qt::AlignCenter - - - + + + Chat dialog opacity: @@ -140,7 +138,7 @@ - + ck_outlineHeadings ck_newHeadings @@ -148,38 +146,5 @@ sl_chatdlgop - - - sl_rosterop - valueChanged(int) - lb_rosterop_val - setNum(int) - - - 208 - 134 - - - 320 - 134 - - - - - sl_chatdlgop - valueChanged(int) - lb_chatdlgop_val - setNum(int) - - - 208 - 159 - - - 320 - 159 - - - - + diff --git a/src/options/opt_chat.cpp b/src/options/opt_chat.cpp index 6dca8c470..973a6e39e 100644 --- a/src/options/opt_chat.cpp +++ b/src/options/opt_chat.cpp @@ -89,8 +89,8 @@ void OptionsTabChat::applyOptions() if (d->ck_chatSoftReturn->isChecked()) { vl << QVariant::fromValue(QKeySequence(Qt::Key_Enter)) << QVariant::fromValue(QKeySequence(Qt::Key_Return)); } else { - vl << QVariant::fromValue(QKeySequence(Qt::Key_Enter + Qt::CTRL)) - << QVariant::fromValue(QKeySequence(Qt::CTRL + Qt::Key_Return)); + vl << QVariant::fromValue(QKeySequence(Qt::Key_Enter | Qt::CTRL)) + << QVariant::fromValue(QKeySequence(Qt::CTRL | Qt::Key_Return)); } o->setOption("options.shortcuts.chat.send", vl); } diff --git a/src/privacy/CMakeLists.txt b/src/privacy/CMakeLists.txt index 60610d699..3ec20efe6 100644 --- a/src/privacy/CMakeLists.txt +++ b/src/privacy/CMakeLists.txt @@ -33,5 +33,5 @@ list(APPEND FORMS qt_wrap_ui(UI_FORMS ${FORMS}) add_library(privacy STATIC ${SOURCES} ${HEADERS} ${UI_FORMS}) -target_link_libraries(privacy ${QT_LIBRARIES} ${iris_LIB} libpsi_tools widgets tabs) +target_link_libraries(privacy ${QT_LIBRARIES} ${iris_LIB} tools widgets tabs) target_include_directories(privacy PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/src/profiledlg.cpp b/src/profiledlg.cpp index 845654b5f..1563a5fad 100644 --- a/src/profiledlg.cpp +++ b/src/profiledlg.cpp @@ -22,7 +22,6 @@ #include "applicationinfo.h" #include "common.h" #include "iconset.h" -#include "iconwidget.h" #include "profiles.h" #include "psioptions.h" @@ -264,26 +263,28 @@ void ProfileManageDlg::slotProfileDelete() } // prompt first - int r = QMessageBox::warning( - this, CAP(tr("Delete Profile")), - tr("Are you sure you want to delete the \"%1\" profile? " - "This will delete all of the profile's message history as well as associated settings!") - .arg(name), - tr("No, I changed my mind"), tr("Delete it!")); - - if (r != 1) + auto msgBox + = QMessageBox(QMessageBox::Warning, CAP(tr("Delete Profile")), + tr("Are you sure you want to delete the \"%1\" profile? " + "This will delete all of the profile's message history as well as associated settings!") + .arg(name)); + auto rejectButton = msgBox.addButton(tr("No, I changed my mind"), QMessageBox::RejectRole); + auto acceptButton = msgBox.addButton(tr("Delete it!"), QMessageBox::AcceptRole); + msgBox.exec(); + + if (msgBox.clickedButton() != acceptButton) return; - r = QMessageBox::information( + auto r = QMessageBox::information( this, CAP(tr("Delete Profile")), tr("As a precaution, you are being asked one last time if this is what you really want. " "The following folders will be deleted!

\n" "%1

\n" "Proceed?") .arg(paths.join("\n")), - tr("&No"), tr("&Yes")); + QMessageBox::Yes | QMessageBox::No); - if (r == 1) { + if (r == QMessageBox::Yes) { if (!profileDelete(paths)) { QMessageBox::critical( this, CAP("Error"), diff --git a/src/psiaccount.cpp b/src/psiaccount.cpp index 764616564..bccbf523a 100644 --- a/src/psiaccount.cpp +++ b/src/psiaccount.cpp @@ -1314,10 +1314,9 @@ void PsiAccount::setEnabled(bool e) return; } if (isActive()) { - if (QMessageBox::information( - nullptr, tr("Disable Account"), tr("The account is currently active.\nDo you want to log out ?"), - QMessageBox::Yes, - QMessageBox::No | QMessageBox::Default | QMessageBox::Escape | QMessageBox::NoButton) + if (QMessageBox::information(nullptr, tr("Disable Account"), + tr("The account is currently active.\nDo you want to log out ?"), + QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { logout(false, loggedOutStatus()); } else { @@ -6338,16 +6337,14 @@ bool PsiAccount::ensureKey(const Jid &j) } if (akey.isEmpty()) { - int n = QMessageBox::information( - nullptr, CAP(tr("No key")), - tr("

Psi was unable to locate the OpenPGP key to use for %1.
" - "
" - "This can happen if you do not have the key that the contact is advertising " - "via signed presence, or if the contact is not advertising any key at all.

") - .arg(JIDUtil::toString(u->jid(), true)), - tr("&Choose key manually"), tr("Do ¬hing")); - if (n != 0) - return false; + QMessageBox::information(nullptr, CAP(tr("No key")), + tr("

Psi was unable to locate the OpenPGP key to use for %1.
" + "
" + "This can happen if you do not have the key that the contact is advertising " + "via signed presence, or if the contact is not advertising any key at all.

") + .arg(JIDUtil::toString(u->jid(), true)), + QMessageBox::Ok); + return false; } // Select a key diff --git a/src/psicontactlistview.cpp b/src/psicontactlistview.cpp index f2e0e7530..c21e66362 100644 --- a/src/psicontactlistview.cpp +++ b/src/psicontactlistview.cpp @@ -173,7 +173,11 @@ void PsiContactListView::showToolTip(const QModelIndex &index, const QPoint &glo bool PsiContactListView::acceptableDragOperation(QDropEvent *e) { +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) ContactListItem *item = itemProxy(indexAt(e->pos())); +#else + ContactListItem *item = itemProxy(indexAt(e->position().toPoint())); +#endif if (!item) return false; @@ -197,7 +201,11 @@ bool PsiContactListView::acceptableDragOperation(QDropEvent *e) void PsiContactListView::dragEnterEvent(QDragEnterEvent *e) { if (acceptableDragOperation(e)) { +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) setCurrentIndex(indexAt(e->pos())); +#else + setCurrentIndex(indexAt(e->position().toPoint())); +#endif e->acceptProposedAction(); return; } @@ -208,7 +216,11 @@ void PsiContactListView::dragEnterEvent(QDragEnterEvent *e) void PsiContactListView::dragMoveEvent(QDragMoveEvent *e) { if (acceptableDragOperation(e)) { +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) setCurrentIndex(indexAt(e->pos())); +#else + setCurrentIndex(indexAt(e->position().toPoint())); +#endif e->acceptProposedAction(); return; } @@ -218,7 +230,11 @@ void PsiContactListView::dragMoveEvent(QDragMoveEvent *e) void PsiContactListView::dropEvent(QDropEvent *e) { +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) ContactListItem *item = itemProxy(indexAt(e->pos())); +#else + ContactListItem *item = itemProxy(indexAt(e->position().toPoint())); +#endif if (!item) return; diff --git a/src/psidbusnotifier.cpp b/src/psidbusnotifier.cpp index 7eebe47f7..febdec7e7 100644 --- a/src/psidbusnotifier.cpp +++ b/src/psidbusnotifier.cpp @@ -132,7 +132,11 @@ bool PsiDBusNotifier::checkServer() QDBusMessage ret = QDBusConnection::sessionBus().call(m); if (ret.type() != QDBusMessage::InvalidMessage && !ret.arguments().isEmpty()) { QVariant v = ret.arguments().constFirst(); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) if (v.type() == QVariant::StringList) +#else + if (v.typeId() == QMetaType::QStringList) +#endif caps_ = v.toStringList(); } @@ -208,7 +212,12 @@ void PsiDBusNotifier::popup(PsiAccount *account, PopupManager::PopupType type, c } if (im.isNull() && ico) { - im = ico->pixmap(QSize(qApp->fontMetrics().height(), qApp->fontMetrics().height())).toImage(); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + const auto fontSize = qApp->fontMetrics().height(); +#else + const auto fontSize = QFontMetrics(qApp->font()).height(); +#endif + im = ico->pixmap(QSize(fontSize, fontSize)).toImage(); } if (!im.isNull()) { @@ -278,7 +287,7 @@ void PsiDBusNotifier::popup(PsiAccount *account, PopupManager::PopupType type, c QDBusMessage m = createMessage("Notify"); QVariantList args; args << QString(ApplicationInfo::name()); - args << QVariant(QVariant::UInt); + args << quint32(0); args << QVariant(""); args << QString(title); args << QString(text); @@ -323,7 +332,7 @@ void PsiDBusNotifier::popup(PsiAccount *account, PopupManager::PopupType /*type* QDBusMessage m = createMessage("Notify"); QVariantList args; args << QString(ApplicationInfo::name()); - args << QVariant(QVariant::UInt); + args << quint32(0); args << QVariant(""); args << QString(titleText); args << QString(plainText); @@ -351,7 +360,11 @@ void PsiDBusNotifier::asyncCallFinished(QDBusPendingCallWatcher *watcher) } QVariant repl = m.arguments().constFirst(); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) if (repl.type() != QVariant::UInt || repl.toUInt() == 0) { +#else + if (repl.typeId() != QMetaType::UInt || repl.toUInt() == 0) { +#endif readyToDie(); } else { id_ = repl.toUInt(); diff --git a/src/psioptionseditor.cpp b/src/psioptionseditor.cpp index f9cddf1ee..b111348a1 100644 --- a/src/psioptionseditor.cpp +++ b/src/psioptionseditor.cpp @@ -27,21 +27,37 @@ protected slots: protected: struct supportedType { - const char *name; + const char *name; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) QVariant::Type typ; +#else + QMetaType::Type typ; +#endif }; static supportedType supportedTypes[]; }; -OptionEditor::supportedType OptionEditor::supportedTypes[] - = { { "bool", QVariant::Bool }, - { "int", QVariant::Int }, - { "QKeySequence", QVariant::KeySequence }, - { "QSize", QVariant::Size }, - { "QString", QVariant::String }, - { "QColor", QVariant::Color }, - // {"QStringList", QVariant::StringList}, doesn't work - { nullptr, QVariant::Invalid } }; +OptionEditor::supportedType OptionEditor::supportedTypes[] = { +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + { "bool", QVariant::Bool }, + { "int", QVariant::Int }, + { "QKeySequence", QVariant::KeySequence }, + { "QSize", QVariant::Size }, + { "QString", QVariant::String }, + { "QColor", QVariant::Color }, + // {"QStringList", QVariant::StringList}, doesn't work + { nullptr, QVariant::Invalid } +#else + { "bool", QMetaType::Bool }, + { "int", QMetaType::Int }, + { "QKeySequence", QMetaType::QKeySequence }, + { "QSize", QMetaType::QSize }, + { "QString", QMetaType::QString }, + { "QColor", QMetaType::QColor }, + // {"QStringList", QMetaType::QStringList}, doesn't work + { nullptr, QMetaType::Nullptr } +#endif +}; OptionEditor::OptionEditor(bool new_, QString name_, QVariant value_) { @@ -65,7 +81,11 @@ OptionEditor::OptionEditor(bool new_, QString name_, QVariant value_) if (value_.isValid()) { bool ok = false; for (int i = 0; supportedTypes[i].name; i++) { +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) if (value_.type() == supportedTypes[i].typ) { +#else + if (value_.typeId() == supportedTypes[i].typ) { +#endif cb_typ->setCurrentIndex(i); le_value->setText(value_.toString()); ok = true; @@ -92,10 +112,14 @@ void OptionEditor::finished() QMessageBox::Close); return; } - QVariant strval(le_value->text()); - QVariant::Type type = supportedTypes[cb_typ->currentIndex()].typ; - QVariant newval = strval; + QVariant strval(le_value->text()); + auto type = supportedTypes[cb_typ->currentIndex()].typ; + QVariant newval = strval; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) newval.convert(int(type)); +#else + newval.convert(QMetaType(type)); +#endif PsiOptions::instance()->setOption(option, newval); accept(); @@ -228,9 +252,17 @@ void PsiOptionsEditor::tv_edit(const QModelIndex &idx) // QModelIndex idx = tv_->currentIndex(); QString option = tm_->indexToOptionName(tpm_->mapToSource(idx)); QVariant value = PsiOptions::instance()->getOption(option); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) if (value.type() == QVariant::Bool) { +#else + if (value.typeId() == QMetaType::Bool) { +#endif PsiOptions::instance()->setOption(option, QVariant(!value.toBool())); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) } else if (value.type() == QVariant::Color) { +#else + } else if (value.typeId() == QMetaType::QColor) { +#endif QColorDialog cd(this); cd.setCurrentColor(value.value()); if (cd.exec() == QDialog::Accepted) { diff --git a/src/registrationdlg.cpp b/src/registrationdlg.cpp index da54432ea..4f129eb9c 100644 --- a/src/registrationdlg.cpp +++ b/src/registrationdlg.cpp @@ -203,7 +203,7 @@ void RegistrationDlg::done(int r) this, tr("Busy"), tr("Registration has already been submitted, so closing this window will not prevent the registration " "from happening. Do you still wish to close?"), - tr("&Yes"), tr("&No")); + QMessageBox::Yes | QMessageBox::No); if (n != 0) return; } diff --git a/src/svgiconengine.cpp b/src/svgiconengine.cpp index a776a8c8f..f639fd3ce 100644 --- a/src/svgiconengine.cpp +++ b/src/svgiconengine.cpp @@ -115,20 +115,12 @@ QPixmap SvgIconEngine::pixmap(const QSize &size, QIcon::Mode mode, QIcon::State auto img = pm.toImage(); for (int x = 0; x < img.width(); x++) { for (int y = 0; y < img.height(); y++) { -#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0) - QColor c = QColor(img.pixel(x, y)); -#else QColor c = img.pixelColor(x, y); -#endif - auto t = c.alpha(); - auto h = c.hue(); - auto v = c.value(); + auto t = c.alpha(); + auto h = c.hue(); + auto v = c.value(); c.setHsv(h, 0, v, t); -#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0) - img.setPixel(x, y, c.rgba()); -#else img.setPixelColor(x, y, c); -#endif } } pm = QPixmap::fromImage(img); diff --git a/src/sxe/CMakeLists.txt b/src/sxe/CMakeLists.txt index d131ab653..aab4acc0c 100644 --- a/src/sxe/CMakeLists.txt +++ b/src/sxe/CMakeLists.txt @@ -35,4 +35,4 @@ set(HEADERS ) add_library(sxe STATIC ${HEADERS} ${SOURCES}) -target_link_libraries(sxe ${QT_LIBRARIES} ${iris_LIB} libpsi_tools widgets) +target_link_libraries(sxe ${QT_LIBRARIES} ${iris_LIB} tools widgets) diff --git a/src/sxe/sxerecord.cpp b/src/sxe/sxerecord.cpp index 6206e5e88..a4373cb3d 100644 --- a/src/sxe/sxerecord.cpp +++ b/src/sxe/sxerecord.cpp @@ -229,7 +229,7 @@ void SxeRecord::processInOrderRecordEdit(const SxeRecordEdit *edit) if (n < 0) qDebug("'replacen' = '%s' is negative.", qPrintable(edit->value(SxeRecordEdit::ReplaceN))); if (from + n > data_.length()) - qDebug("from (%d) + n (%d) > data_.length() (%d).", from, n, data_.length()); + qDebug("from (%d) + n (%d) > data_.length() (%lld).", from, n, qsizetype(data_.length())); } } else { diff --git a/src/theme_p.cpp b/src/theme_p.cpp index a619d5744..92c7bff7b 100644 --- a/src/theme_p.cpp +++ b/src/theme_p.cpp @@ -124,7 +124,7 @@ class ZipResourceLoader : public Theme::ResourceLoader { QByteArray ba; if (!z.readFile(n, &ba)) { - z.readFile(n.mid(baseName.count()), &ba); + z.readFile(n.mid(baseName.size()), &ba); } return ba; @@ -137,7 +137,7 @@ class ZipResourceLoader : public Theme::ResourceLoader { if (z.fileExists(n)) { return true; } - return z.fileExists(n.mid(baseName.count())); + return z.fileExists(n.mid(baseName.size())); } }; #endif diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index 9f979699a..ad771bd33 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -137,6 +137,8 @@ elseif(LINUX) endif() endif() +include(libpsi_tools.cmake) + add_library(tools STATIC ${SOURCES} ${HEADERS}) target_link_libraries(tools ${QT_LIBRARIES} ${iris_LIB} zip ${EXTRA_LDFLAGS}) target_include_directories(tools PUBLIC diff --git a/src/libpsi/tools/atomicxmlfile/atomicxmlfile.cpp b/src/tools/atomicxmlfile/atomicxmlfile.cpp similarity index 100% rename from src/libpsi/tools/atomicxmlfile/atomicxmlfile.cpp rename to src/tools/atomicxmlfile/atomicxmlfile.cpp diff --git a/src/libpsi/tools/atomicxmlfile/atomicxmlfile.h b/src/tools/atomicxmlfile/atomicxmlfile.h similarity index 100% rename from src/libpsi/tools/atomicxmlfile/atomicxmlfile.h rename to src/tools/atomicxmlfile/atomicxmlfile.h diff --git a/src/libpsi/tools/globalshortcut/NDKeyboardLayout.h b/src/tools/globalshortcut/NDKeyboardLayout.h similarity index 100% rename from src/libpsi/tools/globalshortcut/NDKeyboardLayout.h rename to src/tools/globalshortcut/NDKeyboardLayout.h diff --git a/src/libpsi/tools/globalshortcut/NDKeyboardLayout.m b/src/tools/globalshortcut/NDKeyboardLayout.m similarity index 100% rename from src/libpsi/tools/globalshortcut/NDKeyboardLayout.m rename to src/tools/globalshortcut/NDKeyboardLayout.m diff --git a/src/libpsi/tools/globalshortcut/globalshortcutmanager.cpp b/src/tools/globalshortcut/globalshortcutmanager.cpp similarity index 100% rename from src/libpsi/tools/globalshortcut/globalshortcutmanager.cpp rename to src/tools/globalshortcut/globalshortcutmanager.cpp diff --git a/src/libpsi/tools/globalshortcut/globalshortcutmanager.h b/src/tools/globalshortcut/globalshortcutmanager.h similarity index 100% rename from src/libpsi/tools/globalshortcut/globalshortcutmanager.h rename to src/tools/globalshortcut/globalshortcutmanager.h diff --git a/src/libpsi/tools/globalshortcut/globalshortcutmanager_haiku.cpp b/src/tools/globalshortcut/globalshortcutmanager_haiku.cpp similarity index 100% rename from src/libpsi/tools/globalshortcut/globalshortcutmanager_haiku.cpp rename to src/tools/globalshortcut/globalshortcutmanager_haiku.cpp diff --git a/src/libpsi/tools/globalshortcut/globalshortcutmanager_mac.mm b/src/tools/globalshortcut/globalshortcutmanager_mac.mm similarity index 100% rename from src/libpsi/tools/globalshortcut/globalshortcutmanager_mac.mm rename to src/tools/globalshortcut/globalshortcutmanager_mac.mm diff --git a/src/libpsi/tools/globalshortcut/globalshortcutmanager_stub.cpp b/src/tools/globalshortcut/globalshortcutmanager_stub.cpp similarity index 100% rename from src/libpsi/tools/globalshortcut/globalshortcutmanager_stub.cpp rename to src/tools/globalshortcut/globalshortcutmanager_stub.cpp diff --git a/src/libpsi/tools/globalshortcut/globalshortcutmanager_win.cpp b/src/tools/globalshortcut/globalshortcutmanager_win.cpp similarity index 100% rename from src/libpsi/tools/globalshortcut/globalshortcutmanager_win.cpp rename to src/tools/globalshortcut/globalshortcutmanager_win.cpp diff --git a/src/libpsi/tools/globalshortcut/globalshortcutmanager_x11.cpp b/src/tools/globalshortcut/globalshortcutmanager_x11.cpp similarity index 97% rename from src/libpsi/tools/globalshortcut/globalshortcutmanager_x11.cpp rename to src/tools/globalshortcut/globalshortcutmanager_x11.cpp index 5534a0d13..dd5843a65 100644 --- a/src/libpsi/tools/globalshortcut/globalshortcutmanager_x11.cpp +++ b/src/tools/globalshortcut/globalshortcutmanager_x11.cpp @@ -216,7 +216,13 @@ class X11KeyTriggerManager : public QObject { public: static bool convertKeySequence(const QKeySequence &ks, unsigned int *_mod, Qt_XK_Keygroup *_kg) { - int code = ks[0]; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + auto modifiers = Qt::KeyboardModifiers(ks[0] & Qt::KeyboardModifierMask); + int code = modifiers & ~Qt::KeyboardModifierMask; +#else + auto modifiers = ks[0].keyboardModifiers(); + int code = ks[0].key(); +#endif Qt_XK_Keygroup kg; kg.num = 0; kg.sym[0] = 0; @@ -224,17 +230,15 @@ class X11KeyTriggerManager : public QObject { ensureModifiers(); unsigned int mod = 0; - if (code & Qt::META) + if (modifiers & Qt::MetaModifier) mod |= meta_mask; - if (code & Qt::SHIFT) + if (modifiers & Qt::ShiftModifier) mod |= ShiftMask; - if (code & Qt::CTRL) + if (modifiers & Qt::ControlModifier) mod |= ControlMask; - if (code & Qt::ALT) + if (modifiers & Qt::AltModifier) mod |= alt_mask; - code &= ~Qt::KeyboardModifierMask; - bool found = false; for (int n = 0; qt_xk_table[n].key != Qt::Key_unknown; ++n) { if (qt_xk_table[n].key == code) { diff --git a/src/libpsi/tools/globalshortcut/globalshortcuttrigger.h b/src/tools/globalshortcut/globalshortcuttrigger.h similarity index 100% rename from src/libpsi/tools/globalshortcut/globalshortcuttrigger.h rename to src/tools/globalshortcut/globalshortcuttrigger.h diff --git a/src/libpsi/tools/growlnotifier/ChangeLog b/src/tools/growlnotifier/ChangeLog similarity index 100% rename from src/libpsi/tools/growlnotifier/ChangeLog rename to src/tools/growlnotifier/ChangeLog diff --git a/src/libpsi/tools/growlnotifier/growlnotifier.cpp b/src/tools/growlnotifier/growlnotifier.cpp similarity index 100% rename from src/libpsi/tools/growlnotifier/growlnotifier.cpp rename to src/tools/growlnotifier/growlnotifier.cpp diff --git a/src/libpsi/tools/growlnotifier/growlnotifier.h b/src/tools/growlnotifier/growlnotifier.h similarity index 100% rename from src/libpsi/tools/growlnotifier/growlnotifier.h rename to src/tools/growlnotifier/growlnotifier.h diff --git a/src/libpsi/tools/growlnotifier/growlnotifier.mm b/src/tools/growlnotifier/growlnotifier.mm similarity index 100% rename from src/libpsi/tools/growlnotifier/growlnotifier.mm rename to src/tools/growlnotifier/growlnotifier.mm diff --git a/src/libpsi/tools/growlnotifier/growltest.cpp b/src/tools/growlnotifier/growltest.cpp similarity index 98% rename from src/libpsi/tools/growlnotifier/growltest.cpp rename to src/tools/growlnotifier/growltest.cpp index f715c1d55..a3a62686a 100644 --- a/src/libpsi/tools/growlnotifier/growltest.cpp +++ b/src/tools/growlnotifier/growltest.cpp @@ -83,7 +83,8 @@ GrowlTestWidget::GrowlTestWidget(QWidget *parent) : QWidget(parent) // Initialize GrowlNotifier QStringList nots, defaults; - nots << "Notification 1" << "Notification 2"; + nots << "Notification 1" + << "Notification 2"; defaults << "Notification 1"; growlNotifier = new GrowlNotifier(nots, defaults, "GrowlNotifierTest"); } diff --git a/src/libpsi/tools/idle/idle.cpp b/src/tools/idle/idle.cpp similarity index 100% rename from src/libpsi/tools/idle/idle.cpp rename to src/tools/idle/idle.cpp diff --git a/src/libpsi/tools/idle/idle.h b/src/tools/idle/idle.h similarity index 100% rename from src/libpsi/tools/idle/idle.h rename to src/tools/idle/idle.h diff --git a/src/libpsi/tools/idle/idle_mac.cpp b/src/tools/idle/idle_mac.cpp similarity index 100% rename from src/libpsi/tools/idle/idle_mac.cpp rename to src/tools/idle/idle_mac.cpp diff --git a/src/libpsi/tools/idle/idle_win.cpp b/src/tools/idle/idle_win.cpp similarity index 100% rename from src/libpsi/tools/idle/idle_win.cpp rename to src/tools/idle/idle_win.cpp diff --git a/src/libpsi/tools/idle/idle_x11.cpp b/src/tools/idle/idle_x11.cpp similarity index 88% rename from src/libpsi/tools/idle/idle_x11.cpp rename to src/tools/idle/idle_x11.cpp index d50cc3d45..5cdf6071d 100644 --- a/src/libpsi/tools/idle/idle_x11.cpp +++ b/src/tools/idle/idle_x11.cpp @@ -20,11 +20,14 @@ #include "idle.h" #ifdef HAVE_XSS +#include "x11windowsystem.h" #include -#include +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #include +#else +#include +#endif #include -#include #include static XErrorHandler old_handler = 0; @@ -35,6 +38,16 @@ extern "C" int xerrhandler(Display *dpy, XErrorEvent *err) return (*old_handler)(dpy, err); } + +auto getDisplay() +{ +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + return QX11Info::display(); +#else + auto x11app = qApp->nativeInterface(); + return x11app->display(); +#endif +} #endif // HAVE_XSS #ifdef USE_DBUS @@ -107,7 +120,7 @@ bool IdlePlatform::init() } #endif // USE_DBUS #ifdef HAVE_XSS - if (!QX11Info::isPlatformX11()) + if (!X11WindowSystem::instance()->isValid()) return false; if (d->ss_info) @@ -116,7 +129,7 @@ bool IdlePlatform::init() old_handler = XSetErrorHandler(xerrhandler); int event_base, error_base; - if (XScreenSaverQueryExtension(QX11Info::display(), &event_base, &error_base)) { + if (XScreenSaverQueryExtension(getDisplay(), &event_base, &error_base)) { d->ss_info = XScreenSaverAllocInfo(); return true; } @@ -146,7 +159,7 @@ int IdlePlatform::secondsIdle() if (!d->ss_info) return 0; - if (!XScreenSaverQueryInfo(QX11Info::display(), QX11Info::appRootWindow(), d->ss_info)) + if (!XScreenSaverQueryInfo(getDisplay(), X11WindowSystem::instance()->getDesktopRootWindow(), d->ss_info)) return 0; return d->ss_info->idle / 1000; #endif // HAVE_XSS diff --git a/src/libpsi/tools/iodeviceopener.cpp b/src/tools/iodeviceopener.cpp similarity index 100% rename from src/libpsi/tools/iodeviceopener.cpp rename to src/tools/iodeviceopener.cpp diff --git a/src/libpsi/tools/iodeviceopener.h b/src/tools/iodeviceopener.h similarity index 100% rename from src/libpsi/tools/iodeviceopener.h rename to src/tools/iodeviceopener.h diff --git a/src/libpsi/tools/languagemanager.cpp b/src/tools/languagemanager.cpp similarity index 92% rename from src/libpsi/tools/languagemanager.cpp rename to src/tools/languagemanager.cpp index bec4de426..bbad81a2f 100644 --- a/src/libpsi/tools/languagemanager.cpp +++ b/src/tools/languagemanager.cpp @@ -13,8 +13,12 @@ LanguageManager::LangId LanguageManager::fromString(const QString &langDesc) int cnt = langDesc.count(QRegularExpression("[_-]")); id.language = loc.language(); if (cnt) { +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) id.country = loc.country(); // supposing if there are two components then it's lways country and not script - if (cnt > 1) { // lang_script_country +#else + id.country = loc.territory(); +#endif + if (cnt > 1) { // lang_script_country id.script = loc.script(); } } @@ -89,10 +93,15 @@ QList LanguageManager::bestUiMatch(const QSet class QtCFType { if (type) CFRelease(type); } - inline operator T() { return type; } + inline operator T() { return type; } inline QtCFType operator=(const QtCFType &helper) { if (helper.type) diff --git a/src/libpsi/tools/mac_dock/privateqt_mac.mm b/src/tools/mac_dock/privateqt_mac.mm similarity index 100% rename from src/libpsi/tools/mac_dock/privateqt_mac.mm rename to src/tools/mac_dock/privateqt_mac.mm diff --git a/src/libpsi/tools/maybe.h b/src/tools/maybe.h similarity index 100% rename from src/libpsi/tools/maybe.h rename to src/tools/maybe.h diff --git a/src/tools/optionstree/optionstree.h b/src/tools/optionstree/optionstree.h index a8254e7db..d760e1ceb 100644 --- a/src/tools/optionstree/optionstree.h +++ b/src/tools/optionstree/optionstree.h @@ -21,6 +21,7 @@ #define OPTIONSTREE_H #include "varianttree.h" + #include /** @@ -35,8 +36,8 @@ class OptionsTree : public QObject { OptionsTree(QObject *parent = nullptr); ~OptionsTree(); - QVariant getOption(const QString &name, const QVariant &defaultValue = QVariant::Invalid) const; - inline QVariant getOption(const char *name, const QVariant &defaultValue = QVariant::Invalid) const + QVariant getOption(const QString &name, const QVariant &defaultValue = {}) const; + inline QVariant getOption(const char *name, const QVariant &defaultValue = {}) const { return getOption(QString(QString::fromLatin1(name)), defaultValue); } diff --git a/src/tools/optionstree/optionstreereader.cpp b/src/tools/optionstree/optionstreereader.cpp index 7d5571568..73105cc9b 100644 --- a/src/tools/optionstree/optionstreereader.cpp +++ b/src/tools/optionstree/optionstreereader.cpp @@ -59,38 +59,66 @@ void OptionsTreeReader::readTree(VariantTree *tree) QVariant OptionsTreeReader::readVariant(const QString &type) { QVariant result; - if (type == "QStringList") { + if (type == QLatin1String("QStringList")) { result = readStringList(); - } else if (type == "QVariantList") { + } else if (type == QLatin1String("QVariantList")) { result = readVariantList(); - } else if (type == "QSize") { + } else if (type == QLatin1String("QSize")) { result = readSize(); - } else if (type == "QRect") { + } else if (type == QLatin1String("QRect")) { result = readRect(); - } else if (type == "QByteArray") { + } else if (type == QLatin1String("QByteArray")) { result = QByteArray(); result = QByteArray::fromBase64(readElementText().toLatin1()); } else { - QVariant::Type varianttype; - bool known = true; - - if (type == "QString") { - varianttype = QVariant::String; - } else if (type == "bool") { - varianttype = QVariant::Bool; - } else if (type == "int") { - varianttype = QVariant::Int; - } else if (type == "QKeySequence") { - varianttype = QVariant::KeySequence; - } else if (type == "QColor") { - varianttype = QVariant::Color; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + QVariant::Type variantType; +#else + QMetaType::Type variantType; +#endif + bool known = true; + + if (type == QLatin1String("QString")) { +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + variantType = QVariant::String; +#else + variantType = QMetaType::QString; +#endif + } else if (type == QLatin1String("bool")) { +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + variantType = QVariant::Bool; +#else + variantType = QMetaType::Bool; +#endif + } else if (type == QLatin1String("int")) { +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + variantType = QVariant::Int; +#else + variantType = QMetaType::Int; +#endif + } else if (type == QLatin1String("QKeySequence")) { +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + variantType = QVariant::KeySequence; +#else + variantType = QMetaType::QKeySequence; +#endif + } else if (type == QLatin1String("QColor")) { +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + variantType = QVariant::Color; +#else + variantType = QMetaType::QColor; +#endif } else { known = false; } if (known) { result = readElementText(); - result.convert(int(varianttype)); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + result.convert(int(variantType)); +#else + result.convert(QMetaType(variantType)); +#endif } else { [[maybe_unused]] QString result; QByteArray ba; diff --git a/src/tools/optionstree/optionstreewriter.cpp b/src/tools/optionstree/optionstreewriter.cpp index 5ce42d537..82abe618f 100644 --- a/src/tools/optionstree/optionstreewriter.cpp +++ b/src/tools/optionstree/optionstreewriter.cpp @@ -69,31 +69,55 @@ void OptionsTreeWriter::writeTree(const VariantTree *tree) void OptionsTreeWriter::writeVariant(const QVariant &variant) { writeAttribute("type", variant.typeName()); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) if (variant.type() == QVariant::StringList) { +#else + if (variant.typeId() == QMetaType::QStringList) { +#endif const auto &sList = variant.toStringList(); for (const QString &s : sList) { writeStartElement("item"); writeCharacters(s); writeEndElement(); } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) } else if (variant.type() == QVariant::List) { +#else + } else if (variant.typeId() == QMetaType::QVariantList) { +#endif const auto &variants = variant.toList(); for (const QVariant &v : variants) { writeStartElement("item"); writeVariant(v); writeEndElement(); } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) } else if (variant.type() == QVariant::Size) { +#else + } else if (variant.typeId() == QMetaType::QSize) { +#endif writeTextElement("width", QString::number(variant.toSize().width())); writeTextElement("height", QString::number(variant.toSize().height())); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) } else if (variant.type() == QVariant::Rect) { +#else + } else if (variant.typeId() == QMetaType::QRect) { +#endif writeTextElement("x", QString::number(variant.toRect().x())); writeTextElement("y", QString::number(variant.toRect().y())); writeTextElement("width", QString::number(variant.toRect().width())); writeTextElement("height", QString::number(variant.toRect().height())); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) } else if (variant.type() == QVariant::ByteArray) { +#else + } else if (variant.typeId() == QMetaType::QByteArray) { +#endif writeCharacters(variant.toByteArray().toBase64()); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) } else if (variant.type() == QVariant::KeySequence) { +#else + } else if (variant.typeId() == QMetaType::QKeySequence) { +#endif QKeySequence k = variant.value(); writeCharacters(k.toString()); } else { diff --git a/src/tools/optionstree/varianttree.cpp b/src/tools/optionstree/varianttree.cpp index 830ad85aa..2f5df4367 100644 --- a/src/tools/optionstree/varianttree.cpp +++ b/src/tools/optionstree/varianttree.cpp @@ -388,6 +388,7 @@ QVariant VariantTree::elementToVariant(const QDomElement &e) QString type = e.attribute(typeAttr); { // let's start from basic most popular types +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) QVariant::Type varianttype; bool known = true; @@ -406,6 +407,26 @@ QVariant VariantTree::elementToVariant(const QDomElement &e) } else { known = false; } +#else + QMetaType::Type varianttype; + bool known = true; + + if (type == boolType) { + varianttype = QMetaType::Bool; + } else if (type == stringType) { + varianttype = QMetaType::QString; + } else if (type == intType) { + varianttype = QMetaType::Int; + } else if (type == ulonglongType) { + varianttype = QMetaType::ULongLong; + } else if (type == keyseqType) { + varianttype = QMetaType::QKeySequence; + } else if (type == colorType) { + varianttype = QMetaType::QColor; + } else { + known = false; + } +#endif if (known) { for (QDomNode node = e.firstChild(); !node.isNull(); node = node.nextSibling()) { @@ -415,8 +436,11 @@ QVariant VariantTree::elementToVariant(const QDomElement &e) if (!value.isValid()) value = QString(""); - +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) value.convert(int(varianttype)); +#else + value.convert(QMetaType(varianttype)); +#endif return value; } } @@ -506,8 +530,13 @@ QVariant VariantTree::elementToVariant(const QDomElement &e) */ void VariantTree::variantToElement(const QVariant &var, QDomElement &e) { +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) switch (var.type()) { case QVariant::List: { +#else + switch (var.typeId()) { + case QMetaType::QVariantList: { +#endif const auto &variants = var.toList(); for (const QVariant &v : variants) { QDomElement item_element = e.ownerDocument().createElement(QLatin1String("item")); @@ -516,7 +545,11 @@ void VariantTree::variantToElement(const QVariant &var, QDomElement &e) } break; } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) case QVariant::Map: { +#else + case QMetaType::QVariantMap: { +#endif QVariantMap map = var.toMap(); QVariantMap::ConstIterator it = map.constBegin(); for (; it != map.constEnd(); ++it) { @@ -526,7 +559,11 @@ void VariantTree::variantToElement(const QVariant &var, QDomElement &e) } break; } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) case QVariant::Hash: { +#else + case QMetaType::QVariantHash: { +#endif QVariantHash map = var.toHash(); QVariantHash::ConstIterator it = map.constBegin(); for (; it != map.constEnd(); ++it) { @@ -536,7 +573,11 @@ void VariantTree::variantToElement(const QVariant &var, QDomElement &e) } break; } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) case QVariant::StringList: { +#else + case QMetaType::QStringList: { +#endif const auto &strings = var.toStringList(); for (const QString &s : strings) { QDomElement item_element = e.ownerDocument().createElement(QLatin1String("item")); @@ -546,7 +587,11 @@ void VariantTree::variantToElement(const QVariant &var, QDomElement &e) } break; } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) case QVariant::Size: { +#else + case QMetaType::QSize: { +#endif QSize size = var.toSize(); QDomElement width_element = e.ownerDocument().createElement(QLatin1String("width")); width_element.appendChild(e.ownerDocument().createTextNode(QString::number(size.width()))); @@ -556,7 +601,11 @@ void VariantTree::variantToElement(const QVariant &var, QDomElement &e) e.appendChild(height_element); break; } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) case QVariant::Rect: { +#else + case QMetaType::QRect: { +#endif QRect rect = var.toRect(); QDomElement x_element = e.ownerDocument().createElement(QLatin1String("x")); x_element.appendChild(e.ownerDocument().createTextNode(QString::number(rect.x()))); @@ -572,18 +621,31 @@ void VariantTree::variantToElement(const QVariant &var, QDomElement &e) e.appendChild(height_element); break; } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) case QVariant::ByteArray: { +#else + case QMetaType::QByteArray: { +#endif QDomText text = e.ownerDocument().createTextNode(var.toByteArray().toBase64()); e.appendChild(text); break; } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) case QVariant::KeySequence: { +#else + case QMetaType::QKeySequence: { +#endif QKeySequence k = var.value(); QDomText text = e.ownerDocument().createTextNode(k.toString()); e.appendChild(text); break; } - case QVariant::Color: { // save invalid colors as empty string +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + case QVariant::Color: { +#else + case QMetaType::QColor: { +#endif + // save invalid colors as empty string if (var.value().isValid()) { QDomText text = e.ownerDocument().createTextNode(var.toString()); e.appendChild(text); @@ -600,4 +662,4 @@ void VariantTree::variantToElement(const QVariant &var, QDomElement &e) e.setAttribute(QLatin1String("type"), var.typeName()); } -const QVariant VariantTree::missingValue = QVariant(QVariant::Invalid); +const QVariant VariantTree::missingValue = QVariant(); diff --git a/src/libpsi/tools/priorityvalidator.cpp b/src/tools/priorityvalidator.cpp similarity index 100% rename from src/libpsi/tools/priorityvalidator.cpp rename to src/tools/priorityvalidator.cpp diff --git a/src/libpsi/tools/priorityvalidator.h b/src/tools/priorityvalidator.h similarity index 100% rename from src/libpsi/tools/priorityvalidator.h rename to src/tools/priorityvalidator.h diff --git a/src/libpsi/tools/simplecli/simplecli.cpp b/src/tools/simplecli/simplecli.cpp similarity index 100% rename from src/libpsi/tools/simplecli/simplecli.cpp rename to src/tools/simplecli/simplecli.cpp diff --git a/src/libpsi/tools/simplecli/simplecli.h b/src/tools/simplecli/simplecli.h similarity index 100% rename from src/libpsi/tools/simplecli/simplecli.h rename to src/tools/simplecli/simplecli.h diff --git a/src/libpsi/tools/spellchecker/aspellchecker.cpp b/src/tools/spellchecker/aspellchecker.cpp similarity index 100% rename from src/libpsi/tools/spellchecker/aspellchecker.cpp rename to src/tools/spellchecker/aspellchecker.cpp diff --git a/src/libpsi/tools/spellchecker/aspellchecker.h b/src/tools/spellchecker/aspellchecker.h similarity index 100% rename from src/libpsi/tools/spellchecker/aspellchecker.h rename to src/tools/spellchecker/aspellchecker.h diff --git a/src/libpsi/tools/spellchecker/enchantchecker.cpp b/src/tools/spellchecker/enchantchecker.cpp similarity index 100% rename from src/libpsi/tools/spellchecker/enchantchecker.cpp rename to src/tools/spellchecker/enchantchecker.cpp diff --git a/src/libpsi/tools/spellchecker/enchantchecker.h b/src/tools/spellchecker/enchantchecker.h similarity index 100% rename from src/libpsi/tools/spellchecker/enchantchecker.h rename to src/tools/spellchecker/enchantchecker.h diff --git a/src/libpsi/tools/spellchecker/hunspellchecker.cpp b/src/tools/spellchecker/hunspellchecker.cpp similarity index 100% rename from src/libpsi/tools/spellchecker/hunspellchecker.cpp rename to src/tools/spellchecker/hunspellchecker.cpp diff --git a/src/libpsi/tools/spellchecker/hunspellchecker.h b/src/tools/spellchecker/hunspellchecker.h similarity index 100% rename from src/libpsi/tools/spellchecker/hunspellchecker.h rename to src/tools/spellchecker/hunspellchecker.h diff --git a/src/libpsi/tools/spellchecker/macspellchecker.h b/src/tools/spellchecker/macspellchecker.h similarity index 100% rename from src/libpsi/tools/spellchecker/macspellchecker.h rename to src/tools/spellchecker/macspellchecker.h diff --git a/src/libpsi/tools/spellchecker/macspellchecker.mm b/src/tools/spellchecker/macspellchecker.mm similarity index 100% rename from src/libpsi/tools/spellchecker/macspellchecker.mm rename to src/tools/spellchecker/macspellchecker.mm diff --git a/src/libpsi/tools/spellchecker/spellchecker.cpp b/src/tools/spellchecker/spellchecker.cpp similarity index 100% rename from src/libpsi/tools/spellchecker/spellchecker.cpp rename to src/tools/spellchecker/spellchecker.cpp diff --git a/src/libpsi/tools/spellchecker/spellchecker.h b/src/tools/spellchecker/spellchecker.h similarity index 100% rename from src/libpsi/tools/spellchecker/spellchecker.h rename to src/tools/spellchecker/spellchecker.h diff --git a/src/libpsi/tools/spellchecker/spellhighlighter.cpp b/src/tools/spellchecker/spellhighlighter.cpp similarity index 100% rename from src/libpsi/tools/spellchecker/spellhighlighter.cpp rename to src/tools/spellchecker/spellhighlighter.cpp diff --git a/src/libpsi/tools/spellchecker/spellhighlighter.h b/src/tools/spellchecker/spellhighlighter.h similarity index 100% rename from src/libpsi/tools/spellchecker/spellhighlighter.h rename to src/tools/spellchecker/spellhighlighter.h diff --git a/src/libpsi/tools/systemwatch/systemwatch.cpp b/src/tools/systemwatch/systemwatch.cpp similarity index 100% rename from src/libpsi/tools/systemwatch/systemwatch.cpp rename to src/tools/systemwatch/systemwatch.cpp diff --git a/src/libpsi/tools/systemwatch/systemwatch.h b/src/tools/systemwatch/systemwatch.h similarity index 100% rename from src/libpsi/tools/systemwatch/systemwatch.h rename to src/tools/systemwatch/systemwatch.h diff --git a/src/libpsi/tools/systemwatch/systemwatch_mac.cpp b/src/tools/systemwatch/systemwatch_mac.cpp similarity index 100% rename from src/libpsi/tools/systemwatch/systemwatch_mac.cpp rename to src/tools/systemwatch/systemwatch_mac.cpp diff --git a/src/libpsi/tools/systemwatch/systemwatch_mac.h b/src/tools/systemwatch/systemwatch_mac.h similarity index 100% rename from src/libpsi/tools/systemwatch/systemwatch_mac.h rename to src/tools/systemwatch/systemwatch_mac.h diff --git a/src/libpsi/tools/systemwatch/systemwatch_unix.cpp b/src/tools/systemwatch/systemwatch_unix.cpp similarity index 100% rename from src/libpsi/tools/systemwatch/systemwatch_unix.cpp rename to src/tools/systemwatch/systemwatch_unix.cpp diff --git a/src/libpsi/tools/systemwatch/systemwatch_unix.h b/src/tools/systemwatch/systemwatch_unix.h similarity index 100% rename from src/libpsi/tools/systemwatch/systemwatch_unix.h rename to src/tools/systemwatch/systemwatch_unix.h diff --git a/src/libpsi/tools/systemwatch/systemwatch_win.cpp b/src/tools/systemwatch/systemwatch_win.cpp similarity index 100% rename from src/libpsi/tools/systemwatch/systemwatch_win.cpp rename to src/tools/systemwatch/systemwatch_win.cpp diff --git a/src/libpsi/tools/systemwatch/systemwatch_win.h b/src/tools/systemwatch/systemwatch_win.h similarity index 100% rename from src/libpsi/tools/systemwatch/systemwatch_win.h rename to src/tools/systemwatch/systemwatch_win.h diff --git a/src/libpsi/tools/unittest/iodeviceopenertest.cpp b/src/tools/unittest/iodeviceopenertest.cpp similarity index 100% rename from src/libpsi/tools/unittest/iodeviceopenertest.cpp rename to src/tools/unittest/iodeviceopenertest.cpp diff --git a/src/libpsi/tools/zip/CMakeLists.txt b/src/tools/zip/CMakeLists.txt similarity index 100% rename from src/libpsi/tools/zip/CMakeLists.txt rename to src/tools/zip/CMakeLists.txt diff --git a/src/libpsi/tools/zip/minizip/Makefile b/src/tools/zip/minizip/Makefile similarity index 100% rename from src/libpsi/tools/zip/minizip/Makefile rename to src/tools/zip/minizip/Makefile diff --git a/src/libpsi/tools/zip/minizip/Makefile.am b/src/tools/zip/minizip/Makefile.am similarity index 80% rename from src/libpsi/tools/zip/minizip/Makefile.am rename to src/tools/zip/minizip/Makefile.am index d343011eb..646e3530c 100644 --- a/src/libpsi/tools/zip/minizip/Makefile.am +++ b/src/tools/zip/minizip/Makefile.am @@ -16,22 +16,22 @@ iowin32_h = iowin32.h endif libminizip_la_SOURCES = \ - ioapi.c \ - mztools.c \ - unzip.c \ - zip.c \ - ${iowin32_src} + ioapi.c \ + mztools.c \ + unzip.c \ + zip.c \ + ${iowin32_src} libminizip_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0 -lz minizip_includedir = $(includedir)/minizip minizip_include_HEADERS = \ - crypt.h \ - ioapi.h \ - mztools.h \ - unzip.h \ - zip.h \ - ${iowin32_h} + crypt.h \ + ioapi.h \ + mztools.h \ + unzip.h \ + zip.h \ + ${iowin32_h} pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = minizip.pc diff --git a/src/libpsi/tools/zip/minizip/MiniZip64_Changes.txt b/src/tools/zip/minizip/MiniZip64_Changes.txt similarity index 99% rename from src/libpsi/tools/zip/minizip/MiniZip64_Changes.txt rename to src/tools/zip/minizip/MiniZip64_Changes.txt index 13a1bd91a..b1e0a8d5a 100644 --- a/src/libpsi/tools/zip/minizip/MiniZip64_Changes.txt +++ b/src/tools/zip/minizip/MiniZip64_Changes.txt @@ -3,4 +3,3 @@ MiniZip 1.1 was derrived from MiniZip at version 1.01f Change in 1.0 (Okt 2009) - **TODO - Add history** - diff --git a/src/libpsi/tools/zip/minizip/MiniZip64_info.txt b/src/tools/zip/minizip/MiniZip64_info.txt similarity index 99% rename from src/libpsi/tools/zip/minizip/MiniZip64_info.txt rename to src/tools/zip/minizip/MiniZip64_info.txt index 57d715242..21bb28fe8 100644 --- a/src/libpsi/tools/zip/minizip/MiniZip64_info.txt +++ b/src/tools/zip/minizip/MiniZip64_info.txt @@ -10,7 +10,7 @@ All possible work was done for compatibility. Background --------------------- -When adding ZIP64 support Mathias Svensson found that Even Rouault have added ZIP64 +When adding ZIP64 support Mathias Svensson found that Even Rouault have added ZIP64 support for unzip.c into minizip for a open source project called gdal ( http://www.gdal.org/ ) That was used as a starting point. And after that ZIP64 support was added to zip.c @@ -71,4 +71,3 @@ License 3. This notice may not be removed or altered from any source distribution. ---------------------------------------------------------- - diff --git a/src/libpsi/tools/zip/minizip/configure.ac b/src/tools/zip/minizip/configure.ac similarity index 85% rename from src/libpsi/tools/zip/minizip/configure.ac rename to src/tools/zip/minizip/configure.ac index 5b1197097..d5764e5cd 100644 --- a/src/libpsi/tools/zip/minizip/configure.ac +++ b/src/tools/zip/minizip/configure.ac @@ -11,17 +11,17 @@ AC_ARG_ENABLE([demos], AC_HELP_STRING([--enable-demos], [build example programs] AM_CONDITIONAL([COND_DEMOS], [test "$enable_demos" = yes]) if test "$enable_demos" = yes then - AC_MSG_RESULT([yes]) + AC_MSG_RESULT([yes]) else - AC_MSG_RESULT([no]) + AC_MSG_RESULT([no]) fi case "${host}" in - *-mingw* | mingw*) - WIN32="yes" - ;; - *) - ;; + *-mingw* | mingw*) + WIN32="yes" + ;; + *) + ;; esac AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"]) diff --git a/src/libpsi/tools/zip/minizip/crypt.h b/src/tools/zip/minizip/crypt.h similarity index 52% rename from src/libpsi/tools/zip/minizip/crypt.h rename to src/tools/zip/minizip/crypt.h index 1e9e8200b..28ec19ecf 100644 --- a/src/libpsi/tools/zip/minizip/crypt.h +++ b/src/tools/zip/minizip/crypt.h @@ -27,100 +27,92 @@ Encryption is not supported. */ -#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) +#define CRC32(c, b) ((*(pcrc_32_tab + (((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) /*********************************************************************** * Return the next byte in the pseudo-random sequence */ -static int decrypt_byte(unsigned long* pkeys, const z_crc_t* pcrc_32_tab) +static int decrypt_byte(unsigned long *pkeys, const z_crc_t *pcrc_32_tab) { - unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an - * unpredictable manner on 16-bit systems; not a problem - * with any known compiler so far, though */ + unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an + * unpredictable manner on 16-bit systems; not a problem + * with any known compiler so far, though */ - temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; + temp = ((unsigned)(*(pkeys + 2)) & 0xffff) | 2; return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); } /*********************************************************************** * Update the encryption keys with the next byte of plain text */ -static int update_keys(unsigned long* pkeys,const z_crc_t* pcrc_32_tab,int c) +static int update_keys(unsigned long *pkeys, const z_crc_t *pcrc_32_tab, int c) { - (*(pkeys+0)) = CRC32((*(pkeys+0)), c); - (*(pkeys+1)) += (*(pkeys+0)) & 0xff; - (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; + (*(pkeys + 0)) = CRC32((*(pkeys + 0)), c); + (*(pkeys + 1)) += (*(pkeys + 0)) & 0xff; + (*(pkeys + 1)) = (*(pkeys + 1)) * 134775813L + 1; { - register int keyshift = (int)((*(pkeys+1)) >> 24); - (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift); + register int keyshift = (int)((*(pkeys + 1)) >> 24); + (*(pkeys + 2)) = CRC32((*(pkeys + 2)), keyshift); } return c; } - /*********************************************************************** * Initialize the encryption keys and the random header according to * the given password. */ -static void init_keys(const char* passwd,unsigned long* pkeys,const z_crc_t* pcrc_32_tab) +static void init_keys(const char *passwd, unsigned long *pkeys, const z_crc_t *pcrc_32_tab) { - *(pkeys+0) = 305419896L; - *(pkeys+1) = 591751049L; - *(pkeys+2) = 878082192L; + *(pkeys + 0) = 305419896L; + *(pkeys + 1) = 591751049L; + *(pkeys + 2) = 878082192L; while (*passwd != '\0') { - update_keys(pkeys,pcrc_32_tab,(int)*passwd); + update_keys(pkeys, pcrc_32_tab, (int)*passwd); passwd++; } } -#define zdecode(pkeys,pcrc_32_tab,c) \ - (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab))) +#define zdecode(pkeys, pcrc_32_tab, c) (update_keys(pkeys, pcrc_32_tab, c ^= decrypt_byte(pkeys, pcrc_32_tab))) -#define zencode(pkeys,pcrc_32_tab,c,t) \ - (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c)) +#define zencode(pkeys, pcrc_32_tab, c, t) \ + (t = decrypt_byte(pkeys, pcrc_32_tab), update_keys(pkeys, pcrc_32_tab, c), t ^ (c)) #ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED -#define RAND_HEAD_LEN 12 - /* "last resort" source for second part of crypt seed pattern */ -# ifndef ZCR_SEED2 -# define ZCR_SEED2 3141592654UL /* use PI as default pattern */ -# endif - -static int crypthead(const char* passwd, /* password string */ - unsigned char* buf, /* where to write header */ - int bufSize, - unsigned long* pkeys, - const z_crc_t* pcrc_32_tab, - unsigned long crcForCrypting) +#define RAND_HEAD_LEN 12 +/* "last resort" source for second part of crypt seed pattern */ +#ifndef ZCR_SEED2 +#define ZCR_SEED2 3141592654UL /* use PI as default pattern */ +#endif + +static int crypthead(const char *passwd, /* password string */ + unsigned char *buf, /* where to write header */ + int bufSize, unsigned long *pkeys, const z_crc_t *pcrc_32_tab, unsigned long crcForCrypting) { - int n; /* index in random header */ - int t; /* temporary */ - int c; /* random byte */ - unsigned char header[RAND_HEAD_LEN-2]; /* random header */ - static unsigned calls = 0; /* ensure different random header each time */ + int n; /* index in random header */ + int t; /* temporary */ + int c; /* random byte */ + unsigned char header[RAND_HEAD_LEN - 2]; /* random header */ + static unsigned calls = 0; /* ensure different random header each time */ - if (bufSize> 7) & 0xff; + for (n = 0; n < RAND_HEAD_LEN - 2; n++) { + c = (rand() >> 7) & 0xff; header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t); } /* Encrypt random header (last two bytes is high word of crc) */ init_keys(passwd, pkeys, pcrc_32_tab); - for (n = 0; n < RAND_HEAD_LEN-2; n++) - { + for (n = 0; n < RAND_HEAD_LEN - 2; n++) { buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t); } buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t); diff --git a/src/libpsi/tools/zip/minizip/ioapi.c b/src/tools/zip/minizip/ioapi.c similarity index 100% rename from src/libpsi/tools/zip/minizip/ioapi.c rename to src/tools/zip/minizip/ioapi.c diff --git a/src/tools/zip/minizip/ioapi.h b/src/tools/zip/minizip/ioapi.h new file mode 100644 index 000000000..889888d54 --- /dev/null +++ b/src/tools/zip/minizip/ioapi.h @@ -0,0 +1,208 @@ +/* ioapi.h -- IO base function header for compress/uncompress .zip + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications for Zip64 support + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + + Changes + + Oct-2009 - Defined ZPOS64_T to fpos_t on windows and u_int64_t on linux. (might need to find a better why for this) + Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would work on linux. + More if/def section may be needed to support other platforms + Oct-2009 - Defined fxxxx64 calls to normal fopen/ftell/fseek so they would compile on windows. + (but you should use iowin32.c for windows instead) + +*/ + +#ifndef _ZLIBIOAPI64_H +#define _ZLIBIOAPI64_H + +#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) + +// Linux needs this to support file operation on files larger then 4+GB +// But might need better if/def to select just the platforms that needs them. + +#ifndef __USE_FILE_OFFSET64 +#define __USE_FILE_OFFSET64 +#endif +#ifndef __USE_LARGEFILE64 +#define __USE_LARGEFILE64 +#endif +#ifndef _LARGEFILE64_SOURCE +#define _LARGEFILE64_SOURCE +#endif +#ifndef _FILE_OFFSET_BIT +#define _FILE_OFFSET_BIT 64 +#endif + +#endif + +#include "zlib.h" +#include +#include + +#if defined(USE_FILE32API) || defined(__HAIKU__) +#define fopen64 fopen +#define ftello64 ftell +#define fseeko64 fseek +#else +#ifdef __FreeBSD__ +#define fopen64 fopen +#define ftello64 ftello +#define fseeko64 fseeko +#endif +#ifdef _MSC_VER +#define fopen64 fopen +#if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC))) +#define ftello64 _ftelli64 +#define fseeko64 _fseeki64 +#else // old MSC +#define ftello64 ftell +#define fseeko64 fseek +#endif +#endif +#endif + +/* +#ifndef ZPOS64_T + #ifdef _WIN32 + #define ZPOS64_T fpos_t + #else + #include + #define ZPOS64_T uint64_t + #endif +#endif +*/ + +#ifdef HAVE_MINIZIP64_CONF_H +#include "mz64conf.h" +#endif + +/* a type choosen by DEFINE */ +#ifdef HAVE_64BIT_INT_CUSTOM +typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T; +#else +#ifdef HAS_STDINT_H +#include "stdint.h" +typedef uint64_t ZPOS64_T; +#else + +/* Maximum unsigned 32-bit value used as placeholder for zip64 */ +#define MAXU32 0xffffffff + +#if defined(_MSC_VER) || defined(__BORLANDC__) +typedef unsigned __int64 ZPOS64_T; +#else +typedef unsigned long long int ZPOS64_T; +#endif +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define ZLIB_FILEFUNC_SEEK_CUR (1) +#define ZLIB_FILEFUNC_SEEK_END (2) +#define ZLIB_FILEFUNC_SEEK_SET (0) + +#define ZLIB_FILEFUNC_MODE_READ (1) +#define ZLIB_FILEFUNC_MODE_WRITE (2) +#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) + +#define ZLIB_FILEFUNC_MODE_EXISTING (4) +#define ZLIB_FILEFUNC_MODE_CREATE (8) + +#ifndef ZCALLBACK +#if (defined(WIN32) || defined(_WIN32) || defined(WINDOWS) || defined(_WINDOWS)) && defined(CALLBACK) \ + && defined(USEWINDOWS_CALLBACK) +#define ZCALLBACK CALLBACK +#else +#define ZCALLBACK +#endif +#endif + +typedef voidpf(ZCALLBACK *open_file_func) OF((voidpf opaque, const char *filename, int mode)); +typedef uLong(ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void *buf, uLong size)); +typedef uLong(ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void *buf, uLong size)); +typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); +typedef int(ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); + +typedef long(ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); +typedef long(ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); + +/* here is the "old" 32 bits structure structure */ +typedef struct zlib_filefunc_def_s { + open_file_func zopen_file; + read_file_func zread_file; + write_file_func zwrite_file; + tell_file_func ztell_file; + seek_file_func zseek_file; + close_file_func zclose_file; + testerror_file_func zerror_file; + voidpf opaque; +} zlib_filefunc_def; + +// Workaround for cppcheck error: syntax error +#ifndef ZPOS64_T +typedef unsigned long long int ZPOS64_T; +#endif + +typedef ZPOS64_T(ZCALLBACK *tell64_file_func) OF((voidpf opaque, voidpf stream)); +typedef long(ZCALLBACK *seek64_file_func) OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); +typedef voidpf(ZCALLBACK *open64_file_func) OF((voidpf opaque, const void *filename, int mode)); + +typedef struct zlib_filefunc64_def_s { + open64_file_func zopen64_file; + read_file_func zread_file; + write_file_func zwrite_file; + tell64_file_func ztell64_file; + seek64_file_func zseek64_file; + close_file_func zclose_file; + testerror_file_func zerror_file; + voidpf opaque; +} zlib_filefunc64_def; + +void fill_fopen64_filefunc OF((zlib_filefunc64_def * pzlib_filefunc_def)); +void fill_fopen_filefunc OF((zlib_filefunc_def * pzlib_filefunc_def)); + +/* now internal definition, only for zip.c and unzip.h */ +typedef struct zlib_filefunc64_32_def_s { + zlib_filefunc64_def zfile_func64; + open_file_func zopen32_file; + tell_file_func ztell32_file; + seek_file_func zseek32_file; +} zlib_filefunc64_32_def; + +#define ZREAD64(filefunc, filestream, buf, size) \ + ((*((filefunc).zfile_func64.zread_file))((filefunc).zfile_func64.opaque, filestream, buf, size)) +#define ZWRITE64(filefunc, filestream, buf, size) \ + ((*((filefunc).zfile_func64.zwrite_file))((filefunc).zfile_func64.opaque, filestream, buf, size)) +// #define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream)) +// #define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) +// ((filefunc).opaque,filestream,pos,mode)) +#define ZCLOSE64(filefunc, filestream) \ + ((*((filefunc).zfile_func64.zclose_file))((filefunc).zfile_func64.opaque, filestream)) +#define ZERROR64(filefunc, filestream) \ + ((*((filefunc).zfile_func64.zerror_file))((filefunc).zfile_func64.opaque, filestream)) + +voidpf call_zopen64 OF((const zlib_filefunc64_32_def *pfilefunc, const void *filename, int mode)); +long call_zseek64 OF((const zlib_filefunc64_32_def *pfilefunc, voidpf filestream, ZPOS64_T offset, int origin)); +ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def *pfilefunc, voidpf filestream)); + +void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def *p_filefunc64_32, + const zlib_filefunc_def *p_filefunc32); + +#define ZOPEN64(filefunc, filename, mode) (call_zopen64((&(filefunc)), (filename), (mode))) +#define ZTELL64(filefunc, filestream) (call_ztell64((&(filefunc)), (filestream))) +#define ZSEEK64(filefunc, filestream, pos, mode) (call_zseek64((&(filefunc)), (filestream), (pos), (mode))) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/libpsi/tools/zip/minizip/iowin32.c b/src/tools/zip/minizip/iowin32.c similarity index 100% rename from src/libpsi/tools/zip/minizip/iowin32.c rename to src/tools/zip/minizip/iowin32.c diff --git a/src/libpsi/tools/zip/minizip/iowin32.h b/src/tools/zip/minizip/iowin32.h similarity index 65% rename from src/libpsi/tools/zip/minizip/iowin32.h rename to src/tools/zip/minizip/iowin32.h index 0ca0969a7..b6fb8bcc3 100644 --- a/src/libpsi/tools/zip/minizip/iowin32.h +++ b/src/tools/zip/minizip/iowin32.h @@ -13,15 +13,14 @@ #include - #ifdef __cplusplus extern "C" { #endif -void fill_win32_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); -void fill_win32_filefunc64 OF((zlib_filefunc64_def* pzlib_filefunc_def)); -void fill_win32_filefunc64A OF((zlib_filefunc64_def* pzlib_filefunc_def)); -void fill_win32_filefunc64W OF((zlib_filefunc64_def* pzlib_filefunc_def)); +void fill_win32_filefunc OF((zlib_filefunc_def * pzlib_filefunc_def)); +void fill_win32_filefunc64 OF((zlib_filefunc64_def * pzlib_filefunc_def)); +void fill_win32_filefunc64A OF((zlib_filefunc64_def * pzlib_filefunc_def)); +void fill_win32_filefunc64W OF((zlib_filefunc64_def * pzlib_filefunc_def)); #ifdef __cplusplus } diff --git a/src/libpsi/tools/zip/minizip/miniunz.c b/src/tools/zip/minizip/miniunz.c similarity index 100% rename from src/libpsi/tools/zip/minizip/miniunz.c rename to src/tools/zip/minizip/miniunz.c diff --git a/src/libpsi/tools/zip/minizip/miniunzip.1 b/src/tools/zip/minizip/miniunzip.1 similarity index 100% rename from src/libpsi/tools/zip/minizip/miniunzip.1 rename to src/tools/zip/minizip/miniunzip.1 diff --git a/src/libpsi/tools/zip/minizip/minizip.1 b/src/tools/zip/minizip/minizip.1 similarity index 99% rename from src/libpsi/tools/zip/minizip/minizip.1 rename to src/tools/zip/minizip/minizip.1 index 1154484c1..dcdfd578d 100644 --- a/src/libpsi/tools/zip/minizip/minizip.1 +++ b/src/tools/zip/minizip/minizip.1 @@ -43,4 +43,3 @@ archive. If none are specified then an empty archive will be created. .SH AUTHOR This program was written by Gilles Vollant. This manual page was written by Mark Brown . - diff --git a/src/libpsi/tools/zip/minizip/minizip.c b/src/tools/zip/minizip/minizip.c similarity index 100% rename from src/libpsi/tools/zip/minizip/minizip.c rename to src/tools/zip/minizip/minizip.c diff --git a/src/libpsi/tools/zip/minizip/minizip.pc.in b/src/tools/zip/minizip/minizip.pc.in similarity index 100% rename from src/libpsi/tools/zip/minizip/minizip.pc.in rename to src/tools/zip/minizip/minizip.pc.in diff --git a/src/libpsi/tools/zip/minizip/mztools.c b/src/tools/zip/minizip/mztools.c similarity index 100% rename from src/libpsi/tools/zip/minizip/mztools.c rename to src/tools/zip/minizip/mztools.c diff --git a/src/libpsi/tools/zip/minizip/mztools.h b/src/tools/zip/minizip/mztools.h similarity index 64% rename from src/libpsi/tools/zip/minizip/mztools.h rename to src/tools/zip/minizip/mztools.h index a49a426ec..76b1e2b29 100644 --- a/src/libpsi/tools/zip/minizip/mztools.h +++ b/src/tools/zip/minizip/mztools.h @@ -22,16 +22,11 @@ extern "C" { fileOut: output file after recovery fileOutTmp: temporary file name used for recovery */ -extern int ZEXPORT unzRepair(const char* file, - const char* fileOut, - const char* fileOutTmp, - uLong* nRecovered, - uLong* bytesRecovered); - +extern int ZEXPORT unzRepair(const char *file, const char *fileOut, const char *fileOutTmp, uLong *nRecovered, + uLong *bytesRecovered); #ifdef __cplusplus } #endif - #endif diff --git a/src/libpsi/tools/zip/minizip/unzip.c b/src/tools/zip/minizip/unzip.c similarity index 100% rename from src/libpsi/tools/zip/minizip/unzip.c rename to src/tools/zip/minizip/unzip.c diff --git a/src/libpsi/tools/zip/minizip/unzip.h b/src/tools/zip/minizip/unzip.h similarity index 55% rename from src/libpsi/tools/zip/minizip/unzip.h rename to src/tools/zip/minizip/unzip.h index 2104e3915..2eb894ef9 100644 --- a/src/libpsi/tools/zip/minizip/unzip.h +++ b/src/tools/zip/minizip/unzip.h @@ -51,7 +51,7 @@ extern "C" { #include "zlib.h" #endif -#ifndef _ZLIBIOAPI_H +#ifndef _ZLIBIOAPI_H #include "ioapi.h" #endif @@ -64,95 +64,89 @@ extern "C" { #if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) /* like the STRICT of WIN32, we define a pointer that cannot be converted from (void*) without cast */ -typedef struct TagunzFile__ { int unused; } unzFile__; +typedef struct TagunzFile__ { + int unused; +} unzFile__; typedef unzFile__ *unzFile; #else typedef voidp unzFile; #endif - -#define UNZ_OK (0) -#define UNZ_END_OF_LIST_OF_FILE (-100) -#define UNZ_ERRNO (Z_ERRNO) -#define UNZ_EOF (0) -#define UNZ_PARAMERROR (-102) -#define UNZ_BADZIPFILE (-103) -#define UNZ_INTERNALERROR (-104) -#define UNZ_CRCERROR (-105) +#define UNZ_OK (0) +#define UNZ_END_OF_LIST_OF_FILE (-100) +#define UNZ_ERRNO (Z_ERRNO) +#define UNZ_EOF (0) +#define UNZ_PARAMERROR (-102) +#define UNZ_BADZIPFILE (-103) +#define UNZ_INTERNALERROR (-104) +#define UNZ_CRCERROR (-105) /* tm_unz contain date/time info */ -typedef struct tm_unz_s -{ - uInt tm_sec; /* seconds after the minute - [0,59] */ - uInt tm_min; /* minutes after the hour - [0,59] */ - uInt tm_hour; /* hours since midnight - [0,23] */ - uInt tm_mday; /* day of the month - [1,31] */ - uInt tm_mon; /* months since January - [0,11] */ - uInt tm_year; /* years - [1980..2044] */ +typedef struct tm_unz_s { + uInt tm_sec; /* seconds after the minute - [0,59] */ + uInt tm_min; /* minutes after the hour - [0,59] */ + uInt tm_hour; /* hours since midnight - [0,23] */ + uInt tm_mday; /* day of the month - [1,31] */ + uInt tm_mon; /* months since January - [0,11] */ + uInt tm_year; /* years - [1980..2044] */ } tm_unz; /* unz_global_info structure contain global data about the ZIPfile These data comes from the end of central dir */ -typedef struct unz_global_info64_s -{ - ZPOS64_T number_entry; /* total number of entries in - the central dir on this disk */ - uLong size_comment; /* size of the global comment of the zipfile */ +typedef struct unz_global_info64_s { + ZPOS64_T number_entry; /* total number of entries in + the central dir on this disk */ + uLong size_comment; /* size of the global comment of the zipfile */ } unz_global_info64; -typedef struct unz_global_info_s -{ - uLong number_entry; /* total number of entries in - the central dir on this disk */ - uLong size_comment; /* size of the global comment of the zipfile */ +typedef struct unz_global_info_s { + uLong number_entry; /* total number of entries in + the central dir on this disk */ + uLong size_comment; /* size of the global comment of the zipfile */ } unz_global_info; /* unz_file_info contain information about a file in the zipfile */ -typedef struct unz_file_info64_s -{ - uLong version; /* version made by 2 bytes */ - uLong version_needed; /* version needed to extract 2 bytes */ - uLong flag; /* general purpose bit flag 2 bytes */ - uLong compression_method; /* compression method 2 bytes */ - uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ - uLong crc; /* crc-32 4 bytes */ - ZPOS64_T compressed_size; /* compressed size 8 bytes */ - ZPOS64_T uncompressed_size; /* uncompressed size 8 bytes */ - uLong size_filename; /* filename length 2 bytes */ - uLong size_file_extra; /* extra field length 2 bytes */ - uLong size_file_comment; /* file comment length 2 bytes */ - - uLong disk_num_start; /* disk number start 2 bytes */ - uLong internal_fa; /* internal file attributes 2 bytes */ - uLong external_fa; /* external file attributes 4 bytes */ +typedef struct unz_file_info64_s { + uLong version; /* version made by 2 bytes */ + uLong version_needed; /* version needed to extract 2 bytes */ + uLong flag; /* general purpose bit flag 2 bytes */ + uLong compression_method; /* compression method 2 bytes */ + uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ + uLong crc; /* crc-32 4 bytes */ + ZPOS64_T compressed_size; /* compressed size 8 bytes */ + ZPOS64_T uncompressed_size; /* uncompressed size 8 bytes */ + uLong size_filename; /* filename length 2 bytes */ + uLong size_file_extra; /* extra field length 2 bytes */ + uLong size_file_comment; /* file comment length 2 bytes */ + + uLong disk_num_start; /* disk number start 2 bytes */ + uLong internal_fa; /* internal file attributes 2 bytes */ + uLong external_fa; /* external file attributes 4 bytes */ tm_unz tmu_date; } unz_file_info64; -typedef struct unz_file_info_s -{ - uLong version; /* version made by 2 bytes */ - uLong version_needed; /* version needed to extract 2 bytes */ - uLong flag; /* general purpose bit flag 2 bytes */ - uLong compression_method; /* compression method 2 bytes */ - uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ - uLong crc; /* crc-32 4 bytes */ - uLong compressed_size; /* compressed size 4 bytes */ - uLong uncompressed_size; /* uncompressed size 4 bytes */ - uLong size_filename; /* filename length 2 bytes */ - uLong size_file_extra; /* extra field length 2 bytes */ - uLong size_file_comment; /* file comment length 2 bytes */ - - uLong disk_num_start; /* disk number start 2 bytes */ - uLong internal_fa; /* internal file attributes 2 bytes */ - uLong external_fa; /* external file attributes 4 bytes */ +typedef struct unz_file_info_s { + uLong version; /* version made by 2 bytes */ + uLong version_needed; /* version needed to extract 2 bytes */ + uLong flag; /* general purpose bit flag 2 bytes */ + uLong compression_method; /* compression method 2 bytes */ + uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ + uLong crc; /* crc-32 4 bytes */ + uLong compressed_size; /* compressed size 4 bytes */ + uLong uncompressed_size; /* uncompressed size 4 bytes */ + uLong size_filename; /* filename length 2 bytes */ + uLong size_file_extra; /* extra field length 2 bytes */ + uLong size_file_comment; /* file comment length 2 bytes */ + + uLong disk_num_start; /* disk number start 2 bytes */ + uLong internal_fa; /* internal file attributes 2 bytes */ + uLong external_fa; /* external file attributes 4 bytes */ tm_unz tmu_date; } unz_file_info; -extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, - const char* fileName2, - int iCaseSensitivity)); +extern int ZEXPORT unzStringFileNameCompare OF((const char *fileName1, const char *fileName2, int iCaseSensitivity)); /* Compare two filename (fileName1,fileName2). If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) @@ -162,8 +156,7 @@ extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, (like 1 on Unix, 2 on Windows) */ - -extern unzFile ZEXPORT unzOpen OF((const char *path)); +extern unzFile ZEXPORT unzOpen OF((const char *path)); extern unzFile ZEXPORT unzOpen64 OF((const void *path)); /* Open a Zip file. path contain the full pathname (by example, @@ -180,16 +173,13 @@ extern unzFile ZEXPORT unzOpen64 OF((const void *path)); does not describe the reality */ - -extern unzFile ZEXPORT unzOpen2 OF((const char *path, - zlib_filefunc_def* pzlib_filefunc_def)); +extern unzFile ZEXPORT unzOpen2 OF((const char *path, zlib_filefunc_def *pzlib_filefunc_def)); /* Open a Zip file, like unzOpen, but provide a set of file low level API for read/write the zip file (see ioapi.h) */ -extern unzFile ZEXPORT unzOpen2_64 OF((const void *path, - zlib_filefunc64_def* pzlib_filefunc_def)); +extern unzFile ZEXPORT unzOpen2_64 OF((const void *path, zlib_filefunc64_def *pzlib_filefunc_def)); /* Open a Zip file, like unz64Open, but provide a set of file low level API for read/write the zip file (see ioapi.h) @@ -202,27 +192,21 @@ extern int ZEXPORT unzClose OF((unzFile file)); these files MUST be closed with unzCloseCurrentFile before call unzClose. return UNZ_OK if there is no problem. */ -extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, - unz_global_info *pglobal_info)); +extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, unz_global_info *pglobal_info)); -extern int ZEXPORT unzGetGlobalInfo64 OF((unzFile file, - unz_global_info64 *pglobal_info)); +extern int ZEXPORT unzGetGlobalInfo64 OF((unzFile file, unz_global_info64 *pglobal_info)); /* Write info about the ZipFile in the *pglobal_info structure. No preparation of the structure is needed return UNZ_OK if there is no problem. */ - -extern int ZEXPORT unzGetGlobalComment OF((unzFile file, - char *szComment, - uLong uSizeBuf)); +extern int ZEXPORT unzGetGlobalComment OF((unzFile file, char *szComment, uLong uSizeBuf)); /* Get the global comment string of the ZipFile, in the szComment buffer. uSizeBuf is the size of the szComment buffer. return the number of byte copied or an error code <0 */ - /***************************************************************************/ /* Unzip package allow you browse the directory of the zipfile */ @@ -239,9 +223,7 @@ extern int ZEXPORT unzGoToNextFile OF((unzFile file)); return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. */ -extern int ZEXPORT unzLocateFile OF((unzFile file, - const char *szFileName, - int iCaseSensitivity)); +extern int ZEXPORT unzLocateFile OF((unzFile file, const char *szFileName, int iCaseSensitivity)); /* Try locate the file szFileName in the zipfile. For the iCaseSensitivity signification, see unzStringFileNameCompare @@ -251,57 +233,36 @@ extern int ZEXPORT unzLocateFile OF((unzFile file, UNZ_END_OF_LIST_OF_FILE if the file is not found */ - /* ****************************************** */ /* Ryan supplied functions */ /* unz_file_info contain information about a file in the zipfile */ -typedef struct unz_file_pos_s -{ - uLong pos_in_zip_directory; /* offset in zip file directory */ - uLong num_of_file; /* # of file */ +typedef struct unz_file_pos_s { + uLong pos_in_zip_directory; /* offset in zip file directory */ + uLong num_of_file; /* # of file */ } unz_file_pos; -extern int ZEXPORT unzGetFilePos( - unzFile file, - unz_file_pos* file_pos); +extern int ZEXPORT unzGetFilePos(unzFile file, unz_file_pos *file_pos); -extern int ZEXPORT unzGoToFilePos( - unzFile file, - unz_file_pos* file_pos); +extern int ZEXPORT unzGoToFilePos(unzFile file, unz_file_pos *file_pos); -typedef struct unz64_file_pos_s -{ - ZPOS64_T pos_in_zip_directory; /* offset in zip file directory */ - ZPOS64_T num_of_file; /* # of file */ +typedef struct unz64_file_pos_s { + ZPOS64_T pos_in_zip_directory; /* offset in zip file directory */ + ZPOS64_T num_of_file; /* # of file */ } unz64_file_pos; -extern int ZEXPORT unzGetFilePos64( - unzFile file, - unz64_file_pos* file_pos); +extern int ZEXPORT unzGetFilePos64(unzFile file, unz64_file_pos *file_pos); -extern int ZEXPORT unzGoToFilePos64( - unzFile file, - const unz64_file_pos* file_pos); +extern int ZEXPORT unzGoToFilePos64(unzFile file, const unz64_file_pos *file_pos); /* ****************************************** */ -extern int ZEXPORT unzGetCurrentFileInfo64 OF((unzFile file, - unz_file_info64 *pfile_info, - char *szFileName, - uLong fileNameBufferSize, - void *extraField, - uLong extraFieldBufferSize, - char *szComment, - uLong commentBufferSize)); - -extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, - unz_file_info *pfile_info, - char *szFileName, - uLong fileNameBufferSize, - void *extraField, - uLong extraFieldBufferSize, - char *szComment, - uLong commentBufferSize)); +extern int ZEXPORT unzGetCurrentFileInfo64 OF((unzFile file, unz_file_info64 *pfile_info, char *szFileName, + uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize, + char *szComment, uLong commentBufferSize)); + +extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, unz_file_info *pfile_info, char *szFileName, + uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize, + char *szComment, uLong commentBufferSize)); /* Get Info about the current file if pfile_info!=NULL, the *pfile_info structure will contain somes info about @@ -315,14 +276,12 @@ extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, (commentBufferSize is the size of the buffer) */ - /** Addition for GDAL : START */ extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 OF((unzFile file)); /** Addition for GDAL : END */ - /***************************************************************************/ /* for reading the content of the current zipfile, you can open it, read data from it, and close it (you can close it before reading all the file) @@ -334,18 +293,14 @@ extern int ZEXPORT unzOpenCurrentFile OF((unzFile file)); If there is no error, the return value is UNZ_OK. */ -extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file, - const char* password)); +extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file, const char *password)); /* Open for reading data the current file in the zipfile. password is a crypting password If there is no error, the return value is UNZ_OK. */ -extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, - int* method, - int* level, - int raw)); +extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, int *method, int *level, int raw)); /* Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) if raw==1 @@ -355,11 +310,7 @@ extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, but you CANNOT set method parameter as NULL */ -extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, - int* method, - int* level, - int raw, - const char* password)); +extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, int *method, int *level, int raw, const char *password)); /* Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) if raw==1 @@ -369,16 +320,13 @@ extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, but you CANNOT set method parameter as NULL */ - extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); /* Close the file in zip opened with unzOpenCurrentFile Return UNZ_CRCERROR if all the file was read but the CRC is not good */ -extern int ZEXPORT unzReadCurrentFile OF((unzFile file, - voidp buf, - unsigned len)); +extern int ZEXPORT unzReadCurrentFile OF((unzFile file, voidp buf, unsigned len)); /* Read bytes from the current file (opened by unzOpenCurrentFile) buf contain buffer where data must be copied @@ -402,9 +350,7 @@ extern int ZEXPORT unzeof OF((unzFile file)); return 1 if the end of file was reached, 0 elsewhere */ -extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, - voidp buf, - unsigned len)); +extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, voidp buf, unsigned len)); /* Read extra field from the current file (opened by unzOpenCurrentFile) This is the local-header version of the extra field (sometimes, there is @@ -421,14 +367,12 @@ extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, /***************************************************************************/ /* Get the current file offset */ -extern ZPOS64_T ZEXPORT unzGetOffset64 (unzFile file); -extern uLong ZEXPORT unzGetOffset (unzFile file); +extern ZPOS64_T ZEXPORT unzGetOffset64(unzFile file); +extern uLong ZEXPORT unzGetOffset(unzFile file); /* Set the current file offset */ -extern int ZEXPORT unzSetOffset64 (unzFile file, ZPOS64_T pos); -extern int ZEXPORT unzSetOffset (unzFile file, uLong pos); - - +extern int ZEXPORT unzSetOffset64(unzFile file, ZPOS64_T pos); +extern int ZEXPORT unzSetOffset(unzFile file, uLong pos); #ifdef __cplusplus } diff --git a/src/libpsi/tools/zip/minizip/zip.c b/src/tools/zip/minizip/zip.c similarity index 100% rename from src/libpsi/tools/zip/minizip/zip.c rename to src/tools/zip/minizip/zip.c diff --git a/src/tools/zip/minizip/zip.h b/src/tools/zip/minizip/zip.h new file mode 100644 index 000000000..5f013d5eb --- /dev/null +++ b/src/tools/zip/minizip/zip.h @@ -0,0 +1,267 @@ +/* zip.h -- IO on .zip files using zlib + Version 1.1, February 14h, 2010 + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications for Zip64 support + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + + --------------------------------------------------------------------------- + + Condition of use and distribution are the same than zlib : + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + --------------------------------------------------------------------------- + + Changes + + See header of zip.h + +*/ + +#ifndef _zip12_H +#define _zip12_H + +#ifdef __cplusplus +extern "C" { +#endif + +// #define HAVE_BZIP2 + +#ifndef _ZLIB_H +#include "zlib.h" +#endif + +#ifndef _ZLIBIOAPI_H +#include "ioapi.h" +#endif + +#ifdef HAVE_BZIP2 +#include "bzlib.h" +#endif + +#define Z_BZIP2ED 12 + +#if defined(STRICTZIP) || defined(STRICTZIPUNZIP) +/* like the STRICT of WIN32, we define a pointer that cannot be converted + from (void*) without cast */ +typedef struct TagzipFile__ { + int unused; +} zipFile__; +typedef zipFile__ *zipFile; +#else +typedef voidp zipFile; +#endif + +#define ZIP_OK (0) +#define ZIP_EOF (0) +#define ZIP_ERRNO (Z_ERRNO) +#define ZIP_PARAMERROR (-102) +#define ZIP_BADZIPFILE (-103) +#define ZIP_INTERNALERROR (-104) + +#ifndef DEF_MEM_LEVEL +#if MAX_MEM_LEVEL >= 8 +#define DEF_MEM_LEVEL 8 +#else +#define DEF_MEM_LEVEL MAX_MEM_LEVEL +#endif +#endif +/* default memLevel */ + +/* tm_zip contain date/time info */ +typedef struct tm_zip_s { + uInt tm_sec; /* seconds after the minute - [0,59] */ + uInt tm_min; /* minutes after the hour - [0,59] */ + uInt tm_hour; /* hours since midnight - [0,23] */ + uInt tm_mday; /* day of the month - [1,31] */ + uInt tm_mon; /* months since January - [0,11] */ + uInt tm_year; /* years - [1980..2044] */ +} tm_zip; + +typedef struct { + tm_zip tmz_date; /* date in understandable format */ + uLong dosDate; /* if dos_date == 0, tmu_date is used */ + /* uLong flag; */ /* general purpose bit flag 2 bytes */ + + uLong internal_fa; /* internal file attributes 2 bytes */ + uLong external_fa; /* external file attributes 4 bytes */ +} zip_fileinfo; + +typedef const char *zipcharpc; + +#define APPEND_STATUS_CREATE (0) +#define APPEND_STATUS_CREATEAFTER (1) +#define APPEND_STATUS_ADDINZIP (2) + +extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append)); +extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append)); +/* + Create a zipfile. + pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on + an Unix computer "zlib/zlib113.zip". + if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip + will be created at the end of the file. + (useful if the file contain a self extractor code) + if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will + add files in existing zip (be sure you don't add file that doesn't exist) + If the zipfile cannot be opened, the return value is NULL. + Else, the return value is a zipFile Handle, usable with other function + of this zip package. +*/ + +/* Note : there is no delete function into a zipfile. + If you want delete file into a zipfile, you must open a zipfile, and create another + Of couse, you can use RAW reading and writing to copy the file you did not want delte +*/ + +extern zipFile ZEXPORT zipOpen2 OF((const char *pathname, int append, zipcharpc *globalcomment, + zlib_filefunc_def *pzlib_filefunc_def)); + +extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname, int append, zipcharpc *globalcomment, + zlib_filefunc64_def *pzlib_filefunc_def)); + +extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file, const char *filename, const zip_fileinfo *zipfi, + const void *extrafield_local, uInt size_extrafield_local, + const void *extrafield_global, uInt size_extrafield_global, + const char *comment, int method, int level)); + +extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file, const char *filename, const zip_fileinfo *zipfi, + const void *extrafield_local, uInt size_extrafield_local, + const void *extrafield_global, uInt size_extrafield_global, + const char *comment, int method, int level, int zip64)); + +/* + Open a file in the ZIP for writing. + filename : the filename in zip (if NULL, '-' without quote will be used + *zipfi contain supplemental information + if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local + contains the extrafield data the the local header + if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global + contains the extrafield data the the local header + if comment != NULL, comment contain the comment string + method contain the compression method (0 for store, Z_DEFLATED for deflate) + level contain the level of compression (can be Z_DEFAULT_COMPRESSION) + zip64 is set to 1 if a zip64 extended information block should be added to the local file header. + this MUST be '1' if the uncompressed size is >= 0xffffffff. + +*/ + +extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file, const char *filename, const zip_fileinfo *zipfi, + const void *extrafield_local, uInt size_extrafield_local, + const void *extrafield_global, uInt size_extrafield_global, + const char *comment, int method, int level, int raw)); + +extern int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file, const char *filename, const zip_fileinfo *zipfi, + const void *extrafield_local, uInt size_extrafield_local, + const void *extrafield_global, uInt size_extrafield_global, + const char *comment, int method, int level, int raw, int zip64)); +/* + Same than zipOpenNewFileInZip, except if raw=1, we write raw file + */ + +extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file, const char *filename, const zip_fileinfo *zipfi, + const void *extrafield_local, uInt size_extrafield_local, + const void *extrafield_global, uInt size_extrafield_global, + const char *comment, int method, int level, int raw, int windowBits, + int memLevel, int strategy, const char *password, uLong crcForCrypting)); + +extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file, const char *filename, const zip_fileinfo *zipfi, + const void *extrafield_local, uInt size_extrafield_local, + const void *extrafield_global, uInt size_extrafield_global, + const char *comment, int method, int level, int raw, int windowBits, + int memLevel, int strategy, const char *password, uLong crcForCrypting, + int zip64)); + +/* + Same than zipOpenNewFileInZip2, except + windowBits,memLevel,,strategy : see parameter strategy in deflateInit2 + password : crypting password (NULL for no crypting) + crcForCrypting : crc of file to compress (needed for crypting) + */ + +extern int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file, const char *filename, const zip_fileinfo *zipfi, + const void *extrafield_local, uInt size_extrafield_local, + const void *extrafield_global, uInt size_extrafield_global, + const char *comment, int method, int level, int raw, int windowBits, + int memLevel, int strategy, const char *password, uLong crcForCrypting, + uLong versionMadeBy, uLong flagBase)); + +extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file, const char *filename, const zip_fileinfo *zipfi, + const void *extrafield_local, uInt size_extrafield_local, + const void *extrafield_global, uInt size_extrafield_global, + const char *comment, int method, int level, int raw, int windowBits, + int memLevel, int strategy, const char *password, uLong crcForCrypting, + uLong versionMadeBy, uLong flagBase, int zip64)); +/* + Same than zipOpenNewFileInZip4, except + versionMadeBy : value for Version made by field + flag : value for flag field (compression level info will be added) + */ + +extern int ZEXPORT zipWriteInFileInZip OF((zipFile file, const void *buf, unsigned len)); +/* + Write data in the zipfile +*/ + +extern int ZEXPORT zipCloseFileInZip OF((zipFile file)); +/* + Close the current file in the zipfile +*/ + +extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file, uLong uncompressed_size, uLong crc32)); + +extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file, ZPOS64_T uncompressed_size, uLong crc32)); + +/* + Close the current file in the zipfile, for file opened with + parameter raw=1 in zipOpenNewFileInZip2 + uncompressed_size and crc32 are value for the uncompressed size +*/ + +extern int ZEXPORT zipClose OF((zipFile file, const char *global_comment)); +/* + Close the zipfile +*/ + +extern int ZEXPORT zipRemoveExtraInfoBlock OF((char *pData, int *dataLen, short sHeader)); +/* + zipRemoveExtraInfoBlock - Added by Mathias Svensson + + Remove extra information block from a extra information data for the local file header or central directory header + + It is needed to remove ZIP64 extra information blocks when before data is written if using RAW mode. + + 0x0001 is the signature header for the ZIP64 extra information blocks + + usage. + Remove ZIP64 Extra information from a central director extra field data + zipRemoveExtraInfoBlock(pCenDirExtraFieldData, &nCenDirExtraFieldDataLen, 0x0001); + + Remove ZIP64 Extra information from a Local File Header extra field data + zipRemoveExtraInfoBlock(pLocalHeaderExtraFieldData, &nLocalHeaderExtraFieldDataLen, 0x0001); +*/ + +#ifdef __cplusplus +} +#endif + +#endif /* _zip64_H */ diff --git a/src/libpsi/tools/zip/zip.cpp b/src/tools/zip/zip.cpp similarity index 100% rename from src/libpsi/tools/zip/zip.cpp rename to src/tools/zip/zip.cpp diff --git a/src/libpsi/tools/zip/zip.h b/src/tools/zip/zip.h similarity index 100% rename from src/libpsi/tools/zip/zip.h rename to src/tools/zip/zip.h diff --git a/src/webview.cpp b/src/webview.cpp index ddc843b97..b25b590ed 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -31,7 +31,9 @@ #include #ifdef WEBENGINE #include -#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include +#elif QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) #include #endif #else @@ -56,9 +58,6 @@ WebView::WebView(QWidget *parent) : // TODO cache cotrol // TODO network request interception // Review ink delegation (in other words all local links on page should work) - - connect(page()->action(QWebEnginePage::Copy), SIGNAL(triggered()), SLOT(textCopiedEvent())); - connect(page()->action(QWebEnginePage::Cut), SIGNAL(triggered()), SLOT(textCopiedEvent())); #else settings()->setAttribute(QWebSettings::JavaEnabled, false); settings()->setAttribute(QWebSettings::PluginsEnabled, false); @@ -66,16 +65,8 @@ WebView::WebView(QWidget *parent) : settings()->setMaximumPagesInCache(0); settings()->setObjectCacheCapacities(0, 0, 0); settings()->clearMemoryCaches(); - - page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); - - connect(page()->action(QWebPage::Copy), SIGNAL(triggered()), SLOT(textCopiedEvent())); - connect(page()->action(QWebPage::Cut), SIGNAL(triggered()), SLOT(textCopiedEvent())); - connect(page(), SIGNAL(linkClicked(const QUrl &)), this, - SLOT(linkClickedEvent(const QUrl &))); // most likely we don't need this at all #endif - connect(page(), SIGNAL(loadStarted()), this, SLOT(loadStartedEvent())); - connect(page(), SIGNAL(loadFinished(bool)), this, SLOT(loadFinishedEvent(bool))); + connectPageActions(); } void WebView::linkClickedEvent(const QUrl &url) @@ -104,25 +95,25 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) if (isLoading_) return; #ifdef WEBENGINE -#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) - QWebEngineContextMenuData r = page()->contextMenuData(); -#else - struct CMData { - QUrl linkUrl() { return QUrl(); } // just a stub. TODO invent something - }; - CMData r; +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + QWebEngineContextMenuRequest *r = lastContextMenuRequest(); + QUrl linkUrl = r->linkUrl(); +#elif QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) + QWebEngineContextMenuData r = page()->contextMenuData(); + QUrl linkUrl = r.linkUrl(); #endif #else - QWebHitTestResult r = page()->mainFrame()->hitTestContent(event->pos()); + QWebHitTestResult r = page()->mainFrame()->hitTestContent(event->pos()); + QUrl linkUrl = r.linkUrl(); #endif QMenu *menu; - if (!r.linkUrl().isEmpty()) { - if (r.linkUrl().scheme() == "addnick") { + if (!linkUrl.isEmpty()) { + if (linkUrl.scheme() == "addnick") { event->ignore(); return; } - menu = URLObject::getInstance()->createPopupMenu(r.linkUrl().toEncoded()); + menu = URLObject::getInstance()->createPopupMenu(linkUrl.toEncoded()); // menu->addAction(pageAction(QWebPage::CopyLinkToClipboard)); } else { menu = new QMenu(this); @@ -138,7 +129,9 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) } menu->addAction(pageAction(QWebEnginePage::SelectAll)); } +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) menu->addAction(pageAction(QWebEnginePage::InspectElement)); +#endif } // menu->addAction(pageAction(QWebEnginePage::Reload)); #else @@ -240,6 +233,33 @@ void WebView::evaluateJS(const QString &scriptSource) void WebView::addContextMenuAction(QAction *act) { contextMenuActions_.append(act); } +void WebView::connectPageActions() +{ +#ifdef WEBENGINE + connect(page()->action(QWebEnginePage::Copy), SIGNAL(triggered()), SLOT(textCopiedEvent())); + connect(page()->action(QWebEnginePage::Cut), SIGNAL(triggered()), SLOT(textCopiedEvent())); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + connect(page()->action(QWebEnginePage::InspectElement), &QAction::triggered, this, [this](bool) { + auto devView = new QWebEngineView(); + devView->setAttribute(Qt::WA_DeleteOnClose); + devView->setWindowIcon(QIcon(IconsetFactory::iconPtr("psi/logo_128")->icon())); + devView->setWindowTitle("Psi WebView DevTools"); + page()->setDevToolsPage(devView->page()); + devView->show(); + }); +#endif +#else + page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); + + connect(page()->action(QWebPage::Copy), SIGNAL(triggered()), SLOT(textCopiedEvent())); + connect(page()->action(QWebPage::Cut), SIGNAL(triggered()), SLOT(textCopiedEvent())); + connect(page(), SIGNAL(linkClicked(const QUrl &)), this, + SLOT(linkClickedEvent(const QUrl &))); // most likely we don't need this at all +#endif + connect(page(), SIGNAL(loadStarted()), this, SLOT(loadStartedEvent())); + connect(page(), SIGNAL(loadFinished(bool)), this, SLOT(loadFinishedEvent(bool))); +} + #ifndef WEBENGINE QString WebView::selectedText() { return TextUtil::rich2plain(TextUtil::img2title(selectedHtml())); } #endif diff --git a/src/webview.h b/src/webview.h index 608faae3e..720a44a3e 100644 --- a/src/webview.h +++ b/src/webview.h @@ -63,6 +63,7 @@ class WebView : public QWebView { bool isLoading() { return isLoading_; } void addContextMenuAction(QAction *act); + void connectPageActions(); public slots: void copySelected(); diff --git a/src/whiteboarding/wbdlg.cpp b/src/whiteboarding/wbdlg.cpp index 7ac1e26f0..e8b89773c 100644 --- a/src/whiteboarding/wbdlg.cpp +++ b/src/whiteboarding/wbdlg.cpp @@ -241,8 +241,8 @@ void WbDlg::endSession() if (sender() == act_end_) { int n = QMessageBox::information( this, tr("Warning"), - tr("Are you sure you want to end the session?\nThe contents of the whiteboard will be lost."), tr("&Yes"), - tr("&No")); + tr("Are you sure you want to end the session?\nThe contents of the whiteboard will be lost."), + QMessageBox::Yes | QMessageBox::No); if (n != 0) return; } @@ -278,8 +278,8 @@ void WbDlg::closeEvent(QCloseEvent *e) if (keepOpen_) { int n = QMessageBox::information( this, tr("Warning"), - tr("A new whiteboard message was just received.\nDo you still want to close the window?"), tr("&Yes"), - tr("&No")); + tr("A new whiteboard message was just received.\nDo you still want to close the window?"), + QMessageBox::Yes | QMessageBox::No); if (n != 0) { e->ignore(); return; diff --git a/src/whiteboarding/wbwidget.cpp b/src/whiteboarding/wbwidget.cpp index 8f99057bf..551b6f7bf 100644 --- a/src/whiteboarding/wbwidget.cpp +++ b/src/whiteboarding/wbwidget.cpp @@ -241,8 +241,11 @@ void WbWidget::mousePressEvent(QMouseEvent *event) delete newWbItem_; newWbItem_ = nullptr; } - +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) QPointF startPoint = mapToScene(mapFromGlobal(event->globalPos())); +#else + QPointF startPoint = mapToScene(mapFromGlobal(event->globalPosition().toPoint())); +#endif if (mode_ == Mode::DrawPath) { // // Create the element with starting position // QPointF sp = mapToScene(mapFromGlobal(event->globalPos())); @@ -292,8 +295,12 @@ void WbWidget::mouseMoveEvent(QMouseEvent *event) if (mode_ == Mode::Erase) { if (event->buttons() != Qt::MouseButtons(Qt::LeftButton)) return; - // Erase all items that appear in a 2*strokeWidth_ square with center at the event position - QPointF p = mapToScene(mapFromGlobal(event->globalPos())); + // Erase all items that appear in a 2*strokeWidth_ square with center at the event position +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + QPointF p = mapToScene(mapFromGlobal(event->globalPos())); +#else + QPointF p = mapToScene(mapFromGlobal(event->globalPosition().toPoint())); +#endif QGraphicsRectItem *eraseRect = scene_->addRect(QRectF(p.x() - strokeWidth_, p.y() - strokeWidth_, 2 * strokeWidth_, 2 * strokeWidth_)); const auto &gItems = eraseRect->collidingItems(); @@ -308,7 +315,11 @@ void WbWidget::mouseMoveEvent(QMouseEvent *event) event->ignore(); return; } else if (mode_ >= Mode::DrawPath && newWbItem_) { +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) newWbItem_->parseCursorMove(mapToScene(mapFromGlobal(event->globalPos()))); +#else + newWbItem_->parseCursorMove(mapToScene(mapFromGlobal(event->globalPosition().toPoint()))); +#endif } } diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt index ea4d7e6cd..ac4b0ba2f 100644 --- a/src/widgets/CMakeLists.txt +++ b/src/widgets/CMakeLists.txt @@ -10,6 +10,7 @@ set(SOURCES eventnotifier.cpp fancylabel.cpp fancypopup.cpp + grepshortcutkeydialog.cpp iconaction.cpp iconselect.cpp iconwidget.cpp @@ -36,6 +37,7 @@ set(HEADERS fancylabel.h fancypopup.h fancypopuplist.h + grepshortcutkeydialog.h iconaction.h iconbutton.h iconlabel.h @@ -75,6 +77,7 @@ endif() set(FORMS fancypopup.ui + grepshortcutkeydialog.ui ) if(PSI_PLUS AND (EXISTS "${CMAKE_CURRENT_LIST_DIR}/psiwindowheader.cpp")) @@ -91,5 +94,5 @@ endif() qt_wrap_ui(UI_FORMS ${FORMS}) add_library(widgets STATIC ${SOURCES} ${HEADERS} ${UI_FORMS}) -target_link_libraries(widgets ${QT_LIBRARIES} ${iris_LIB} libpsi_tools) -target_include_directories(widgets PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) +target_link_libraries(widgets ${QT_LIBRARIES} ${iris_LIB} tools) +target_include_directories(widgets PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_LIST_DIR}) diff --git a/src/widgets/emojidb.cpp b/src/widgets/emojidb.cpp index 56c3b9fe7..052cf6297 100644 --- a/src/widgets/emojidb.cpp +++ b/src/widgets/emojidb.cpp @@ -1,8 +1,5 @@ // This is a generated file. See emoji.py for details // clang-format off -#include "qglobal.h" -#include "emojiregistry.h" -#include static std::vector db = { { QT_TR_NOOP("Smileys & Emotion"), @@ -229,6 +226,14 @@ static std::vector db = { { "🫨", "shaking face" + }, + { + "🙂‍↔️", + "head shaking horizontally" + }, + { + "🙂‍↕️", + "head shaking vertically" } } }, @@ -586,12 +591,8 @@ static std::vector db = { } }, { - "emotion", + "heart", { - { - "💋", - "kiss mark" - }, { "💌", "love letter" @@ -648,6 +649,10 @@ static std::vector db = { "❤️", "red heart" }, + { + "🩷", + "pink heart" + }, { "🧡", "orange heart" @@ -664,21 +669,13 @@ static std::vector db = { "💙", "blue heart" }, - { - "💜", - "purple heart" - }, { "🩵", "light blue heart" }, { - "🩶", - "grey heart" - }, - { - "🩷", - "pink heart" + "💜", + "purple heart" }, { "🤎", @@ -688,9 +685,22 @@ static std::vector db = { "🖤", "black heart" }, + { + "🩶", + "grey heart" + }, { "🤍", "white heart" + } + } + }, + { + "emotion", + { + { + "💋", + "kiss mark" }, { "💯", @@ -720,10 +730,6 @@ static std::vector db = { "🕳️", "hole" }, - { - "💣", - "bomb" - }, { "💬", "speech balloon" @@ -793,6 +799,14 @@ static std::vector db = { { "🫴", "palm up hand" + }, + { + "🫷", + "leftwards pushing hand" + }, + { + "🫸", + "rightwards pushing hand" } } }, @@ -929,14 +943,6 @@ static std::vector db = { { "🙏", "folded hands" - }, - { - "🫷", - "leftwards pushing hand" - }, - { - "🫸", - "rightwards pushing hand" } } }, @@ -1781,6 +1787,18 @@ static std::vector db = { "🚶‍♀️", "woman walking" }, + { + "🚶‍➡️", + "person walking facing right" + }, + { + "🚶‍♀️‍➡️", + "woman walking facing right" + }, + { + "🚶‍♂️‍➡️", + "man walking facing right" + }, { "🧍", "person standing" @@ -1805,42 +1823,90 @@ static std::vector db = { "🧎‍♀️", "woman kneeling" }, + { + "🧎‍➡️", + "person kneeling facing right" + }, + { + "🧎‍♀️‍➡️", + "woman kneeling facing right" + }, + { + "🧎‍♂️‍➡️", + "man kneeling facing right" + }, { "🧑‍🦯", "person with white cane" }, + { + "🧑‍🦯‍➡️", + "person with white cane facing right" + }, { "👨‍🦯", "man with white cane" }, + { + "👨‍🦯‍➡️", + "man with white cane facing right" + }, { "👩‍🦯", "woman with white cane" }, + { + "👩‍🦯‍➡️", + "woman with white cane facing right" + }, { "🧑‍🦼", "person in motorized wheelchair" }, + { + "🧑‍🦼‍➡️", + "person in motorized wheelchair facing right" + }, { "👨‍🦼", "man in motorized wheelchair" }, + { + "👨‍🦼‍➡️", + "man in motorized wheelchair facing right" + }, { "👩‍🦼", "woman in motorized wheelchair" }, + { + "👩‍🦼‍➡️", + "woman in motorized wheelchair facing right" + }, { "🧑‍🦽", "person in manual wheelchair" }, + { + "🧑‍🦽‍➡️", + "person in manual wheelchair facing right" + }, { "👨‍🦽", "man in manual wheelchair" }, + { + "👨‍🦽‍➡️", + "man in manual wheelchair facing right" + }, { "👩‍🦽", "woman in manual wheelchair" }, + { + "👩‍🦽‍➡️", + "woman in manual wheelchair facing right" + }, { "🏃", "person running" @@ -1853,6 +1919,18 @@ static std::vector db = { "🏃‍♀️", "woman running" }, + { + "🏃‍➡️", + "person running facing right" + }, + { + "🏃‍♀️‍➡️", + "woman running facing right" + }, + { + "🏃‍♂️‍➡️", + "man running facing right" + }, { "💃", "woman dancing" @@ -2156,10 +2234,6 @@ static std::vector db = { "👩‍❤️‍👩", "couple with heart" }, - { - "👪", - "family" - }, { "👨‍👩‍👦", "family" @@ -2281,6 +2355,26 @@ static std::vector db = { "🫂", "people hugging" }, + { + "👪", + "family" + }, + { + "🧑‍🧑‍🧒", + "family" + }, + { + "🧑‍🧑‍🧒‍🧒", + "family" + }, + { + "🧑‍🧒", + "family" + }, + { + "🧑‍🧒‍🧒", + "family" + }, { "👣", "footprints" @@ -2640,13 +2734,17 @@ static std::vector db = { "🪽", "wing" }, + { + "🐦‍⬛", + "black bird" + }, { "🪿", "goose" }, { - "🐦‍⬛", - "black bird" + "🐦‍🔥", + "phoenix" } } }, @@ -2933,6 +3031,10 @@ static std::vector db = { { "🪺", "nest with eggs" + }, + { + "🍄", + "mushroom" } } } @@ -2964,6 +3066,10 @@ static std::vector db = { "🍋", "lemon" }, + { + "🍋‍🟩", + "lime" + }, { "🍌", "banana" @@ -3073,10 +3179,6 @@ static std::vector db = { "🧅", "onion" }, - { - "🍄", - "mushroom" - }, { "🥜", "peanuts" @@ -3096,6 +3198,10 @@ static std::vector db = { { "🫛", "pea pod" + }, + { + "🍄‍🟫", + "brown mushroom" } } }, @@ -4700,6 +4806,10 @@ static std::vector db = { "🪁", "kite" }, + { + "🔫", + "water pistol" + }, { "🎱", "pool 8 ball" @@ -4712,14 +4822,6 @@ static std::vector db = { "🪄", "magic wand" }, - { - "🧿", - "nazar amulet" - }, - { - "🪬", - "hamsa" - }, { "🎮", "video game" @@ -4915,10 +5017,6 @@ static std::vector db = { "🪭", "folding hand fan" }, - { - "🪮", - "hair pick" - }, { "👛", "purse" @@ -4975,6 +5073,10 @@ static std::vector db = { "👢", "woman’s boot" }, + { + "🪮", + "hair pick" + }, { "👑", "crown" @@ -5677,8 +5779,8 @@ static std::vector db = { "crossed swords" }, { - "🔫", - "water pistol" + "💣", + "bomb" }, { "🪃", @@ -5728,6 +5830,10 @@ static std::vector db = { "🔗", "link" }, + { + "⛓️‍💥", + "broken chain" + }, { "⛓️", "chains" @@ -5940,6 +6046,14 @@ static std::vector db = { "⚱️", "funeral urn" }, + { + "🧿", + "nazar amulet" + }, + { + "🪬", + "hamsa" + }, { "🗿", "moai" @@ -6367,6 +6481,10 @@ static std::vector db = { "📶", "antenna bars" }, + { + "🛜", + "wireless" + }, { "📳", "vibration mode" @@ -6374,10 +6492,6 @@ static std::vector db = { { "📴", "mobile phone off" - }, - { - "🛜", - "wireless" } } }, diff --git a/src/widgets/emojiregistry.cpp b/src/widgets/emojiregistry.cpp index e21629b3e..3c70e1b41 100644 --- a/src/widgets/emojiregistry.cpp +++ b/src/widgets/emojiregistry.cpp @@ -19,9 +19,10 @@ #include -#include "emojidb.cpp" #include "emojiregistry.h" +#include "emojidb.cpp" // don't move this line to other headers + const EmojiRegistry &EmojiRegistry::instance() { static EmojiRegistry i; diff --git a/src/libpsi/dialogs/grepshortcutkeydialog.cpp b/src/widgets/grepshortcutkeydialog.cpp similarity index 100% rename from src/libpsi/dialogs/grepshortcutkeydialog.cpp rename to src/widgets/grepshortcutkeydialog.cpp diff --git a/src/libpsi/dialogs/grepshortcutkeydialog.h b/src/widgets/grepshortcutkeydialog.h similarity index 100% rename from src/libpsi/dialogs/grepshortcutkeydialog.h rename to src/widgets/grepshortcutkeydialog.h diff --git a/src/libpsi/dialogs/grepshortcutkeydialog.ui b/src/widgets/grepshortcutkeydialog.ui similarity index 100% rename from src/libpsi/dialogs/grepshortcutkeydialog.ui rename to src/widgets/grepshortcutkeydialog.ui diff --git a/src/widgets/iconselect.cpp b/src/widgets/iconselect.cpp index 870025d1a..230d7d058 100644 --- a/src/widgets/iconselect.cpp +++ b/src/widgets/iconselect.cpp @@ -258,7 +258,7 @@ IconSelect::~IconSelect() { } void IconSelect::closeMenu() { // this way all parent menus (if any) would be closed too - QMouseEvent me(QEvent::MouseButtonPress, menu->pos() - QPoint(5, 5), Qt::LeftButton, Qt::LeftButton, + QMouseEvent me(QEvent::MouseButtonPress, menu->pos() - QPoint(5, 5), QCursor::pos(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); menu->mousePressEvent(&me); @@ -302,9 +302,13 @@ void IconSelect::setIconset(const Iconset &iconset) // first we need to find optimal size for elements and don't forget about // taking too much screen space float w = 0, h = 0; - auto fontSz = qApp->fontMetrics().height(); - int maxPrefTileHeight = fontSz * 2; - auto maxPrefSize = QSize(maxPrefTileHeight, maxPrefTileHeight); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + const auto fontSz = qApp->fontMetrics().height(); +#else + const auto fontSz = QFontMetrics(qApp->font()).height(); +#endif + int maxPrefTileHeight = fontSz * 2; + auto maxPrefSize = QSize(maxPrefTileHeight, maxPrefTileHeight); double count; // the 'double' type is somewhat important for MSVC.NET here if (fontEmojiMode) { diff --git a/src/widgets/iconwidget.cpp b/src/widgets/iconwidget.cpp index be19fc7ba..ca1ce4b40 100644 --- a/src/widgets/iconwidget.cpp +++ b/src/widgets/iconwidget.cpp @@ -431,9 +431,13 @@ class IconsetDisplayItem : public RealIconWidgetItem { connect(&icon, SIGNAL(pixmapChanged()), SLOT(update())); icon.activated(false); - - auto iconSize = qApp->fontMetrics().height() * ScalableIconFactor; - h = icon.pixmap(QSize(iconSize, iconSize)).height(); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + const auto fontSize = qApp->fontMetrics().height(); +#else + const auto fontSize = QFontMetrics(qApp->font()).height(); +#endif + const auto iconSize = fontSize * ScalableIconFactor; + h = icon.pixmap(QSize(iconSize, iconSize)).height(); QStringList str; for (const PsiIcon::IconText &t : icon.text()) @@ -475,7 +479,12 @@ class IconsetDisplayItem : public RealIconWidgetItem { void paint(QPainter *painter) const { #ifndef WIDGET_PLUGIN - auto iconSize = qApp->fontMetrics().height() * ScalableIconFactor; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + const auto fontSize = qApp->fontMetrics().height(); +#else + const auto fontSize = QFontMetrics(qApp->font()).height(); +#endif + const auto iconSize = fontSize * ScalableIconFactor; painter->drawPixmap(QPoint((2 * margin + w - icon.pixmap(QSize(iconSize, iconSize)).width()) / 2, margin), icon.pixmap(QSize(iconSize, iconSize))); #else @@ -497,8 +506,13 @@ IconsetDisplay::~IconsetDisplay() { } void IconsetDisplay::setIconset(const Iconset &iconset) { #ifndef WIDGET_PLUGIN - int w = 0; - auto iconSize = qApp->fontMetrics().height() * ScalableIconFactor; + int w = 0; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + const auto fontSize = qApp->fontMetrics().height(); +#else + const auto fontSize = QFontMetrics(qApp->font()).height(); +#endif + const auto iconSize = fontSize * ScalableIconFactor; QListIterator it = iconset.iterator(); while (it.hasNext()) { w = qMax(w, it.next()->pixmap(QSize(iconSize, iconSize)).width()); diff --git a/src/widgets/tabbar.cpp b/src/widgets/tabbar.cpp index ec2da70ae..3d05d7a21 100644 --- a/src/widgets/tabbar.cpp +++ b/src/widgets/tabbar.cpp @@ -1109,20 +1109,25 @@ void TabBar::mouseMoveEvent(QMouseEvent *event) void TabBar::dragMoveEvent(QDragMoveEvent *event) { - int newDragHoverTab = tabAt(event->pos()); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + auto eventPos = event->pos(); +#else + auto eventPos = event->position().toPoint(); +#endif + int newDragHoverTab = tabAt(eventPos); int newDragInsertIndex = newDragHoverTab; // Try to guess that need to insert in the end if (newDragHoverTab == -1) { QPoint p = d->hackedTabs.last().rect.topRight(); - if (event->pos().x() > p.x() && event->pos().y() > p.y()) { + if (eventPos.x() > p.x() && eventPos.y() > p.y()) { newDragHoverTab = d->hackedTabs.size() - 1; newDragInsertIndex = newDragHoverTab; } } if (newDragInsertIndex > -1) { - int x = event->pos().x() - d->hackedTabs[newDragInsertIndex].rect.left(); + int x = eventPos.x() - d->hackedTabs[newDragInsertIndex].rect.left(); if (x * 2 > d->hackedTabs[newDragInsertIndex].rect.width()) newDragInsertIndex++; } diff --git a/src/widgets/typeaheadfind.cpp b/src/widgets/typeaheadfind.cpp index cfe6b6266..ebb25b740 100644 --- a/src/widgets/typeaheadfind.cpp +++ b/src/widgets/typeaheadfind.cpp @@ -29,6 +29,9 @@ #include #include #include +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include +#endif /** * \class TypeAheadFindBar @@ -85,7 +88,13 @@ class TypeAheadFindBar::Private { |= options & QTextDocument::FindBackward ? QWebEnginePage::FindBackward : QWebEnginePage::FindFlags(); wkOptions |= options & QTextDocument::FindCaseSensitively ? QWebEnginePage::FindCaseSensitively : QWebEnginePage::FindFlags(); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) wv->findText(str, wkOptions, [this](bool found) { updateFoundStyle(found); }); +#else + wv->findText(str, wkOptions, [this](const QWebEngineFindTextResult &found) { + updateFoundStyle(found.numberOfMatches() > 0); + }); +#endif #else QWebPage::FindFlags wkOptions; wkOptions |= options & QTextDocument::FindBackward ? QWebPage::FindBackward : QWebPage::FindFlags(); diff --git a/src/x11windowsystem.cpp b/src/x11windowsystem.cpp index 1efc80c66..7687ff0ed 100644 --- a/src/x11windowsystem.cpp +++ b/src/x11windowsystem.cpp @@ -377,3 +377,5 @@ bool X11WindowSystem::windowHasAnyOfStates(Window win, const QSet &filtere } return false; } + +ulong X11WindowSystem::getDesktopRootWindow() { return getRootWindow(); }; diff --git a/src/x11windowsystem.h b/src/x11windowsystem.h index db335e806..50e7d2131 100644 --- a/src/x11windowsystem.h +++ b/src/x11windowsystem.h @@ -44,6 +44,7 @@ class X11WindowSystem { bool desktopOfWindow(Window *window, long *desktop); void x11wmClass(WId wid, QString resName); void bringToFront(QWidget *w); + ulong getDesktopRootWindow(); }; #endif // X11WINDOWSYSTEM_H diff --git a/src/xmlconsole.cpp b/src/xmlconsole.cpp index d5ea01286..010fde697 100644 --- a/src/xmlconsole.cpp +++ b/src/xmlconsole.cpp @@ -215,7 +215,7 @@ void XmlPrompt::doTransmit() if (!doc.setContent(str)) { int i = QMessageBox::warning(this, tr("Malformed XML"), tr("You have entered malformed XML input. Are you sure you want to send this ?"), - tr("Yes"), tr("No")); + QMessageBox::Yes | QMessageBox::No); if (i != 0) return; } diff --git a/version b/version index 525cd4f89..690ec2298 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.5.1683 (2024-03-17, aba51030) +1.5.1700 (2024-03-18, 33c6541f)