Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit d32d9929 authored by Laurent Montel's avatar Laurent Montel 😁

Remove private class

parent 62bc5262
......@@ -34,22 +34,9 @@
#include <KLocalizedString>
#include <QIcon>
class CodecAction::Private
{
public:
Private(CodecAction::Mode mod, CodecAction *qq)
: mode(mod)
, q(qq)
{
}
const CodecAction::Mode mode;
CodecAction *const q;
};
CodecAction::CodecAction(Mode mode, QObject *parent)
: KCodecAction(parent, mode == ReaderMode)
, d(new Private(mode, this))
, mMode(mode)
{
if (mode == ComposerMode) {
// Add 'us-ascii' entry. We want it at the top, so remove then re-add everything.
......@@ -72,7 +59,6 @@ CodecAction::CodecAction(Mode mode, QObject *parent)
CodecAction::~CodecAction()
{
delete d;
}
QList<QByteArray> CodecAction::mimeCharsets() const
......
......@@ -54,9 +54,7 @@ public:
void setAutoCharset();
void setCharset(const QByteArray &charset);
private:
class Private;
friend class Private;
Private *const d;
const CodecAction::Mode mMode;
};
#endif
......@@ -31,35 +31,44 @@ using MessageComposer::AliasesExpandJob;
#include <KEmailAddress>
class AddressValidationJob::Private
AddressValidationJob::AddressValidationJob(const QString &emailAddresses, QWidget *parentWidget, QObject *parent)
: KJob(parent)
, mEmailAddresses(emailAddresses)
, mParentWidget(parentWidget)
{
public:
Private(AddressValidationJob *qq, const QString &emailAddresses, QWidget *parentWidget)
: q(qq)
, mEmailAddresses(emailAddresses)
, mIsValid(false)
, mParentWidget(parentWidget)
{
}
}
void slotAliasExpansionDone(KJob *);
AddressValidationJob::~AddressValidationJob()
{
}
AddressValidationJob *q;
QString mEmailAddresses;
QString mDomainDefaultName;
bool mIsValid;
QWidget *mParentWidget;
};
void AddressValidationJob::setDefaultDomain(const QString &domainName)
{
mDomainDefaultName = domainName;
}
void AddressValidationJob::Private::slotAliasExpansionDone(KJob *job)
void AddressValidationJob::start()
{
AliasesExpandJob *job = new AliasesExpandJob(mEmailAddresses, mDomainDefaultName, this);
connect(job, SIGNAL(result(KJob *)), SLOT(slotAliasExpansionDone(KJob *)));
job->start();
}
bool AddressValidationJob::isValid() const
{
return mIsValid;
}
void AddressValidationJob::slotAliasExpansionDone(KJob *job)
{
mIsValid = true;
if (job->error()) {
q->setError(job->error());
q->setErrorText(job->errorText());
setError(job->error());
setErrorText(job->errorText());
mIsValid = false;
q->emitResult();
emitResult();
return;
}
......@@ -96,35 +105,5 @@ void AddressValidationJob::Private::slotAliasExpansionDone(KJob *job)
}
}
q->emitResult();
emitResult();
}
AddressValidationJob::AddressValidationJob(const QString &emailAddresses, QWidget *parentWidget, QObject *parent)
: KJob(parent)
, d(new Private(this, emailAddresses, parentWidget))
{
}
AddressValidationJob::~AddressValidationJob()
{
delete d;
}
void AddressValidationJob::setDefaultDomain(const QString &domainName)
{
d->mDomainDefaultName = domainName;
}
void AddressValidationJob::start()
{
AliasesExpandJob *job = new AliasesExpandJob(d->mEmailAddresses, d->mDomainDefaultName, this);
connect(job, SIGNAL(result(KJob *)), SLOT(slotAliasExpansionDone(KJob *)));
job->start();
}
bool AddressValidationJob::isValid() const
{
return d->mIsValid;
}
#include "moc_addressvalidationjob.cpp"
......@@ -40,12 +40,11 @@ public:
void setDefaultDomain(const QString &domainName);
private:
//@cond PRIVATE
class Private;
Private *const d;
Q_PRIVATE_SLOT(d, void slotAliasExpansionDone(KJob *))
//@endcond
void slotAliasExpansionDone(KJob *);
QString mEmailAddresses;
QString mDomainDefaultName;
bool mIsValid = false;
QWidget *mParentWidget = nullptr;
};
#endif
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