use markup again for snore backend
This commit is contained in:
parent
bb447c91c1
commit
21846d2d2e
|
@ -28,6 +28,7 @@ public:
|
|||
"<a href=\"https://github.com/Snorenotify/Snorenotify\">Website</a><br>");
|
||||
private slots:
|
||||
void benchmarkUtilsToHtml();
|
||||
void benchmarkUtilsToHtmlAllMarkup();
|
||||
void benchmarkUtilsToPlain();
|
||||
|
||||
private:
|
||||
|
@ -65,6 +66,15 @@ void SnoreBenchmark::benchmarkUtilsToHtml(){
|
|||
}
|
||||
}
|
||||
|
||||
void SnoreBenchmark::benchmarkUtilsToHtmlAllMarkup()
|
||||
{
|
||||
QCOMPARE(Utils::normaliseMarkup(htmlTestString, Utils::ALL_MARKUP), htmlTestString);
|
||||
|
||||
QBENCHMARK{
|
||||
Utils::normaliseMarkup(htmlTestString, Utils::ALL_MARKUP);
|
||||
}
|
||||
}
|
||||
|
||||
void SnoreBenchmark::benchmarkUtilsToPlain()
|
||||
{
|
||||
QBENCHMARK{
|
||||
|
|
|
@ -79,6 +79,10 @@ void Utils::raiseWindowToFront(qlonglong wid)
|
|||
QString Utils::normaliseMarkup(QString string, MARKUP_FLAGS tags)
|
||||
{
|
||||
static QMutex mutex;
|
||||
if(tags == ALL_MARKUP){
|
||||
return string;
|
||||
}
|
||||
|
||||
QMutexLocker lock(&mutex);
|
||||
|
||||
if (~tags & Utils::BREAK) {
|
||||
|
|
|
@ -87,8 +87,8 @@ void NotifyWidget::display(const Notification ¬ification)
|
|||
QRgb gray = qGray(qGray(color.rgb()) - qGray(QColor(Qt::white).rgb()));
|
||||
QColor textColor = QColor(gray, gray, gray);
|
||||
QMetaObject::invokeMethod(m_qmlNotification, "update", Qt::QueuedConnection,
|
||||
Q_ARG(QVariant, notification.title()),
|
||||
Q_ARG(QVariant, notification.text()),
|
||||
Q_ARG(QVariant, notification.title(Utils::ALL_MARKUP)),
|
||||
Q_ARG(QVariant, notification.text(Utils::ALL_MARKUP)),
|
||||
Q_ARG(QVariant, QUrl::fromLocalFile(notification.icon().localUrl())),
|
||||
Q_ARG(QVariant, QUrl::fromLocalFile(notification.application().icon().localUrl())),
|
||||
Q_ARG(QVariant, color),
|
||||
|
|
Loading…
Reference in New Issue