From 6570bcf0662d675cc3f0ed89820fc95efe4cace3 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Mon, 4 Jan 2021 13:45:18 -0600 Subject: Fix timestamps when toggling showname On toggling shownames, regenerate_ic_chatlog() gets called to reprint the entire chatlog with append_ic_text(). The issue is that append_ic_text() uses QDateTime::currentDateTime() for the timestamp when it's called. Therefore the fix is adding a new timestamp parameter to the append_ic_text() which we supply from the datetime provided by each chatlogpiece --- include/courtroom.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index f05b15a..9332481 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -225,7 +225,7 @@ public: // selected // or the user isn't already scrolled to the top void append_ic_text(QString p_text, QString p_name = "", QString action = "", - int color = 0); + int color = 0, QDateTime timestamp = {}); // prints who played the song to IC chat and plays said song(if found on local // filesystem) takes in a list where the first element is the song name and -- cgit From 8aaba6633ec8b3303e0e7f24d42b96f3d5a4a90e Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Mon, 4 Jan 2021 19:21:11 -0600 Subject: Change default parameter to be QDateTime::currentDateTime() Print debug message if provided timestamp is invalid --- include/courtroom.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index 9332481..4610130 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -225,7 +225,7 @@ public: // selected // or the user isn't already scrolled to the top void append_ic_text(QString p_text, QString p_name = "", QString action = "", - int color = 0, QDateTime timestamp = {}); + int color = 0, QDateTime timestamp = QDateTime::currentDateTime()); // prints who played the song to IC chat and plays said song(if found on local // filesystem) takes in a list where the first element is the song name and -- cgit