From fe2f9f52534729f0aa9d373c0ce05736a45b9415 Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Tue, 11 Mar 2014 19:26:14 +0200 Subject: [PATCH] Prevented empty time stamps - when less then a minute has passed - from appearing. --- interface/interface_en.ts | 2 +- interface/src/ui/ChatWindow.cpp | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/interface/interface_en.ts b/interface/interface_en.ts index fbbe4752ea..ed8a2155e4 100644 --- a/interface/interface_en.ts +++ b/interface/interface_en.ts @@ -76,7 +76,7 @@ - + %1 online now: diff --git a/interface/src/ui/ChatWindow.cpp b/interface/src/ui/ChatWindow.cpp index 0ebfb3d4dd..09b50ebf46 100644 --- a/interface/src/ui/ChatWindow.cpp +++ b/interface/src/ui/ChatWindow.cpp @@ -109,13 +109,15 @@ void ChatWindow::addTimeStamp() { } } timeString.chop(1); - QLabel* timeLabel = new QLabel(timeString); - timeLabel->setStyleSheet("color: palette(shadow);" - "background-color: palette(highlight);" - "padding: 4px;"); - timeLabel->setAlignment(Qt::AlignHCenter); - ui->messagesFormLayout->addRow(timeLabel); - numMessagesAfterLastTimeStamp = 0; + if (!timeString.isEmpty()) { + QLabel* timeLabel = new QLabel(timeString); + timeLabel->setStyleSheet("color: palette(shadow);" + "background-color: palette(highlight);" + "padding: 4px;"); + timeLabel->setAlignment(Qt::AlignHCenter); + ui->messagesFormLayout->addRow(timeLabel); + numMessagesAfterLastTimeStamp = 0; + } } void ChatWindow::startTimerForTimeStamps() {