MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / updateWithMod

Method updateWithMod

launcher/ui/widgets/InfoFrame.cpp:58–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58void InfoFrame::updateWithMod(Mod const& m)
59{
60 if (m.type() == ResourceType::FOLDER)
61 {
62 clear();
63 return;
64 }
65
66 QString text = "";
67 QString name = "";
68 if (m.name().isEmpty())
69 name = m.internal_id();
70 else
71 name = m.name();
72
73 if (m.homeurl().isEmpty())
74 text = name;
75 else
76 text = "<a href=\"" + m.homeurl() + "\">" + name + "</a>";
77 if (!m.authors().isEmpty())
78 text += " by " + m.authors().join(", ");
79
80 setName(text);
81
82 if (m.description().isEmpty())
83 {
84 setDescription(QString());
85 }
86 else
87 {
88 setDescription(m.description());
89 }
90
91 setImage();
92}
93
94void InfoFrame::updateWithResource(const Resource& resource)
95{

Callers 1

onSelectionChangedMethod · 0.80

Calls 8

QStringClass · 0.85
isEmptyMethod · 0.80
internal_idMethod · 0.80
homeurlMethod · 0.80
authorsMethod · 0.80
typeMethod · 0.45
nameMethod · 0.45
descriptionMethod · 0.45

Tested by

no test coverage detected