some work on the search function
git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@31 b624d157-de02-0410-bad0-e51aec6abb33
This commit is contained in:
@@ -84,6 +84,11 @@ for(int i=0; i<Items.size();i++){
|
||||
}
|
||||
}
|
||||
|
||||
void KeepassEntryView::showSearchResults(QList<Q_UINT32>& results){
|
||||
|
||||
|
||||
}
|
||||
|
||||
void KeepassEntryView::refreshVisibleItems(){
|
||||
EntryViewItem *tmp=NULL;
|
||||
for(int i=0;i<Items.size();i++){
|
||||
|
||||
@@ -32,6 +32,7 @@ public:
|
||||
void refreshVisibleItems();
|
||||
void setCurrentGroup(uint GroupID);
|
||||
void updateColumns();
|
||||
void showSearchResults(QList<Q_UINT32>& results);
|
||||
PwDatabase* db;
|
||||
vector<EntryViewItem*>Items;
|
||||
private:
|
||||
|
||||
@@ -41,6 +41,7 @@ InsertionMarker=QLine();
|
||||
db=NULL;
|
||||
LastHoverItem=NULL;
|
||||
setHeaderLabels(QStringList()<<tr("Gruppen"));
|
||||
ShowSearchGroup=true;
|
||||
}
|
||||
|
||||
void KeepassGroupView:: dragEnterEvent ( QDragEnterEvent * event ){
|
||||
@@ -197,7 +198,16 @@ Items.back()->setIcon(0,EntryIcons[db->Groups[i].ImageID]);
|
||||
|
||||
for(int i=0;i<Items.size();i++){
|
||||
setItemExpanded(Items[i],Items[i]->pGroup->UI_ItemIsExpanded);
|
||||
}}
|
||||
}
|
||||
if(ShowSearchGroup){
|
||||
Items.push_back(new GroupViewItem(this));
|
||||
Items.back()->setText(0,trUtf8("Suchergebnisse"));
|
||||
Items.back()->pGroup=NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
GroupViewItem* KeepassGroupView::getLastSameLevelItem(int level){
|
||||
for(int i=Items.size()-1;i>=0;i--){
|
||||
@@ -221,6 +231,10 @@ painter.drawLine(InsertionMarker);
|
||||
}
|
||||
}
|
||||
|
||||
bool KeepassGroupView::isSearchResultGroup(GroupViewItem* item){
|
||||
if(ShowSearchGroup && (item == Items.back()))return true;
|
||||
else return false;
|
||||
}
|
||||
|
||||
|
||||
GroupViewItem::GroupViewItem(QTreeWidget *parent):QTreeWidgetItem(parent){
|
||||
|
||||
@@ -30,6 +30,7 @@ class KeepassGroupView:public QTreeWidget{
|
||||
public:
|
||||
KeepassGroupView(QWidget* parent=0);
|
||||
void updateItems();
|
||||
bool isSearchResultGroup(GroupViewItem* item);
|
||||
PwDatabase *db;
|
||||
vector<GroupViewItem*>Items;
|
||||
protected:
|
||||
@@ -49,6 +50,7 @@ private:
|
||||
QPixmap DragPixmap;
|
||||
GroupViewItem* DragItem;
|
||||
GroupViewItem* LastHoverItem;
|
||||
bool ShowSearchGroup; //needs a "updateItems()" after a change!
|
||||
|
||||
GroupViewItem* getLastSameLevelItem(int level);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user