fix markup stuff
This commit is contained in:
parent
3031723315
commit
711e880dd7
|
@ -94,20 +94,12 @@ const Application &Notification::application() const
|
||||||
|
|
||||||
QString Notification::title(Utils::MARKUP_FLAGS flags) const
|
QString Notification::title(Utils::MARKUP_FLAGS flags) const
|
||||||
{
|
{
|
||||||
if(!application().constHints().value("use-markup").toBool()) {
|
return d->resolveMarkup(d->m_title, flags);
|
||||||
return d->m_title.toHtmlEscaped();
|
|
||||||
} else {
|
|
||||||
return Utils::normaliseMarkup(d->m_title, flags);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Notification::text(Utils::MARKUP_FLAGS flags) const
|
QString Notification::text(Utils::MARKUP_FLAGS flags) const
|
||||||
{
|
{
|
||||||
if(!application().constHints().value("use-markup").toBool()) {
|
return d->resolveMarkup(d->m_text, flags);
|
||||||
return d->m_text.toHtmlEscaped();
|
|
||||||
}else {
|
|
||||||
return Utils::normaliseMarkup(d->m_text, flags);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const Alert &Notification::alert() const
|
const Alert &Notification::alert() const
|
||||||
|
|
|
@ -90,6 +90,15 @@ void NotificationData::setTimeoutTimer(QTimer *timer)
|
||||||
m_timeoutTimer.reset(timer);
|
m_timeoutTimer.reset(timer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString NotificationData::resolveMarkup(const QString &string, Utils::MARKUP_FLAGS flags)
|
||||||
|
{
|
||||||
|
if(flags != Utils::NO_MARKUP && !m_application.constHints().value("use-markup").toBool()) {
|
||||||
|
return string.toHtmlEscaped();
|
||||||
|
} else {
|
||||||
|
return Utils::normaliseMarkup(string, flags);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void NotificationData::initHints()
|
void NotificationData::initHints()
|
||||||
{
|
{
|
||||||
m_hints.setValue("silent", SnoreCore::instance().value("Silent", LOCAL_SETTING));
|
m_hints.setValue("silent", SnoreCore::instance().value("Silent", LOCAL_SETTING));
|
||||||
|
|
|
@ -48,6 +48,8 @@ public:
|
||||||
|
|
||||||
void setTimeoutTimer(QTimer *timer);
|
void setTimeoutTimer(QTimer *timer);
|
||||||
|
|
||||||
|
QString resolveMarkup(const QString &string, Utils::MARKUP_FLAGS flags);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(NotificationData)
|
Q_DISABLE_COPY(NotificationData)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue