本文整理汇总了C++中Profile::addResource方法的典型用法代码示例。如果您正苦于以下问题:C++ Profile::addResource方法的具体用法?C++ Profile::addResource怎么用?C++ Profile::addResource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Profile
的用法示例。
在下文中一共展示了Profile::addResource方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: eventLoopStarted
void ProfileManager::eventLoopStarted()
{
QSettings settings;
for (int i = 0 ; true ; i++) {
if (!settings.contains(QString("profile%1/name").arg(i))) {
break;
}
Profile* profile = new Profile(settings.value(QString("profile%1/name").arg(i)).toString());
GameInfo::VersionMode ver;
QString verStr = settings.value(QString("profile%1/version").arg(i)).toString();
if (verStr == "gta3")
ver = GameInfo::GTAIII;
else if (verStr == "gtavc")
ver = GameInfo::GTAVC;
else
ver = GameInfo::GTASA;
GameInfo info(ver, File(settings.value(QString("profile%1/root").arg(i)).toString().toLocal8Bit().constData()));
profile->setGameInfo(info);
for (int j = 0 ; true ; j++) {
if (!settings.contains(QString("profile%1/resource%2").arg(i).arg(j))) {
break;
}
QString resource = settings.value(QString("profile%1/resource%2").arg(i).arg(j)).toString();
profile->addResource(File(resource.toLocal8Bit().constData()));
}
for (int j = 0 ; true ; j++) {
if (!settings.contains(QString("profile%1/search_resource%2").arg(i).arg(j))) {
break;
}
QString resource = settings.value(QString("profile%1/search_resource%2").arg(i).arg(j)).toString();
profile->addSearchResource(File(resource.toLocal8Bit().constData()));
}
for (int j = 0 ; true ; j++) {
if (!settings.contains(QString("profile%1/dat_file%2").arg(i).arg(j))) {
break;
}
QString datFile = settings.value(QString("profile%1/dat_file%2").arg(i).arg(j)).toString();
profile->addDATFile(File(datFile.toLocal8Bit().constData()));
}
addProfile(profile);
}
int currentProfileIdx = settings.value("main/current_profile", -1).toInt();
if (currentProfileIdx != -1) {
setCurrentProfile(getProfile(currentProfileIdx));
} else {
setCurrentProfile(NULL);
}
emit profilesLoaded();
}