-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommit.cpp
56 lines (48 loc) · 1 KB
/
commit.cpp
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
#include "commit.h"
#include "commitdao.h"
Commit::Commit(const CommitDao *dao, QString hash, QObject *parent)
: QObject(parent)
, m_dao(dao)
, m_hash(hash)
{
}
QString Commit::hash() const
{
return m_hash;
}
QString Commit::summary()
{
if (m_summary.isEmpty())
m_summary = m_dao->getSummary(hash());
return m_summary;
}
QString Commit::message()
{
if (m_message.isEmpty())
m_message = m_dao->getMessage(hash());
return m_message;
}
QString Commit::authorName()
{
if (m_author.isEmpty())
m_author.unite(m_dao->getAuthor(hash()));
return m_author[AuthorInfo::Name];
}
QString Commit::authorEmail()
{
if (m_author.isEmpty())
m_author.unite(m_dao->getAuthor(hash()));
return m_author[AuthorInfo::Email];
}
QString Commit::time()
{
if (m_time.isEmpty())
m_time = m_dao->getTime(hash()).toString();
return m_time;
}
QString Commit::diff()
{
if (m_diff.isEmpty())
m_diff = m_dao->getDiff(hash());
return m_diff;
}