Exemplo n.º 1
0
HeightMapInterface* AbstractHeightMapManager::getHeightMapOfTile(Tile* tile) {
	if (tileMap.find(tile->getId()) != tileMap.end()) {
		return tileMap[tile->getId()]; //cache hit
	}

	//load and save
	std::string fileName = generateFileName(tile);
	HeightMapInterface* h = loadImpl(fileName);
	if(h) {
		PRINTD(INFO, "found saved heightmap at %s\n",fileName.c_str());
	} else {
		PRINTD(INFO, "creating heightmap for tile %s\n",tile->getName().c_str());
		h = createImpl(tile);
		if(h) { //save to disk
			if(!saveImpl(h, fileName))
				PRINTD(WARNING, "can't save heightmap of tile %s to %s\n",tile->getName().c_str(), fileName.c_str());
		}
	}

	if(h) { //save in cache -> TODO what about locks?
		tileMap[tile->getId()] = h;
		return h;
	} else {
		PRINTD(WARNING, "can't neighter load or create heightmap for tile %s\n",tile->getName().c_str());
		return NULL;
	}
}
Exemplo n.º 2
0
TorrentPersistentData::TorrentPersistentData()
  : all_data(QIniSettings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent-resume")).value("torrents").toHash())
  , dirty(false)
{
  connect(&timer, SIGNAL(timeout()), SLOT(saveImpl()));
  m_instance = this;
}
Exemplo n.º 3
0
void SettingsWidget::save()
{
//		if(!isModified())
//			return;
	p->sleep = true;
	saveImpl();
	p->clearValues();
	p->sleep = false;
	emit saved();
}
Exemplo n.º 4
0
void SettingsWidget::save()
{
	if(!isModified())
		return;
	p->sleep = true;
	saveImpl();
	p->clearValues();
	p->sleep = false;
	emit saved();
	emit modifiedChanged(false);
}
Exemplo n.º 5
0
void DataSettingsObject::save(const DataItem &item)
{
    saveImpl(item);
}
Exemplo n.º 6
0
void TorrentPersistentData::save() {
  if (dirty)
    saveImpl();
}
Exemplo n.º 7
0
void Alert::save(void)
{
  t_.ensureIsActive();
  saveImpl(t_);
}