@@ -98,10 +98,10 @@ void GroupView::dragMoveEvent(QDragMoveEvent* event)
98
98
{
99
99
QTreeView::dragMoveEvent (event);
100
100
101
- if (event->isAccepted () ) {
101
+ if (event->isAccepted ()) {
102
102
// we need to fix the drop action to have the correct cursor icon
103
103
fixDropAction (event);
104
- if (event->dropAction () != event->proposedAction ()){
104
+ if (event->dropAction () != event->proposedAction ()) {
105
105
event->accept ();
106
106
}
107
107
@@ -113,7 +113,7 @@ void GroupView::dragMoveEvent(QDragMoveEvent* event)
113
113
}
114
114
}
115
115
116
- void GroupView::dropEvent (QDropEvent * event)
116
+ void GroupView::dropEvent (QDropEvent* event)
117
117
{
118
118
fixDropAction (event);
119
119
QTreeView::dropEvent (event);
@@ -156,11 +156,12 @@ void GroupView::recInitExpanded(Group* group)
156
156
}
157
157
}
158
158
159
- void GroupView::fixDropAction (QDropEvent * event)
159
+ void GroupView::fixDropAction (QDropEvent* event)
160
160
{
161
161
if (event->keyboardModifiers ().testFlag (Qt::ControlModifier) && event->possibleActions ().testFlag (Qt::CopyAction)) {
162
162
event->setDropAction (Qt::CopyAction);
163
- } else if (event->keyboardModifiers ().testFlag (Qt::ShiftModifier) && event->possibleActions ().testFlag (Qt::MoveAction)) {
163
+ } else if (event->keyboardModifiers ().testFlag (Qt::ShiftModifier)
164
+ && event->possibleActions ().testFlag (Qt::MoveAction)) {
164
165
event->setDropAction (Qt::MoveAction);
165
166
} else {
166
167
static const QString groupMimeDataType = " application/x-keepassx-group" ;
@@ -169,18 +170,18 @@ void GroupView::fixDropAction(QDropEvent *event)
169
170
bool isGroup = event->mimeData ()->hasFormat (groupMimeDataType);
170
171
bool isEntry = event->mimeData ()->hasFormat (entryMimeDataType);
171
172
172
- if (isGroup || isEntry){
173
+ if (isGroup || isEntry) {
173
174
QByteArray encoded = event->mimeData ()->data (isGroup ? groupMimeDataType : entryMimeDataType);
174
175
QDataStream stream (&encoded, QIODevice::ReadOnly);
175
176
176
177
QUuid dbUuid;
177
178
QUuid itemUuid;
178
179
stream >> dbUuid >> itemUuid;
179
180
180
- if (dbUuid != m_model->database ()->uuid ()){
181
- if (event->possibleActions ().testFlag (Qt::CopyAction)){
181
+ if (dbUuid != m_model->database ()->uuid ()) {
182
+ if (event->possibleActions ().testFlag (Qt::CopyAction)) {
182
183
event->setDropAction (Qt::CopyAction);
183
- } else if (event->possibleActions ().testFlag (Qt::MoveAction)){
184
+ } else if (event->possibleActions ().testFlag (Qt::MoveAction)) {
184
185
event->setDropAction (Qt::MoveAction);
185
186
}
186
187
}
0 commit comments