From: Enar Väikene Date: Tue, 26 Jul 2011 12:06:39 +0000 (+0300) Subject: Changed the iGenerator interface to a pure abstract class. X-Git-Url: https://vaikene.ee/gitweb/pswgen04.html?a=commitdiff_plain;h=5dbab6f7a87661995e93ed6b632ae711434f20c0;p=evaf Changed the iGenerator interface to a pure abstract class. --- diff --git a/src/apps/PswGen/Generator/CMakeLists.txt b/src/apps/PswGen/Generator/CMakeLists.txt index dbf88ef..9325fe9 100644 --- a/src/apps/PswGen/Generator/CMakeLists.txt +++ b/src/apps/PswGen/Generator/CMakeLists.txt @@ -21,7 +21,6 @@ set(SRCS # Header files for the meta-object compiler set(MOC_HDRS - igenerator.h module.h ) diff --git a/src/apps/PswGen/Generator/igenerator.h b/src/apps/PswGen/Generator/igenerator.h index a702167..3d1db68 100644 --- a/src/apps/PswGen/Generator/igenerator.h +++ b/src/apps/PswGen/Generator/igenerator.h @@ -20,8 +20,6 @@ #ifndef __PSWGEN_GENERATOR_IGENERATOR_H # define __PSWGEN_GENERATOR_IGENERATOR_H -#include "lib.h" - #include #include @@ -33,17 +31,8 @@ namespace PswGen { * * This interface is used to generate strong passwords. */ -class PSWGEN_GENERATOR_EXPORT iGenerator : public QObject +struct iGenerator { - Q_OBJECT - -public: - - /// Interface constructor - iGenerator() : QObject() {} - - /// Empty virtual destructor - virtual ~iGenerator() {} /** * Flags for the password generator. @@ -85,4 +74,6 @@ public: } // namespace eVaf::PswGen } // namespace eVaf +Q_DECLARE_INTERFACE(eVaf::PswGen::iGenerator, "eVaf.PswGen.iGenerator/1.0") + #endif // igenerator.h diff --git a/src/apps/PswGen/Generator/module.cpp b/src/apps/PswGen/Generator/module.cpp index 27354f5..e19933b 100644 --- a/src/apps/PswGen/Generator/module.cpp +++ b/src/apps/PswGen/Generator/module.cpp @@ -71,7 +71,7 @@ void Module::done() using namespace eVaf::PswGen::Generator::Internal; GeneratorImpl::GeneratorImpl() - : iGenerator() + : QObject() { setObjectName(QString("%1.iGenerator").arg(VER_MODULE_NAME_STR)); diff --git a/src/apps/PswGen/Generator/module.h b/src/apps/PswGen/Generator/module.h index a1be474..927adc6 100644 --- a/src/apps/PswGen/Generator/module.h +++ b/src/apps/PswGen/Generator/module.h @@ -74,9 +74,10 @@ namespace Internal { * Implements the iGenerator interface using MD5 cryptographic hashes. */ -class GeneratorImpl : public iGenerator +class GeneratorImpl : public QObject, public iGenerator { Q_OBJECT + Q_INTERFACES(eVaf::PswGen::iGenerator) public: