Explicitely set the user data type to avoid const/non-const mismatch

pull/183/head
scrawl 8 years ago
parent 5de5be77f3
commit a556475fae

@ -122,7 +122,7 @@ namespace MWGui
if (!iter->isEmpty())
{
mApparatus.at (index)->setUserString ("ToolTipType", "ItemPtr");
mApparatus.at (index)->setUserData (*iter);
mApparatus.at (index)->setUserData (MWWorld::Ptr(*iter));
}
}
@ -190,9 +190,9 @@ namespace MWGui
continue;
ingredient->setUserString("ToolTipType", "ItemPtr");
ingredient->setUserData(item);
ingredient->setUserData(MWWorld::Ptr(item));
ingredient->setCount(ingredient->getUserData<MWWorld::Ptr>()->getRefData().getCount());
ingredient->setCount(item.getRefData().getCount());
}
mItemView->update();

@ -79,7 +79,7 @@ namespace MWGui
{
mSoulBox->setItem(gem);
mSoulBox->setUserString ("ToolTipType", "ItemPtr");
mSoulBox->setUserData(gem);
mSoulBox->setUserData(MWWorld::Ptr(gem));
mEnchanting.setSoulGem(gem);
}
}
@ -97,7 +97,7 @@ namespace MWGui
mName->setCaption(item.getClass().getName(item));
mItemBox->setItem(item);
mItemBox->setUserString ("ToolTipType", "ItemPtr");
mItemBox->setUserData(item);
mItemBox->setUserData(MWWorld::Ptr(item));
mEnchanting.setOldItem(item);
}
}

@ -417,7 +417,7 @@ namespace MWGui
mSpellStatus->setProgressPosition(chargePercent);
mSpellBox->setUserString("ToolTipType", "ItemPtr");
mSpellBox->setUserData(item);
mSpellBox->setUserData(MWWorld::Ptr(item));
mSpellImage->setItem(item);
}
@ -435,7 +435,7 @@ namespace MWGui
mWeapBox->clearUserStrings();
mWeapBox->setUserString("ToolTipType", "ItemPtr");
mWeapBox->setUserData(item);
mWeapBox->setUserData(MWWorld::Ptr(item));
mWeapStatus->setProgressRange(100);
mWeapStatus->setProgressPosition(durabilityPercent);

@ -97,7 +97,7 @@ namespace MWGui
line.mIcon = mScrollView->createWidget<ItemWidget>("MW_ItemIconSmall", MyGUI::IntCoord(), MyGUI::Align::Default);
line.mIcon->setItem(line.mItemPtr);
line.mIcon->setUserString("ToolTipType", "ItemPtr");
line.mIcon->setUserData(line.mItemPtr);
line.mIcon->setUserData(MWWorld::Ptr(line.mItemPtr));
line.mIcon->eventMouseButtonClick += MyGUI::newDelegate(this, &ItemChargeView::onIconClicked);
line.mIcon->eventMouseWheel += MyGUI::newDelegate(this, &ItemChargeView::onMouseWheelMoved);

@ -86,7 +86,7 @@ void MerchantRepair::startRepair(const MWWorld::Ptr &actor)
currentY += 18;
button->setUserString("Price", MyGUI::utility::toString(price));
button->setUserData(*iter);
button->setUserData(MWWorld::Ptr(*iter));
button->setCaptionWithReplacing(name);
button->setSize(button->getTextSize().width,18);
button->eventMouseWheel += MyGUI::newDelegate(this, &MerchantRepair::onMouseWheel);

@ -185,7 +185,7 @@ namespace MWGui
button->setItem(item, ItemWidget::Barter);
button->setUserString ("ToolTipType", "ItemPtr");
button->setUserData(item);
button->setUserData(MWWorld::Ptr(item));
if (mItemSelectionDialog)
mItemSelectionDialog->setVisible(false);
@ -209,7 +209,7 @@ namespace MWGui
button->setIcon(item);
button->setUserString ("ToolTipType", "ItemPtr");
button->setUserData(item);
button->setUserData(MWWorld::Ptr(item));
if (mMagicSelectionDialog)
mMagicSelectionDialog->setVisible(false);
@ -278,7 +278,7 @@ namespace MWGui
if (Misc::StringUtils::ciEqual(it->getCellRef().getRefId(), id))
{
item = *it;
button->setUserData(item);
button->setUserData(MWWorld::Ptr(item));
break;
}
}

@ -68,7 +68,7 @@ void Recharge::start (const MWWorld::Ptr &item)
{
mGemIcon->setItem(item);
mGemIcon->setUserString("ToolTipType", "ItemPtr");
mGemIcon->setUserData(item);
mGemIcon->setUserData(MWWorld::Ptr(item));
updateView();
}

@ -66,7 +66,7 @@ void Repair::startRepairItem(const MWWorld::Ptr &item)
mToolIcon->setItem(item);
mToolIcon->setUserString("ToolTipType", "ItemPtr");
mToolIcon->setUserData(item);
mToolIcon->setUserData(MWWorld::Ptr(item));
updateRepairView();
}

@ -278,7 +278,7 @@ namespace MWGui
{
if (spell.mType == Spell::Type_EnchantedItem)
{
widget->setUserData(spell.mItem);
widget->setUserData(MWWorld::Ptr(spell.mItem));
widget->setUserString("ToolTipType", "ItemPtr");
}
else

Loading…
Cancel
Save