summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2017-12-12 09:31:00 +0200
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2017-12-12 09:31:00 +0200
commit1d285993f7f2e41437acafbab3a1335622e85817 (patch)
treef3420aff451df40d2d3a5ae972b59e57dd18086e /src
parentAdd dialog to create rooms (diff)
downloadnheko-1d285993f7f2e41437acafbab3a1335622e85817.tar.xz
Valgrind run
- Fix a memory leak where a layout was created without being used.
- Fix uninitialized value.
Diffstat (limited to 'src')
-rw-r--r--src/timeline/TimelineItem.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/timeline/TimelineItem.cc b/src/timeline/TimelineItem.cc

index 39b345b5..0534ab7d 100644 --- a/src/timeline/TimelineItem.cc +++ b/src/timeline/TimelineItem.cc
@@ -43,10 +43,9 @@ TimelineItem::init() QFontMetrics fm(font_); - topLayout_ = new QHBoxLayout(this); - sideLayout_ = new QVBoxLayout(); - mainLayout_ = new QVBoxLayout(); - headerLayout_ = new QHBoxLayout(); + topLayout_ = new QHBoxLayout(this); + sideLayout_ = new QVBoxLayout; + mainLayout_ = new QVBoxLayout; topLayout_->setContentsMargins(conf::timeline::msgMargin, conf::timeline::msgMargin, 0, 0); topLayout_->setSpacing(0); @@ -59,9 +58,6 @@ TimelineItem::init() mainLayout_->setContentsMargins(conf::timeline::headerLeftMargin, 0, 0, 0); mainLayout_->setSpacing(0); - - headerLayout_->setMargin(0); - headerLayout_->setSpacing(conf::timeline::headerSpacing); } /* @@ -418,6 +414,10 @@ TimelineItem::setupAvatarLayout(const QString &userName) sideLayout_->addWidget(userAvatar_); sideLayout_->addStretch(1); + headerLayout_ = new QHBoxLayout; + headerLayout_->setMargin(0); + headerLayout_->setSpacing(conf::timeline::headerSpacing); + headerLayout_->addWidget(userName_); headerLayout_->addWidget(timestamp_, 1); }