diff --git a/src/lib/EntryView.cpp b/src/lib/EntryView.cpp index 2a9d2e8..e493e23 100644 --- a/src/lib/EntryView.cpp +++ b/src/lib/EntryView.cpp @@ -80,13 +80,17 @@ void KeepassEntryView::setCurrentGroup(uint id){ CurrentGroup=id; for(int i=0; ipEntry->GroupID != id)); - } } void KeepassEntryView::showSearchResults(QList& results){ - - +setCurrentGroup(0); +for(int j=0; jpEntry->sID == results[j]) + setItemHidden(Items[i],false); + } +} } void KeepassEntryView::refreshVisibleItems(){ diff --git a/src/lib/GroupView.cpp b/src/lib/GroupView.cpp index f7a91e6..c512f3c 100644 --- a/src/lib/GroupView.cpp +++ b/src/lib/GroupView.cpp @@ -41,7 +41,12 @@ InsertionMarker=QLine(); db=NULL; LastHoverItem=NULL; setHeaderLabels(QStringList()<setAccepted(false); +else if(item){ QRect ItemRect=visualItemRect(item); if(!db->isParentGroup(item->pGroup,DragItem->pGroup) && DragItem!=item){ if((ItemRect.height()+ItemRect.y())-event->pos().y() > INSERT_AREA_WIDTH && event->pos().y() > INSERT_AREA_WIDTH){ @@ -148,6 +154,8 @@ void KeepassGroupView::mouseMoveEvent(QMouseEvent *event){ if ((event->pos() - DragStartPos).manhattanLength() < QApplication::startDragDistance()) return; DragItem=(GroupViewItem*)itemAt(DragStartPos); + if (isSearchResultGroup(DragItem)) + return; if(!DragItem)return; QDrag *drag = new QDrag(this); QFontMetrics fontmet(DragItem->font(0)); @@ -203,6 +211,9 @@ if(ShowSearchGroup){ Items.push_back(new GroupViewItem(this)); Items.back()->setText(0,trUtf8("Suchergebnisse")); Items.back()->pGroup=NULL; + QFont f=Items.back()->font(0); + f.setItalic(true); + Items.back()->setFont(0,f); } } diff --git a/src/lib/GroupView.h b/src/lib/GroupView.h index 444a6fa..967c787 100644 --- a/src/lib/GroupView.h +++ b/src/lib/GroupView.h @@ -31,7 +31,9 @@ public: KeepassGroupView(QWidget* parent=0); void updateItems(); bool isSearchResultGroup(GroupViewItem* item); + void selectSearchGroup(); PwDatabase *db; + bool ShowSearchGroup; //needs a "updateItems()" after a change! vectorItems; protected: virtual void dragEnterEvent ( QDragEnterEvent * event ); @@ -50,7 +52,6 @@ private: QPixmap DragPixmap; GroupViewItem* DragItem; GroupViewItem* LastHoverItem; - bool ShowSearchGroup; //needs a "updateItems()" after a change! GroupViewItem* getLastSameLevelItem(int level); }; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 480151f..cb6878e 100755 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -512,6 +512,10 @@ void KeepassMainWindow::search(CGroup* group){ CSearchDlg dlg(db,group,this,"SearchDialog",false); if(dlg.exec()){ SearchResults=dlg.Hits; + GroupView->ShowSearchGroup=true; + GroupView->updateItems(); + GroupView->selectSearchGroup(); + EntryView->showSearchResults(SearchResults); } else {