1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 15:35:23 +00:00

more readable code.

This commit is contained in:
Marek Kochanowicz 2014-02-15 13:22:14 +01:00
parent b1f63947e8
commit 4ee90c24e5

View File

@ -485,16 +485,14 @@ void CSVWorld::Table::dropEvent(QDropEvent *event)
{
QModelIndex index = indexAt (event->pos());
if (dynamic_cast<const CSMWorld::TableMimeData*> (event->mimeData())->fromDocument (mDocument))
const CSMWorld::TableMimeData* mime = dynamic_cast<const CSMWorld::TableMimeData*> (event->mimeData());
if (mime->fromDocument (mDocument))
{
CSMWorld::ColumnBase::Display display = static_cast<CSMWorld::ColumnBase::Display>
(mModel->headerData (index.column(), Qt::Horizontal, CSMWorld::ColumnBase::Role_Display).toInt());
if (dynamic_cast<const CSMWorld::TableMimeData*> (event->mimeData())->holdsType (display))
if (mime->holdsType (display))
{
const CSMWorld::TableMimeData* mime = dynamic_cast<const CSMWorld::TableMimeData*>
(event->mimeData());
CSMWorld::UniversalId record (mime->returnMatching (display));
std::auto_ptr<CSMWorld::ModifyCommand> command (new CSMWorld::ModifyCommand