Store the avatar voxel URL along with the rest of the avatar settings.

This commit is contained in:
Andrzej Kapolka 2013-06-07 11:30:41 -07:00
parent f42f248db2
commit dc8a6c2725
2 changed files with 7 additions and 6 deletions

View file

@ -1023,7 +1023,7 @@ void Application::editPreferences() {
QFormLayout* form = new QFormLayout();
layout->addLayout(form, 1);
QLineEdit* avatarURL = new QLineEdit(_settings->value("avatarURL").toString());
QLineEdit* avatarURL = new QLineEdit(_myAvatar.getVoxels()->getVoxelURL().toString());
avatarURL->setMinimumWidth(400);
form->addRow("Avatar URL:", avatarURL);
@ -1040,7 +1040,6 @@ void Application::editPreferences() {
return;
}
QUrl url(avatarURL->text());
_settings->setValue("avatarURL", url);
_myAvatar.getVoxels()->setVoxelURL(url);
sendAvatarVoxelURLMessage(url);
@ -1532,10 +1531,6 @@ void Application::init() {
_myCamera.setModeShiftRate(1.0f);
_myAvatar.setDisplayingLookatVectors(false);
QUrl avatarURL = _settings->value("avatarURL").toUrl();
_myAvatar.getVoxels()->setVoxelURL(avatarURL);
sendAvatarVoxelURLMessage(avatarURL);
QCursor::setPos(_headMouseX, _headMouseY);
OculusManager::connect();
@ -1547,6 +1542,8 @@ void Application::init() {
gettimeofday(&_lastTimeIdle, NULL);
loadSettings();
sendAvatarVoxelURLMessage(_myAvatar.getVoxels()->getVoxelURL());
}
void Application::updateAvatar(float deltaTime) {

View file

@ -1225,6 +1225,8 @@ void Avatar::loadData(QSettings* set) {
_position.y = set->value("position_y", _position.y).toFloat();
_position.z = set->value("position_z", _position.z).toFloat();
_voxels.setVoxelURL(set->value("voxelURL").toUrl());
set->endGroup();
}
@ -1244,6 +1246,8 @@ void Avatar::saveData(QSettings* set) {
set->setValue("position_y", _position.y);
set->setValue("position_z", _position.z);
set->setValue("voxelURL", _voxels.getVoxelURL());
set->endGroup();
}