Possbile fix for #1754998

git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@172 b624d157-de02-0410-bad0-e51aec6abb33
master
sniperbeamer 17 years ago
parent 9de7489805
commit 5db29eafed
  1. 18
      src/lib/GroupView.cpp

@ -220,10 +220,6 @@ void KeepassGroupView::dragLeaveEvent ( QDragLeaveEvent * event ){
}
void KeepassGroupView::entryDropEvent( QDropEvent * event ){
if(LastHoverItem){
LastHoverItem->setBackgroundColor(0,QApplication::palette().color(QPalette::Base));
LastHoverItem->setForeground(0,QBrush(QApplication::palette().color(QPalette::Text)));
}
GroupViewItem* Item=(GroupViewItem*)itemAt(event->pos());
if(!Item){
event->ignore();
@ -237,28 +233,29 @@ void KeepassGroupView::entryDropEvent( QDropEvent * event ){
}
emit entriesDropped();
emit fileModified();
}
}
}
void KeepassGroupView::dropEvent( QDropEvent * event ){
if(LastHoverItem){
LastHoverItem->setBackgroundColor(0,QApplication::palette().color(QPalette::Base));
LastHoverItem->setForeground(0,QBrush(QApplication::palette().color(QPalette::Text)));
}
if(DragType==EntryDrag){
entryDropEvent(event);
return;
}
if(LastHoverItem){
LastHoverItem->setBackgroundColor(0,QApplication::palette().color(QPalette::Base));
LastHoverItem->setForeground(0,QBrush(QApplication::palette().color(QPalette::Text)));
}
if(InsLinePos!=-1){
int RemoveLine=InsLinePos;
InsLinePos=-1;
viewport()->update(QRegion(0,RemoveLine-2,viewport()->width(),4));
}
GroupViewItem* Item=(GroupViewItem*)itemAt(event->pos());
if(!Item){
qDebug("Append at the end");
db->moveGroup(DragItem->GroupHandle,NULL,-1);
@ -278,6 +275,9 @@ void KeepassGroupView::dropEvent( QDropEvent * event ){
emit fileModified();
}
else{
if (DragItem->GroupHandle==Item->GroupHandle)
return;
QRect ItemRect=visualItemRect(Item);
if(event->pos().y()>ItemRect.y()+2 && event->pos().y()<ItemRect.y()+ItemRect.height()-2){
qDebug("Append as child of '%s'",((char*)Item->text(0).toUtf8().data()));