use markup again for snore backend

This commit is contained in:
Patrick von Reth 2015-06-23 17:13:01 +02:00
parent bb447c91c1
commit 21846d2d2e
3 changed files with 16 additions and 2 deletions

View File

@ -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{

View File

@ -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) {

View File

@ -87,8 +87,8 @@ void NotifyWidget::display(const Notification &notification)
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),