summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--application/widgets/MCModInfoFrame.cpp19
-rw-r--r--logic/minecraft/Mod.h4
2 files changed, 16 insertions, 7 deletions
diff --git a/application/widgets/MCModInfoFrame.cpp b/application/widgets/MCModInfoFrame.cpp
index 2f859ed3..0ec1376d 100644
--- a/application/widgets/MCModInfoFrame.cpp
+++ b/application/widgets/MCModInfoFrame.cpp
@@ -22,7 +22,7 @@
void MCModInfoFrame::updateWithMod(Mod &m)
{
- if(m.type() == m.MOD_FOLDER)
+ if (m.type() == m.MOD_FOLDER)
{
clear();
return;
@@ -30,16 +30,21 @@ void MCModInfoFrame::updateWithMod(Mod &m)
QString text = "";
QString name = "";
- if(m.name().isEmpty()) name = m.mmc_id();
- else name = m.name();
+ if (m.name().isEmpty())
+ name = m.mmc_id();
+ else
+ name = m.name();
- if(m.homeurl().isEmpty()) text = name;
- else text = "<a href=\"" + m.homeurl() + "\">" + name + "</a>";
- if(!m.authors().isEmpty()) text += " by " + m.authors();
+ if (m.homeurl().isEmpty())
+ text = name;
+ else
+ text = "<a href=\"" + m.homeurl() + "\">" + name + "</a>";
+ if (!m.authors().isEmpty())
+ text += " by " + m.authors();
setModText(text);
- if(m.description().isEmpty())
+ if (m.description().isEmpty())
{
setModDescription(tr("No description provided in mcmod.info"));
}
diff --git a/logic/minecraft/Mod.h b/logic/minecraft/Mod.h
index 5b815bc1..19f4c740 100644
--- a/logic/minecraft/Mod.h
+++ b/logic/minecraft/Mod.h
@@ -57,6 +57,10 @@ public:
}
QString name() const
{
+ if(m_name.trimmed().isEmpty())
+ {
+ return m_mmc_id;
+ }
return m_name;
}