Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/iris/cmake/modules/IrisSCTP.cmake b/iris/cmake/modules/IrisSCTP.cmake
- index d02888b5..84056f5b 100644
- --- a/iris/cmake/modules/IrisSCTP.cmake
- +++ b/iris/cmake/modules/IrisSCTP.cmake
- @@ -60,10 +60,14 @@ else()
- if(NOT Git_FOUND)
- message(FATAL_ERROR "Git not found! Bundled UsrSCTP needs Git utility.\nPlease set GIT_EXECUTABLE variable or add git to PATH")
- endif()
- + # When using the "cmake --build . -t clean" command, it cleans the built files, but the next time it builds, it crashes with a patch error.
- + # As an attempt to avoid this crash the last line of patch_command was added
- set(patch_command
- - ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/usrsctp.patch <SOURCE_DIR> &&
- - ${GIT_EXECUTABLE} checkout <SOURCE_DIR>/usrsctplib/netinet/sctp_output.c &&
- - ${GIT_EXECUTABLE} apply <SOURCE_DIR>/usrsctp.patch)
- + ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/usrsctp.patch <SOURCE_DIR> &&
- + ${GIT_EXECUTABLE} checkout <SOURCE_DIR>/usrsctplib/netinet/sctp_output.c &&
- + ${GIT_EXECUTABLE} apply <SOURCE_DIR>/usrsctp.patch ||
- + ${CMAKE_COMMAND} -E echo "USRSCTP Sources already patched"
- + )
- ExternalProject_Add(UsrSCTPProject
- PREFIX ${USRSCTP_PREFIX}
- BINARY_DIR ${USRSCTP_BUILD_DIR}
- diff --git a/iris/src/xmpp/xmpp-im/types.cpp b/iris/src/xmpp/xmpp-im/types.cpp
- index 6b212b70..ff22a0f7 100644
- --- a/iris/src/xmpp/xmpp-im/types.cpp
- +++ b/iris/src/xmpp/xmpp-im/types.cpp
- @@ -33,6 +33,10 @@
- #include <optional>
- +#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)
- +#include <QTimeZone>
- +#endif
- +
- #define NS_XML "http://www.w3.org/XML/1998/namespace"
- namespace XMPP {
- @@ -1482,7 +1486,7 @@ Stanza Message::toStanza(Stream *stream) const
- if (!d->reactions.targetId.isEmpty()) {
- auto e = s.createElement(reactionsNS, QStringLiteral("reactions"));
- e.setAttribute(QLatin1String("id"), d->reactions.targetId);
- - for (const QString &reaction : d->reactions.reactions) {
- + for (const QString &reaction : std::as_const(d->reactions.reactions)) {
- e.appendChild(s.createTextElement(reactionsNS, QStringLiteral("reaction"), reaction));
- }
- s.appendChild(e);
- @@ -1656,7 +1660,11 @@ bool Message::fromStanza(const Stanza &s, bool useTimeZoneOffset, int timeZoneOf
- if (useTimeZoneOffset) {
- d->timeStamp = stamp.addSecs(timeZoneOffset * 3600);
- } else {
- +#if QT_VERSION < QT_VERSION_CHECK(6, 9, 0)
- stamp.setTimeSpec(Qt::UTC);
- +#else
- + stamp.setTimeZone(QTimeZone::UTC);
- +#endif
- d->timeStamp = stamp.toLocalTime();
- }
- d->timeStampSend = true;
- diff --git a/iris/src/xmpp/xmpp-im/xmpp_mamtask.cpp b/iris/src/xmpp/xmpp-im/xmpp_mamtask.cpp
- index 87eee3d3..a79a3740 100644
- --- a/iris/src/xmpp/xmpp-im/xmpp_mamtask.cpp
- +++ b/iris/src/xmpp/xmpp-im/xmpp_mamtask.cpp
- @@ -18,6 +18,9 @@
- */
- #include "xmpp_mamtask.h"
- +#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)
- +#include <QTimeZone>
- +#endif
- using namespace XMLHelper;
- using namespace XMPP;
- @@ -76,7 +79,11 @@ XData MAMTask::Private::makeMAMFilter()
- XData::Field start;
- start.setType(XData::Field::Field_TextSingle);
- start.setVar(QLatin1String("start"));
- +#if QT_VERSION < QT_VERSION_CHECK(6, 9, 0)
- from.setTimeSpec(Qt::UTC);
- +#else
- + from.setTimeZone(QTimeZone::UTC);
- +#endif
- start.setValue(QStringList(from.toString()));
- fl.append(start);
- }
- @@ -85,7 +92,11 @@ XData MAMTask::Private::makeMAMFilter()
- XData::Field end;
- end.setType(XData::Field::Field_TextSingle);
- end.setVar(QLatin1String("end"));
- +#if QT_VERSION < QT_VERSION_CHECK(6, 9, 0)
- to.setTimeSpec(Qt::UTC);
- +#else
- + to.setTimeZone(QTimeZone::UTC);
- +#endif
- end.setValue(QStringList(to.toString()));
- fl.append(end);
- }
- diff --git a/iris/src/xmpp/xmpp-im/xmpp_tasks.cpp b/iris/src/xmpp/xmpp-im/xmpp_tasks.cpp
- index 90d8232c..ea0f4ba6 100644
- --- a/iris/src/xmpp/xmpp-im/xmpp_tasks.cpp
- +++ b/iris/src/xmpp/xmpp-im/xmpp_tasks.cpp
- @@ -32,6 +32,9 @@
- #include <QList>
- #include <QRegularExpression>
- #include <QTimer>
- +#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)
- +#include <QTimeZone>
- +#endif
- using namespace XMPP;
- @@ -776,7 +779,11 @@ bool JT_PushPresence::take(const QDomElement &e)
- if (client()->manualTimeZoneOffset()) {
- stamp = stamp.addSecs(client()->timeZoneOffset() * 3600);
- } else {
- +#if QT_VERSION < QT_VERSION_CHECK(6, 9, 0)
- stamp.setTimeSpec(Qt::UTC);
- +#else
- + stamp.setTimeZone(QTimeZone::UTC);
- +#endif
- stamp = stamp.toLocalTime();
- }
- p.setTimeStamp(stamp);
- diff --git a/plugins/generic/contentdownloaderplugin/form.cpp b/plugins/generic/contentdownloaderplugin/form.cpp
- index db8f2159..23a3e0f7 100644
- --- a/plugins/generic/contentdownloaderplugin/form.cpp
- +++ b/plugins/generic/contentdownloaderplugin/form.cpp
- @@ -271,7 +271,15 @@ void Form::downloadHtmlFinished()
- QString errorMsg;
- int errorLine, errorColumn;
- +#if QT_VERSION < QT_VERSION_CHECK(6, 8, 0)
- if (doc.setContent(html, &errorMsg, &errorLine, &errorColumn)) {
- +#else
- + auto parseResult = doc.setContent(html);
- + errorMsg = parseResult.errorMessage;
- + errorLine = parseResult.errorLine;
- + errorColumn = parseResult.errorColumn;
- + if (parseResult) {
- +#endif
- QString imgsdir = tmpDir_ + QDir::separator() + "imgs";
- QDir dir(imgsdir);
- QFileSystemModel *model = new QFileSystemModel();
- diff --git a/plugins/generic/juickplugin/juickparser.cpp b/plugins/generic/juickplugin/juickparser.cpp
- index 1116d8ee..6330f7ee 100644
- --- a/plugins/generic/juickplugin/juickparser.cpp
- +++ b/plugins/generic/juickplugin/juickparser.cpp
- @@ -21,6 +21,9 @@
- #include <QDateTime>
- #include <QObject>
- #include <QRegularExpression>
- +#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)
- +#include <QTimeZone>
- +#endif
- static const QString juickLink("https://juick.com/%1");
- @@ -247,7 +250,11 @@ QString JuickParser::timeStamp() const
- if (offset == -1) {
- QDateTime cur = QDateTime::currentDateTime();
- QDateTime utc = cur.toUTC();
- +#if QT_VERSION < QT_VERSION_CHECK(6, 9, 0)
- utc.setTimeSpec(Qt::LocalTime);
- +#else
- + utc.setTimeZone(QTimeZone::LocalTime);
- +#endif
- offset = utc.secsTo(cur);
- }
- dt = dt.addSecs(offset);
- diff --git a/plugins/generic/omemoplugin/src/omemo.h b/plugins/generic/omemoplugin/src/omemo.h
- index c09cb77f..962dc511 100644
- --- a/plugins/generic/omemoplugin/src/omemo.h
- +++ b/plugins/generic/omemoplugin/src/omemo.h
- @@ -111,9 +111,9 @@ private:
- };
- std::shared_ptr<Crypto> m_crypto;
- + AccountInfoAccessingHost *m_accountInfoAccessor = nullptr;
- StanzaSendingHost *m_stanzaSender = nullptr;
- PsiAccountControllingHost *m_accountController = nullptr;
- - AccountInfoAccessingHost *m_accountInfoAccessor = nullptr;
- ContactInfoAccessingHost *m_contactInfoAccessor = nullptr;
- QVector<std::shared_ptr<MessageWaitingForBundles>> m_pendingMessages;
- QString m_dataPath;
- diff --git a/plugins/generic/otrplugin/src/htmltidy.cpp b/plugins/generic/otrplugin/src/htmltidy.cpp
- index 8c30061a..cac3abad 100644
- --- a/plugins/generic/otrplugin/src/htmltidy.cpp
- +++ b/plugins/generic/otrplugin/src/htmltidy.cpp
- @@ -89,7 +89,15 @@ QDomElement HtmlTidy::output(QDomDocument &document)
- QString errorText;
- QString html = writeOutput();
- +#if QT_VERSION < QT_VERSION_CHECK(6, 8, 0)
- if (!document.setContent(html, true, &errorText, &errorLine, &errorColumn)) {
- +#else
- + auto result = document.setContent(html, QDomDocument::ParseOption::UseNamespaceProcessing);
- + errorLine = result.errorLine;
- + errorColumn = result.errorColumn;
- + errorText = result.errorMessage;
- + if (!result) {
- +#endif
- qWarning() << "---- parsing error:\n"
- << html << "\n----\n"
- << errorText << " line:" << errorLine << " column:" << errorColumn;
- diff --git a/plugins/generic/otrplugin/src/psiotrplugin.cpp b/plugins/generic/otrplugin/src/psiotrplugin.cpp
- index 1b7e6c18..bcd4f6f0 100644
- --- a/plugins/generic/otrplugin/src/psiotrplugin.cpp
- +++ b/plugins/generic/otrplugin/src/psiotrplugin.cpp
- @@ -302,7 +302,15 @@ bool PsiOtrPlugin::decryptMessageElement(int accountIndex, QDomElement &messageE
- QDomDocument document;
- int errorLine = 0, errorColumn = 0;
- QString errorText;
- +#if QT_VERSION < QT_VERSION_CHECK(6, 8, 0)
- if (document.setContent(decrypted, true, &errorText, &errorLine, &errorColumn)) {
- +#else
- + auto result = document.setContent(decrypted, QDomDocument::ParseOption::UseNamespaceProcessing);
- + errorColumn = result.errorColumn;
- + errorLine = result.errorLine;
- + errorText = result.errorMessage;
- + if (result) {
- +#endif
- htmlElement.appendChild(document.documentElement());
- } else {
- qWarning() << "---- parsing error:\n"
- diff --git a/src/bookmarkmanagedlg.cpp b/src/bookmarkmanagedlg.cpp
- index fdb8081c..a7bdfc52 100644
- --- a/src/bookmarkmanagedlg.cpp
- +++ b/src/bookmarkmanagedlg.cpp
- @@ -234,7 +234,13 @@ void BookmarkManageDlg::importBookmarks()
- if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
- QDomDocument doc;
- QString error;
- +#if QT_VERSION < QT_VERSION_CHECK(6, 8, 0)
- if (doc.setContent(&file, &error)) {
- +#else
- + auto result = doc.setContent(&file);
- + error = result.errorMessage;
- + if (result) {
- +#endif
- QDomElement root = doc.firstChildElement("bookmarks");
- if (root.isNull())
- return;
- diff --git a/src/historydlg.cpp b/src/historydlg.cpp
- index 6e2a3a60..ec9870d2 100644
- --- a/src/historydlg.cpp
- +++ b/src/historydlg.cpp
- @@ -38,6 +38,9 @@
- #include <QProgressDialog>
- #include <QScrollBar>
- #include <QTextBlock>
- +#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)
- +#include <QTimeZone>
- +#endif
- #define SEARCH_PADDING_SIZE 20
- #define DISPLAY_PAGE_SIZE 200
- @@ -1138,8 +1141,10 @@ void HistoryDlg::getNext()
- void HistoryDlg::getDate()
- {
- -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
- +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) && QT_VERSION < QT_VERSION_CHECK(6,9,0)
- QDateTime ts = ui_.calendar->selectedDate().startOfDay(Qt::UTC);
- +#elif QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)
- + QDateTime ts = ui_.calendar->selectedDate().startOfDay(QTimeZone::UTC);
- #else
- QDateTime ts(ui_.calendar->selectedDate(), { 0, 0 }, Qt::UTC);
- #endif
- diff --git a/src/tools/iconset/iconset.cpp b/src/tools/iconset/iconset.cpp
- index e96db1a0..72801102 100644
- --- a/src/tools/iconset/iconset.cpp
- +++ b/src/tools/iconset/iconset.cpp
- @@ -1603,7 +1603,11 @@ bool Iconset::load(const QString &dir, Format format)
- ba = d->loadData(fileName, dir);
- if (!ba.isEmpty()) {
- QDomDocument doc;
- +#if QT_VERSION < QT_VERSION_CHECK(6, 8, 0)
- if (doc.setContent(ba, false)) {
- +#else
- + if (doc.setContent(ba)) {
- +#endif
- if ((format == Format::Psi && d->load(doc, dir))
- || (format == Format::KdeEmoticons && d->loadKdeEmoticons(doc, dir))) {
- d->filename = dir;
- diff --git a/src/vcardfactory.cpp b/src/vcardfactory.cpp
- index 718ce9f6..525c77b2 100644
- --- a/src/vcardfactory.cpp
- +++ b/src/vcardfactory.cpp
- @@ -207,7 +207,11 @@ VCard4::VCard VCardFactory::vcard(const Jid &j, Flags flags)
- if (!v4) {
- file.seek(0);
- QDomDocument doc;
- +#if QT_VERSION < QT_VERSION_CHECK(6, 8, 0)
- if (doc.setContent(&file, false)) {
- +#else
- + if (doc.setContent(&file)) {
- +#endif
- VCard vcard = VCard::fromXml(doc.documentElement());
- if (!vcard.isNull()) {
- v4.fromVCardTemp(vcard);
- diff --git a/src/whiteboarding/wbmanager.cpp b/src/whiteboarding/wbmanager.cpp
- index 74ccafea..b55e3d6c 100644
- --- a/src/whiteboarding/wbmanager.cpp
- +++ b/src/whiteboarding/wbmanager.cpp
- @@ -114,7 +114,11 @@ void WbManager::openWhiteboard(const Jid &target, const Jid &ownJid, bool groupC
- QFile file(fileName);
- if (file.open(QIODevice::ReadOnly)) {
- +#if QT_VERSION < QT_VERSION_CHECK(6, 8, 0)
- doc.setContent(&file, true);
- +#else
- + doc.setContent(&file, QDomDocument::ParseOption::UseNamespaceProcessing);
- +#endif
- file.close();
- }
- }
- @@ -124,7 +128,11 @@ void WbManager::openWhiteboard(const Jid &target, const Jid &ownJid, bool groupC
- // initialize with an empty whiteboarding document
- doc = QDomDocument();
- +#if QT_VERSION < QT_VERSION_CHECK(6, 8, 0)
- doc.setContent(QString(EMPTYWB), true);
- +#else
- + doc.setContent(QString(EMPTYWB), QDomDocument::ParseOption::UseNamespaceProcessing);
- +#endif
- }
- // negotiate the session
Advertisement
Add Comment
Please, Sign In to add comment