-rw-r--r-- | noncore/securityplugins/pin/pin.cpp | 22 | ||||
-rw-r--r-- | noncore/securityplugins/pin/pin.h | 3 |
2 files changed, 19 insertions, 6 deletions
diff --git a/noncore/securityplugins/pin/pin.cpp b/noncore/securityplugins/pin/pin.cpp index c21ffcd..2accb9c 100644 --- a/noncore/securityplugins/pin/pin.cpp +++ b/noncore/securityplugins/pin/pin.cpp @@ -25,3 +25,2 @@ #include "pinDialogBase.h" -#include "pinConfigWidget.h" /* OPIE */ @@ -320,2 +319,12 @@ int PinPlugin::authenticate() +/// Standard c'tor +PinPlugin::PinPlugin() : MultiauthPluginObject(), m_pinW(0) { +} + +/// deletes m_pinW if we need to +PinPlugin::~PinPlugin() { + if (m_pinW != 0) + delete m_pinW; +} + /// Simply returns the plugin name (PIN plugin) @@ -335,8 +344,9 @@ QString PinPlugin::pixmapNameConfig() const { MultiauthConfigWidget * PinPlugin::configWidget(QWidget * parent) { - PinConfigWidget * pinw = new PinConfigWidget(parent, "PIN configuration widget"); - - connect(pinw->changePIN, SIGNAL( clicked() ), this, SLOT( changePIN() )); - connect(pinw->clearPIN, SIGNAL( clicked() ), this, SLOT( clearPIN() )); + if (m_pinW == 0) { + m_pinW = new PinConfigWidget(parent, "PIN configuration widget"); - return pinw; + connect(m_pinW->changePIN, SIGNAL( clicked() ), this, SLOT( changePIN() )); + connect(m_pinW->clearPIN, SIGNAL( clicked() ), this, SLOT( clearPIN() )); + } + return m_pinW; } diff --git a/noncore/securityplugins/pin/pin.h b/noncore/securityplugins/pin/pin.h index 1832210..b5ae10a 100644 --- a/noncore/securityplugins/pin/pin.h +++ b/noncore/securityplugins/pin/pin.h @@ -50,2 +50,4 @@ class PinPlugin : public QObject, public Opie::Security::MultiauthPluginObject { public: + PinPlugin(); + virtual ~PinPlugin(); int authenticate(); @@ -63,2 +65,3 @@ private slots: private: + PinConfigWidget * m_pinW; QString encrypt(const QString& pin); |