Commit f82379d4 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use Q_DECL_OVERRIDE/Q_NULLPTR

parent fa5d043e
......@@ -40,7 +40,7 @@ class AddTransportDialog::Private
{
public:
Private(AddTransportDialog *qq)
: q(qq), okButton(0)
: q(qq), okButton(Q_NULLPTR)
{
}
......
......@@ -31,7 +31,7 @@ class Akonadi::FilterActionJob::Private
{
public:
Private(FilterActionJob *qq)
: q(qq), functor(0)
: q(qq), functor(Q_NULLPTR)
{
}
......
......@@ -32,7 +32,7 @@ K_PLUGIN_FACTORY(MailTransportConfigFactory, registerPlugin<ConfigModule>();)
ConfigModule::ConfigModule(QWidget *parent, const QVariantList &args) :
KCModule(parent, args)
{
setButtons(0);
setButtons(Q_NULLPTR);
QVBoxLayout *l = new QVBoxLayout(this);
l->setMargin(0);
TransportManagementWidget *tmw = new TransportManagementWidget(this);
......
......@@ -89,7 +89,7 @@ bool MessageQueueJob::Private::validate()
}
const int transport = transportAttribute.transportId();
if (TransportManager::self()->transportById(transport, false) == 0) {
if (TransportManager::self()->transportById(transport, false) == Q_NULLPTR) {
q->setError(UserDefinedError);
q->setErrorText(i18n("Message has invalid transport."));
q->emitResult();
......
......@@ -51,14 +51,14 @@ public:
virtual ~SendQueuedAction();
/* reimpl */
virtual Akonadi::ItemFetchScope fetchScope() const;
virtual Akonadi::ItemFetchScope fetchScope() const Q_DECL_OVERRIDE;
/* reimpl */
virtual bool itemAccepted(const Akonadi::Item &item) const;
virtual bool itemAccepted(const Akonadi::Item &item) const Q_DECL_OVERRIDE;
/* reimpl */
virtual Akonadi::Job *itemAction(const Akonadi::Item &item,
Akonadi::FilterActionJob *parent) const;
Akonadi::FilterActionJob *parent) const Q_DECL_OVERRIDE;
private:
class Private;
......@@ -86,14 +86,14 @@ public:
virtual ~ClearErrorAction();
/* reimpl */
virtual Akonadi::ItemFetchScope fetchScope() const;
virtual Akonadi::ItemFetchScope fetchScope() const Q_DECL_OVERRIDE;
/* reimpl */
virtual bool itemAccepted(const Akonadi::Item &item) const;
virtual bool itemAccepted(const Akonadi::Item &item) const Q_DECL_OVERRIDE;
/* reimpl */
virtual Akonadi::Job *itemAction(const Akonadi::Item &item,
Akonadi::FilterActionJob *parent) const;
Akonadi::FilterActionJob *parent) const Q_DECL_OVERRIDE;
private:
class Private;
......@@ -119,14 +119,14 @@ public:
virtual ~DispatchManualTransportAction();
/* reimpl */
virtual Akonadi::ItemFetchScope fetchScope() const;
virtual Akonadi::ItemFetchScope fetchScope() const Q_DECL_OVERRIDE;
/* reimpl */
virtual bool itemAccepted(const Akonadi::Item &item) const;
virtual bool itemAccepted(const Akonadi::Item &item) const Q_DECL_OVERRIDE;
/* reimpl */
virtual Akonadi::Job *itemAction(const Akonadi::Item &item,
Akonadi::FilterActionJob *parent) const;
Akonadi::FilterActionJob *parent) const Q_DECL_OVERRIDE;
private:
class Private;
......
......@@ -48,7 +48,7 @@ public:
};
PreCommandJobPrivate::PreCommandJobPrivate(PrecommandJob *parent)
: process(0), q(parent)
: process(Q_NULLPTR), q(parent)
{
}
......@@ -94,7 +94,7 @@ void PreCommandJobPrivate::slotError(QProcess::ProcessError error)
bool PrecommandJob::doKill()
{
delete d->process;
d->process = 0;
d->process = Q_NULLPTR;
return true;
}
......
......@@ -60,7 +60,7 @@ public:
protected:
/** reimpl */
virtual void doStart();
virtual void doStart() Q_DECL_OVERRIDE;
private:
friend class ResourceSendJobPrivate;
......
......@@ -103,7 +103,7 @@ void SendmailJob::receivedStdErr()
bool SendmailJob::doKill()
{
delete d->process;
d->process = 0;
d->process = Q_NULLPTR;
return true;
}
......@@ -94,7 +94,7 @@ public:
}
ServerTestPrivate::ServerTestPrivate(ServerTest *test)
: q(test), testProgress(0), secureSocketFinished(false),
: q(test), testProgress(Q_NULLPTR), secureSocketFinished(false),
normalSocketFinished(false), tlsFinished(false),
normalPossible(true), securePossible(true)
{
......
......@@ -169,7 +169,7 @@ static void checkHighestEnabledButton(QButtonGroup *group)
void SMTPConfigWidget::init()
{
Q_D(SMTPConfigWidget);
d->serverTest = 0;
d->serverTest = Q_NULLPTR;
connect(TransportManager::self(), &TransportManager::passwordsChanged, this, &SMTPConfigWidget::passwordsLoaded);
......
......@@ -94,7 +94,7 @@ SmtpJob::SmtpJob(Transport *transport, QObject *parent)
: TransportJob(transport, parent), d(new SmtpJobPrivate(this))
{
d->currentState = SmtpJobPrivate::Idle;
d->slave = 0;
d->slave = Q_NULLPTR;
d->finished = false;
if (!s_slavePool.isDestroyed()) {
s_slavePool->ref++;
......@@ -175,7 +175,7 @@ void SmtpJob::startSmtpJob()
QPointer<KPasswordDialog> dlg =
new KPasswordDialog(
0,
Q_NULLPTR,
KPasswordDialog::ShowUsernameLine |
KPasswordDialog::ShowKeepPassword);
dlg->setPrompt(i18n("You need to supply a username and a password "
......
......@@ -133,7 +133,7 @@ void SocketPrivate::slotSslErrors(const QList<QSslError> &)
Socket::Socket(QObject *parent)
: QObject(parent), d(new SocketPrivate(this))
{
d->socket = 0;
d->socket = Q_NULLPTR;
d->port = 0;
d->secure = false;
qCDebug(MAILTRANSPORT_LOG);
......
......@@ -237,7 +237,7 @@ bool Transport::usrSave()
if (!wallet || wallet->writePassword(QString::number(id()), d->password) != 0) {
// wallet saving failed, ask if we should store in the config file instead
if (d->storePasswordInFile || KMessageBox::warningYesNo(
0,
Q_NULLPTR,
i18n("KWallet is not available. It is strongly recommended to use "
"KWallet for managing your passwords.\n"
"However, the password can be stored in the configuration "
......
......@@ -45,7 +45,7 @@ class MailTransport::TransportConfigDialog::Private
{
public:
Private(TransportConfigDialog *qq)
: transport(0), configWidget(0), q(qq), okButton(0)
: transport(Q_NULLPTR), configWidget(Q_NULLPTR), q(qq), okButton(Q_NULLPTR)
{
}
......@@ -107,7 +107,7 @@ TransportConfigDialog::TransportConfigDialog(Transport *transport, QWidget *pare
}
default: {
Q_ASSERT(false);
d->configWidget = 0;
d->configWidget = Q_NULLPTR;
break;
}
}
......
......@@ -42,7 +42,7 @@ TransportJob::TransportJob(Transport *transport, QObject *parent)
: KCompositeJob(parent), d(new Private)
{
d->transport = transport;
d->buffer = 0;
d->buffer = Q_NULLPTR;
}
TransportJob::~ TransportJob()
......
......@@ -116,7 +116,7 @@ public:
StaticTransportManager() : TransportManager() {}
};
StaticTransportManager *sSelf = 0;
StaticTransportManager *sSelf = Q_NULLPTR;
static void destroyStaticTransportManager()
{
......@@ -133,7 +133,7 @@ TransportManager::TransportManager()
qAddPostRoutine(destroyStaticTransportManager);
d->myOwnChange = false;
d->appliedChange = false;
d->wallet = 0;
d->wallet = Q_NULLPTR;
d->walletOpenFailed = false;
d->walletAsyncOpen = false;
d->defaultTransportId = -1;
......@@ -184,7 +184,7 @@ Transport *TransportManager::transportById(int id, bool def) const
if (def || (id == 0 && d->defaultTransportId != id)) {
return transportById(d->defaultTransportId, false);
}
return 0;
return Q_NULLPTR;
}
Transport *TransportManager::transportByName(const QString &name, bool def) const
......@@ -197,7 +197,7 @@ Transport *TransportManager::transportByName(const QString &name, bool def) cons
if (def) {
return transportById(0, false);
}
return 0;
return Q_NULLPTR;
}
QList< Transport * > TransportManager::transports() const
......@@ -309,7 +309,7 @@ TransportJob *TransportManager::createTransportJob(int transportId)
{
Transport *t = transportById(transportId, false);
if (!t) {
return 0;
return Q_NULLPTR;
}
t = t->clone(); // Jobs delete their transports.
t->updatePasswordState();
......@@ -322,13 +322,13 @@ TransportJob *TransportManager::createTransportJob(int transportId)
return new ResourceSendJob(t, this);
}
Q_ASSERT(false);
return 0;
return Q_NULLPTR;
}
TransportJob *TransportManager::createTransportJob(const QString &transport)
{
bool ok = false;
Transport *t = 0;
Transport *t = Q_NULLPTR;
int transportId = transport.toInt(&ok);
if (ok) {
......@@ -343,7 +343,7 @@ TransportJob *TransportManager::createTransportJob(const QString &transport)
return createTransportJob(t->id());
}
return 0;
return Q_NULLPTR;
}
bool TransportManager::isEmpty() const
......@@ -436,7 +436,7 @@ void TransportManagerPrivate::readConfig()
if (re.indexIn(s) == -1) {
continue;
}
Transport *t = 0;
Transport *t = Q_NULLPTR;
// see if we happen to have that one already
foreach (Transport *old, oldTransports) {
......@@ -584,7 +584,7 @@ KWallet::Wallet *TransportManager::wallet()
}
if (!Wallet::isEnabled() || d->walletOpenFailed) {
return 0;
return Q_NULLPTR;
}
WId window = 0;
......@@ -599,7 +599,7 @@ KWallet::Wallet *TransportManager::wallet()
if (!d->wallet) {
d->walletOpenFailed = true;
return 0;
return Q_NULLPTR;
}
d->prepareWallet();
......@@ -681,7 +681,7 @@ void TransportManagerPrivate::slotWalletOpened(bool success)
if (!success) {
walletOpenFailed = true;
delete wallet;
wallet = 0;
wallet = Q_NULLPTR;
} else {
prepareWallet();
}
......@@ -727,7 +727,7 @@ void TransportManagerPrivate::migrateToWallet()
// ask user if he wants to migrate
int result = KMessageBox::questionYesNoList(
0,
Q_NULLPTR,
i18n("The following mail transports store their passwords in an "
"unencrypted configuration file.\nFor security reasons, "
"please consider migrating these passwords to KWallet, the "
......
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