blob: 72be162e7071f8a5a665cc6a1cbc203f95d86af4 (
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
|
#include "FlagIconDelegate.h"
#include <bit>
namespace BSPluginList
{
using enum TESData::FileInfo::EFlag;
FlagIconDelegate::FlagIconDelegate(PluginListView* view)
: GUI::IconDelegate(view), m_View{view}
{}
QList<QString> FlagIconDelegate::getIcons(const QModelIndex& index) const
{
const auto flags = m_View->fileFlags(index);
QList<QString> icons;
if (flags & FLAG_PROBLEMATIC) {
icons.append(":/MO/gui/warning");
}
if (flags & FLAG_INFORMATION) {
icons.append(":/MO/gui/information");
}
if (flags & FLAG_INI) {
icons.append(":/MO/gui/attachment");
}
if (flags & FLAG_BSA) {
icons.append(":/MO/gui/archive_conflict_neutral");
}
if (flags & FLAG_MASTER) {
icons.append(":/bsplugins/star");
}
if (flags & FLAG_LIGHT) {
icons.append(":/bsplugins/feather");
}
if (flags & FLAG_MEDIUM) {
icons.append(":/MO/gui/run");
if (flags & FLAG_LIGHT) {
icons.append(":/MO/gui/warning");
}
}
if (flags & FLAG_BLUEPRINT) {
icons.append(":/MO/gui/resources/go-down.png");
}
if (flags & FLAG_CLEAN) {
icons.append(":/MO/gui/edit_clear");
}
return icons;
}
int FlagIconDelegate::getNumIcons(const QModelIndex& index) const
{
return std::popcount(static_cast<uint>(m_View->fileFlags(index)));
}
} // namespace BSPluginList
|