From ec03bc2e8cfa8674ac3b262a9c0ede8d9e6ba3a5 Mon Sep 17 00:00:00 2001 From: nuuls Date: Thu, 24 May 2018 23:12:50 +0200 Subject: [PATCH] fixed performance --- src/messages/layouts/messagelayout.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/messages/layouts/messagelayout.cpp b/src/messages/layouts/messagelayout.cpp index d9a0f484a..860fb243f 100644 --- a/src/messages/layouts/messagelayout.cpp +++ b/src/messages/layouts/messagelayout.cpp @@ -76,6 +76,7 @@ bool MessageLayout::layout(int width, float scale, MessageElement::Flags flags) // check if timestamp format changed bool timestampFormatChanged = this->timestampFormat != app->settings->timestampFormat; + this->timestampFormat = app->settings->timestampFormat.getValue(); layoutRequired |= timestampFormatChanged; @@ -86,6 +87,8 @@ bool MessageLayout::layout(int width, float scale, MessageElement::Flags flags) imagesChanged |= scaleChanged; textChanged |= scaleChanged; +// assert(layoutRequired); + // update word sizes if needed if (imagesChanged) { // this->container.updateImages(); @@ -100,6 +103,8 @@ bool MessageLayout::layout(int width, float scale, MessageElement::Flags flags) } // return if no layout is required + qDebug() << layoutRequired; + if (!layoutRequired) { return false; } @@ -123,8 +128,6 @@ void MessageLayout::actuallyLayout(int width, MessageElement::Flags _flags) this->container.begin(width, this->scale, messageFlags); for (const std::unique_ptr &element : this->message->getElements()) { - BenchmarkGuard guard("addelement"); - element->addToContainer(this->container, _flags); }