From 57771d31e5c0148205a7e5b15b80f475eb22b408 Mon Sep 17 00:00:00 2001 From: Yuriy Puchkov Date: Fri, 18 Dec 2020 13:41:53 +0200 Subject: [PATCH 1/4] Release 0.8.5.6 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b18af5b8..1acefe78 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.13) # cmake_policy(SET CMP0076 OLD) -set(FLAMESHOT_VERSION 0.8.5.5) +set(FLAMESHOT_VERSION 0.8.5.6) # Flameshot-org #set(GIT_API_URL "https://api.github.com/repos/flameshot-org/flameshot/releases/latest") From aee8a552921cb282d00c5aa62c225446285584ec Mon Sep 17 00:00:00 2001 From: Yuriy Puchkov Date: Fri, 18 Dec 2020 14:55:45 +0200 Subject: [PATCH 2/4] fix - update version notification logic --- src/core/controller.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/controller.cpp b/src/core/controller.cpp index b0a24dea..ee82ed9a 100644 --- a/src/core/controller.cpp +++ b/src/core/controller.cpp @@ -159,8 +159,9 @@ void Controller::handleReplyCheckUpdates(QNetworkReply* reply) QJsonDocument response = QJsonDocument::fromJson(reply->readAll()); QJsonObject json = response.object(); m_appLatestVersion = json["tag_name"].toString().replace("v", ""); - if (m_appLatestVersion.compare( - QStringLiteral(APP_VERSION).replace("v", "")) < 0) { + if (QStringLiteral(APP_VERSION) + .replace("v", "") + .compare(m_appLatestVersion) < 0) { m_appLatestUrl = json["html_url"].toString(); QString newVersion = tr("New version %1 is available").arg(m_appLatestVersion); From 2114ad3c322046cc14c6a792ce7f4d3f77c81f89 Mon Sep 17 00:00:00 2001 From: Yuriy Puchkov Date: Fri, 18 Dec 2020 15:22:14 +0200 Subject: [PATCH 3/4] fix - 'update version notification' widget position and event handler for Linux --- src/core/controller.cpp | 1 + src/widgets/capture/capturewidget.cpp | 11 +++++++++-- src/widgets/updatenotificationwidget.cpp | 3 +++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/core/controller.cpp b/src/core/controller.cpp index ee82ed9a..e5ed79d4 100644 --- a/src/core/controller.cpp +++ b/src/core/controller.cpp @@ -159,6 +159,7 @@ void Controller::handleReplyCheckUpdates(QNetworkReply* reply) QJsonDocument response = QJsonDocument::fromJson(reply->readAll()); QJsonObject json = response.object(); m_appLatestVersion = json["tag_name"].toString().replace("v", ""); + m_appLatestVersion = "0.8.5.7"; if (QStringLiteral(APP_VERSION) .replace("v", "") .compare(m_appLatestVersion) < 0) { diff --git a/src/widgets/capture/capturewidget.cpp b/src/widgets/capture/capturewidget.cpp index 21fd1b09..b28316c3 100644 --- a/src/widgets/capture/capturewidget.cpp +++ b/src/widgets/capture/capturewidget.cpp @@ -784,8 +784,15 @@ void CaptureWidget::showAppUpdateNotification(const QString& appLatestVersion, m_updateNotificationWidget = new UpdateNotificationWidget(this, appLatestVersion, appLatestUrl); } - m_updateNotificationWidget->move( - (width() - m_updateNotificationWidget->width()) / 2, 0); +#if (defined(Q_OS_MAC) || defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || \ + defined(Q_OS_MACX)) + int ax = (width() - m_updateNotificationWidget->width()) / 2; +#else + QRect helpRect = QGuiApplication::primaryScreen()->geometry(); + int ax = helpRect.left() + + ((helpRect.width() - m_updateNotificationWidget->width()) / 2); +#endif + m_updateNotificationWidget->move(ax, 0); makeChild(m_updateNotificationWidget); m_updateNotificationWidget->show(); } diff --git a/src/widgets/updatenotificationwidget.cpp b/src/widgets/updatenotificationwidget.cpp index 5a3c5e92..3a7d8e73 100644 --- a/src/widgets/updatenotificationwidget.cpp +++ b/src/widgets/updatenotificationwidget.cpp @@ -85,6 +85,9 @@ void UpdateNotificationWidget::updateButton() { QDesktopServices::openUrl(m_appLatestUrl); hide(); + if (parentWidget()) { + parentWidget()->close(); + } } void UpdateNotificationWidget::initInternalPanel() From 6576f0ae47c72ae3a42019a3b88c50a490c214e0 Mon Sep 17 00:00:00 2001 From: Yuriy Puchkov Date: Fri, 18 Dec 2020 16:26:51 +0200 Subject: [PATCH 4/4] fix - ignore available updates by "less" instead of "not equal" --- src/core/controller.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/controller.cpp b/src/core/controller.cpp index e5ed79d4..780e7b95 100644 --- a/src/core/controller.cpp +++ b/src/core/controller.cpp @@ -159,7 +159,6 @@ void Controller::handleReplyCheckUpdates(QNetworkReply* reply) QJsonDocument response = QJsonDocument::fromJson(reply->readAll()); QJsonObject json = response.object(); m_appLatestVersion = json["tag_name"].toString().replace("v", ""); - m_appLatestVersion = "0.8.5.7"; if (QStringLiteral(APP_VERSION) .replace("v", "") .compare(m_appLatestVersion) < 0) { @@ -269,8 +268,8 @@ void Controller::startVisualCapture(const uint id, m_captureWindow->showFullScreen(); #endif if (!m_appLatestUrl.isEmpty() && - 0 != m_appLatestVersion.compare( - ConfigHandler().ignoreUpdateToVersion())) { + ConfigHandler().ignoreUpdateToVersion().compare( + m_appLatestVersion) < 0) { m_captureWindow->showAppUpdateNotification(m_appLatestVersion, m_appLatestUrl); }