Control: tags -1 + pending

On Sun, Nov 01, 2020 at 05:05:49PM +0300, Dmitry Shachnev wrote:
> Dear Maintainer,
>
> qtox autopkgtest failed when run against Qt 5.15 from unstable:
>
> https://ci.debian.net/data/autopkgtest/testing/amd64/q/t/7855235/log.gz

I have just uploaded an NMU to fix this. Sorry but I uploaded with 0-day
delay, because this is the last blocker for Qt transition.

The debdiff is attached. I have also created a merge request:

https://salsa.debian.org/yangfl-guest/qTox/-/merge_requests/1

--
Dmitry Shachnev
diff -Nru qtox-1.17.2/debian/changelog qtox-1.17.2/debian/changelog
--- qtox-1.17.2/debian/changelog	2020-05-05 21:53:32.000000000 +0300
+++ qtox-1.17.2/debian/changelog	2020-11-05 15:09:24.000000000 +0300
@@ -1,3 +1,12 @@
+qtox (1.17.2-1.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Backport upstream changes to fix build with Qt 5.15.
+  * Run cmake with -Wno-dev in the autopkgtest (closes: #973540).
+  * Fix Lintian duplicate-globbing-patterns error.
+
+ -- Dmitry Shachnev <mity...@debian.org>  Thu, 05 Nov 2020 15:09:24 +0300
+
 qtox (1.17.2-1) unstable; urgency=medium
 
   * New upstream release (Closes: #959699)
diff -Nru qtox-1.17.2/debian/copyright qtox-1.17.2/debian/copyright
--- qtox-1.17.2/debian/copyright	2020-05-05 21:53:32.000000000 +0300
+++ qtox-1.17.2/debian/copyright	2020-11-05 15:09:24.000000000 +0300
@@ -87,10 +87,6 @@
            2014-2015 The qTox Project Contributors
 License: GPL-3+
 
-Files: src/widget/tool/friendrequestdialog.h
-Copyright: 2013 Maxim Biro <nurupo.contributi...@gmail.com>
-License: GPL-3+
-
 Files: src/platform/statusnotifier/*
 Copyright: 2014 Olivier Brunel <j...@jjacky.com>
 License: GPL-3+
diff -Nru qtox-1.17.2/debian/patches/fix-build-with-qt5.15.patch qtox-1.17.2/debian/patches/fix-build-with-qt5.15.patch
--- qtox-1.17.2/debian/patches/fix-build-with-qt5.15.patch	1970-01-01 03:00:00.000000000 +0300
+++ qtox-1.17.2/debian/patches/fix-build-with-qt5.15.patch	2020-11-05 15:09:24.000000000 +0300
@@ -0,0 +1,248 @@
+From: Dmitry Shachnev <mity...@debian.org>
+Date: Wed, 4 Nov 2020 21:17:40 +0300
+Subject: Fix build with Qt 5.15
+
+This contains changes from three upstream commits:
+
+- 6d51971c6fe6a7ee Jimi Huotari: refactor(Qt): fix build with Qt 5.15
+- 6a59f0fe4dcd2663 Jimi Huotari: refactor(Qt): fix build with Qt 5.15 again
+- f5f42233cad3e84d Maxim Biro: fix: Usage of random
+---
+ src/core/core.cpp                        |  7 +++++++
+ src/main.cpp                             |  4 ++++
+ src/model/sessionchatlog.cpp             |  4 ++++
+ src/persistence/history.cpp              |  6 +++++-
+ src/widget/emoticonswidget.cpp           |  8 ++++++++
+ src/widget/flowlayout.cpp                |  2 +-
+ src/widget/form/loadhistorydialog.cpp    |  4 ++++
+ src/widget/form/searchsettingsform.cpp   |  4 ++++
+ src/widget/form/settings/privacyform.cpp | 15 ++++++++++++---
+ src/widget/genericchatitemlayout.h       |  4 ++++
+ src/widget/tool/activatedialog.h         |  4 ++++
+ 11 files changed, 57 insertions(+), 5 deletions(-)
+
+diff --git a/src/core/core.cpp b/src/core/core.cpp
+index 78c26a8..2b645ca 100644
+--- a/src/core/core.cpp
++++ b/src/core/core.cpp
+@@ -34,6 +34,9 @@
+ #include "src/util/strongtype.h"
+ 
+ #include <QCoreApplication>
++#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
++#include <QRandomGenerator>
++#endif
+ #include <QRegularExpression>
+ #include <QString>
+ #include <QStringBuilder>
+@@ -467,7 +470,11 @@ void Core::bootstrapDht()
+     }
+ 
+     int i = 0;
++#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
++    static int j = QRandomGenerator::global()->bounded(listSize);
++#else
+     static int j = qrand() % listSize;
++#endif
+     // i think the more we bootstrap, the more we jitter because the more we overwrite nodes
+     while (i < 2) {
+         const DhtServer& dhtServer = bootstrapNodes[j % listSize];
+diff --git a/src/main.cpp b/src/main.cpp
+index 91ec5e5..84a84aa 100644
+--- a/src/main.cpp
++++ b/src/main.cpp
+@@ -175,7 +175,9 @@ int main(int argc, char* argv[])
+     qInstallMessageHandler(logMessageHandler);
+ 
+     // initialize random number generator
++#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
+     qsrand(time(nullptr));
++#endif
+ 
+     std::unique_ptr<QApplication> a(new QApplication(argc, argv));
+ 
+@@ -200,7 +202,9 @@ int main(int argc, char* argv[])
+     osx::migrateProfiles();
+ #endif
+ 
++#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
+     qsrand(time(nullptr));
++#endif
+     Settings& settings = Settings::getInstance();
+     QString locale = settings.getTranslation();
+     Translator::translate(locale);
+diff --git a/src/model/sessionchatlog.cpp b/src/model/sessionchatlog.cpp
+index f4a224f..3019a5d 100644
+--- a/src/model/sessionchatlog.cpp
++++ b/src/model/sessionchatlog.cpp
+@@ -96,7 +96,11 @@ bool toxFileIsComplete(ToxFile::FileStatus status)
+ std::map<ChatLogIdx, ChatLogItem>::const_iterator
+ firstItemAfterDate(QDate date, const std::map<ChatLogIdx, ChatLogItem>& items)
+ {
++#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
++    return std::lower_bound(items.begin(), items.end(), QDateTime(date.startOfDay()),
++#else
+     return std::lower_bound(items.begin(), items.end(), QDateTime(date),
++#endif
+                             [](const MessageDateAdaptor& a, MessageDateAdaptor const& b) {
+                                 return a.timestamp.date() < b.timestamp.date();
+                             });
+diff --git a/src/persistence/history.cpp b/src/persistence/history.cpp
+index 6e9f29f..f487e78 100644
+--- a/src/persistence/history.cpp
++++ b/src/persistence/history.cpp
+@@ -872,7 +872,7 @@ QDateTime History::getDateWhereFindPhrase(const QString& friendPk, const QDateTi
+     }
+ 
+     if (parameter.period == PeriodSearch::AfterDate || parameter.period == PeriodSearch::BeforeDate) {
+-        date = QDateTime(parameter.date);
++        date = parameter.date.startOfDay();
+     }
+ 
+     QString period;
+@@ -957,7 +957,11 @@ QList<History::DateIdx> History::getNumMessagesForFriendBeforeDateBoundaries(con
+                                "%4;")
+                            .arg(countMessagesForFriend)
+                            .arg(friendPkString)
++#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
++                           .arg(QDateTime(from.startOfDay()).toMSecsSinceEpoch())
++#else
+                            .arg(QDateTime(from).toMSecsSinceEpoch())
++#endif
+                            .arg(limitString);
+ 
+     QList<DateIdx> dateIdxs;
+diff --git a/src/widget/emoticonswidget.cpp b/src/widget/emoticonswidget.cpp
+index 3b29fa3..180c72c 100644
+--- a/src/widget/emoticonswidget.cpp
++++ b/src/widget/emoticonswidget.cpp
+@@ -161,8 +161,16 @@ void EmoticonsWidget::mousePressEvent(QMouseEvent*)
+ 
+ void EmoticonsWidget::wheelEvent(QWheelEvent* e)
+ {
++#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
++    const bool vertical = qAbs(e->angleDelta().y()) >= qAbs(e->angleDelta().x());
++    const int delta = vertical ? e->angleDelta().y() : e->angleDelta().x();
++
++    if (vertical) {
++        if (delta < 0) {
++#else
+     if (e->orientation() == Qt::Vertical) {
+         if (e->delta() < 0) {
++#endif
+             stack.setCurrentIndex(stack.currentIndex() + 1);
+         } else {
+             stack.setCurrentIndex(stack.currentIndex() - 1);
+diff --git a/src/widget/flowlayout.cpp b/src/widget/flowlayout.cpp
+index ac3895f..b186664 100644
+--- a/src/widget/flowlayout.cpp
++++ b/src/widget/flowlayout.cpp
+@@ -104,7 +104,7 @@ QLayoutItem* FlowLayout::takeAt(int index)
+ 
+ Qt::Orientations FlowLayout::expandingDirections() const
+ {
+-    return nullptr;
++    return {};
+ }
+ 
+ bool FlowLayout::hasHeightForWidth() const
+diff --git a/src/widget/form/loadhistorydialog.cpp b/src/widget/form/loadhistorydialog.cpp
+index 0e19252..46241d7 100644
+--- a/src/widget/form/loadhistorydialog.cpp
++++ b/src/widget/form/loadhistorydialog.cpp
+@@ -52,7 +52,11 @@ LoadHistoryDialog::~LoadHistoryDialog()
+ 
+ QDateTime LoadHistoryDialog::getFromDate()
+ {
++#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
++    QDateTime res(ui->fromDate->selectedDate().startOfDay());
++#else
+     QDateTime res(ui->fromDate->selectedDate());
++#endif
+     if (res.date().month() != ui->fromDate->monthShown()
+         || res.date().year() != ui->fromDate->yearShown()) {
+         QDate newDate(ui->fromDate->yearShown(), ui->fromDate->monthShown(), 1);
+diff --git a/src/widget/form/searchsettingsform.cpp b/src/widget/form/searchsettingsform.cpp
+index abdf6b4..49863cc 100644
+--- a/src/widget/form/searchsettingsform.cpp
++++ b/src/widget/form/searchsettingsform.cpp
+@@ -37,7 +37,11 @@ SearchSettingsForm::SearchSettingsForm(QWidget *parent) :
+ 
+     reloadTheme();
+ 
++#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
++    connect(ui->startSearchComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
++#else
+     connect(ui->startSearchComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
++#endif
+             this, &SearchSettingsForm::onStartSearchSelected);
+     connect(ui->registerCheckBox, &QCheckBox::clicked, this, &SearchSettingsForm::onRegisterClicked);
+     connect(ui->wordsOnlyRadioButton, &QCheckBox::clicked, this, &SearchSettingsForm::onWordsOnlyClicked);
+diff --git a/src/widget/form/settings/privacyform.cpp b/src/widget/form/settings/privacyform.cpp
+index 5d0ed94..74ba484 100644
+--- a/src/widget/form/settings/privacyform.cpp
++++ b/src/widget/form/settings/privacyform.cpp
+@@ -23,6 +23,11 @@
+ #include <QDebug>
+ #include <QFile>
+ #include <QMessageBox>
++#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
++#include <QRandomGenerator>
++#else
++#include <QDateTime>
++#endif
+ 
+ #include "src/core/core.h"
+ #include "src/nexus.h"
+@@ -97,12 +102,16 @@ void PrivacyForm::showEvent(QShowEvent*)
+ 
+ void PrivacyForm::on_randomNosapamButton_clicked()
+ {
+-    QTime time = QTime::currentTime();
+-    qsrand((uint)time.msec());
+-
+     uint32_t newNospam{0};
++
++#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
++    // guarantees to give a random 32-bit unsigned integer
++    newNospam = QRandomGenerator::global()->generate();
++#else
++    qsrand(static_cast<uint>(QDateTime::currentMSecsSinceEpoch()));
+     for (int i = 0; i < 4; ++i)
+         newNospam = (newNospam << 8) + (qrand() % 256); // Generate byte by byte. For some reason.
++#endif
+ 
+     Core::getInstance()->setNospam(newNospam);
+     bodyUI->nospamLineEdit->setText(Core::getInstance()->getSelfId().getNoSpamString());
+diff --git a/src/widget/genericchatitemlayout.h b/src/widget/genericchatitemlayout.h
+index aea161e..6d4bce7 100644
+--- a/src/widget/genericchatitemlayout.h
++++ b/src/widget/genericchatitemlayout.h
+@@ -33,7 +33,11 @@ public:
+     GenericChatItemLayout(const GenericChatItemLayout& layout) = delete;
+     ~GenericChatItemLayout();
+ 
++#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
++    void addSortedWidget(GenericChatItemWidget* widget, int stretch = 0, Qt::Alignment alignment = Qt::Alignment());
++#else
+     void addSortedWidget(GenericChatItemWidget* widget, int stretch = 0, Qt::Alignment alignment = nullptr);
++#endif
+     int indexOfSortedWidget(GenericChatItemWidget* widget) const;
+     bool existsSortedWidget(GenericChatItemWidget* widget) const;
+     void removeSortedWidget(GenericChatItemWidget* widget);
+diff --git a/src/widget/tool/activatedialog.h b/src/widget/tool/activatedialog.h
+index c961841..422b68a 100644
+--- a/src/widget/tool/activatedialog.h
++++ b/src/widget/tool/activatedialog.h
+@@ -26,7 +26,11 @@ class ActivateDialog : public QDialog
+ {
+     Q_OBJECT
+ public:
++#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
++    ActivateDialog(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
++#else
+     ActivateDialog(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
++#endif
+     bool event(QEvent* event) override;
+ 
+ signals:
diff -Nru qtox-1.17.2/debian/patches/series qtox-1.17.2/debian/patches/series
--- qtox-1.17.2/debian/patches/series	2020-05-05 21:53:32.000000000 +0300
+++ qtox-1.17.2/debian/patches/series	2020-11-05 15:09:24.000000000 +0300
@@ -1,2 +1,3 @@
 no-builtin-font.patch
 no-net-tests.patch
+fix-build-with-qt5.15.patch
diff -Nru qtox-1.17.2/debian/tests/unittest.sh qtox-1.17.2/debian/tests/unittest.sh
--- qtox-1.17.2/debian/tests/unittest.sh	2020-05-05 21:53:32.000000000 +0300
+++ qtox-1.17.2/debian/tests/unittest.sh	2020-11-05 15:09:24.000000000 +0300
@@ -3,7 +3,7 @@
 
 mkdir build
 cd build
-cmake ..
+cmake -Wno-dev ..
 for i in \
     test_contactid test_dbschema test_friendmessagedispatcher \
     test_groupmessagedispatcher test_messageprocessor test_offlinemsgengine \

Attachment: signature.asc
Description: PGP signature

Reply via email to