Commit 0ee4928c authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use Q_DECL_OVERRIDE/Q_NULLPTR

parent 0b7ff31c
......@@ -521,7 +521,7 @@ void InvitationsAgent::itemAdded(const Item &item, const Collection &collection)
if (message->contentType()->isMultipart()) {
qDebug() << "message is multipart:" << message->attachments().size();
InvitationsAgentItem *it = 0;
InvitationsAgentItem *it = Q_NULLPTR;
foreach (KMime::Content *content, message->contents()) {
KMime::Headers::ContentType *ct = content->contentType();
......
......@@ -60,14 +60,14 @@ class MailDispatcherAgent::Private
public:
Private(MailDispatcherAgent *parent)
: q(parent),
queue(0),
currentJob(0),
queue(Q_NULLPTR),
currentJob(Q_NULLPTR),
aborting(false),
sendingInProgress(false),
sentAnything(false),
errorOccurred(false),
sentItemsSize(0),
sentActionHandler(0)
sentActionHandler(Q_NULLPTR)
{
}
......@@ -224,7 +224,7 @@ MailDispatcherAgent::~MailDispatcherAgent()
void MailDispatcherAgent::configure(WId windowId)
{
Q_UNUSED(windowId);
KNotifyConfigWidget::configure(0);
KNotifyConfigWidget::configure(Q_NULLPTR);
}
void MailDispatcherAgent::doSetOnline(bool online)
......@@ -314,7 +314,7 @@ void MailDispatcherAgent::Private::sendResult(KJob *job)
Q_ASSERT(sendingInProgress);
Q_ASSERT(job == currentJob);
currentJob->disconnect(q);
currentJob = 0;
currentJob = Q_NULLPTR;
Q_ASSERT(currentItem.isValid());
sentItemsSize += currentItem.size();
......
......@@ -58,8 +58,8 @@ public:
Private(OutboxQueue *qq)
: q(qq),
outbox(-1),
monitor(0),
futureTimer(0),
monitor(Q_NULLPTR),
futureTimer(Q_NULLPTR),
totalSize(0),
outboxDiscoveryRetries(0)
{
......@@ -165,7 +165,7 @@ void OutboxQueue::Private::addIfComplete(const Item &item)
const TransportAttribute *transportAttribute = item.attribute<TransportAttribute>();
Q_ASSERT(transportAttribute);
if (transportAttribute->transport() == 0) {
if (transportAttribute->transport() == Q_NULLPTR) {
qCWarning(MAILDISPATCHER_LOG) << "Item" << item.id() << "has invalid transport.";
return;
}
......
......@@ -63,9 +63,9 @@ public:
Private(const Item &itm, SendJob *qq)
: q(qq),
item(itm),
currentJob(0),
interface(0),
mailfilterInterface(0),
currentJob(Q_NULLPTR),
interface(Q_NULLPTR),
mailfilterInterface(Q_NULLPTR),
aborting(false)
{
}
......@@ -149,7 +149,7 @@ void SendJob::Private::doAkonadiTransport()
if (!interface->isValid()) {
storeResult(false, i18n("Failed to get D-Bus interface of resource %1.", resourceId));
delete interface;
interface = 0;
interface = Q_NULLPTR;
return;
}
......@@ -232,7 +232,7 @@ void SendJob::Private::transportPercent(KJob *job, unsigned long)
void SendJob::Private::transportResult(KJob *job)
{
Q_ASSERT(currentJob == job);
currentJob = 0;
currentJob = Q_NULLPTR;
doPostJob(!job->error(), job->errorString());
}
......@@ -257,7 +257,7 @@ void SendJob::Private::resourceResult(qlonglong itemId, int result,
Q_UNUSED(itemId);
Q_ASSERT(interface);
delete interface; // So that abort() knows the transport job is over.
interface = 0;
interface = Q_NULLPTR;
const TransportResourceBase::TransportResult transportResult =
static_cast<TransportResourceBase::TransportResult>(result);
......@@ -334,7 +334,7 @@ bool SendJob::Private::filterItem(int filterset)
if (!mailfilterInterface->isValid()) {
storeResult(false, i18n("Failed to get D-Bus interface of mailfilteragent."));
delete mailfilterInterface;
mailfilterInterface = 0;
mailfilterInterface = Q_NULLPTR;
return false;
}
......@@ -343,12 +343,12 @@ bool SendJob::Private::filterItem(int filterset)
if (!reply.isValid()) {
storeResult(false, i18n("Invalid D-Bus reply from mailfilteragent"));
delete mailfilterInterface;
mailfilterInterface = 0;
mailfilterInterface = Q_NULLPTR;
return false;
}
delete mailfilterInterface;
mailfilterInterface = 0;
mailfilterInterface = Q_NULLPTR;
return true;
}
......@@ -377,7 +377,7 @@ void SendJob::Private::slotSentMailCollectionFetched(KJob *job)
void SendJob::Private::postJobResult(KJob *job)
{
Q_ASSERT(currentJob == job);
currentJob = 0;
currentJob = Q_NULLPTR;
const SentBehaviourAttribute *attribute = item.attribute<SentBehaviourAttribute>();
Q_ASSERT(attribute);
......@@ -423,7 +423,7 @@ void SendJob::Private::storeResult(bool success, const QString &message)
void SendJob::Private::doEmitResult(KJob *job)
{
Q_ASSERT(currentJob == job);
currentJob = 0;
currentJob = Q_NULLPTR;
if (job->error()) {
qCWarning(MAILDISPATCHER_LOG) << "Error storing result.";
......@@ -472,7 +472,7 @@ void SendJob::abort()
qCDebug(MAILDISPATCHER_LOG) << "Abort called, active transport job.";
// Abort transport.
d->currentJob->kill(KJob::EmitResult);
} else if (d->interface != 0) {
} else if (d->interface != Q_NULLPTR) {
qCDebug(MAILDISPATCHER_LOG) << "Abort called, propagating to resource.";
// Abort resource doing transport.
AgentInstance instance = AgentManager::self()->instance(d->resourceId);
......
......@@ -34,14 +34,14 @@ class DummyMigrator : public MigratorBase
public:
explicit DummyMigrator(const QString &identifier);
virtual QString displayName() const;
virtual void startWork();
QString displayName() const Q_DECL_OVERRIDE;
void startWork() Q_DECL_OVERRIDE;
virtual bool shouldAutostart() const;
virtual bool canStart();
virtual void pause();
bool shouldAutostart() const Q_DECL_OVERRIDE;
bool canStart() Q_DECL_OVERRIDE;
void pause() Q_DECL_OVERRIDE;
virtual void abort();
void abort() Q_DECL_OVERRIDE;
private slots:
void onTimerElapsed();
};
......
......@@ -37,15 +37,15 @@ public:
MigratorBase(QLatin1String("testmigrator") + identifier, QString(), QString(), parent), mAutostart(false)
{}
virtual QString displayName() const
QString displayName() const Q_DECL_OVERRIDE
{
return QLatin1String("name");
}
virtual void startWork()
void startWork() Q_DECL_OVERRIDE
{}
virtual void abort()
void abort() Q_DECL_OVERRIDE
{
setMigrationState(Aborted);
}
......@@ -55,17 +55,17 @@ public:
setMigrationState(Complete);
}
virtual bool shouldAutostart() const
bool shouldAutostart() const Q_DECL_OVERRIDE
{
return mAutostart;
}
virtual void pause()
void pause() Q_DECL_OVERRIDE
{
setMigrationState(Paused);
}
virtual void resume()
void resume() Q_DECL_OVERRIDE
{
setMigrationState(InProgress);
}
......@@ -79,23 +79,23 @@ public:
TestJobTracker() : mPercent(0)
{}
virtual void registerJob(KJob *job)
void registerJob(KJob *job) Q_DECL_OVERRIDE
{
KJobTrackerInterface::registerJob(job);
mJobs << job;
}
virtual void unregisterJob(KJob *job)
void unregisterJob(KJob *job) Q_DECL_OVERRIDE
{
mJobs.removeAll(job);
}
virtual void finished(KJob *job)
void finished(KJob *job) Q_DECL_OVERRIDE
{
mJobs.removeAll(job);
}
virtual void percent(KJob *job, long unsigned int percent)
void percent(KJob *job, long unsigned int percent) Q_DECL_OVERRIDE
{
Q_UNUSED(job);
mPercent = percent;
......
......@@ -99,7 +99,7 @@ NewMailNotifierAgent::NewMailNotifierAgent(const QString &id)
KNotification::event(QLatin1String("text-to-speak-not-found"),
i18n("Starting Jovie Text-to-Speech Service Failed %1", error),
mDefaultPixmap,
0,
Q_NULLPTR,
KNotification::CloseOnTimeout,
QLatin1String("akonadi_newmailnotifier_agent"));
}
......@@ -504,7 +504,7 @@ void NewMailNotifierAgent::slotDisplayNotification(const QPixmap &pixmap, const
KNotification::event(QLatin1String("new-email"),
message,
pixmap,
0,
Q_NULLPTR,
KNotification::CloseOnTimeout,
QLatin1String("akonadi_newmailnotifier_agent"));
......
......@@ -180,7 +180,7 @@ void NewMailNotifierSelectCollectionWidget::updateCollectionsRecursive(const QMo
mCheckProxy->data(child, Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>();
Akonadi::NewMailNotifierAttribute *attr = collection.attribute<Akonadi::NewMailNotifierAttribute>();
Akonadi::CollectionModifyJob *modifyJob = 0;
Akonadi::CollectionModifyJob *modifyJob = Q_NULLPTR;
const bool selected = (mCheckProxy->data(child, Qt::CheckStateRole).value<int>() != 0);
if (selected && attr && attr->ignoreNewMail()) {
collection.removeAttribute<Akonadi::NewMailNotifierAttribute>();
......
......@@ -159,7 +159,7 @@ void SpecialNotifierJob::emitNotification(const QPixmap &pixmap)
}
if (NewMailNotifierAgentSettings::showButtonToDisplayMail()) {
KNotification *notification = new KNotification(QLatin1String("new-email"), 0, KNotification::CloseOnTimeout);
KNotification *notification = new KNotification(QLatin1String("new-email"), Q_NULLPTR, KNotification::CloseOnTimeout);
notification->setText(result.join(QLatin1String("\n")));
notification->setPixmap(pixmap);
notification->setActions(QStringList() << i18n("Show mail..."));
......
......@@ -44,7 +44,7 @@ public:
/**
* Starts the job.
*/
void start();
void start() Q_DECL_OVERRIDE;
private Q_SLOTS:
void davJobFinished(KJob *);
......
......@@ -27,7 +27,7 @@
#include <QtXml/QDomDocument>
DavManager *DavManager::mSelf = 0;
DavManager *DavManager::mSelf = Q_NULLPTR;
DavManager::DavManager()
{
......@@ -94,7 +94,7 @@ const DavProtocolBase *DavManager::davProtocol(DavUtils::Protocol protocol)
if (createProtocol(protocol)) {
return mProtocols[ protocol ];
} else {
return 0;
return Q_NULLPTR;
}
}
......
......@@ -25,21 +25,21 @@ class CaldavProtocol : public DavMultigetProtocol
{
public:
CaldavProtocol();
virtual bool supportsPrincipals() const;
virtual bool useReport() const;
virtual bool useMultiget() const;
virtual QString principalHomeSet() const;
virtual QString principalHomeSetNS() const;
virtual QDomDocument collectionsQuery() const;
virtual QString collectionsXQuery() const;
virtual QList<QDomDocument> itemsQueries() const;
virtual QString mimeTypeForQuery(int index) const;
virtual QDomDocument itemsReportQuery(const QStringList &urls) const;
virtual QString responseNamespace() const;
virtual QString dataTagName() const;
virtual DavCollection::ContentTypes collectionContentTypes(const QDomElement &propstat) const;
virtual QString contactsMimeType() const;
bool supportsPrincipals() const Q_DECL_OVERRIDE;
bool useReport() const Q_DECL_OVERRIDE;
bool useMultiget() const Q_DECL_OVERRIDE;
QString principalHomeSet() const Q_DECL_OVERRIDE;
QString principalHomeSetNS() const Q_DECL_OVERRIDE;
QDomDocument collectionsQuery() const Q_DECL_OVERRIDE;
QString collectionsXQuery() const Q_DECL_OVERRIDE;
QList<QDomDocument> itemsQueries() const Q_DECL_OVERRIDE;
QString mimeTypeForQuery(int index) const Q_DECL_OVERRIDE;
QDomDocument itemsReportQuery(const QStringList &urls) const Q_DECL_OVERRIDE;
QString responseNamespace() const Q_DECL_OVERRIDE;
QString dataTagName() const Q_DECL_OVERRIDE;
DavCollection::ContentTypes collectionContentTypes(const QDomElement &propstat) const Q_DECL_OVERRIDE;
QString contactsMimeType() const Q_DECL_OVERRIDE;
private:
QList<QDomDocument> mItemsQueries;
......
......@@ -25,21 +25,21 @@ class CarddavProtocol : public DavMultigetProtocol
{
public:
CarddavProtocol();
virtual bool supportsPrincipals() const;
virtual bool useReport() const;
virtual bool useMultiget() const;
virtual QString principalHomeSet() const;
virtual QString principalHomeSetNS() const;
virtual QDomDocument collectionsQuery() const;
virtual QString collectionsXQuery() const;
virtual QList<QDomDocument> itemsQueries() const;
virtual QString mimeTypeForQuery(int index) const;
virtual QDomDocument itemsReportQuery(const QStringList &urls) const;
virtual QString responseNamespace() const;
virtual QString dataTagName() const;
virtual DavCollection::ContentTypes collectionContentTypes(const QDomElement &propstat) const;
virtual QString contactsMimeType() const;
bool supportsPrincipals() const Q_DECL_OVERRIDE;
bool useReport() const Q_DECL_OVERRIDE;
bool useMultiget() const Q_DECL_OVERRIDE;
QString principalHomeSet() const Q_DECL_OVERRIDE;
QString principalHomeSetNS() const Q_DECL_OVERRIDE;
QDomDocument collectionsQuery() const Q_DECL_OVERRIDE;
QString collectionsXQuery() const Q_DECL_OVERRIDE;
QList<QDomDocument> itemsQueries() const Q_DECL_OVERRIDE;
QString mimeTypeForQuery(int index) const Q_DECL_OVERRIDE;
QDomDocument itemsReportQuery(const QStringList &urls) const Q_DECL_OVERRIDE;
QString responseNamespace() const Q_DECL_OVERRIDE;
QString dataTagName() const Q_DECL_OVERRIDE;
DavCollection::ContentTypes collectionContentTypes(const QDomElement &propstat) const Q_DECL_OVERRIDE;
QString contactsMimeType() const Q_DECL_OVERRIDE;
private:
QList<QDomDocument> mItemsQueries;
......
......@@ -25,16 +25,16 @@ class GroupdavProtocol : public DavProtocolBase
{
public:
GroupdavProtocol();
virtual bool supportsPrincipals() const;
virtual bool useReport() const;
virtual bool useMultiget() const;
virtual QDomDocument collectionsQuery() const;
virtual QString collectionsXQuery() const;
virtual QList<QDomDocument> itemsQueries() const;
virtual QString mimeTypeForQuery(int index) const;
virtual DavCollection::ContentTypes collectionContentTypes(const QDomElement &propstat) const;
virtual QString contactsMimeType() const;
bool supportsPrincipals() const Q_DECL_OVERRIDE;
bool useReport() const Q_DECL_OVERRIDE;
bool useMultiget() const Q_DECL_OVERRIDE;
QDomDocument collectionsQuery() const Q_DECL_OVERRIDE;
QString collectionsXQuery() const Q_DECL_OVERRIDE;
QList<QDomDocument> itemsQueries() const Q_DECL_OVERRIDE;
QString mimeTypeForQuery(int index) const Q_DECL_OVERRIDE;
DavCollection::ContentTypes collectionContentTypes(const QDomElement &propstat) const Q_DECL_OVERRIDE;
QString contactsMimeType() const Q_DECL_OVERRIDE;
private:
QList<QDomDocument> mItemsQueries;
......
......@@ -56,7 +56,7 @@ class SettingsHelper
{
public:
SettingsHelper()
: q(0)
: q(Q_NULLPTR)
{
}
......@@ -290,7 +290,7 @@ Settings::UrlConfiguration *Settings::urlConfiguration(DavUtils::Protocol proto,
{
QString key = url + QLatin1Char(',') + DavUtils::protocolName(proto);
UrlConfiguration *ret = 0;
UrlConfiguration *ret = Q_NULLPTR;
if (mUrls.contains(key)) {
ret = mUrls[ key ];
}
......
......@@ -374,7 +374,7 @@ bool ServerTypePage::validatePage()
*/
ConnectionPage::ConnectionPage(QWidget *parent)
: QWizardPage(parent), mPreviewLayout(0), mCalDavUrlPreview(0), mCardDavUrlPreview(0), mGroupDavUrlPreview(0)
: QWizardPage(parent), mPreviewLayout(Q_NULLPTR), mCalDavUrlPreview(Q_NULLPTR), mCardDavUrlPreview(Q_NULLPTR), mGroupDavUrlPreview(Q_NULLPTR)
{
setTitle(i18n("Connection"));
setSubTitle(i18n("Enter the connection information for the groupware server"));
......@@ -442,19 +442,19 @@ void ConnectionPage::cleanupPage()
if (mCalDavUrlPreview) {
delete mCalDavUrlLabel;
delete mCalDavUrlPreview;
mCalDavUrlPreview = 0;
mCalDavUrlPreview = Q_NULLPTR;
}
if (mCardDavUrlPreview) {
delete mCardDavUrlLabel;
delete mCardDavUrlPreview;
mCardDavUrlPreview = 0;
mCardDavUrlPreview = Q_NULLPTR;
}
if (mGroupDavUrlPreview) {
delete mGroupDavUrlLabel;
delete mGroupDavUrlPreview;
mGroupDavUrlPreview = 0;
mGroupDavUrlPreview = Q_NULLPTR;
}
QWizardPage::cleanupPage();
......
......@@ -71,8 +71,8 @@ class PredefinedProviderPage : public QWizardPage
public:
PredefinedProviderPage(QWidget *parent = Q_NULLPTR);
virtual void initializePage();
virtual int nextId() const;
void initializePage() Q_DECL_OVERRIDE;
int nextId() const Q_DECL_OVERRIDE;
private:
QLabel *mLabel;
......@@ -85,7 +85,7 @@ class CredentialsPage : public QWizardPage
{
public:
CredentialsPage(QWidget *parent = Q_NULLPTR);
virtual int nextId() const;
int nextId() const Q_DECL_OVERRIDE;
private:
KLineEdit *mUserName;
......@@ -99,7 +99,7 @@ class ServerTypePage : public QWizardPage
public:
ServerTypePage(QWidget *parent = Q_NULLPTR);
virtual bool validatePage();
bool validatePage() Q_DECL_OVERRIDE;
private slots:
void manualConfigToggled(bool toggled);
......@@ -116,8 +116,8 @@ class ConnectionPage : public QWizardPage
public:
ConnectionPage(QWidget *parent = Q_NULLPTR);
virtual void initializePage();
virtual void cleanupPage();
void initializePage() Q_DECL_OVERRIDE;
void cleanupPage() Q_DECL_OVERRIDE;
private slots:
void urlElementChanged();
......
......@@ -73,7 +73,7 @@ FolderArchiveAccountInfo::FolderArchiveType FolderArchiveComboBox::type() const
FolderArchiveSettingPage::FolderArchiveSettingPage(const QString &instanceName, QWidget *parent)
: QWidget(parent),
mInstanceName(instanceName),
mInfo(0)
mInfo(Q_NULLPTR)
{
QVBoxLayout *lay = new QVBoxLayout;
mEnabled = new QCheckBox(i18n("Enable"));
......
......@@ -126,7 +126,7 @@ void CalendarResource::retrieveItems(const Akonadi::Collection &collection)
lastSyncDelta = QDateTime::currentDateTimeUtc().toTime_t() - collection.remoteRevision().toUInt();
}
KGAPI2::Job *job = 0;
KGAPI2::Job *job = Q_NULLPTR;
if (collection.contentMimeTypes().contains(KCalCore::Event::eventMimeType())) {
EventFetchJob *fetchJob = new EventFetchJob(collection.remoteId(), account(), this);
if (lastSyncDelta > -1 && lastSyncDelta < 25 * 24 * 3600) {
......@@ -177,7 +177,7 @@ void CalendarResource::itemAdded(const Akonadi::Item &item, const Akonadi::Colle
return;
}
KGAPI2::Job *job = 0;
KGAPI2::Job *job = Q_NULLPTR;
if (item.hasPayload<KCalCore::Event::Ptr>()) {
KCalCore::Event::Ptr event = item.payload<KCalCore::Event::Ptr>();
EventPtr kevent(new Event(*event));
......@@ -222,7 +222,7 @@ void CalendarResource::itemChanged(const Akonadi::Item &item,
return;
}
KGAPI2::Job *job = 0;
KGAPI2::Job *job = Q_NULLPTR;
if (item.hasPayload<KCalCore::Event::Ptr>()) {
KCalCore::Event::Ptr event = item.payload<KCalCore::Event::Ptr>();
EventPtr kevent(new Event(*event));
......@@ -442,7 +442,7 @@ void CalendarResource::slotCollectionsRetrieved(KGAPI2::Job *job)
Collection::CanChangeItem |
Collection::CanDeleteItem);
} else {
collection.setRights(0);
collection.setRights(Q_NULLPTR);
}
EntityDisplayAttribute *attr = collection.attribute<EntityDisplayAttribute>(Entity::AddIfMissing);
......
......@@ -30,10 +30,10 @@ class DefaultReminderAttribute : public Akonadi::Attribute
public:
explicit DefaultReminderAttribute();
Attribute *clone() const;
void deserialize(const QByteArray &data);
QByteArray serialized() const;
QByteArray type() const;
Attribute *clone() const Q_DECL_OVERRIDE;
void deserialize(const QByteArray &data) Q_DECL_OVERRIDE;
QByteArray serialized() const Q_DECL_OVERRIDE;
QByteArray type() const Q_DECL_OVERRIDE;
void setReminders(const KGAPI2::RemindersList &reminders);
KCalCore::Alarm::List alarms(KCalCore::Incidence *incidence) const;
......
......@@ -25,14 +25,14 @@
class SettingsHelper
{
public:
SettingsHelper() : q(0)
SettingsHelper() : q(Q_NULLPTR)
{