Skip to content

Commit 98ea2e7

Browse files
wyu71deepin-bot[bot]
authored andcommitted
fix: unescape quotes in Bluetooth device notification
- Added unescaping for single and double quotes in notification body text. Log: resolve notification display issue for Bluetooth device names with quotes pms: BUG-342911
1 parent b6fbce2 commit 98ea2e7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

panels/notification/server/notificationmanager.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ uint NotificationManager::Notify(const QString &appName, uint replacesId, const
223223
}
224224

225225
QString strBody = body;
226-
strBody.replace(QLatin1String("\\\\"), QLatin1String("\\"), Qt::CaseInsensitive);
226+
// Unescape backslashes and quotes from %q formatted strings (e.g., \\ -> \, \" -> ", \' -> ')
227+
strBody.replace(QRegularExpression("\\\\(\\\\|['\"])"), "\\1");
227228

228229
QString strIcon = appIcon;
229230
if (strIcon.isEmpty())

0 commit comments

Comments
 (0)