diff options
author | Fedja Beader <fedja@protonmail.ch> | 2023-10-11 23:58:43 +0200 |
---|---|---|
committer | Fedja Beader <fedja@protonmail.ch> | 2023-10-13 00:06:47 +0200 |
commit | 7a0c3cbf9143aaa9293c1048b15dc1cd63c2ce36 (patch) | |
tree | 13e34a58570810d1d5e4612f39d6b48b72a92985 /src/gui/widgets/tabs/chat/chattab.cpp | |
parent | 5dda53c71f51ab46e273a6c3033925102cbe99e7 (diff) | |
download | manaverse-7a0c3cbf9143aaa9293c1048b15dc1cd63c2ce36.tar.gz manaverse-7a0c3cbf9143aaa9293c1048b15dc1cd63c2ce36.tar.bz2 manaverse-7a0c3cbf9143aaa9293c1048b15dc1cd63c2ce36.tar.xz manaverse-7a0c3cbf9143aaa9293c1048b15dc1cd63c2ce36.zip |
Allow users to set their own timestamp formats.
Diffstat (limited to 'src/gui/widgets/tabs/chat/chattab.cpp')
-rw-r--r-- | src/gui/widgets/tabs/chat/chattab.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/widgets/tabs/chat/chattab.cpp b/src/gui/widgets/tabs/chat/chattab.cpp index f619a881c..8e83d14bc 100644 --- a/src/gui/widgets/tabs/chat/chattab.cpp +++ b/src/gui/widgets/tabs/chat/chattab.cpp @@ -252,8 +252,10 @@ void ChatTab::chatLog(std::string line, if (timeInfo != nullptr) { char timeStamp[64]; // 64 bytes should be enough for everybody?? C.. + // TODO: cache this and useLocalTime somehow, respond to change event. + std::string timeFormat = config.getStringValue("chatTimeStampFormat"); - size_t res = strftime(timeStamp, 64, "[%H:%M]", timeInfo); + size_t res = strftime(timeStamp, 64, timeFormat.c_str(), timeInfo); // strftime returns 0 even in case of success (empty format or %p) // see strftime(3) for further details. if (res > 0) |