Skip to content

Commit

Permalink
git: clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
nullobsi committed Jul 29, 2024
1 parent 7a0b218 commit 363ec17
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/knotifications/src/knotification.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#ifndef KNOTIFICATION_H
#define KNOTIFICATION_H

#include <QImage>
#include <QList>
#include <QObject>
#include <QPair>
#include <QImage>
#include <QUrl>
#include <QVariant>
#include <QWindow>
Expand Down
16 changes: 9 additions & 7 deletions 3rdparty/knotifications/src/notifybymacosnotificationcenter.mm
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,20 @@ - (void)userNotificationCenter:(NSUserNotificationCenter *)center didDeliverNoti
internalNotificationId, @"internalId", nil];
osxNotification.informativeText = text;

if (notification->image().isNull()) {
QIcon notificationIcon = QIcon::fromTheme(notification->iconName());
if (notification->image().isNull()) {
QIcon notificationIcon = QIcon::fromTheme(notification->iconName());
if (!notificationIcon.isNull()) {
osxNotification.contentImage = [[NSImage alloc]
initWithCGImage: notificationIcon.pixmap(QSize(64, 64)).toImage().toCGImage() size: NSMakeSize(64, 64)];
}
} else {
osxNotification.contentImage = [[NSImage alloc]
initWithCGImage: notification->image().toCGImage() size: NSMakeSize(64, 64)];
}
}
else {
osxNotification.contentImage = [[NSImage alloc]
initWithCGImage:notification->image().toCGImage()
size:NSMakeSize(64, 64)];
}

if (notification->actions().isEmpty()) {
if (notification->actions().isEmpty()) {
// Remove all buttons
osxNotification.hasReplyButton = false;
osxNotification.hasActionButton = false;
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/knotifications/src/notifybysnore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ void NotifyBySnore::notifyDeferred(KNotification* notification)
// handle the icon for toast notification
const QString iconPath = m_iconDir.path() + QLatin1Char('/') + QString::number(notification->id());
const bool hasIcon = (notification->image().isNull()) ? qApp->windowIcon().pixmap(1024, 1024).save(iconPath, "PNG")//
: notification->image().save(iconPath, "PNG");
: notification->image().save(iconPath, "PNG");
if (hasIcon) {
snoretoastArgsList << QStringLiteral("-p") << iconPath;
}
Expand Down

0 comments on commit 363ec17

Please sign in to comment.