std::set<GameSettingsPresetInfo> presetsForMod(const std::string& modDir) {
	std::set<GameSettingsPresetInfo> presets;
	for(Iterator<std::string>::Ref it = FileListIter(".", false, FM_REG, "*.gamesettings"); it->isValid(); it->next())
		presets.insert(settingsInfo("./" + GetBaseFilename(it->get()), true));
	
	for(Iterator<std::string>::Ref it = FileListIter(modDir, false, FM_REG, "*.gamesettings"); it->isValid(); it->next())
		presets.insert(settingsInfo(modDir + "/" + GetBaseFilename(it->get()), false));
	
	return presets;
}
Beispiel #2
0
Datei: ssu.cpp Projekt: lbt/ssu
Ssu::Ssu(): QObject(){
  errorFlag = false;
  pendingRequests = 0;

#ifdef SSUCONFHACK
  // dirty hack to make sure we can write to the configuration
  // this is currently required since there's no global gconf,
  // and we migth not yet have users on bootstrap
  QFileInfo settingsInfo(SSU_CONFIGURATION);
  if (settingsInfo.groupId() != SSU_GROUP_ID ||
      !settingsInfo.permission(QFile::WriteGroup)){
    QProcess proc;
    proc.start("/usr/bin/ssuconfperm");
    proc.waitForFinished();
  }
#endif

  SsuCoreConfig *settings = SsuCoreConfig::instance();

#ifdef TARGET_ARCH
  if (!settings->contains("arch"))
    settings->setValue("arch", TARGET_ARCH);
#else
// FIXME, try to guess a matching architecture
#warning "TARGET_ARCH not defined"
#endif
  settings->sync();



  manager = new QNetworkAccessManager(this);
  connect(manager, SIGNAL(finished(QNetworkReply *)),
          SLOT(requestFinished(QNetworkReply *)));
}
bool GameSettingsPresetInfo::fromString( const std::string & str) {
	bool global = GetBaseFilename(str) == str || strStartsWith(str, "./");
	*this = settingsInfo(str, global);
	return true;
}