本文整理汇总了C++中RomInfo::Genre方法的典型用法代码示例。如果您正苦于以下问题:C++ RomInfo::Genre方法的具体用法?C++ RomInfo::Genre怎么用?C++ RomInfo::Genre使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RomInfo
的用法示例。
在下文中一共展示了RomInfo::Genre方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fillNode
void GameUI::fillNode(MythGenericTree *node)
{
QString layername = node->GetText();
RomInfo *romInfo = qVariantValue<RomInfo *>(node->GetData());
MSqlQuery query(MSqlQuery::InitCon());
query.prepare(getFillSql(node));
if (romInfo)
{
if (!romInfo->System().isEmpty())
query.bindValue(":SYSTEM", romInfo->System());
if (!romInfo->Year().isEmpty())
query.bindValue(":YEAR", romInfo->Year());
if (!romInfo->Genre().isEmpty())
query.bindValue(":GENRE", romInfo->Genre());
if (!romInfo->Plot().isEmpty())
query.bindValue(":PLOT", romInfo->Plot());
if (!romInfo->Publisher().isEmpty())
query.bindValue(":PUBLISHER", romInfo->Publisher());
if (!romInfo->Gamename().isEmpty())
query.bindValue(":GAMENAME", romInfo->Gamename());
}
bool IsLeaf = node->getInt() == getLevelsOnThisBranch(node);
if (query.exec() && query.size() > 0)
{
while (query.next())
{
QString current = query.value(0).toString().trimmed();
MythGenericTree *new_node =
new MythGenericTree(current, node->getInt() + 1, false);
if (IsLeaf)
{
RomInfo *temp = new RomInfo();
temp->setSystem(query.value(1).toString().trimmed());
temp->setYear(query.value(2).toString());
temp->setGenre(query.value(3).toString().trimmed());
temp->setGamename(query.value(4).toString().trimmed());
new_node->SetData(qVariantFromValue(temp));
node->addNode(new_node);
}
else
{
RomInfo *newRomInfo;
if (node->getInt() > 1)
{
RomInfo *currentRomInfo;
currentRomInfo = qVariantValue<RomInfo *>(node->GetData());
newRomInfo = new RomInfo(*currentRomInfo);
}
else
{
newRomInfo = new RomInfo();
}
new_node->SetData(qVariantFromValue(newRomInfo));
node->addNode(new_node);
if (getChildLevelString(node) != "hash")
newRomInfo->setField(getChildLevelString(node), current);
}
}
}
}
示例2: getFillSql
QString GameUI::getFillSql(MythGenericTree *node) const
{
QString layer = node->GetText();
int childDepth = node->getInt() + 1;
QString childLevel = getChildLevelString(node);
QString filter = getFilter(node);
bool childIsLeaf = childDepth == getLevelsOnThisBranch(node) + 1;
RomInfo *romInfo = qVariantValue<RomInfo *>(node->GetData());
QString columns;
QString conj = "where ";
if (!filter.isEmpty())
{
filter = conj + filter;
conj = " and ";
}
if ((childLevel == "gamename") && (m_gameShowFileName))
{
columns = childIsLeaf
? "romname,system,year,genre,gamename"
: "romname";
if (m_showHashed)
filter += " and romname like '" + layer + "%'";
}
else if ((childLevel == "gamename") && (layer.length() == 1))
{
columns = childIsLeaf
? childLevel + ",system,year,genre,gamename"
: childLevel;
if (m_showHashed)
filter += " and gamename like '" + layer + "%'";
}
else if (childLevel == "hash")
{
columns = "left(gamename,1)";
}
else
{
columns = childIsLeaf
? childLevel + ",system,year,genre,gamename"
: childLevel;
}
// this whole section ought to be in rominfo.cpp really, but I've put it
// in here for now to minimise the number of files changed by this mod
if (romInfo)
{
if (!romInfo->System().isEmpty())
{
filter += conj + "trim(system)=:SYSTEM";
conj = " and ";
}
if (!romInfo->Year().isEmpty())
{
filter += conj + "year=:YEAR";
conj = " and ";
}
if (!romInfo->Genre().isEmpty())
{
filter += conj + "trim(genre)=:GENRE";
conj = " and ";
}
if (!romInfo->Plot().isEmpty())
{
filter += conj + "plot=:PLOT";
conj = " and ";
}
if (!romInfo->Publisher().isEmpty())
{
filter += conj + "publisher=:PUBLISHER";
conj = " and ";
}
if (!romInfo->Gamename().isEmpty())
{
filter += conj + "trim(gamename)=:GAMENAME";
}
}
filter += conj + " display = 1 ";
QString sql;
if ((childLevel == "gamename") && (m_gameShowFileName))
{
sql = "select distinct "
+ columns
+ " from gamemetadata "
+ filter
+ " order by romname"
+ ";";
}
else if (childLevel == "hash")
{
//.........这里部分代码省略.........