X-Git-Url: https://vaikene.ee/gitweb/pswgen11.html?a=blobdiff_plain;f=src%2Fapps%2FPswGen%2FGenerator%2Fmodule.cpp;fp=src%2Fapps%2FPswGen%2FGenerator%2Fgenerator.cpp;h=27354f52a630575fa5e9e1ff3f99d3f58b501923;hb=3352f7acc232104985807b9f470cb12bcb2b47c2;hp=01f1a93121864a65ef7fc78e4a1c80993527dc50;hpb=1d2a1e80abac012e9755cd23b264e3e099ccc3f5;p=evaf diff --git a/src/apps/PswGen/Generator/generator.cpp b/src/apps/PswGen/Generator/module.cpp similarity index 77% rename from src/apps/PswGen/Generator/generator.cpp rename to src/apps/PswGen/Generator/module.cpp index 01f1a93..27354f5 100644 --- a/src/apps/PswGen/Generator/generator.cpp +++ b/src/apps/PswGen/Generator/module.cpp @@ -1,5 +1,5 @@ /** - * @file PswGen/Generator/generator.cpp + * @file PswGen/Generator/module.cpp * @brief Implementation of the iGenerator interface * @author Enar Vaikene * @@ -17,7 +17,7 @@ * Agreement provided with the Software. */ -#include "generator.h" +#include "module.h" #include "version.h" #include @@ -25,6 +25,9 @@ #include +VER_EXPORT_VERSION_INFO() +Q_EXPORT_PLUGIN2(VER_MODULE_NAME_STR, eVaf::PswGen::Generator::Module) + using namespace eVaf; using namespace eVaf::PswGen; using namespace eVaf::PswGen::Generator; @@ -33,7 +36,6 @@ using namespace eVaf::PswGen::Generator; Module::Module() : Plugins::iPlugin() - , mReady(false) { setObjectName(QString("%1.%2").arg(VER_MODULE_NAME_STR).arg(__FUNCTION__)); @@ -49,15 +51,10 @@ Module::~Module() EVAF_INFO("%s destroyed", qPrintable(objectName())); } -bool Module::init(const QString & args) +bool Module::init(QString const & args) { Q_UNUSED(args); - if (!mGenerator->init()) - return false; - - mReady = true; - EVAF_INFO("%s initialized", qPrintable(objectName())); return true; @@ -65,10 +62,6 @@ bool Module::init(const QString & args) void Module::done() { - mReady = false; - - mGenerator->done(); - EVAF_INFO("%s finalized", qPrintable(objectName())); } @@ -92,20 +85,10 @@ GeneratorImpl::~GeneratorImpl() EVAF_INFO("%s destroyed", qPrintable(objectName())); } -bool GeneratorImpl::init() -{ - EVAF_INFO("%s initialized", qPrintable(objectName())); - - return true; -} - -void GeneratorImpl::done() +QString GeneratorImpl::generatePassword(QString const & name, QString const & masterPassword, int length, uint flags) const { - EVAF_INFO("%s finalized", qPrintable(objectName())); -} + Q_UNUSED(flags); -QString GeneratorImpl::generatePassword(char const * const name, char const * const masterPassword, int length, uint flags) -{ QByteArray inputString = QString("%1%2").arg(name).arg(masterPassword).toLatin1(); QCryptographicHash hash(QCryptographicHash::Md5); hash.addData(inputString); @@ -115,9 +98,3 @@ QString GeneratorImpl::generatePassword(char const * const name, char const * co else return result; } - - -//------------------------------------------------------------------- - -VER_EXPORT_VERSION_INFO() -Q_EXPORT_PLUGIN2(VER_MODULE_NAME_STR, Module)