diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp index 60ae5b3a0..f2ec62939 100644 --- a/apps/launcher/maindialog.cpp +++ b/apps/launcher/maindialog.cpp @@ -326,7 +326,7 @@ bool Launcher::MainDialog::setupGameSettings() foreach (const QString &path, paths) { qDebug() << "Loading config file:" << path.toUtf8().constData(); - QFile file(path); + file.setFileName(path); if (file.exists()) { if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { cfgError(tr("Error opening OpenMW configuration file"), diff --git a/apps/opencs/model/tools/mergestages.cpp b/apps/opencs/model/tools/mergestages.cpp index 4d4835ece..02fc551ab 100644 --- a/apps/opencs/model/tools/mergestages.cpp +++ b/apps/opencs/model/tools/mergestages.cpp @@ -184,7 +184,7 @@ void CSMTools::MergeLandTexturesStage::perform (int stage, CSMDoc::Messages& mes CSMWorld::LandTexture texture = mState.mSource.getData().getLandTextures().getRecord (index).get(); - std::ostringstream stream; + stream.clear(); stream << mNext->second-1 << "_0"; texture.mIndex = mNext->second-1; diff --git a/apps/opencs/model/world/idtable.cpp b/apps/opencs/model/world/idtable.cpp index 9dbe38998..7975e05ea 100644 --- a/apps/opencs/model/world/idtable.cpp +++ b/apps/opencs/model/world/idtable.cpp @@ -191,7 +191,7 @@ void CSMWorld::IdTable::setRecord (const std::string& id, const RecordBase& reco if (index==-1) { - int index = mIdCollection->getAppendIndex (id, type); + index = mIdCollection->getAppendIndex (id, type); beginInsertRows (QModelIndex(), index, index); diff --git a/apps/opencs/model/world/refcollection.cpp b/apps/opencs/model/world/refcollection.cpp index 506f9027e..6b586dcec 100644 --- a/apps/opencs/model/world/refcollection.cpp +++ b/apps/opencs/model/world/refcollection.cpp @@ -63,7 +63,7 @@ void CSMWorld::RefCollection::load (ESM::ESMReader& reader, int cellIndex, bool std::cerr << "Position: #" << index.first << " " << index.second <<", Target #"<< mref.mTarget[0] << " " << mref.mTarget[1] << std::endl; - std::ostringstream stream; + stream.clear(); stream << "#" << mref.mTarget[0] << " " << mref.mTarget[1]; ref.mCell = stream.str(); // overwrite } diff --git a/apps/openmw/mwclass/creaturelevlist.cpp b/apps/openmw/mwclass/creaturelevlist.cpp index e0e890b60..5941a09f5 100644 --- a/apps/openmw/mwclass/creaturelevlist.cpp +++ b/apps/openmw/mwclass/creaturelevlist.cpp @@ -118,9 +118,9 @@ namespace MWClass } const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore(); - MWWorld::ManualRef ref(store, id); - ref.getPtr().getCellRef().setPosition(ptr.getCellRef().getPosition()); - MWWorld::Ptr placed = MWBase::Environment::get().getWorld()->placeObject(ref.getPtr(), ptr.getCell() , ptr.getCellRef().getPosition()); + MWWorld::ManualRef manualRef(store, id); + manualRef.getPtr().getCellRef().setPosition(ptr.getCellRef().getPosition()); + MWWorld::Ptr placed = MWBase::Environment::get().getWorld()->placeObject(manualRef.getPtr(), ptr.getCell() , ptr.getCellRef().getPosition()); customData.mSpawnActorId = placed.getClass().getCreatureStats(placed).getActorId(); customData.mSpawn = false; } diff --git a/apps/openmw/mwgui/alchemywindow.cpp b/apps/openmw/mwgui/alchemywindow.cpp index 61a0efc46..385010ac5 100644 --- a/apps/openmw/mwgui/alchemywindow.cpp +++ b/apps/openmw/mwgui/alchemywindow.cpp @@ -200,15 +200,15 @@ namespace MWGui std::set effectIds = mAlchemy->listEffects(); Widgets::SpellEffectList list; unsigned int effectIndex=0; - for (std::set::iterator it = effectIds.begin(); it != effectIds.end(); ++it) + for (std::set::iterator it2 = effectIds.begin(); it2 != effectIds.end(); ++it2) { Widgets::SpellEffectParams params; - params.mEffectID = it->mId; - const ESM::MagicEffect* magicEffect = MWBase::Environment::get().getWorld()->getStore().get().find(it->mId); + params.mEffectID = it2->mId; + const ESM::MagicEffect* magicEffect = MWBase::Environment::get().getWorld()->getStore().get().find(it2->mId); if (magicEffect->mData.mFlags & ESM::MagicEffect::TargetSkill) - params.mSkill = it->mArg; + params.mSkill = it2->mArg; else if (magicEffect->mData.mFlags & ESM::MagicEffect::TargetAttribute) - params.mAttribute = it->mArg; + params.mAttribute = it2->mArg; params.mIsConstant = true; params.mNoTarget = true; diff --git a/apps/openmw/mwgui/birth.cpp b/apps/openmw/mwgui/birth.cpp index 327d5e5cf..69fb2c462 100644 --- a/apps/openmw/mwgui/birth.cpp +++ b/apps/openmw/mwgui/birth.cpp @@ -226,7 +226,7 @@ namespace MWGui coord.top += lineHeight; end = categories[category].spells.end(); - for (std::vector::const_iterator it = categories[category].spells.begin(); it != end; ++it) + for (it = categories[category].spells.begin(); it != end; ++it) { const std::string &spellId = *it; spellWidget = mSpellArea->createWidget("MW_StatName", coord, MyGUI::Align::Default, std::string("Spell") + MyGUI::utility::toString(i)); diff --git a/apps/openmw/mwgui/inventoryitemmodel.cpp b/apps/openmw/mwgui/inventoryitemmodel.cpp index 061c8c4c4..2fe540f22 100644 --- a/apps/openmw/mwgui/inventoryitemmodel.cpp +++ b/apps/openmw/mwgui/inventoryitemmodel.cpp @@ -85,8 +85,8 @@ void InventoryItemModel::update() if (mActor.getClass().hasInventoryStore(mActor)) { - MWWorld::InventoryStore& store = mActor.getClass().getInventoryStore(mActor); - if (store.isEquipped(newItem.mBase)) + MWWorld::InventoryStore& invStore = mActor.getClass().getInventoryStore(mActor); + if (invStore.isEquipped(newItem.mBase)) newItem.mType = ItemStack::Type_Equipped; } diff --git a/apps/openmw/mwgui/tooltips.cpp b/apps/openmw/mwgui/tooltips.cpp index b0838b336..b3cc19a64 100644 --- a/apps/openmw/mwgui/tooltips.cpp +++ b/apps/openmw/mwgui/tooltips.cpp @@ -256,7 +256,7 @@ namespace MWGui std::string key = it->first.substr(0, underscorePos); std::string widgetName = it->first.substr(underscorePos+1, it->first.size()-(underscorePos+1)); - std::string type = "Property"; + type = "Property"; size_t caretPos = key.find("^"); if (caretPos != std::string::npos) { diff --git a/apps/openmw/mwmechanics/aiactivate.cpp b/apps/openmw/mwmechanics/aiactivate.cpp index 745a01c8b..b1426a4c1 100644 --- a/apps/openmw/mwmechanics/aiactivate.cpp +++ b/apps/openmw/mwmechanics/aiactivate.cpp @@ -41,9 +41,7 @@ namespace MWMechanics if (pathTo(actor, dest, duration, MWBase::Environment::get().getWorld()->getMaxActivationDistance())) //Stop when you get in activation range { // activate when reached - MWWorld::Ptr target = MWBase::Environment::get().getWorld()->getPtr(mObjectId,false); MWBase::Environment::get().getWorld()->activate(target, actor); - return true; } diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index c2761e25d..e7227178f 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -686,9 +686,9 @@ namespace MWRender state.mAutoDisable = autodisable; mStates[groupname] = state; - NifOsg::TextKeyMap::const_iterator textkey(textkeys.lower_bound(state.getTime())); if (state.mPlaying) { + NifOsg::TextKeyMap::const_iterator textkey(textkeys.lower_bound(state.getTime())); while(textkey != textkeys.end() && textkey->first <= state.getTime()) { handleTextKey(state, groupname, textkey, textkeys); @@ -976,14 +976,14 @@ namespace MWRender while(!(velocity > 1.0f) && ++animiter != mAnimSources.rend()) { - const NifOsg::TextKeyMap &keys = (*animiter)->getTextKeys(); + const NifOsg::TextKeyMap &keys2 = (*animiter)->getTextKeys(); const AnimSource::ControllerMap& ctrls2 = (*animiter)->mControllerMap[0]; for (AnimSource::ControllerMap::const_iterator it = ctrls2.begin(); it != ctrls2.end(); ++it) { if (Misc::StringUtils::ciEqual(it->first, mAccumRoot->getName())) { - velocity = calcAnimVelocity(keys, it->second, mAccumulate, groupname); + velocity = calcAnimVelocity(keys2, it->second, mAccumulate, groupname); break; } } diff --git a/apps/openmw/mwrender/characterpreview.cpp b/apps/openmw/mwrender/characterpreview.cpp index ed61334bb..b26744920 100644 --- a/apps/openmw/mwrender/characterpreview.cpp +++ b/apps/openmw/mwrender/characterpreview.cpp @@ -221,10 +221,10 @@ namespace MWRender groupname = "inventoryhandtohand"; else { - const std::string &type = iter->getTypeName(); - if(type == typeid(ESM::Lockpick).name() || type == typeid(ESM::Probe).name()) + const std::string &typeName = iter->getTypeName(); + if(typeName == typeid(ESM::Lockpick).name() || typeName == typeid(ESM::Probe).name()) groupname = "inventoryweapononehand"; - else if(type == typeid(ESM::Weapon).name()) + else if(typeName == typeid(ESM::Weapon).name()) { MWWorld::LiveCellRef *ref = iter->get(); diff --git a/apps/openmw/mwrender/ripplesimulation.cpp b/apps/openmw/mwrender/ripplesimulation.cpp index 85319a632..56302077e 100644 --- a/apps/openmw/mwrender/ripplesimulation.cpp +++ b/apps/openmw/mwrender/ripplesimulation.cpp @@ -39,11 +39,11 @@ namespace { std::ostringstream texname; texname << "textures/water/" << tex << std::setw(2) << std::setfill('0') << i << ".dds"; - osg::ref_ptr tex (new osg::Texture2D(resourceSystem->getImageManager()->getImage(texname.str()))); - tex->setWrap(osg::Texture::WRAP_S, osg::Texture::REPEAT); - tex->setWrap(osg::Texture::WRAP_T, osg::Texture::REPEAT); - resourceSystem->getSceneManager()->applyFilterSettings(tex); - textures.push_back(tex); + osg::ref_ptr tex2 (new osg::Texture2D(resourceSystem->getImageManager()->getImage(texname.str()))); + tex2->setWrap(osg::Texture::WRAP_S, osg::Texture::REPEAT); + tex2->setWrap(osg::Texture::WRAP_T, osg::Texture::REPEAT); + resourceSystem->getSceneManager()->applyFilterSettings(tex2); + textures.push_back(tex2); } osg::ref_ptr controller (new NifOsg::FlipController(0, 0.3f/rippleFrameCount, textures)); diff --git a/apps/openmw/mwscript/locals.cpp b/apps/openmw/mwscript/locals.cpp index 5c9ffa07a..a535910da 100644 --- a/apps/openmw/mwscript/locals.cpp +++ b/apps/openmw/mwscript/locals.cpp @@ -238,15 +238,15 @@ namespace MWScript else { char type = declarations.getType (iter->first); - char index = declarations.getIndex (iter->first); + char index2 = declarations.getIndex (iter->first); try { switch (type) { - case 's': mShorts.at (index) = iter->second.getInteger(); break; - case 'l': mLongs.at (index) = iter->second.getInteger(); break; - case 'f': mFloats.at (index) = iter->second.getFloat(); break; + case 's': mShorts.at (index2) = iter->second.getInteger(); break; + case 'l': mLongs.at (index2) = iter->second.getInteger(); break; + case 'f': mFloats.at (index2) = iter->second.getFloat(); break; // silently ignore locals that don't exist anymore } diff --git a/apps/wizard/existinginstallationpage.cpp b/apps/wizard/existinginstallationpage.cpp index f821b38ba..a04e721d8 100644 --- a/apps/wizard/existinginstallationpage.cpp +++ b/apps/wizard/existinginstallationpage.cpp @@ -63,13 +63,13 @@ bool Wizard::ExistingInstallationPage::validatePage() The Wizard needs to update settings in this file.

\ Press \"Browse...\" to specify the location manually.
")); - QAbstractButton *browseButton = + QAbstractButton *browseButton2 = msgBox.addButton(QObject::tr("B&rowse..."), QMessageBox::ActionRole); msgBox.exec(); QString iniFile; - if (msgBox.clickedButton() == browseButton) { + if (msgBox.clickedButton() == browseButton2) { iniFile = QFileDialog::getOpenFileName( this, QObject::tr("Select configuration file"), diff --git a/apps/wizard/mainwizard.cpp b/apps/wizard/mainwizard.cpp index 19cdf9535..fa934868b 100644 --- a/apps/wizard/mainwizard.cpp +++ b/apps/wizard/mainwizard.cpp @@ -165,7 +165,7 @@ void Wizard::MainWizard::setupGameSettings() foreach (const QString &path, paths) { qDebug() << "Loading config file:" << path.toUtf8().constData(); - QFile file(path); + file.setFileName(path); if (file.exists()) { if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { QMessageBox msgBox; diff --git a/components/contentselector/view/contentselector.cpp b/components/contentselector/view/contentselector.cpp index 87c9cea08..514a0444a 100644 --- a/components/contentselector/view/contentselector.cpp +++ b/components/contentselector/view/contentselector.cpp @@ -192,8 +192,8 @@ void ContentSelectorView::ContentSelector::setGameFileSelected(int index, bool s const ContentSelectorModel::EsmFile* file = mContentModel->item(fileName); if (file != NULL) { - QModelIndex index(mContentModel->indexFromItem(file)); - mContentModel->setData(index, selected, Qt::UserRole + 1); + QModelIndex index2(mContentModel->indexFromItem(file)); + mContentModel->setData(index2, selected, Qt::UserRole + 1); } }