fixed crash when deleting search results,

fixed bad SID Assoc.

git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@58 b624d157-de02-0410-bad0-e51aec6abb33
This commit is contained in:
tariq
2006-03-18 13:58:29 +00:00
parent 49059c82f4
commit 9bbe30fb16
20 changed files with 774 additions and 615 deletions

View File

@@ -45,6 +45,7 @@ LastHoverItem=NULL;
setHeaderLabels(QStringList()<<tr("Groups"));
ShowSearchGroup=false;
ContextMenu=new QMenu(this);
ContextMenuSearchGroup=new QMenu(this);
}
void KeepassGroupView::selectSearchGroup(){
@@ -282,7 +283,10 @@ if(!(GroupViewItem*)itemAt(e->pos()) && selectedItems().size()){
setItemSelected(selectedItems()[0],false);
}
e->accept();
ContextMenu->popup(e->globalPos());
if(isSearchResultGroup((GroupViewItem*)itemAt(e->pos())))
ContextMenuSearchGroup->popup(e->globalPos());
else
ContextMenu->popup(e->globalPos());
}
GroupViewItem::GroupViewItem(QTreeWidget *parent):QTreeWidgetItem(parent){

View File

@@ -39,6 +39,7 @@ public:
bool ShowSearchGroup; //needs a "updateItems()" after a change!
vector<GroupViewItem*>Items;
QMenu *ContextMenu;
QMenu *ContextMenuSearchGroup;
signals:
void fileModified();

View File

@@ -20,11 +20,11 @@
#include "UrlLabel.h"
#include "main.h"
#include <qfont.h>
#include <qcolor.h>
#include <qcursor.h>
#include <qfontmetrics.h>
//Added by qt3to4:
#include <QMouseEvent>
#include <QLabel>
@@ -41,15 +41,22 @@ LinkLabel::~LinkLabel(){
}
QString LinkLabel::url(){
if(URL!=QString())return URL;
if(text().contains("@"))
return QString("mailto:")+text();
else return text();
}
void LinkLabel::mouseReleaseEvent(QMouseEvent* event){
if(event->button()==Qt::LeftButton)
clicked();
emit clicked();
openBrowser(url());
}
void LinkLabel::setPos(int x,int y){
QFontMetrics fm(font());
setGeometry(x,y,fm.width(text()),fm.height());
}
void LinkLabel::setText(const QString& text){

View File

@@ -30,17 +30,20 @@ public:
LinkLabel(QWidget *parent, const char* name = 0,const QString& text=QString::null, int x=0, int y=0,Qt::WFlags f=0);
~LinkLabel();
void setPos(int x,int y);
QString url();
public slots:
virtual void setText(const QString&);
signals:
void clicked();
protected:
virtual void mouseReleaseEvent(QMouseEvent* event);
private:
QString URL;
};
#endif