Skip to content
Snippets Groups Projects
Commit ecb7a1fa authored by hluk's avatar hluk
Browse files

Use KDE Frameworks 5.81 on Windows and macOS

parent 5bde427e
No related branches found
No related tags found
No related merge requests found
...@@ -14,7 +14,7 @@ skip_branch_with_pr: true ...@@ -14,7 +14,7 @@ skip_branch_with_pr: true
environment: environment:
APPVEYOR_SAVE_CACHE_ON_ERROR: true APPVEYOR_SAVE_CACHE_ON_ERROR: true
KF5_VERSION: 5.80 KF5_VERSION: 5.81
KF5_PATCH: 0 KF5_PATCH: 0
SNORETOAST_VERSION: 0.7.0 SNORETOAST_VERSION: 0.7.0
......
From ebdd03b8052087b47587b5d8ede1c82ab1cf5648 Mon Sep 17 00:00:00 2001 From be14d07c405b49628be6aa0eb450d896ddd3b54f Mon Sep 17 00:00:00 2001
From: Lukas Holecek <hluk@email.cz> From: Lukas Holecek <hluk@email.cz>
Date: Sun, 15 Nov 2020 19:06:53 +0100 Date: Sun, 15 Nov 2020 19:06:53 +0100
Subject: [PATCH] Support updating Snore notifications Subject: [PATCH] Support updating Snore notifications
...@@ -8,24 +8,24 @@ Subject: [PATCH] Support updating Snore notifications ...@@ -8,24 +8,24 @@ Subject: [PATCH] Support updating Snore notifications
1 file changed, 21 insertions(+), 8 deletions(-) 1 file changed, 21 insertions(+), 8 deletions(-)
diff --git a/src/notifybysnore.cpp b/src/notifybysnore.cpp diff --git a/src/notifybysnore.cpp b/src/notifybysnore.cpp
index 2dad47a..cb32b39 100644 index 9356bd3..b023238 100644
--- a/src/notifybysnore.cpp --- a/src/notifybysnore.cpp
+++ b/src/notifybysnore.cpp +++ b/src/notifybysnore.cpp
@@ -56,7 +56,7 @@ NotifyBySnore::NotifyBySnore(QObject* parent) : @@ -60,7 +60,7 @@ NotifyBySnore::NotifyBySnore(QObject *parent)
m_server.listen(QString::number(qHash(qApp->applicationDirPath()))); m_server.listen(QString::number(qHash(qApp->applicationDirPath())));
connect(&m_server, &QLocalServer::newConnection, this, [this]() { connect(&m_server, &QLocalServer::newConnection, this, [this]() {
QLocalSocket* responseSocket = m_server.nextPendingConnection(); QLocalSocket *responseSocket = m_server.nextPendingConnection();
- connect(responseSocket, &QLocalSocket::readyRead, [this, responseSocket](){ - connect(responseSocket, &QLocalSocket::readyRead, [this, responseSocket]() {
+ connect(responseSocket, &QLocalSocket::readyRead, this, [this, responseSocket](){ + connect(responseSocket, &QLocalSocket::readyRead, this, [this, responseSocket](){
const QByteArray rawNotificationResponse = responseSocket->readAll(); const QByteArray rawNotificationResponse = responseSocket->readAll();
responseSocket->deleteLater(); responseSocket->deleteLater();
@@ -159,9 +159,20 @@ void NotifyBySnore::notifyDeferred(KNotification* notification) @@ -169,9 +169,20 @@ void NotifyBySnore::notifyDeferred(KNotification *notification)
// handle the icon for toast notification // handle the icon for toast notification
const QString iconPath = m_iconDir.path() + QLatin1Char('/') + QString::number(notification->id()); const QString iconPath = m_iconDir.path() + QLatin1Char('/') + QString::number(notification->id());
+ const bool deleteNewIcon = !QFile::exists(iconPath); + const bool deleteNewIcon = !QFile::exists(iconPath);
const bool hasIcon = (notification->pixmap().isNull()) ? qApp->windowIcon().pixmap(1024, 1024).save(iconPath, "PNG") const bool hasIcon = (notification->pixmap().isNull()) ? qApp->windowIcon().pixmap(1024, 1024).save(iconPath, "PNG") //
: notification->pixmap().save(iconPath, "PNG"); : notification->pixmap().save(iconPath, "PNG");
if (hasIcon) { if (hasIcon) {
+ qCDebug(LOG_KNOTIFICATIONS) << "Created temporary icon" << iconPath; + qCDebug(LOG_KNOTIFICATIONS) << "Created temporary icon" << iconPath;
...@@ -41,21 +41,21 @@ index 2dad47a..cb32b39 100644 ...@@ -41,21 +41,21 @@ index 2dad47a..cb32b39 100644
snoretoastArgsList << QStringLiteral("-p") << iconPath; snoretoastArgsList << QStringLiteral("-p") << iconPath;
} }
@@ -183,19 +194,20 @@ void NotifyBySnore::notifyDeferred(KNotification* notification) @@ -189,19 +200,20 @@ void NotifyBySnore::notifyDeferred(KNotification *notification)
qCDebug(LOG_KNOTIFICATIONS) << "SnoreToast process stdout:" const auto data = snoretoastProcess->readAllStandardOutput();
<< snoretoastArgsList << data; qCDebug(LOG_KNOTIFICATIONS) << "SnoreToast process stdout:" << snoretoastArgsList << data;
}); });
- connect(snoretoastProcess, &QProcess::errorOccurred, this, [this, snoretoastProcess, snoretoastArgsList, iconPath](QProcess::ProcessError error) {
+ QPointer<KNotification> maybeNotification = notification; + QPointer<KNotification> maybeNotification = notification;
connect(snoretoastProcess, &QProcess::errorOccurred, this, + connect(snoretoastProcess, &QProcess::errorOccurred, this, [this, snoretoastProcess, maybeNotification, snoretoastArgsList, iconPath](QProcess::ProcessError error) {
- [this, snoretoastProcess, snoretoastArgsList, iconPath](QProcess::ProcessError error) { qCWarning(LOG_KNOTIFICATIONS) << "SnoreToast process errored:" << snoretoastArgsList << error;
+ [this, snoretoastProcess, maybeNotification, snoretoastArgsList, iconPath](QProcess::ProcessError error) { snoretoastProcess->deleteLater();
qCWarning(LOG_KNOTIFICATIONS) << "SnoreToast process errored:" - QFile::remove(iconPath);
<< snoretoastArgsList << error; + close(maybeNotification);
snoretoastProcess->deleteLater();
- QFile::remove(iconPath);
+ close(maybeNotification);
}); });
connect(snoretoastProcess, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, connect(snoretoastProcess,
QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
this,
- [this, snoretoastProcess, snoretoastArgsList, iconPath](int exitCode, QProcess::ExitStatus exitStatus) { - [this, snoretoastProcess, snoretoastArgsList, iconPath](int exitCode, QProcess::ExitStatus exitStatus) {
+ [this, snoretoastProcess, maybeNotification, snoretoastArgsList, iconPath](int exitCode, QProcess::ExitStatus exitStatus) { + [this, snoretoastProcess, maybeNotification, snoretoastArgsList, iconPath](int exitCode, QProcess::ExitStatus exitStatus) {
qCDebug(LOG_KNOTIFICATIONS) << "SnoreToast process finished:" << snoretoastArgsList; qCDebug(LOG_KNOTIFICATIONS) << "SnoreToast process finished:" << snoretoastArgsList;
...@@ -63,10 +63,10 @@ index 2dad47a..cb32b39 100644 ...@@ -63,10 +63,10 @@ index 2dad47a..cb32b39 100644
snoretoastProcess->deleteLater(); snoretoastProcess->deleteLater();
- QFile::remove(iconPath); - QFile::remove(iconPath);
+ close(maybeNotification); + close(maybeNotification);
}); });
qCDebug(LOG_KNOTIFICATIONS) << "SnoreToast process starting:" << snoretoastArgsList; qCDebug(LOG_KNOTIFICATIONS) << "SnoreToast process starting:" << snoretoastArgsList;
@@ -204,6 +216,9 @@ void NotifyBySnore::notifyDeferred(KNotification* notification) @@ -210,6 +222,9 @@ void NotifyBySnore::notifyDeferred(KNotification *notification)
void NotifyBySnore::close(KNotification *notification) void NotifyBySnore::close(KNotification *notification)
{ {
...@@ -76,7 +76,7 @@ index 2dad47a..cb32b39 100644 ...@@ -76,7 +76,7 @@ index 2dad47a..cb32b39 100644
qCDebug(LOG_KNOTIFICATIONS) << "Requested to close notification with ID:" << notification->id(); qCDebug(LOG_KNOTIFICATIONS) << "Requested to close notification with ID:" << notification->id();
if (m_notifications.constFind(notification->id()) == m_notifications.constEnd()) { if (m_notifications.constFind(notification->id()) == m_notifications.constEnd()) {
qCWarning(LOG_KNOTIFICATIONS) << "Couldn't find the notification in m_notifications. Nothing to close."; qCWarning(LOG_KNOTIFICATIONS) << "Couldn't find the notification in m_notifications. Nothing to close.";
@@ -226,8 +241,6 @@ void NotifyBySnore::close(KNotification *notification) @@ -228,7 +243,5 @@ void NotifyBySnore::close(KNotification *notification)
void NotifyBySnore::update(KNotification *notification, KNotifyConfig *config) void NotifyBySnore::update(KNotification *notification, KNotifyConfig *config)
{ {
...@@ -85,7 +85,6 @@ index 2dad47a..cb32b39 100644 ...@@ -85,7 +85,6 @@ index 2dad47a..cb32b39 100644
- qCWarning(LOG_KNOTIFICATIONS) << "updating a notification is not supported yet."; - qCWarning(LOG_KNOTIFICATIONS) << "updating a notification is not supported yet.";
+ notify(notification, config); + notify(notification, config);
} }
-- --
2.30.2 2.30.2
class ExtraCmakeModules < Formula
desc "Extra modules and scripts for CMake"
homepage "https://api.kde.org/frameworks/extra-cmake-modules/html/index.html"
url "https://download.kde.org/stable/frameworks/5.81/extra-cmake-modules-5.81.0.tar.xz"
sha256 "5f57e4b843069b6098d955051bb2913558d1623fead3f3b95b7017d7e1e35b83"
license all_of: ["BSD-2-Clause", "BSD-3-Clause", "MIT"]
head "https://invent.kde.org/frameworks/extra-cmake-modules.git"
depends_on "cmake" => [:build, :test]
depends_on "ninja" => :build
depends_on "qt@5" => :build
def install
args = std_cmake_args
args << "-DBUILD_HTML_DOCS=OFF"
args << "-DBUILD_MAN_DOCS=OFF"
args << "-DBUILD_QTHELP_DOCS=OFF"
args << "-DBUILD_TESTING=OFF"
mkdir "build" do
system "cmake", "-G", "Ninja", "..", *args
system "ninja"
system "ninja", "install"
end
end
test do
(testpath/"CMakeLists.txt").write("find_package(ECM REQUIRED)")
system "cmake", ".", "-Wno-dev"
expected="ECM_DIR:PATH=#{HOMEBREW_PREFIX}/share/ECM/cmake"
assert_match expected, File.read(testpath/"CMakeCache.txt")
end
end
class Kf5Kconfig < Formula class Kf5Kconfig < Formula
desc "Configuration system" desc "Configuration system"
homepage "https://www.kde.org" homepage "https://www.kde.org"
url "https://download.kde.org/stable/frameworks/5.79/kconfig-5.79.0.tar.xz" url "https://download.kde.org/stable/frameworks/5.81/kconfig-5.81.0.tar.xz"
sha256 "f948718ac87f573b14bbf73e4af02d488f023cfcf011425af7cdbc0cefca510a" sha256 "1ddf9e384140ce72bbd555eb36a76d0db1a256391429b02b51769c08ebf0ae8f"
head "https://invent.kde.org/frameworks/kconfig.git" head "https://invent.kde.org/frameworks/kconfig.git"
depends_on "cmake" => [:build, :test] depends_on "cmake" => [:build, :test]
depends_on "kde-extra-cmake-modules" => [:build, :test]
depends_on "ninja" => :build depends_on "ninja" => :build
depends_on "copyq/kde/extra-cmake-modules" => [:build, :test]
depends_on "qt@5" depends_on "qt@5"
def install def install
......
class Kf5Kcoreaddons < Formula class Kf5Kcoreaddons < Formula
desc "Addons to QtCore" desc "Addons to QtCore"
homepage "https://www.kde.org" homepage "https://www.kde.org"
url "https://download.kde.org/stable/frameworks/5.79/kcoreaddons-5.79.0.tar.xz" url "https://download.kde.org/stable/frameworks/5.81/kcoreaddons-5.81.0.tar.xz"
sha256 "6f221bd93be73aeec863cd7089c69e84fef76bea83a906c6cd2c853937813659" sha256 "ac0ccb1687dd159ad2c6926f766498a2450906266139ec924d7794839a8cfedb"
head "https://invent.kde.org/frameworks/kcoreaddons.git" head "https://invent.kde.org/frameworks/kcoreaddons.git"
depends_on "cmake" => [:build, :test] depends_on "cmake" => [:build, :test]
depends_on "kde-extra-cmake-modules" => [:build, :test]
depends_on "ninja" => :build depends_on "ninja" => :build
depends_on "copyq/kde/extra-cmake-modules" => [:build, :test]
depends_on "qt@5" depends_on "qt@5"
def install def install
......
class Kf5Knotifications < Formula class Kf5Knotifications < Formula
desc "Abstraction for system notifications" desc "Abstraction for system notifications"
homepage "https://www.kde.org" homepage "https://www.kde.org"
url "https://download.kde.org/stable/frameworks/5.79/knotifications-5.79.0.tar.xz" url "https://download.kde.org/stable/frameworks/5.81/knotifications-5.81.0.tar.xz"
sha256 "129ee0ab84740d4bcd1930ddd2b6d0e692836c576175bac804c8a40f94eee485" sha256 "1ad7f7d0e17724085c2e55f9fda34828add9ff74966aae0bc95aa1041accce13"
head "https://invent.kde.org/frameworks/knotifications.git" head "https://invent.kde.org/frameworks/knotifications.git"
depends_on "cmake" => [:build, :test] depends_on "cmake" => [:build, :test]
depends_on "kde-extra-cmake-modules" => [:build, :test]
depends_on "ninja" => :build depends_on "ninja" => :build
depends_on "copyq/kde/extra-cmake-modules" => [:build, :test]
depends_on "copyq/kde/kf5-kconfig" depends_on "copyq/kde/kf5-kconfig"
depends_on "copyq/kde/kf5-kcoreaddons" depends_on "copyq/kde/kf5-kcoreaddons"
depends_on "copyq/kde/kf5-kwindowsystem" depends_on "copyq/kde/kf5-kwindowsystem"
......
class Kf5Kwindowsystem < Formula class Kf5Kwindowsystem < Formula
desc "Access to the windowing system" desc "Access to the windowing system"
homepage "https://www.kde.org" homepage "https://www.kde.org"
url "https://download.kde.org/stable/frameworks/5.79/kwindowsystem-5.79.0.tar.xz" url "https://download.kde.org/stable/frameworks/5.81/kwindowsystem-5.81.0.tar.xz"
sha256 "b8aef806276b5f12e9810473679401a6715b3b86e786eb874b12b2b6ed16f196" sha256 "4753aaabb073b41dd8be79d454756ec616cc386f3be16f5503a77c84e12eaa86"
head "https://invent.kde.org/frameworks/kwindowsystem.git" head "https://invent.kde.org/frameworks/kwindowsystem.git"
depends_on "cmake" => [:build, :test] depends_on "cmake" => [:build, :test]
depends_on "kde-extra-cmake-modules" => [:build, :test]
depends_on "ninja" => :build depends_on "ninja" => :build
depends_on "copyq/kde/extra-cmake-modules" => [:build, :test]
depends_on "qt@5" depends_on "qt@5"
def install def install
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment