MCPcopy Create free account
hub / github.com/MultiMC/Launcher / updateWithMod

Method updateWithMod

launcher/ui/widgets/MCModInfoFrame.cpp:24–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22#include "ui/dialogs/CustomMessageBox.h"
23
24void MCModInfoFrame::updateWithMod(Mod &m)
25{
26 if (m.type() == m.MOD_FOLDER)
27 {
28 clear();
29 return;
30 }
31
32 QString text = "";
33 QString name = "";
34 if (m.name().isEmpty())
35 name = m.mmc_id();
36 else
37 name = m.name();
38
39 if (m.homeurl().isEmpty())
40 text = name;
41 else
42 text = "<a href=\"" + m.homeurl() + "\">" + name + "</a>";
43 if (!m.authors().isEmpty())
44 text += " by " + m.authors().join(", ");
45
46 setModText(text);
47
48 if (m.description().isEmpty())
49 {
50 setModDescription(QString());
51 }
52 else
53 {
54 setModDescription(m.description());
55 }
56}
57
58void MCModInfoFrame::clear()
59{

Callers 1

modCurrentMethod · 0.80

Calls 9

QStringClass · 0.85
isEmptyMethod · 0.80
mmc_idMethod · 0.80
homeurlMethod · 0.80
authorsMethod · 0.80
joinMethod · 0.80
descriptionMethod · 0.80
typeMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected