Get rid of another switch/default issue by avoiding switch altogther. Makes the code more readable (I think) actually.
This commit is contained in:
@@ -372,19 +372,15 @@ wxDragResult wxDropSource::DoDragDrop(int flags /*=wxDrag_CopyOnly*/)
|
|||||||
SetDragCursor(drag, m_cursorMove, Qt::MoveAction);
|
SetDragCursor(drag, m_cursorMove, Qt::MoveAction);
|
||||||
SetDragCursor(drag, m_cursorStop, Qt::IgnoreAction);
|
SetDragCursor(drag, m_cursorStop, Qt::IgnoreAction);
|
||||||
|
|
||||||
Qt::DropActions actions = Qt::CopyAction | Qt::MoveAction;
|
const Qt::DropActions actions =
|
||||||
Qt::DropAction defaultAction = Qt::CopyAction;
|
flags == wxDrag_CopyOnly
|
||||||
switch ( flags )
|
? Qt::CopyAction
|
||||||
{
|
: Qt::CopyAction | Qt::MoveAction;
|
||||||
case wxDrag_CopyOnly:
|
|
||||||
actions = Qt::CopyAction;
|
const Qt::DropAction defaultAction =
|
||||||
break;
|
flags == wxDrag_DefaultMove
|
||||||
case wxDrag_DefaultMove:
|
? Qt::MoveAction
|
||||||
defaultAction = Qt::MoveAction;
|
: Qt::CopyAction;
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return DropActionToDragResult(drag.exec(actions, defaultAction));
|
return DropActionToDragResult(drag.exec(actions, defaultAction));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user