diff options
author | Luca Weiss | 2020-04-20 21:24:33 +0200 |
---|---|---|
committer | Luca Weiss | 2020-04-20 21:24:33 +0200 |
commit | f448da038e04646c8178599e7a948fd7599589fc (patch) | |
tree | ad6e3b0ad17843daa7377275dfebfb88eb1ef139 | |
parent | b0cd77073b383523994a98249aec56c4c6611aa3 (diff) | |
download | aur-f448da038e04646c8178599e7a948fd7599589fc.tar.gz |
upgpkg: nheko 0.7.0-1
upstream release
-rw-r--r-- | .SRCINFO | 15 | ||||
-rw-r--r-- | 0001-Fix-deprecated-function-call-issues-with-Qt-5.13.patch | 378 | ||||
-rw-r--r-- | PKGBUILD | 17 | ||||
-rw-r--r-- | spdlog_fix.patch | 14 |
4 files changed, 11 insertions, 413 deletions
@@ -1,7 +1,7 @@ pkgbase = nheko pkgdesc = Desktop client for the Matrix protocol - pkgver = 0.6.4 - pkgrel = 2 + pkgver = 0.7.0 + pkgrel = 1 url = https://github.com/Nheko-Reborn/nheko arch = x86_64 arch = i686 @@ -14,17 +14,14 @@ pkgbase = nheko makedepends = tweeny depends = qt5-multimedia depends = qt5-svg + depends = qt5-quickcontrols2 depends = hicolor-icon-theme depends = lmdb depends = cmark - depends = mtxclient + depends = mtxclient>=0.3.0 depends = spdlog - source = nheko-0.6.4.tar.gz::https://github.com/Nheko-Reborn/nheko/archive/v0.6.4.tar.gz - source = 0001-Fix-deprecated-function-call-issues-with-Qt-5.13.patch - source = spdlog_fix.patch - sha512sums = 782673a3ae642029307517798e5be96cf0473cd4261af891988a35dfeb5e2e724d2c034407f62addd2e15973d287d11c6590d70cca739c705354cb0151536470 - sha512sums = a20e5a3a152a22525bc1a0563f210bc8ed4f4d988342f20e1960b9530fdc0ca90539847719bbc9abf7802a0cd4af99f41b84641cd0bb5881dc1a9d160e224c2e - sha512sums = e0c9992e561d3e8ef3d5bf61032dd48e78b38b4a7db3834aa0703c6a9f0761803e46a9209d440c07fea767be7aa594ed2cbeed1b188f366bf3c9b17da6e2fed3 + source = nheko-0.7.0.tar.gz::https://github.com/Nheko-Reborn/nheko/archive/v0.7.0.tar.gz + sha512sums = 0e30b3937b8cf92ff250496df999aafea86f18ddc8301b9feafe52db66e10b5f95b177931582d0b5418a1084b8dc9fbed31f15ec5573dcadade2a3bec7d19e9e pkgname = nheko diff --git a/0001-Fix-deprecated-function-call-issues-with-Qt-5.13.patch b/0001-Fix-deprecated-function-call-issues-with-Qt-5.13.patch deleted file mode 100644 index 96dea2f82f8f..000000000000 --- a/0001-Fix-deprecated-function-call-issues-with-Qt-5.13.patch +++ /dev/null @@ -1,378 +0,0 @@ -From 881f0b54f4ae6b06e03781c9d82b7f49454a1cff Mon Sep 17 00:00:00 2001 -From: Joseph Donofry <joedonofry@gmail.com> -Date: Thu, 4 Jul 2019 21:20:19 -0400 -Subject: [PATCH] Fix deprecated function call issues with Qt 5.13 - ---- - src/RoomInfoListItem.cpp | 4 ++-- - src/TypingDisplay.cpp | 2 +- - src/Utils.cpp | 9 +++++++-- - src/dialogs/ImageOverlay.cpp | 5 ++++- - src/main.cpp | 5 ++++- - src/notifications/ManagerLinux.cpp | 2 +- - src/timeline/TimelineItem.cpp | 6 ++++-- - src/timeline/TimelineItem.h | 8 ++++++++ - src/timeline/widgets/AudioItem.cpp | 2 +- - src/timeline/widgets/FileItem.cpp | 2 +- - src/timeline/widgets/ImageItem.cpp | 2 +- - src/ui/DropShadow.h | 22 +++++++++++++--------- - src/ui/InfoMessage.cpp | 4 ++-- - src/ui/Painter.h | 6 ++++-- - 14 files changed, 53 insertions(+), 26 deletions(-) - -diff --git a/src/RoomInfoListItem.cpp b/src/RoomInfoListItem.cpp -index f17b383..d6a4f78 100644 ---- a/src/RoomInfoListItem.cpp -+++ b/src/RoomInfoListItem.cpp -@@ -182,7 +182,7 @@ RoomInfoListItem::paintEvent(QPaintEvent *event) - - QFont tsFont; - tsFont.setPointSizeF(tsFont.pointSizeF() * 0.9); -- const int msgStampWidth = QFontMetrics(tsFont).width(lastMsgInfo_.timestamp) + 4; -+ const int msgStampWidth = QFontMetrics(tsFont).horizontalAdvance(lastMsgInfo_.timestamp) + 4; - - // We use the full width of the widget if there is no unread msg bubble. - const int bottomLineWidthLimit = (unreadMsgCount_ > 0) ? msgStampWidth : 0; -@@ -211,7 +211,7 @@ RoomInfoListItem::paintEvent(QPaintEvent *event) - p.setFont(QFont{}); - p.drawText(QPoint(2 * wm.padding + wm.iconSize, bottom_y), userName); - -- int nameWidth = QFontMetrics(QFont{}).width(userName); -+ int nameWidth = QFontMetrics(QFont{}).horizontalAdvance(userName); - - p.setFont(QFont{}); - -diff --git a/src/TypingDisplay.cpp b/src/TypingDisplay.cpp -index 11313ad..97aeb26 100644 ---- a/src/TypingDisplay.cpp -+++ b/src/TypingDisplay.cpp -@@ -69,7 +69,7 @@ TypingDisplay::paintEvent(QPaintEvent *) - text_ = fm.elidedText(text_, Qt::ElideRight, (double)(width() * 0.75)); - - QPainterPath path; -- path.addRoundedRect(QRectF(0, 0, fm.width(text_) + 2 * LEFT_PADDING, height()), 3, 3); -+ path.addRoundedRect(QRectF(0, 0, fm.horizontalAdvance(text_) + 2 * LEFT_PADDING, height()), 3, 3); - - p.fillPath(path, backgroundColor()); - p.drawText(region, Qt::AlignVCenter, text_); -diff --git a/src/Utils.cpp b/src/Utils.cpp -index f8fdfaf..65fc8f0 100644 ---- a/src/Utils.cpp -+++ b/src/Utils.cpp -@@ -3,6 +3,8 @@ - #include <QApplication> - #include <QComboBox> - #include <QDesktopWidget> -+#include <QGuiApplication> -+#include <QScreen> - #include <QSettings> - #include <QTextDocument> - #include <QXmlStreamReader> -@@ -229,8 +231,10 @@ utils::scaleImageToPixmap(const QImage &img, int size) - if (img.isNull()) - return QPixmap(); - -+ // Deprecated in 5.13: const double sz = -+ // std::ceil(QApplication::desktop()->screen()->devicePixelRatioF() * (double)size); - const double sz = -- std::ceil(QApplication::desktop()->screen()->devicePixelRatioF() * (double)size); -+ std::ceil(QGuiApplication::primaryScreen()->devicePixelRatio() * (double)size); - return QPixmap::fromImage( - img.scaled(sz, sz, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); - } -@@ -461,7 +465,8 @@ utils::centerWidget(QWidget *widget, QWidget *parent) - return; - } - -- widget->move(findCenter(QApplication::desktop()->screenGeometry())); -+ // Deprecated in 5.13: widget->move(findCenter(QApplication::desktop()->screenGeometry())); -+ widget->move(findCenter(QGuiApplication::primaryScreen()->geometry())); - } - - void -diff --git a/src/dialogs/ImageOverlay.cpp b/src/dialogs/ImageOverlay.cpp -index dbf5bbe..dd9cd03 100644 ---- a/src/dialogs/ImageOverlay.cpp -+++ b/src/dialogs/ImageOverlay.cpp -@@ -17,7 +17,9 @@ - - #include <QApplication> - #include <QDesktopWidget> -+#include <QGuiApplication> - #include <QPainter> -+#include <QScreen> - - #include "dialogs/ImageOverlay.h" - -@@ -39,7 +41,8 @@ ImageOverlay::ImageOverlay(QPixmap image, QWidget *parent) - setAttribute(Qt::WA_DeleteOnClose, true); - setWindowState(Qt::WindowFullScreen); - -- screen_ = QApplication::desktop()->availableGeometry(); -+ // Deprecated in 5.13: screen_ = QApplication::desktop()->availableGeometry(); -+ screen_ = QGuiApplication::primaryScreen()->availableGeometry(); - - move(QApplication::desktop()->mapToGlobal(screen_.topLeft())); - resize(screen_.size()); -diff --git a/src/main.cpp b/src/main.cpp -index 0c196a3..bd7560d 100644 ---- a/src/main.cpp -+++ b/src/main.cpp -@@ -21,10 +21,12 @@ - #include <QDir> - #include <QFile> - #include <QFontDatabase> -+#include <QGuiApplication> - #include <QLabel> - #include <QLibraryInfo> - #include <QMessageBox> - #include <QPoint> -+#include <QScreen> - #include <QSettings> - #include <QStandardPaths> - #include <QTranslator> -@@ -72,7 +74,8 @@ registerSignalHandlers() - QPoint - screenCenter(int width, int height) - { -- QRect screenGeometry = QApplication::desktop()->screenGeometry(); -+ // Deprecated in 5.13: QRect screenGeometry = QApplication::desktop()->screenGeometry(); -+ QRect screenGeometry = QGuiApplication::primaryScreen()->geometry(); - - int x = (screenGeometry.width() - width) / 2; - int y = (screenGeometry.height() - height) / 2; -diff --git a/src/notifications/ManagerLinux.cpp b/src/notifications/ManagerLinux.cpp -index d3901c5..1d9f97d 100644 ---- a/src/notifications/ManagerLinux.cpp -+++ b/src/notifications/ManagerLinux.cpp -@@ -142,7 +142,7 @@ operator<<(QDBusArgument &arg, const QImage &image) - int channels = i.isGrayscale() ? 1 : (i.hasAlphaChannel() ? 4 : 3); - arg << i.depth() / channels; - arg << channels; -- arg << QByteArray(reinterpret_cast<const char *>(i.bits()), i.byteCount()); -+ arg << QByteArray(reinterpret_cast<const char *>(i.bits()), i.sizeInBytes()); - arg.endStructure(); - return arg; - } -diff --git a/src/timeline/TimelineItem.cpp b/src/timeline/TimelineItem.cpp -index d23dbf4..74686a8 100644 ---- a/src/timeline/TimelineItem.cpp -+++ b/src/timeline/TimelineItem.cpp -@@ -690,7 +690,9 @@ TimelineItem::generateUserName(const QString &user_id, const QString &displaynam - userName_->setToolTipDuration(1500); - userName_->setAttribute(Qt::WA_Hover); - userName_->setAlignment(Qt::AlignLeft | Qt::AlignTop); -- userName_->setFixedWidth(QFontMetrics(userName_->font()).width(userName_->text())); -+ // width deprecated in 5.13: -+ // userName_->setFixedWidth(QFontMetrics(userName_->font()).width(userName_->text())); -+ userName_->setFixedWidth(QFontMetrics(userName_->font()).horizontalAdvance(userName_->text())); - - // Set the user color asynchronously if it hasn't been generated yet, - // otherwise this will just set it. -@@ -915,4 +917,4 @@ TimelineItem::openRawMessageViewer() const - "failed to serialize event ({}, {})", room_id, event_id); - } - }); --} -\ No newline at end of file -+} -diff --git a/src/timeline/TimelineItem.h b/src/timeline/TimelineItem.h -index 7bf6a07..00f26f2 100644 ---- a/src/timeline/TimelineItem.h -+++ b/src/timeline/TimelineItem.h -@@ -28,6 +28,8 @@ - - #include <QtConcurrent> - -+#include "mtx/events.hpp" -+ - #include "AvatarProvider.h" - #include "RoomInfoListItem.h" - #include "Utils.h" -@@ -273,6 +275,7 @@ private: - - QString replaceEmoji(const QString &body); - QString event_id_; -+ mtx::events::MessageType message_type_; - QString room_id_; - - DescInfo descriptionMsg_; -@@ -342,6 +345,11 @@ TimelineItem::setupWidgetLayout(Widget *widget, const Event &event, bool withSen - { - init(); - -+ //if (event.type == mtx::events::EventType::RoomMessage) { -+ // message_type_ = mtx::events::getMessageType(event.content.msgtype); -+ //} -+ // TODO: Fix this. -+ message_type_ = mtx::events::MessageType::Unknown; - event_id_ = QString::fromStdString(event.event_id); - const auto sender = QString::fromStdString(event.sender); - -diff --git a/src/timeline/widgets/AudioItem.cpp b/src/timeline/widgets/AudioItem.cpp -index 7233217..8cc2ba8 100644 ---- a/src/timeline/widgets/AudioItem.cpp -+++ b/src/timeline/widgets/AudioItem.cpp -@@ -163,7 +163,7 @@ AudioItem::resizeEvent(QResizeEvent *event) - - QFontMetrics fm(font); - const int computedWidth = std::min( -- fm.width(text_) + 2 * IconRadius + VerticalPadding * 2 + TextPadding, (double)MaxWidth); -+ fm.horizontalAdvance(text_) + 2 * IconRadius + VerticalPadding * 2 + TextPadding, (double)MaxWidth); - - resize(computedWidth, Height); - -diff --git a/src/timeline/widgets/FileItem.cpp b/src/timeline/widgets/FileItem.cpp -index e97554e..903fc4b 100644 ---- a/src/timeline/widgets/FileItem.cpp -+++ b/src/timeline/widgets/FileItem.cpp -@@ -154,7 +154,7 @@ FileItem::resizeEvent(QResizeEvent *event) - - QFontMetrics fm(font); - const int computedWidth = std::min( -- fm.width(text_) + 2 * IconRadius + VerticalPadding * 2 + TextPadding, (double)MaxWidth); -+ fm.horizontalAdvance(text_) + 2 * IconRadius + VerticalPadding * 2 + TextPadding, (double)MaxWidth); - - resize(computedWidth, Height); - -diff --git a/src/timeline/widgets/ImageItem.cpp b/src/timeline/widgets/ImageItem.cpp -index 4ee9e42..79a66c4 100644 ---- a/src/timeline/widgets/ImageItem.cpp -+++ b/src/timeline/widgets/ImageItem.cpp -@@ -192,7 +192,7 @@ ImageItem::paintEvent(QPaintEvent *event) - if (image_.isNull()) { - QString elidedText = metrics.elidedText(text_, Qt::ElideRight, max_width_ - 10); - -- setFixedSize(metrics.width(elidedText), fontHeight); -+ setFixedSize(metrics.horizontalAdvance(elidedText), fontHeight); - - painter.setFont(font); - painter.setPen(QPen(QColor(66, 133, 244))); -diff --git a/src/ui/DropShadow.h b/src/ui/DropShadow.h -index b7ba198..d322fb4 100644 ---- a/src/ui/DropShadow.h -+++ b/src/ui/DropShadow.h -@@ -30,7 +30,11 @@ public: - gradient.setStart(right0); - gradient.setFinalStop(right1); - painter.setBrush(QBrush(gradient)); -- painter.drawRoundRect( -+ // Deprecated in 5.13: painter.drawRoundRect( -+ // QRectF(QPointF(width - margin * radius, margin), QPointF(width, height - margin)), -+ // 0.0, -+ // 0.0); -+ painter.drawRoundedRect( - QRectF(QPointF(width - margin * radius, margin), QPointF(width, height - margin)), - 0.0, - 0.0); -@@ -41,7 +45,7 @@ public: - gradient.setStart(left0); - gradient.setFinalStop(left1); - painter.setBrush(QBrush(gradient)); -- painter.drawRoundRect( -+ painter.drawRoundedRect( - QRectF(QPointF(margin * radius, margin), QPointF(0, height - margin)), 0.0, 0.0); - - // Top -@@ -50,7 +54,7 @@ public: - gradient.setStart(top0); - gradient.setFinalStop(top1); - painter.setBrush(QBrush(gradient)); -- painter.drawRoundRect( -+ painter.drawRoundedRect( - QRectF(QPointF(width - margin, 0), QPointF(margin, margin)), 0.0, 0.0); - - // Bottom -@@ -59,7 +63,7 @@ public: - gradient.setStart(bottom0); - gradient.setFinalStop(bottom1); - painter.setBrush(QBrush(gradient)); -- painter.drawRoundRect( -+ painter.drawRoundedRect( - QRectF(QPointF(margin, height - margin), QPointF(width - margin, height)), - 0.0, - 0.0); -@@ -71,7 +75,7 @@ public: - gradient.setFinalStop(bottomright1); - gradient.setColorAt(endPosition1, end); - painter.setBrush(QBrush(gradient)); -- painter.drawRoundRect(QRectF(bottomright0, bottomright1), 0.0, 0.0); -+ painter.drawRoundedRect(QRectF(bottomright0, bottomright1), 0.0, 0.0); - - // BottomLeft - QPointF bottomleft0(margin, height - margin); -@@ -80,7 +84,7 @@ public: - gradient.setFinalStop(bottomleft1); - gradient.setColorAt(endPosition1, end); - painter.setBrush(QBrush(gradient)); -- painter.drawRoundRect(QRectF(bottomleft0, bottomleft1), 0.0, 0.0); -+ painter.drawRoundedRect(QRectF(bottomleft0, bottomleft1), 0.0, 0.0); - - // TopLeft - QPointF topleft0(margin, margin); -@@ -89,7 +93,7 @@ public: - gradient.setFinalStop(topleft1); - gradient.setColorAt(endPosition1, end); - painter.setBrush(QBrush(gradient)); -- painter.drawRoundRect(QRectF(topleft0, topleft1), 0.0, 0.0); -+ painter.drawRoundedRect(QRectF(topleft0, topleft1), 0.0, 0.0); - - // TopRight - QPointF topright0(width - margin, margin); -@@ -98,12 +102,12 @@ public: - gradient.setFinalStop(topright1); - gradient.setColorAt(endPosition1, end); - painter.setBrush(QBrush(gradient)); -- painter.drawRoundRect(QRectF(topright0, topright1), 0.0, 0.0); -+ painter.drawRoundedRect(QRectF(topright0, topright1), 0.0, 0.0); - - // Widget - painter.setBrush(QBrush("#FFFFFF")); - painter.setRenderHint(QPainter::Antialiasing); -- painter.drawRoundRect( -+ painter.drawRoundedRect( - QRectF(QPointF(margin, margin), QPointF(width - margin, height - margin)), - radius, - radius); -diff --git a/src/ui/InfoMessage.cpp b/src/ui/InfoMessage.cpp -index e9de20c..b18a80c 100644 ---- a/src/ui/InfoMessage.cpp -+++ b/src/ui/InfoMessage.cpp -@@ -22,7 +22,7 @@ InfoMessage::InfoMessage(QString msg, QWidget *parent) - initFont(); - - QFontMetrics fm{font()}; -- width_ = fm.width(msg_) + HPadding * 2; -+ width_ = fm.horizontalAdvance(msg_) + HPadding * 2; - height_ = fm.ascent() + 2 * VPadding; - - setFixedHeight(height_ + 2 * HMargin); -@@ -64,7 +64,7 @@ DateSeparator::DateSeparator(QDateTime datetime, QWidget *parent) - msg_ = datetime.toString(fmt); - - QFontMetrics fm{font()}; -- width_ = fm.width(msg_) + HPadding * 2; -+ width_ = fm.horizontalAdvance(msg_) + HPadding * 2; - height_ = fm.ascent() + 2 * VPadding; - - setFixedHeight(height_ + 2 * HMargin); -diff --git a/src/ui/Painter.h b/src/ui/Painter.h -index 8de3965..8feed17 100644 ---- a/src/ui/Painter.h -+++ b/src/ui/Painter.h -@@ -20,8 +20,10 @@ public: - void drawTextRight(int x, int y, int outerw, const QString &text, int textWidth = -1) - { - QFontMetrics m(fontMetrics()); -- if (textWidth < 0) -- textWidth = m.width(text); -+ if (textWidth < 0) { -+ // deprecated in 5.13: textWidth = m.width(text); -+ textWidth = m.horizontalAdvance(text); -+ } - drawText((outerw - x - textWidth), y + m.ascent(), text); - } - --- -2.23.0 - @@ -2,26 +2,19 @@ # Contributor: Konstantinos Sideris <siderisk at auth dot gr> pkgname=nheko -pkgver=0.6.4 -pkgrel=2 +pkgver=0.7.0 +pkgrel=1 pkgdesc="Desktop client for the Matrix protocol" arch=('x86_64' 'i686') url="https://github.com/Nheko-Reborn/nheko" license=('GPL3') -depends=('qt5-multimedia' 'qt5-svg' 'hicolor-icon-theme' 'lmdb' 'cmark' 'mtxclient' 'spdlog') +depends=('qt5-multimedia' 'qt5-svg' 'qt5-quickcontrols2' 'hicolor-icon-theme' 'lmdb' 'cmark' 'mtxclient>=0.3.0' 'spdlog') makedepends=('cmake' 'boost' 'qt5-tools' 'nlohmann-json' 'lmdbxx' 'tweeny') -source=("$pkgname-$pkgver.tar.gz::https://github.com/Nheko-Reborn/nheko/archive/v$pkgver.tar.gz" - "0001-Fix-deprecated-function-call-issues-with-Qt-5.13.patch" - "spdlog_fix.patch") -sha512sums=('782673a3ae642029307517798e5be96cf0473cd4261af891988a35dfeb5e2e724d2c034407f62addd2e15973d287d11c6590d70cca739c705354cb0151536470' - 'a20e5a3a152a22525bc1a0563f210bc8ed4f4d988342f20e1960b9530fdc0ca90539847719bbc9abf7802a0cd4af99f41b84641cd0bb5881dc1a9d160e224c2e' - 'e0c9992e561d3e8ef3d5bf61032dd48e78b38b4a7db3834aa0703c6a9f0761803e46a9209d440c07fea767be7aa594ed2cbeed1b188f366bf3c9b17da6e2fed3') +source=("$pkgname-$pkgver.tar.gz::https://github.com/Nheko-Reborn/nheko/archive/v$pkgver.tar.gz") +sha512sums=('0e30b3937b8cf92ff250496df999aafea86f18ddc8301b9feafe52db66e10b5f95b177931582d0b5418a1084b8dc9fbed31f15ec5573dcadade2a3bec7d19e9e') prepare() { mkdir -p build - cd $pkgname-$pkgver - patch -Np1 < ../0001-Fix-deprecated-function-call-issues-with-Qt-5.13.patch - patch -Np1 < ../spdlog_fix.patch } build() { diff --git a/spdlog_fix.patch b/spdlog_fix.patch deleted file mode 100644 index 900543ddd04e..000000000000 --- a/spdlog_fix.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index fda60b7..8493e8f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -399,7 +399,8 @@ set(COMMON_LIBS - Qt5::Svg - Qt5::Concurrent - Qt5::Multimedia -- nlohmann_json::nlohmann_json) -+ nlohmann_json::nlohmann_json -+ spdlog::spdlog) - - if(APPVEYOR_BUILD) - set(NHEKO_LIBS ${COMMON_LIBS} lmdb) |