Commit 42342869 authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

use d private internal container

parent 62797dee
......@@ -40,27 +40,42 @@
namespace KIPIPlugins
{
class KPDialogBase::KPDialogBasePrivate
{
public:
KPDialogBasePrivate()
{
about = 0;
dialog = 0;
}
KPAboutData* about;
KDialog* dialog;
};
KPDialogBase::KPDialogBase(KDialog* const dlg)
: d(new KPDialogBasePrivate)
{
m_about = 0;
m_dialog = dlg;
d->dialog = dlg;
}
KPDialogBase::~KPDialogBase()
{
delete m_about;
delete d->about;
delete d;
}
void KPDialogBase::setAboutData(KPAboutData* const data, KPushButton* help)
{
if (!data || !m_dialog) return;
if (!data || !d->dialog) return;
if (!help) help = m_dialog->button(KDialog::Help);
if (!help) help = d->dialog->button(KDialog::Help);
if (!help) return;
m_about = data;
m_about->setHelpButton(help);
d->about = data;
d->about->setHelpButton(help);
}
// -----------------------------------------------------------------------------------
......
......@@ -33,6 +33,8 @@
#include "kipiplugins_export.h"
class KPushButton;
namespace KIPIPlugins
{
......@@ -43,14 +45,14 @@ class KIPIPLUGINS_EXPORT KPDialogBase
public:
KPDialogBase(KDialog* const dlg);
~KPDialogBase();
virtual ~KPDialogBase();
void setAboutData(KPAboutData* const data, KPushButton* help=0);
private:
KPAboutData* m_about;
KDialog* m_dialog;
class KPDialogBasePrivate;
KPDialogBasePrivate* const d;
};
// -----------------------------------------------------------------------------------
......@@ -60,7 +62,7 @@ class KIPIPLUGINS_EXPORT KPToolDialog : public KDialog, public KPDialogBase
public:
KPToolDialog(QWidget* const parent=0);
~KPToolDialog();
virtual ~KPToolDialog();
};
// -----------------------------------------------------------------------------------
......@@ -70,7 +72,7 @@ class KIPIPLUGINS_EXPORT KPWizardDialog : public KAssistantDialog, public KPDial
public:
KPWizardDialog(QWidget* const parent=0);
~KPWizardDialog();
virtual ~KPWizardDialog();
};
// -----------------------------------------------------------------------------------
......@@ -80,7 +82,7 @@ class KIPIPLUGINS_EXPORT KPPageDialog : public KPageDialog, public KPDialogBase
public:
KPPageDialog(QWidget* const parent=0);
~KPPageDialog();
virtual ~KPPageDialog();
};
} // namespace KIPIPlugins
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment