Backup deleted entries
Fixed compilation errors on win32 git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@233 b624d157-de02-0410-bad0-e51aec6abb33
This commit is contained in:
parent
f88ca3f4c0
commit
bb80c9616a
|
@ -23,7 +23,10 @@
|
|||
#include "PasswordGenDlg.h"
|
||||
#include "EditEntryDlg.h"
|
||||
#include "CalendarDlg.h"
|
||||
|
||||
#ifdef GLOBAL_AUTOTYPE
|
||||
#include "TargetWindowDlg.h"
|
||||
#endif
|
||||
|
||||
CEditEntryDlg::CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* parent, bool modal, bool newEntry)
|
||||
: QDialog(parent)
|
||||
|
@ -200,9 +203,10 @@ void CEditEntryDlg::OnButtonOK()
|
|||
ModFlag=true;
|
||||
|
||||
if(ModFlag){
|
||||
QDateTime now = QDateTime::currentDateTime();
|
||||
entry->setExpire(DateTime_Expire->dateTime());
|
||||
entry->setLastAccess(QDateTime::currentDateTime());
|
||||
entry->setLastMod(QDateTime::currentDateTime());
|
||||
entry->setLastAccess(now);
|
||||
entry->setLastMod(now);
|
||||
entry->setTitle(Edit_Title->text());
|
||||
entry->setUsername(Edit_UserName->text());
|
||||
entry->setUrl(Edit_URL->text());
|
||||
|
@ -449,7 +453,7 @@ void CEditEntryDlg::OnSelectTarget(){
|
|||
QString text = Edit_Comment->toPlainText();
|
||||
if (!text.isEmpty())
|
||||
text.append("\n");
|
||||
Edit_Comment->setPlainText(text.append(dlg.windowTitle()));
|
||||
Edit_Comment->setPlainText(text.append("Auto-Type-Window: "+dlg.windowTitle()));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -149,8 +149,21 @@ void KeepassEntryView::OnDeleteEntry(){
|
|||
return;
|
||||
}
|
||||
|
||||
bool backup = false;
|
||||
IGroupHandle* bGroup;
|
||||
if (config->backup() && ((EntryViewItem*)entries[0])->EntryHandle->group() != (bGroup=db->backupGroup()))
|
||||
backup = true;
|
||||
for(int i=0; i<entries.size();i++){
|
||||
db->deleteEntry(((EntryViewItem*)entries[i])->EntryHandle);
|
||||
IEntryHandle* entryHandle = ((EntryViewItem*)entries[i])->EntryHandle;
|
||||
if (backup){
|
||||
db->moveEntry(entryHandle, bGroup);
|
||||
QDateTime now = QDateTime::currentDateTime();
|
||||
entryHandle->setLastAccess(now);
|
||||
entryHandle->setLastMod(now);
|
||||
}
|
||||
else{
|
||||
db->deleteEntry(entryHandle);
|
||||
}
|
||||
Items.removeAt(Items.indexOf((EntryViewItem*)entries[i]));
|
||||
delete entries[i];
|
||||
}
|
||||
|
@ -221,10 +234,10 @@ void KeepassEntryView::editEntry(EntryViewItem* item){
|
|||
break;
|
||||
}
|
||||
|
||||
if ((result==1 || result==2) && config->backup()){
|
||||
IGroupHandle* bGroup;
|
||||
if ((result==1 || result==2) && config->backup() && item->EntryHandle->group() != (bGroup=db->backupGroup())){
|
||||
old.LastAccess = QDateTime::currentDateTime();
|
||||
old.LastMod = QDateTime::currentDateTime();
|
||||
IGroupHandle* bGroup = db->backupGroup();
|
||||
old.LastMod = old.LastAccess;
|
||||
if (bGroup==NULL)
|
||||
emit requestCreateGroup("Backup", 4, NULL);
|
||||
if ((bGroup = db->backupGroup())!=NULL)
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <QFile>
|
||||
#elif defined(Q_WS_WIN)
|
||||
#include <windows.h>
|
||||
#include <wincrypt.h>
|
||||
#include <QSysInfo>
|
||||
#endif
|
||||
|
||||
|
@ -93,7 +94,7 @@ extern void initStdRand(){
|
|||
stream << QDateTime::currentDateTime().toTime_t();
|
||||
stream << QTime::currentTime().msec();
|
||||
#ifdef Q_WS_WIN
|
||||
stream << GetCurrentProcessId();
|
||||
stream << (quint32) GetCurrentProcessId();
|
||||
#else
|
||||
stream << getpid();
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue