增加对hints中sound-name的处理

This commit is contained in:
iaom 2023-07-06 17:03:06 +08:00
parent c6c8fe0998
commit 8882da2edf
2 changed files with 14 additions and 2 deletions

View File

@ -50,6 +50,7 @@ public:
bool m_resident = false;
bool m_transient = false;
QString m_soundFile;
QString m_soundName;
bool m_suppressSound = false;
QString m_display;
QStringList m_actionState;
@ -317,8 +318,9 @@ void PopupNotification::setHints(const QVariantMap &hints)
d->loadImageFromPath(it->toString());
}
}
//暂不支持声音主题
d->m_soundFile = hints.value(QStringLiteral("sound-file")).toString();
d->m_soundName = hints.value(QStringLiteral("sound-name")).toString();
d->m_suppressSound = hints.value(QStringLiteral("suppress-sound")).toBool();
d->m_display = hints.value(QStringLiteral("x-ukui-display")).toString();
d->m_actionState = hints.value(QStringLiteral("x-ukui-action-state")).toStringList();
@ -379,6 +381,10 @@ QString PopupNotification::soundFile() const
{
return d->m_soundFile;
}
QString PopupNotification::soundName() const
{
return d->m_soundName;
}
bool PopupNotification::suppressSound() const
{

View File

@ -51,6 +51,7 @@ class UKUINOTIFICATION_EXPORT PopupNotification
Q_PROPERTY(bool resident READ resident)
Q_PROPERTY(bool transient READ transient)
Q_PROPERTY(QString soundFile READ soundFile)
Q_PROPERTY(QString soundName READ soundName)
Q_PROPERTY(bool suppressSound READ suppressSound)
Q_PROPERTY(QString category READ category)
Q_PROPERTY(Urgency urgency READ urgency WRITE setUrgency)
@ -134,10 +135,15 @@ public:
*/
bool resident() const;
/**
*
*
* @return
*/
QString soundFile() const;
/**
*
* @return
*/
QString soundName() const;
/**
*
* @return