增加对hints中sound-name的处理
This commit is contained in:
parent
c6c8fe0998
commit
8882da2edf
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue