Skip to content

Commit

Permalink
rename function
Browse files Browse the repository at this point in the history
  • Loading branch information
zoff99 committed May 27, 2023
1 parent b531b94 commit 73c970b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/platform/desktop_notifications/desktopnotify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ DesktopNotify::DesktopNotify(Settings& settings_)
connect(&notifyCore, &Snore::SnoreCore::notificationClosed, this, &DesktopNotify::onNotificationClose);
}

QString DesktopNotify::sanitize_text_for_notifications(const QString& input_text)
QString DesktopNotify::sanitizeTextForNotifications(const QString& input_text)
{
QString output_text = QString(input_text);
output_text.replace(QRegularExpression("[^a-zA-Z0-9 _:]"), "_"); // allow only a A-Z and 0-9 and "_" and " " and ":" chars
// qDebug() << "sanitize_text_for_notifications: input:" << input_text << "output:" << output_text;
// qDebug() << "sanitizeTextForNotifications: input:" << input_text << "output:" << output_text;
return output_text;
}

Expand All @@ -59,8 +59,8 @@ void DesktopNotify::notifyMessage(const NotificationData& notificationData)
}

auto icon = notificationData.pixmap.isNull() ? snoreIcon : Snore::Icon(notificationData.pixmap);
auto title_sanitized = sanitize_text_for_notifications(notificationData.title);
auto message_sanitizied = sanitize_text_for_notifications(notificationData.message);
auto title_sanitized = sanitizeTextForNotifications(notificationData.title);
auto message_sanitizied = sanitizeTextForNotifications(notificationData.message);
auto newNotification = Snore::Notification{snoreApp, Snore::Alert(), title_sanitized, message_sanitizied, icon, 0};
latestId = newNotification.id();

Expand Down
2 changes: 1 addition & 1 deletion src/platform/desktop_notifications/desktopnotify.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class DesktopNotify : public QObject
Q_OBJECT
public:
explicit DesktopNotify(Settings& settings);
QString sanitize_text_for_notifications(const QString& input_text);
QString sanitizeTextForNotifications(const QString& input_text);

public slots:
void notifyMessage(const NotificationData& notificationData);
Expand Down

0 comments on commit 73c970b

Please sign in to comment.