本文整理汇总了C++中Mod::type方法的典型用法代码示例。如果您正苦于以下问题:C++ Mod::type方法的具体用法?C++ Mod::type怎么用?C++ Mod::type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mod
的用法示例。
在下文中一共展示了Mod::type方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateWithMod
void MCModInfoFrame::updateWithMod(Mod &m)
{
if(m.type() == m.MOD_FOLDER)
{
clear();
return;
}
QString text = "";
QString 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();
setModText(text);
if(m.description().isEmpty())
{
setModDescription(tr("No description provided in mcmod.info"));
}
else
{
setModDescription(m.description());
}
}
示例2: replace
bool Mod::replace(Mod &with)
{
if (!destroy())
return false;
bool success = false;
auto t = with.type();
if (t == MOD_ZIPFILE || t == MOD_SINGLEFILE)
{
QLOG_DEBUG() << "Copy: " << with.m_file.filePath() << " to " << m_file.filePath();
success = QFile::copy(with.m_file.filePath(), m_file.filePath());
}
if (t == MOD_FOLDER)
{
success = copyPath(with.m_file.filePath(), m_file.path());
}
if (success)
{
m_name = with.m_name;
m_mmc_id = with.m_mmc_id;
m_mod_id = with.m_mod_id;
m_version = with.m_version;
m_mcversion = with.m_mcversion;
m_description = with.m_description;
m_authors = with.m_authors;
m_credits = with.m_credits;
m_homeurl = with.m_homeurl;
m_type = with.m_type;
m_file.refresh();
}
return success;
}
示例3: strongCompare
bool Mod::strongCompare(const Mod &other) const
{
return mmc_id() == other.mmc_id() && version() == other.version() && type() == other.type();
}