Fix: Icons could be shown multiple times in Group dialog

git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@374 b624d157-de02-0410-bad0-e51aec6abb33
master
sniperbeamer 15 years ago
parent f60c395595
commit fdd226a510
  1. 11
      src/dialogs/EditGroupDlg.cpp
  2. 2
      src/dialogs/EditGroupDlg.h

@ -50,19 +50,16 @@ CEditGroupDialog::CEditGroupDialog(IDatabase* database,CGroup* Group,QWidget* pa
connect( ButtonBox, SIGNAL( accepted() ), this, SLOT( OnOK() ) ); connect( ButtonBox, SIGNAL( accepted() ), this, SLOT( OnOK() ) );
connect( ButtonBox, SIGNAL( rejected() ), this, SLOT( OnCancel() ) ); connect( ButtonBox, SIGNAL( rejected() ), this, SLOT( OnCancel() ) );
connect( Button_Icon, SIGNAL( clicked() ), this, SLOT( OnIconDlg() )); connect( Button_Icon, SIGNAL( clicked() ), this, SLOT( OnIconDlg() ));
}
CEditGroupDialog::~CEditGroupDialog(){
}
void CEditGroupDialog::showEvent(QShowEvent *event){
if(event->spontaneous()==false){
EditTitle->setText(group->Title); EditTitle->setText(group->Title);
for(int i=0;i<db->numIcons();i++){ for(int i=0;i<db->numIcons();i++){
ComboIconPicker->insertItem(i,db->icon(i),""); ComboIconPicker->insertItem(i,db->icon(i),"");
} }
ComboIconPicker->setCurrentIndex(group->Image); ComboIconPicker->setCurrentIndex(group->Image);
} }
CEditGroupDialog::~CEditGroupDialog(){
} }
void CEditGroupDialog::OnOK() void CEditGroupDialog::OnOK()

@ -30,7 +30,7 @@ class CEditGroupDialog : public QDialog, private Ui_EditGroupDialog
CEditGroupDialog(IDatabase*,IGroupHandle*,QWidget* parent = 0, Qt::WFlags fl = 0 ); CEditGroupDialog(IDatabase*,IGroupHandle*,QWidget* parent = 0, Qt::WFlags fl = 0 );
CEditGroupDialog(IDatabase*,CGroup*,QWidget* parent = 0, Qt::WFlags fl = 0 ); CEditGroupDialog(IDatabase*,CGroup*,QWidget* parent = 0, Qt::WFlags fl = 0 );
~CEditGroupDialog(); ~CEditGroupDialog();
virtual void showEvent(QShowEvent *event);
private: private:
IDatabase* db; IDatabase* db;
IGroupHandle* handle; IGroupHandle* handle;