Added 2 new password generator options
git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@227 b624d157-de02-0410-bad0-e51aec6abb33
This commit is contained in:
@@ -274,6 +274,7 @@ void KeepassEntryView::OnEditOpenUrl(){
|
||||
void KeepassEntryView::OnEditCopyUrl(){
|
||||
if (selectedItems().size() == 0) return;
|
||||
QString url = ((EntryViewItem*)selectedItems().first())->EntryHandle->url();
|
||||
if (url.trimmed().isEmpty()) return;
|
||||
if (url.startsWith("cmd://") && url.length()>6)
|
||||
url = url.right(url.length()-6);
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ void SecData::unlock(){
|
||||
}
|
||||
|
||||
void SecData::copyData(quint8* src){
|
||||
unlock();
|
||||
locked = false;
|
||||
memcpy(data, src, length);
|
||||
lock();
|
||||
}
|
||||
|
||||
@@ -47,10 +47,14 @@ void getEntropy(quint8* buffer, int length){
|
||||
}
|
||||
}
|
||||
|
||||
quint32 randint(quint32 n){
|
||||
quint32 randint(quint32 limit){
|
||||
quint32 rand;
|
||||
randomize(&rand, 4);
|
||||
return (rand % n);
|
||||
return (rand % limit);
|
||||
}
|
||||
|
||||
quint32 randintRange(quint32 min, quint32 max){
|
||||
return min + randint(max-min+1);
|
||||
}
|
||||
|
||||
#if defined(Q_WS_X11) || defined(Q_WS_MAC)
|
||||
|
||||
@@ -33,10 +33,12 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
void getEntropy(quint8* buffer, int length);
|
||||
quint32 randint(quint32 n);
|
||||
quint32 randint(quint32 limit); // generate random number: 0 <= n < limit
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
quint32 randintRange(quint32 min, quint32 max); // generate random number: min <= n <= max
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user