blob: 05a924ca2afa1090b123be3df2f915ed52a11803 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
#include "chatlogpiece.h"
chatlogpiece::chatlogpiece()
{
name = tr("UNKNOWN");
showname = tr("UNKNOWN");
message = tr("UNKNOWN");
color = 0;
action = "";
datetime = QDateTime::currentDateTime().toUTC();
}
chatlogpiece::chatlogpiece(QString p_name, QString p_showname,
QString p_message, QString p_action, int p_color)
{
name = p_name;
showname = p_showname;
message = p_message;
action = p_action;
color = p_color;
datetime = QDateTime::currentDateTime().toUTC();
}
chatlogpiece::chatlogpiece(QString p_name, QString p_showname,
QString p_message, QString p_action, int p_color,
QDateTime p_datetime)
{
name = p_name;
showname = p_showname;
message = p_message;
action = p_action;
color = p_color;
datetime = p_datetime.toUTC();
}
QString chatlogpiece::get_name() { return name; }
QString chatlogpiece::get_showname() { return showname; }
QString chatlogpiece::get_message() { return message; }
QDateTime chatlogpiece::get_datetime() { return datetime; }
QString chatlogpiece::get_action() { return action; }
QString chatlogpiece::get_datetime_as_string() { return datetime.toString(); }
int chatlogpiece::get_chat_color() { return color; }
QString chatlogpiece::get_full()
{
QString full = "[";
full.append(get_datetime_as_string());
full.append("] ");
full.append(get_showname());
if (get_showname() != get_name())
{
full.append(" (");
full.append(get_name());
full.append(")");
}
if (!get_action().isEmpty())
full.append(" " + get_action());
full.append(": ");
full.append(get_message());
return full;
}
|