aboutsummaryrefslogtreecommitdiff
path: root/net-im/qTox
diff options
context:
space:
mode:
authorTobias C. Berner <tcberner@FreeBSD.org>2019-10-01 04:13:31 +0000
committerTobias C. Berner <tcberner@FreeBSD.org>2019-10-01 04:13:31 +0000
commitc45de9579f6ec97574056dd335df02031ccd00ad (patch)
treebf42b7c476faa7a6183d0feaa4c65bb90053847d /net-im/qTox
parent4c6b47d49f526e4aa085f3d82bef3b2910453e64 (diff)
downloadports-c45de9579f6ec97574056dd335df02031ccd00ad.tar.gz
ports-c45de9579f6ec97574056dd335df02031ccd00ad.zip
Qt5 update to 5.13.0
For new features, check: https://wiki.qt.io/New_Features_in_Qt_5.13 Thanks to adridg who helped to fix a lot of packages. Exp-run by: antoine PR: 238782
Notes
Notes: svn path=/head/; revision=513447
Diffstat (limited to 'net-im/qTox')
-rw-r--r--net-im/qTox/files/patch-git-0ac5386786733e1246ce49c483ebdf35c329102313
-rw-r--r--net-im/qTox/files/patch-git-16452eff0c21abc2888150e4f9eefd12072fc65617
-rw-r--r--net-im/qTox/files/patch-git-24811d10420901199b2fe0a5f35a391272f24f3613
-rw-r--r--net-im/qTox/files/patch-git-34e1e25b7fb12dc662ed197e615c422ea56c867a12
-rw-r--r--net-im/qTox/files/patch-git-6e71ccfdad17b275961efff0a51a182de61ef96313
-rw-r--r--net-im/qTox/files/patch-git-8a0197b37f9c6098e28115d412895d337c326a9152
-rw-r--r--net-im/qTox/files/patch-git-b45ba34be250e938c6b07617e121d789ed52ca1d38
-rw-r--r--net-im/qTox/files/patch-git-ba9d724a17e76bfe7981a69330334c612f52a76929
-rw-r--r--net-im/qTox/files/patch-git-dbf56581bb90667dc44c6db230ee7076616149a030
-rw-r--r--net-im/qTox/files/patch-git-dfe75fb101d8a8f24baa346312c2d847de6e45da43
-rw-r--r--net-im/qTox/files/patch-git-fb3f44721e6b49a3afbb57b407607c02674fe13a44
11 files changed, 304 insertions, 0 deletions
diff --git a/net-im/qTox/files/patch-git-0ac5386786733e1246ce49c483ebdf35c3291023 b/net-im/qTox/files/patch-git-0ac5386786733e1246ce49c483ebdf35c3291023
new file mode 100644
index 000000000000..ebdc65ceae5f
--- /dev/null
+++ b/net-im/qTox/files/patch-git-0ac5386786733e1246ce49c483ebdf35c3291023
@@ -0,0 +1,13 @@
+diff --git src/widget/tool/callconfirmwidget.cpp src/widget/tool/callconfirmwidget.cpp
+index 19db6b86..dbcb96fc 100644
+--- src/widget/tool/callconfirmwidget.cpp
++++ src/widget/tool/callconfirmwidget.cpp
+@@ -148,7 +148,7 @@ void CallConfirmWidget::paintEvent(QPaintEvent*)
+ painter.setBrush(brush);
+ painter.setPen(Qt::NoPen);
+
+- painter.drawRoundRect(mainRect, roundedFactor * rectRatio, roundedFactor);
++ painter.drawRoundedRect(mainRect, roundedFactor * rectRatio, roundedFactor, Qt::RelativeSize);
+ painter.drawPolygon(spikePoly);
+ }
+
diff --git a/net-im/qTox/files/patch-git-16452eff0c21abc2888150e4f9eefd12072fc656 b/net-im/qTox/files/patch-git-16452eff0c21abc2888150e4f9eefd12072fc656
new file mode 100644
index 000000000000..957b064b90f2
--- /dev/null
+++ b/net-im/qTox/files/patch-git-16452eff0c21abc2888150e4f9eefd12072fc656
@@ -0,0 +1,17 @@
+diff --git src/widget/form/settings/avform.cpp src/widget/form/settings/avform.cpp
+index 9a306c2a..4c360143 100644
+--- src/widget/form/settings/avform.cpp
++++ src/widget/form/settings/avform.cpp
+@@ -105,9 +105,11 @@ AVForm::AVForm(IAudioControl& audio, CoreAV* coreAV, CameraSource& camera,
+ eventsInit();
+
+ QDesktopWidget* desktop = QApplication::desktop();
+- connect(desktop, &QDesktopWidget::resized, this, &AVForm::rescanDevices);
+ connect(desktop, &QDesktopWidget::screenCountChanged, this, &AVForm::rescanDevices);
+
++ for (QScreen* qScreen : QGuiApplication::screens()) {
++ connect(qScreen, &QScreen::geometryChanged, this, &AVForm::rescanDevices);
++ }
+ Translator::registerHandler(std::bind(&AVForm::retranslateUi, this), this);
+ }
+
diff --git a/net-im/qTox/files/patch-git-24811d10420901199b2fe0a5f35a391272f24f36 b/net-im/qTox/files/patch-git-24811d10420901199b2fe0a5f35a391272f24f36
new file mode 100644
index 000000000000..737e0972c9a7
--- /dev/null
+++ b/net-im/qTox/files/patch-git-24811d10420901199b2fe0a5f35a391272f24f36
@@ -0,0 +1,13 @@
+diff --git src/persistence/offlinemsgengine.cpp src/persistence/offlinemsgengine.cpp
+index 0e7247b3..b1cff673 100644
+--- src/persistence/offlinemsgengine.cpp
++++ src/persistence/offlinemsgengine.cpp
+@@ -101,7 +101,7 @@ void OfflineMsgEngine::deliverOfflineMsgs()
+
+ QVector<OfflineMessage> messages = sentMessages.values().toVector() + unsentMessages;
+ // order messages by authorship time to resend in same order as they were written
+- qSort(messages.begin(), messages.end(), [](const OfflineMessage& lhs, const OfflineMessage& rhs) {
++ std::sort(messages.begin(), messages.end(), [](const OfflineMessage& lhs, const OfflineMessage& rhs) {
+ return lhs.authorshipTime < rhs.authorshipTime;
+ });
+ removeAllMessages();
diff --git a/net-im/qTox/files/patch-git-34e1e25b7fb12dc662ed197e615c422ea56c867a b/net-im/qTox/files/patch-git-34e1e25b7fb12dc662ed197e615c422ea56c867a
new file mode 100644
index 000000000000..ff30d19c49e1
--- /dev/null
+++ b/net-im/qTox/files/patch-git-34e1e25b7fb12dc662ed197e615c422ea56c867a
@@ -0,0 +1,12 @@
+diff --git test/model/groupmessagedispatcher_test.cpp test/model/groupmessagedispatcher_test.cpp
+index 30990d03..30591b37 100644
+--- test/model/groupmessagedispatcher_test.cpp
++++ test/model/groupmessagedispatcher_test.cpp
+@@ -26,6 +26,7 @@
+ #include <QObject>
+ #include <QtTest/QtTest>
+
++#include <set>
+ #include <deque>
+
+
diff --git a/net-im/qTox/files/patch-git-6e71ccfdad17b275961efff0a51a182de61ef963 b/net-im/qTox/files/patch-git-6e71ccfdad17b275961efff0a51a182de61ef963
new file mode 100644
index 000000000000..1651d0ce8e41
--- /dev/null
+++ b/net-im/qTox/files/patch-git-6e71ccfdad17b275961efff0a51a182de61ef963
@@ -0,0 +1,13 @@
+diff --git src/widget/form/groupchatform.cpp src/widget/form/groupchatform.cpp
+index 73411749..58e23b02 100644
+--- src/widget/form/groupchatform.cpp
++++ src/widget/form/groupchatform.cpp
+@@ -218,7 +218,7 @@ void GroupChatForm::updateUserNames()
+ // add the labels in alphabetical order into the layout
+ auto nickLabelList = peerLabels.values();
+
+- qSort(nickLabelList.begin(), nickLabelList.end(), [](const QLabel* a, const QLabel* b)
++ std::sort(nickLabelList.begin(), nickLabelList.end(), [](const QLabel* a, const QLabel* b)
+ {
+ return a->text().toLower() < b->text().toLower();
+ });
diff --git a/net-im/qTox/files/patch-git-8a0197b37f9c6098e28115d412895d337c326a91 b/net-im/qTox/files/patch-git-8a0197b37f9c6098e28115d412895d337c326a91
new file mode 100644
index 000000000000..1ab642c334ee
--- /dev/null
+++ b/net-im/qTox/files/patch-git-8a0197b37f9c6098e28115d412895d337c326a91
@@ -0,0 +1,52 @@
+diff --git src/chatlog/content/filetransferwidget.cpp src/chatlog/content/filetransferwidget.cpp
+index bf79238e..87156de9 100644
+--- src/chatlog/content/filetransferwidget.cpp
++++ src/chatlog/content/filetransferwidget.cpp
+@@ -195,13 +195,14 @@ void FileTransferWidget::paintEvent(QPaintEvent*)
+ // Draw the widget background:
+ painter.setClipRect(QRect(0, 0, width(), height()));
+ painter.setBrush(QBrush(backgroundColor));
+- painter.drawRoundRect(geometry(), r * ratio, r);
++ painter.drawRoundedRect(geometry(), r * ratio, r, Qt::RelativeSize);
+
+ if (drawButtonAreaNeeded()) {
+ // Draw the button background:
+ QPainterPath buttonBackground;
+- buttonBackground.addRoundRect(width() - 2 * buttonFieldWidth - lineWidth * 2, 0,
+- buttonFieldWidth, buttonFieldWidth + lineWidth, 50, 50);
++ buttonBackground.addRoundedRect(width() - 2 * buttonFieldWidth - lineWidth * 2, 0,
++ buttonFieldWidth, buttonFieldWidth + lineWidth, 50, 50,
++ Qt::RelativeSize);
+ buttonBackground.addRect(width() - 2 * buttonFieldWidth - lineWidth * 2, 0,
+ buttonFieldWidth * 2, buttonFieldWidth / 2);
+ buttonBackground.addRect(width() - 1.5 * buttonFieldWidth - lineWidth * 2, 0,
+@@ -212,9 +213,9 @@ void FileTransferWidget::paintEvent(QPaintEvent*)
+
+ // Draw the left button:
+ QPainterPath leftButton;
+- leftButton.addRoundRect(QRect(width() - 2 * buttonFieldWidth - lineWidth, 0,
++ leftButton.addRoundedRect(QRect(width() - 2 * buttonFieldWidth - lineWidth, 0,
+ buttonFieldWidth, buttonFieldWidth),
+- 50, 50);
++ 50, 50, Qt::RelativeSize);
+ leftButton.addRect(QRect(width() - 2 * buttonFieldWidth - lineWidth, 0,
+ buttonFieldWidth / 2, buttonFieldWidth / 2));
+ leftButton.addRect(QRect(width() - 1.5 * buttonFieldWidth - lineWidth, 0,
+@@ -226,7 +227,7 @@ void FileTransferWidget::paintEvent(QPaintEvent*)
+ // Draw the right button:
+ painter.setBrush(QBrush(buttonColor));
+ painter.setClipRect(QRect(width() - buttonFieldWidth, 0, buttonFieldWidth, buttonFieldWidth));
+- painter.drawRoundRect(geometry(), r * ratio, r);
++ painter.drawRoundedRect(geometry(), r * ratio, r, Qt::RelativeSize);
+ }
+ }
+
+@@ -539,7 +540,7 @@ void FileTransferWidget::showPreview(const QString& filename)
+ ui->previewButton->show();
+ // Show mouseover preview, but make sure it's not larger than 50% of the screen
+ // width/height
+- const QRect desktopSize = QApplication::desktop()->screenGeometry();
++ const QRect desktopSize = QApplication::desktop()->geometry();
+ const int maxPreviewWidth{desktopSize.width() / 2};
+ const int maxPreviewHeight{desktopSize.height() / 2};
+ const QImage previewImage = [&image, maxPreviewWidth, maxPreviewHeight]() {
diff --git a/net-im/qTox/files/patch-git-b45ba34be250e938c6b07617e121d789ed52ca1d b/net-im/qTox/files/patch-git-b45ba34be250e938c6b07617e121d789ed52ca1d
new file mode 100644
index 000000000000..10479f719345
--- /dev/null
+++ b/net-im/qTox/files/patch-git-b45ba34be250e938c6b07617e121d789ed52ca1d
@@ -0,0 +1,38 @@
+diff --git src/widget/tool/croppinglabel.cpp src/widget/tool/croppinglabel.cpp
+index 0b12840a..d4364361 100644
+--- src/widget/tool/croppinglabel.cpp
++++ src/widget/tool/croppinglabel.cpp
+@@ -36,8 +36,7 @@ CroppingLabel::CroppingLabel(QWidget* parent)
+ public:
+ explicit LineEdit(QWidget* parent = nullptr)
+ : QLineEdit(parent)
+- {
+- }
++ {}
+
+ protected:
+ void keyPressEvent(QKeyEvent* event) override
+@@ -106,7 +105,11 @@ QSize CroppingLabel::sizeHint() const
+
+ QSize CroppingLabel::minimumSizeHint() const
+ {
++#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
++ return QSize(fontMetrics().horizontalAdvance("..."), QLabel::minimumSizeHint().height());
++#else
+ return QSize(fontMetrics().width("..."), QLabel::minimumSizeHint().height());
++#endif
+ }
+
+ void CroppingLabel::mouseReleaseEvent(QMouseEvent* e)
+@@ -171,7 +174,11 @@ void CroppingLabel::minimizeMaximumWidth()
+ {
+ // This function chooses the smallest possible maximum width.
+ // Text width + padding. Without padding, we'll have elipses.
++#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
++ setMaximumWidth(fontMetrics().horizontalAdvance(origText) + fontMetrics().horizontalAdvance("..."));
++#else
+ setMaximumWidth(fontMetrics().width(origText) + fontMetrics().width("..."));
++#endif
+ }
+
+ void CroppingLabel::editingFinished()
diff --git a/net-im/qTox/files/patch-git-ba9d724a17e76bfe7981a69330334c612f52a769 b/net-im/qTox/files/patch-git-ba9d724a17e76bfe7981a69330334c612f52a769
new file mode 100644
index 000000000000..812696e54774
--- /dev/null
+++ b/net-im/qTox/files/patch-git-ba9d724a17e76bfe7981a69330334c612f52a769
@@ -0,0 +1,29 @@
+diff --git src/widget/contentdialog.cpp src/widget/contentdialog.cpp
+index 2476390d..da34e9e3 100644
+--- src/widget/contentdialog.cpp
++++ src/widget/contentdialog.cpp
+@@ -69,7 +69,11 @@ ContentDialog::ContentDialog(QWidget* parent)
+ friendLayout->getLayoutOffline()};
+
+ if (s.getGroupchatPosition()) {
++#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
++ layouts.swapItemsAt(0, 1);
++#else
+ layouts.swap(0, 1);
++#endif
+ }
+
+ QWidget* friendWidget = new QWidget();
+@@ -399,7 +403,12 @@ void ContentDialog::reorderLayouts(bool newGroupOnTop)
+ {
+ bool oldGroupOnTop = layouts.first() == groupLayout.getLayout();
+ if (newGroupOnTop != oldGroupOnTop) {
++ // Kriby: Maintain backwards compatibility
++#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
++ layouts.swapItemsAt(0, 1);
++#else
+ layouts.swap(0, 1);
++#endif
+ }
+ }
+
diff --git a/net-im/qTox/files/patch-git-dbf56581bb90667dc44c6db230ee7076616149a0 b/net-im/qTox/files/patch-git-dbf56581bb90667dc44c6db230ee7076616149a0
new file mode 100644
index 000000000000..3b6c4e22aa44
--- /dev/null
+++ b/net-im/qTox/files/patch-git-dbf56581bb90667dc44c6db230ee7076616149a0
@@ -0,0 +1,30 @@
+diff --git src/widget/systemtrayicon.cpp src/widget/systemtrayicon.cpp
+index d89236cc..623f32cd 100644
+--- src/widget/systemtrayicon.cpp
++++ src/widget/systemtrayicon.cpp
+@@ -115,9 +115,13 @@ GdkPixbuf* SystemTrayIcon::convertQIconToPixbuf(const QIcon& icon)
+ QImage image = icon.pixmap(64, 64).toImage();
+ if (image.format() != QImage::Format_RGBA8888_Premultiplied)
+ image = image.convertToFormat(QImage::Format_RGBA8888_Premultiplied);
++#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
++ guchar* image_bytes = new guchar[image.sizeInBytes()];
++ memcpy(image_bytes, image.bits(), image.sizeInBytes());
++#else
+ guchar* image_bytes = new guchar[image.byteCount()];
+ memcpy(image_bytes, image.bits(), image.byteCount());
+-
++#endif
+ return gdk_pixbuf_new_from_data(image_bytes, GDK_COLORSPACE_RGB, image.hasAlphaChannel(), 8,
+ image.width(), image.height(), image.bytesPerLine(),
+ callbackFreeImage, nullptr);
+@@ -214,8 +218,8 @@ void SystemTrayIcon::setContextMenu(QMenu* menu)
+ else if (a->icon().isNull())
+ item = gtk_menu_item_new_with_label(aText.c_str());
+ else {
+- const std::string iconPath = extractIconToFile(a->icon(),
+- "iconmenu" + a->icon().name()).toStdString();
++ const std::string iconPath =
++ extractIconToFile(a->icon(), "iconmenu" + a->icon().name()).toStdString();
+ GtkWidget* image = gtk_image_new_from_file(iconPath.c_str());
+ item = gtk_image_menu_item_new_with_label(aText.c_str());
+ gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image);
diff --git a/net-im/qTox/files/patch-git-dfe75fb101d8a8f24baa346312c2d847de6e45da b/net-im/qTox/files/patch-git-dfe75fb101d8a8f24baa346312c2d847de6e45da
new file mode 100644
index 000000000000..7cab1326793f
--- /dev/null
+++ b/net-im/qTox/files/patch-git-dfe75fb101d8a8f24baa346312c2d847de6e45da
@@ -0,0 +1,43 @@
+diff --git src/video/genericnetcamview.cpp src/video/genericnetcamview.cpp
+index 7398cc47..36012b20 100644
+--- src/video/genericnetcamview.cpp
++++ src/video/genericnetcamview.cpp
+@@ -20,6 +20,7 @@
+ #include "genericnetcamview.h"
+
+ #include <QApplication>
++#include <QScreen>
+ #include <QBoxLayout>
+ #include <QDesktopWidget>
+ #include <QKeyEvent>
+@@ -136,8 +137,11 @@ void GenericNetCamView::enterFullScreen()
+ showFullScreen();
+ enterFullScreenButton->hide();
+ toggleMessagesButton->hide();
+-
+- const auto screenSize = QApplication::desktop()->screenGeometry(this);
++#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
++ const auto screenSize = QGuiApplication::screenAt(this->pos())->geometry();
++#else
++ const QRect screenSize = QApplication::desktop()->screenGeometry(this);
++#endif
+ buttonPanel->setGeometry((screenSize.width() / 2) - buttonPanel->width() / 2,
+ screenSize.height() - BTN_PANEL_HEIGHT - 25, BTN_PANEL_WIDTH, BTN_PANEL_HEIGHT);
+ buttonPanel->show();
+diff --git src/widget/tool/screenshotgrabber.cpp src/widget/tool/screenshotgrabber.cpp
+index 7ea91f6b..0863393f 100644
+--- src/widget/tool/screenshotgrabber.cpp
++++ src/widget/tool/screenshotgrabber.cpp
+@@ -203,7 +203,11 @@ void ScreenshotGrabber::chooseHelperTooltipText(QRect rect)
+ void ScreenshotGrabber::adjustTooltipPosition()
+ {
+ QRect recGL = QGuiApplication::primaryScreen()->virtualGeometry();
+- QRect rec = qApp->desktop()->screenGeometry(QCursor::pos());
++#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
++ const auto rec = QGuiApplication::screenAt(QCursor::pos())->geometry();
++#else
++ const auto rec = qApp->desktop()->screenGeometry(QCursor::pos());
++#endif
+ const QRectF ttRect = this->helperToolbox->childrenBoundingRect();
+ int x = qAbs(recGL.x()) + rec.x() + ((rec.width() - ttRect.width()) / 2);
+ int y = qAbs(recGL.y()) + rec.y();
diff --git a/net-im/qTox/files/patch-git-fb3f44721e6b49a3afbb57b407607c02674fe13a b/net-im/qTox/files/patch-git-fb3f44721e6b49a3afbb57b407607c02674fe13a
new file mode 100644
index 000000000000..e36dada2eeed
--- /dev/null
+++ b/net-im/qTox/files/patch-git-fb3f44721e6b49a3afbb57b407607c02674fe13a
@@ -0,0 +1,44 @@
+diff --git src/widget/form/settings/avform.cpp src/widget/form/settings/avform.cpp
+index 4c360143..e939f6ab 100644
+--- src/widget/form/settings/avform.cpp
++++ src/widget/form/settings/avform.cpp
+@@ -105,11 +105,14 @@ AVForm::AVForm(IAudioControl& audio, CoreAV* coreAV, CameraSource& camera,
+ eventsInit();
+
+ QDesktopWidget* desktop = QApplication::desktop();
+- connect(desktop, &QDesktopWidget::screenCountChanged, this, &AVForm::rescanDevices);
+-
+ for (QScreen* qScreen : QGuiApplication::screens()) {
+ connect(qScreen, &QScreen::geometryChanged, this, &AVForm::rescanDevices);
+ }
++ auto* qGUIApp = qobject_cast<QGuiApplication *>(qApp);
++ assert (qGUIApp);
++ connect(qGUIApp, &QGuiApplication::screenAdded, this, &AVForm::trackNewScreenGeometry);
++ connect(qGUIApp, &QGuiApplication::screenAdded, this, &AVForm::rescanDevices);
++ connect(qGUIApp, &QGuiApplication::screenRemoved, this, &AVForm::rescanDevices);
+ Translator::registerHandler(std::bind(&AVForm::retranslateUi, this), this);
+ }
+
+@@ -160,6 +163,10 @@ void AVForm::open(const QString& devName, const VideoMode& mode)
+ camera.setupDevice(devName, mode);
+ }
+
++void AVForm::trackNewScreenGeometry(QScreen* qScreen) {
++ connect(qScreen, &QScreen::geometryChanged, this, &AVForm::rescanDevices);
++}
++
+ void AVForm::rescanDevices()
+ {
+ getAudioInDevices();
+diff --git src/widget/form/settings/avform.h src/widget/form/settings/avform.h
+index 5ff4ad6f..becaa74c 100644
+--- src/widget/form/settings/avform.h
++++ src/widget/form/settings/avform.h
+@@ -95,6 +95,7 @@ private:
+ void open(const QString& devName, const VideoMode& mode);
+ int getStepsFromValue(qreal val, qreal valMin, qreal valMax);
+ qreal getValueFromSteps(int steps, qreal valMin, qreal valMax);
++ void trackNewScreenGeometry(QScreen* qScreen);
+
+ private:
+ IAudioControl& audio;