add humanize as a dependency

This commit is contained in:
Rasmus Karlsson 2017-06-11 21:01:08 +02:00
parent 7c3cd930f3
commit 2305afe700
5 changed files with 14 additions and 6 deletions

3
.gitmodules vendored
View file

@ -4,3 +4,6 @@
[submodule "lib/settings"]
path = lib/settings
url = https://github.com/pajlada/settings
[submodule "lib/humanize"]
path = lib/humanize
url = https://github.com/pajlada/humanize.git

View file

@ -195,3 +195,4 @@ werr {
# External dependencies
include(dependencies/rapidjson.pri)
include(dependencies/settings.pri)
include(dependencies/humanize.pri)

2
dependencies/humanize.pri vendored Normal file
View file

@ -0,0 +1,2 @@
# settings
INCLUDEPATH += $$PWD/../lib/humanize/include/

1
lib/humanize Submodule

@ -0,0 +1 @@
Subproject commit 4e00a03623966723f23ca3034c1ad944009cd7be

View file

@ -33,14 +33,15 @@ void MessageBuilder::appendTimestamp(time_t time)
{
char timeStampBuffer[69];
// Add word for timestamp with no seconds
strftime(timeStampBuffer, 69, "%H:%M", localtime(&time));
QString timestamp = QString(timeStampBuffer);
strftime(timeStampBuffer, 69, "%H:%M:%S", localtime(&time));
QString timestampWithSeconds = QString(timeStampBuffer);
appendWord(Word(timestamp, Word::TimestampNoSeconds,
QString timestampNoSeconds(timeStampBuffer);
appendWord(Word(timestampNoSeconds, Word::TimestampNoSeconds,
ColorScheme::getInstance().SystemMessageColor, QString(), QString()));
// Add word for timestamp with seconds
strftime(timeStampBuffer, 69, "%H:%M:%S", localtime(&time));
QString timestampWithSeconds(timeStampBuffer);
appendWord(Word(timestampWithSeconds, Word::TimestampWithSeconds,
ColorScheme::getInstance().SystemMessageColor, QString(), QString()));
}