summaryrefslogtreecommitdiffabout
path: root/pwmanager/pwmanager/genpasswd.cpp
Side-by-side diff
Diffstat (limited to 'pwmanager/pwmanager/genpasswd.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/genpasswd.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/pwmanager/pwmanager/genpasswd.cpp b/pwmanager/pwmanager/genpasswd.cpp
index b0cceff..41078b3 100644
--- a/pwmanager/pwmanager/genpasswd.cpp
+++ b/pwmanager/pwmanager/genpasswd.cpp
@@ -1,70 +1,71 @@
/***************************************************************************
* *
* copyright (C) 2004 by Michael Buesch *
* email: mbuesch@freenet.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License version 2 *
* as published by the Free Software Foundation. *
* *
***************************************************************************/
/***************************************************************************
* copyright (C) 2004 by Ulf Schenk
* This file is originaly based on version 1.0.1 of pwmanager
* and was modified to run on embedded devices that run microkde
*
* $Id$
**************************************************************************/
#include "genpasswd.h"
#include "pwmexception.h"
#include "randomizer.h"
+#include "globalstuff.h"
/* how often can a char of the same charset be reused in order */
#define FILTER_MAX_CHARSET_REUSE 3
/* re-randomize all charsets on every iteration (0/1) */
#define RERAND_CHARSET 0
struct staticCharsetStruct
{
const char *lower;
const char *upper;
const char *num;
const char *special;
const char *blank;
};
static struct staticCharsetStruct staticCharset = {
"abcdefghijklmnopqrstuvwxyz",
"ABCDEFGHIJKLMNOPQRSTUVWXYZ",
"0123456789",
"!\"§$%&/()=?,.-;:_+",
" "
};
GenPasswd::GenPasswd()
: length (8)
, useFilter (true)
{
dynCharset.setAutoDelete(true);
}
void GenPasswd::setCharset(bool lower,
bool upper,
bool num,
bool special,
bool blank,
QString user)
{
unsigned int sanityCheck = 0;
dynCharset_element *tmpElement;
dynCharset.clear();
if (lower) {
tmpElement = new dynCharset_element;
tmpElement->refCnt = 0;
tmpElement->data = staticCharset.lower;
dynCharset.append(tmpElement);