1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-27 05:10:36 +00:00

net-im/qTox: Update 1.16.3-529 -> 1.16.3-784

This commit is contained in:
Yuri Victorovich 2020-02-01 21:46:46 +00:00
parent f37084238c
commit dc0b5b1e1d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=524789
13 changed files with 5 additions and 315 deletions

View File

@ -3,14 +3,10 @@
PORTNAME= qTox
DISTVERSIONPREFIX= v
DISTVERSION= 1.16.3-529
DISTVERSIONSUFFIX= -gb4450319
PORTREVISION= 6
DISTVERSION= 1.16.3-784
DISTVERSIONSUFFIX= -g981ecfca
CATEGORIES= net-im net-p2p
PATCH_SITES= https://github.com/${PORTNAME}/${PORTNAME}/commit/
PATCHFILES= c3e4e82049b476de5453bc2c654c19d920e908a3.patch:-p1
MAINTAINER= yuri@FreeBSD.org
COMMENT= Qt 5 based Tox client

View File

@ -1,5 +1,3 @@
TIMESTAMP = 1563607024
SHA256 (qTox-qTox-v1.16.3-529-gb4450319_GH0.tar.gz) = 6cf753ed8eebd1ada617f995bc41dad9e920287c6517c847415960d9d9009f84
SIZE (qTox-qTox-v1.16.3-529-gb4450319_GH0.tar.gz) = 4778886
SHA256 (c3e4e82049b476de5453bc2c654c19d920e908a3.patch) = 9bafbd5c21edf31bb83e318f4db60864e8c3780134c2e4a7cf10f6a6d04086a0
SIZE (c3e4e82049b476de5453bc2c654c19d920e908a3.patch) = 4034
TIMESTAMP = 1580592945
SHA256 (qTox-qTox-v1.16.3-784-g981ecfca_GH0.tar.gz) = b0912617db03138a8d15a41b3a916b70a5b461897553a0cc4d8bbf6d0cf9a6ee
SIZE (qTox-qTox-v1.16.3-784-g981ecfca_GH0.tar.gz) = 4782040

View File

@ -1,13 +0,0 @@
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);
}

View File

@ -1,17 +0,0 @@
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);
}

View File

@ -1,13 +0,0 @@
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();

View File

@ -1,12 +0,0 @@
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>

View File

@ -1,13 +0,0 @@
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();
});

View File

@ -1,52 +0,0 @@
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]() {

View File

@ -1,38 +0,0 @@
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()

View File

@ -1,29 +0,0 @@
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
}
}

View File

@ -1,30 +0,0 @@
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);

View File

@ -1,43 +0,0 @@
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();

View File

@ -1,44 +0,0 @@
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;