X-Git-Url: https://vaikene.ee/gitweb/gitweb.cgi?a=blobdiff_plain;f=src%2Fapps%2FPswGen%2FGenerator%2Figenerator.h;fp=src%2Fapps%2FPswGen%2FGenerator%2Figenerator.h;h=a702167a3778f8044feca015ce728dd7c911335b;hb=3352f7acc232104985807b9f470cb12bcb2b47c2;hp=d5122f21b9068b39465ab52343140fe8244f9f10;hpb=1d2a1e80abac012e9755cd23b264e3e099ccc3f5;p=evaf diff --git a/src/apps/PswGen/Generator/igenerator.h b/src/apps/PswGen/Generator/igenerator.h index d5122f2..a702167 100644 --- a/src/apps/PswGen/Generator/igenerator.h +++ b/src/apps/PswGen/Generator/igenerator.h @@ -23,6 +23,7 @@ #include "lib.h" #include +#include namespace eVaf { namespace PswGen { @@ -39,7 +40,7 @@ class PSWGEN_GENERATOR_EXPORT iGenerator : public QObject public: /// Interface constructor - iGenerator() {} + iGenerator() : QObject() {} /// Empty virtual destructor virtual ~iGenerator() {} @@ -51,18 +52,11 @@ public: ALPHANUMERIC = 0x01 ///< Generated password contains only alphanumeric characters }; - /** - * Default length of the generated password - */ - enum { - DEFAULT_LENGTH = 16 - }; - /** * Generates a strong password * @param name Name of the password * @param masterPassword Master password - * @param length Length of the password + * @param length Length of the password (if zero, then uses the max length) * @param flags Flags for the generator * @return Generated password * @@ -75,7 +69,7 @@ public: * * Optional flags can be used to fine-tune the generator. */ - virtual QString generatePassword(char const * const name, char const * const masterPassword, int length = DEFAULT_LENGTH, uint flags = 0) = 0; + virtual QString generatePassword(QString const & name, QString const & masterPassword, int length, uint flags = 0) const = 0; /** * Returns the maximum length of generated passwords