Commit 0de14827 authored by Laurent Montel's avatar Laurent Montel 😁

Use Q_DECL_OVERRIDE/Q_NULLPTR

parent 5d326a1d
......@@ -71,12 +71,12 @@ static const Collection::Rights writableRights = Collection::CanChangeItem | Col
= Class: AkonadiModel
=============================================================================*/
AkonadiModel* AkonadiModel::mInstance = 0;
QPixmap* AkonadiModel::mTextIcon = 0;
QPixmap* AkonadiModel::mFileIcon = 0;
QPixmap* AkonadiModel::mCommandIcon = 0;
QPixmap* AkonadiModel::mEmailIcon = 0;
QPixmap* AkonadiModel::mAudioIcon = 0;
AkonadiModel* AkonadiModel::mInstance = Q_NULLPTR;
QPixmap* AkonadiModel::mTextIcon = Q_NULLPTR;
QPixmap* AkonadiModel::mFileIcon = Q_NULLPTR;
QPixmap* AkonadiModel::mCommandIcon = Q_NULLPTR;
QPixmap* AkonadiModel::mEmailIcon = Q_NULLPTR;
QPixmap* AkonadiModel::mAudioIcon = Q_NULLPTR;
QSize AkonadiModel::mIconSize;
int AkonadiModel::mTimeHourPos = -2;
......@@ -149,7 +149,7 @@ AkonadiModel::AkonadiModel(ChangeRecorder* monitor, QObject* parent)
AkonadiModel::~AkonadiModel()
{
if (mInstance == this)
mInstance = 0;
mInstance = Q_NULLPTR;
}
/******************************************************************************
......@@ -541,7 +541,7 @@ bool AkonadiModel::setData(const QModelIndex& index, const QVariant& value, int
{
// This is a Collection row
bool updateCollection = false;
CollectionAttribute* attr = 0;
CollectionAttribute* attr = Q_NULLPTR;
switch (role)
{
case Qt::BackgroundRole:
......@@ -1267,12 +1267,12 @@ KAEvent AkonadiModel::event(Item::Id itemId) const
const QModelIndex ix = itemIndex(itemId);
if (!ix.isValid())
return KAEvent();
return event(ix.data(ItemRole).value<Item>(), ix, 0);
return event(ix.data(ItemRole).value<Item>(), ix, Q_NULLPTR);
}
KAEvent AkonadiModel::event(const QModelIndex& index) const
{
return event(index.data(ItemRole).value<Item>(), index, 0);
return event(index.data(ItemRole).value<Item>(), index, Q_NULLPTR);
}
KAEvent AkonadiModel::event(const Item& item, const QModelIndex& index, Collection* collection) const
......
......@@ -105,8 +105,8 @@ class AkonadiModel : public Akonadi::EntityTreeModel
*/
void updateCommandError(const KAEvent&);
virtual QVariant data(const QModelIndex&, int role = Qt::DisplayRole) const;
virtual bool setData(const QModelIndex&, const QVariant& value, int role);
QVariant data(const QModelIndex&, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
bool setData(const QModelIndex&, const QVariant& value, int role) Q_DECL_OVERRIDE;
/** Refresh the specified collection instance with up to date data. */
bool refresh(Akonadi::Collection&) const;
......@@ -144,7 +144,7 @@ class AkonadiModel : public Akonadi::EntityTreeModel
/** Return the alarm with the specified unique identifier.
* @return the event, or invalid event if no such event exists.
*/
KAEvent event(const Akonadi::Item& item) const { return event(item, QModelIndex(), 0); }
KAEvent event(const Akonadi::Item& item) const { return event(item, QModelIndex(), Q_NULLPTR); }
KAEvent event(Akonadi::Item::Id) const;
KAEvent event(const QModelIndex&) const;
using QObject::event; // prevent warning about hidden virtual method
......@@ -245,8 +245,8 @@ class AkonadiModel : public Akonadi::EntityTreeModel
void serverStopped();
protected:
virtual QVariant entityHeaderData(int section, Qt::Orientation, int role, HeaderGroup) const;
virtual int entityColumnCount(HeaderGroup) const;
QVariant entityHeaderData(int section, Qt::Orientation, int role, HeaderGroup) const Q_DECL_OVERRIDE;
int entityColumnCount(HeaderGroup) const Q_DECL_OVERRIDE;
private Q_SLOTS:
void checkResources(Akonadi::ServerManager::State);
......@@ -284,7 +284,7 @@ class AkonadiModel : public Akonadi::EntityTreeModel
};
struct CollTypeData // data for configuration dialog for collection creation job
{
CollTypeData() : parent(0), alarmType(CalEvent::EMPTY) {}
CollTypeData() : parent(Q_NULLPTR), alarmType(CalEvent::EMPTY) {}
CollTypeData(CalEvent::Type t, QWidget* p) : parent(p), alarmType(t) {}
QWidget* parent;
CalEvent::Type alarmType;
......
......@@ -106,7 +106,7 @@ void AkonadiResourceCreator::agentInstanceCreated(KJob* j)
if (j->error())
{
qCritical() << "Failed to create new calendar resource:" << j->errorString();
KMessageBox::error(0, xi18nc("@info", "%1<nl/>(%2)", i18nc("@info", "Failed to create new calendar resource"), j->errorString()));
KMessageBox::error(Q_NULLPTR, xi18nc("@info", "%1<nl/>(%2)", i18nc("@info", "Failed to create new calendar resource"), j->errorString()));
exitWithError();
}
else
......
......@@ -51,8 +51,8 @@ static KACalendar::Compat fix(const KCalCore::FileStorage::Ptr&);
static const QString displayCalendarName = QLatin1String("displaying.ics");
static const Collection::Id DISPLAY_COL_ID = -1; // collection ID used for displaying calendar
AlarmCalendar* AlarmCalendar::mResourcesCalendar = 0;
AlarmCalendar* AlarmCalendar::mDisplayCalendar = 0;
AlarmCalendar* AlarmCalendar::mResourcesCalendar = Q_NULLPTR;
AlarmCalendar* AlarmCalendar::mDisplayCalendar = Q_NULLPTR;
/******************************************************************************
......@@ -84,9 +84,9 @@ bool AlarmCalendar::initialiseCalendars()
void AlarmCalendar::terminateCalendars()
{
delete mResourcesCalendar;
mResourcesCalendar = 0;
mResourcesCalendar = Q_NULLPTR;
delete mDisplayCalendar;
mDisplayCalendar = 0;
mDisplayCalendar = Q_NULLPTR;
}
/******************************************************************************
......@@ -97,7 +97,7 @@ AlarmCalendar* AlarmCalendar::displayCalendarOpen()
if (mDisplayCalendar->open())
return mDisplayCalendar;
qCritical() << "Open error";
return 0;
return Q_NULLPTR;
}
/******************************************************************************
......@@ -107,7 +107,7 @@ AlarmCalendar* AlarmCalendar::displayCalendarOpen()
KAEvent* AlarmCalendar::getEvent(const EventId& eventId)
{
if (eventId.eventId().isEmpty())
return 0;
return Q_NULLPTR;
return mResourcesCalendar->event(eventId);
}
......@@ -402,7 +402,7 @@ void AlarmCalendar::updateDisplayKAEvents()
delete event;
}
events.clear();
mEarliestAlarm[key] = 0;
mEarliestAlarm[key] = Q_NULLPTR;
Calendar::Ptr cal = mCalendarStorage->calendar();
if (!cal)
return;
......@@ -746,7 +746,7 @@ bool AlarmCalendar::exportAlarms(const KAEvent::List& events, QWidget* parent)
{
// One or more alarms have been exported to the calendar.
// Save the calendar to file.
QTemporaryFile* tempFile = 0;
QTemporaryFile* tempFile = Q_NULLPTR;
bool local = url.isLocalFile();
if (!local)
{
......@@ -871,7 +871,7 @@ bool AlarmCalendar::addEvent(KAEvent& evnt, QWidget* promptParent, bool useEvent
}
Collection::Id key = (collection && collection->isValid()) ? collection->id() : -1;
Event::Ptr kcalEvent((mCalType == RESOURCES) ? (Event*)0 : new Event);
Event::Ptr kcalEvent((mCalType == RESOURCES) ? (Event*)Q_NULLPTR : new Event);
KAEvent* event = new KAEvent(evnt);
QString id = event->id();
if (type == CalEvent::ACTIVE)
......@@ -965,7 +965,7 @@ void AlarmCalendar::addNewEvent(const Collection& collection, KAEvent* event, bo
&& event->category() == CalEvent::ACTIVE)
{
// Update the earliest alarm to trigger
KAEvent* earliest = mEarliestAlarm.value(key, (KAEvent*)0);
KAEvent* earliest = mEarliestAlarm.value(key, (KAEvent*)Q_NULLPTR);
if (replace && earliest == event)
findEarliestAlarm(key);
else
......@@ -1048,7 +1048,7 @@ KAEvent* AlarmCalendar::updateEvent(const KAEvent& evnt)
KAEvent* AlarmCalendar::updateEvent(const KAEvent* evnt)
{
if (!mOpen || mCalType != RESOURCES)
return 0;
return Q_NULLPTR;
KAEvent* kaevnt = event(EventId(*evnt));
if (kaevnt)
{
......@@ -1061,7 +1061,7 @@ KAEvent* AlarmCalendar::updateEvent(const KAEvent* evnt)
}
}
qCDebug(KALARM_LOG) << "error";
return 0;
return Q_NULLPTR;
}
......@@ -1194,7 +1194,7 @@ CalEvent::Type AlarmCalendar::deleteEventInternal(const QString& eventID, const
KAEvent* AlarmCalendar::event(const EventId& uniqueID, bool checkDuplicates)
{
if (!isValid())
return 0;
return Q_NULLPTR;
const QString eventId = uniqueID.eventId();
if (uniqueID.collectionId() == -1 && checkDuplicates)
{
......@@ -1204,15 +1204,15 @@ KAEvent* AlarmCalendar::event(const EventId& uniqueID, bool checkDuplicates)
if (list.count() > 1)
{
qCWarning(KALARM_LOG) << "Multiple events found with ID" << eventId;
return 0;
return Q_NULLPTR;
}
if (list.isEmpty())
return 0;
return Q_NULLPTR;
return list[0];
}
KAEventMap::ConstIterator it = mEventMap.constFind(uniqueID);
if (it == mEventMap.constEnd())
return 0;
return Q_NULLPTR;
return it.value();
}
......@@ -1235,14 +1235,14 @@ Event::Ptr AlarmCalendar::kcalEvent(const QString& uniqueID)
KAEvent* AlarmCalendar::templateEvent(const QString& templateName)
{
if (templateName.isEmpty())
return 0;
return Q_NULLPTR;
KAEvent::List eventlist = events(CalEvent::TEMPLATE);
for (int i = 0, end = eventlist.count(); i < end; ++i)
{
if (eventlist[i]->templateName() == templateName)
return eventlist[i];
}
return 0;
return Q_NULLPTR;
}
/******************************************************************************
......@@ -1456,7 +1456,7 @@ void AlarmCalendar::findEarliestAlarm(Collection::Id key)
{
EarliestMap::Iterator eit = mEarliestAlarm.find(key);
if (eit != mEarliestAlarm.end())
eit.value() = 0;
eit.value() = Q_NULLPTR;
if (mCalType != RESOURCES
|| key < 0)
return;
......@@ -1464,7 +1464,7 @@ void AlarmCalendar::findEarliestAlarm(Collection::Id key)
if (rit == mResourceMap.constEnd())
return;
const KAEvent::List& events = rit.value();
KAEvent* earliest = 0;
KAEvent* earliest = Q_NULLPTR;
KDateTime earliestTime;
for (int i = 0, end = events.count(); i < end; ++i)
{
......@@ -1489,7 +1489,7 @@ void AlarmCalendar::findEarliestAlarm(Collection::Id key)
*/
KAEvent* AlarmCalendar::earliestAlarm() const
{
KAEvent* earliest = 0;
KAEvent* earliest = Q_NULLPTR;
KDateTime earliestTime;
for (EarliestMap::ConstIterator eit = mEarliestAlarm.constBegin(); eit != mEarliestAlarm.constEnd(); ++eit)
{
......
......@@ -69,7 +69,7 @@ class AlarmCalendar : public QObject
KCalCore::Event::List kcalEvents(CalEvent::Type s = CalEvent::EMPTY); // display calendar only
bool eventReadOnly(Akonadi::Item::Id) const;
Akonadi::Collection collectionForEvent(Akonadi::Item::Id) const;
bool addEvent(KAEvent&, QWidget* promptparent = Q_NULLPTR, bool useEventID = false, Akonadi::Collection* = 0, bool noPrompt = false, bool* cancelled = 0);
bool addEvent(KAEvent&, QWidget* promptparent = Q_NULLPTR, bool useEventID = false, Akonadi::Collection* = Q_NULLPTR, bool noPrompt = false, bool* cancelled = Q_NULLPTR);
bool modifyEvent(const EventId& oldEventId, KAEvent& newEvent);
KAEvent* updateEvent(const KAEvent&);
KAEvent* updateEvent(const KAEvent*);
......@@ -87,7 +87,7 @@ class AlarmCalendar : public QObject
static AlarmCalendar* displayCalendar() { return mDisplayCalendar; }
static AlarmCalendar* displayCalendarOpen();
static KAEvent* getEvent(const EventId&);
static bool importAlarms(QWidget*, Akonadi::Collection* = 0);
static bool importAlarms(QWidget*, Akonadi::Collection* = Q_NULLPTR);
static bool exportAlarms(const KAEvent::List&, QWidget* parent);
Q_SIGNALS:
......
......@@ -122,7 +122,7 @@ bool AlarmTime::convertTimeString(const QByteArray& timeString, KDateTime& dateT
char* end;
bool noTime;
// Get the minute value
if ((s = strchr(timeStr, ':')) == 0)
if ((s = strchr(timeStr, ':')) == Q_NULLPTR)
noTime = true;
else
{
......@@ -132,7 +132,7 @@ bool AlarmTime::convertTimeString(const QByteArray& timeString, KDateTime& dateT
if (end == s || *end || dt[4] >= 60)
return false;
// Get the hour value
if ((s = strrchr(timeStr, '-')) == 0)
if ((s = strrchr(timeStr, '-')) == Q_NULLPTR)
s = timeStr;
else
*s++ = 0;
......@@ -145,7 +145,7 @@ bool AlarmTime::convertTimeString(const QByteArray& timeString, KDateTime& dateT
{
noDate = false;
// Get the day value
if ((s = strrchr(timeStr, '-')) == 0)
if ((s = strrchr(timeStr, '-')) == Q_NULLPTR)
s = timeStr;
else
*s++ = 0;
......@@ -155,7 +155,7 @@ bool AlarmTime::convertTimeString(const QByteArray& timeString, KDateTime& dateT
if (s != timeStr)
{
// Get the month value
if ((s = strrchr(timeStr, '-')) == 0)
if ((s = strrchr(timeStr, '-')) == Q_NULLPTR)
s = timeStr;
else
*s++ = 0;
......
......@@ -139,7 +139,7 @@ void AlarmTimeWidget::init(Mode mode, const QString& title)
if (mode == DEFER_TIME)
{
mAnyTimeAllowed = false;
mAnyTimeCheckBox = 0;
mAnyTimeCheckBox = Q_NULLPTR;
}
else
{
......@@ -252,7 +252,7 @@ void AlarmTimeWidget::init(Mode mode, const QString& title)
void AlarmTimeWidget::setReadOnly(bool ro)
{
mAtTimeRadio->setReadOnly(ro);
mDateEdit->setOptions(ro ? KDateComboBox::Options(0) : KDateComboBox::EditDate | KDateComboBox::SelectDate | KDateComboBox::DatePicker);
mDateEdit->setOptions(ro ? KDateComboBox::Options(Q_NULLPTR) : KDateComboBox::EditDate | KDateComboBox::SelectDate | KDateComboBox::DatePicker);
mTimeEdit->setReadOnly(ro);
if (mAnyTimeCheckBox)
mAnyTimeCheckBox->setReadOnly(ro);
......@@ -289,7 +289,7 @@ KDateTime AlarmTimeWidget::getDateTime(int* minsFromNow, bool checkExpired, bool
if (minsFromNow)
*minsFromNow = 0;
if (errorWidget)
*errorWidget = 0;
*errorWidget = Q_NULLPTR;
KDateTime now = KDateTime::currentUtcDateTime();
now.setTime(QTime(now.time().hour(), now.time().minute(), 0));
if (!mAtTimeRadio->isChecked())
......
......@@ -48,7 +48,7 @@ class AlarmTimeWidget : public QFrame
};
AlarmTimeWidget(const QString& groupBoxTitle, Mode, QWidget* parent = Q_NULLPTR);
explicit AlarmTimeWidget(Mode, QWidget* parent = Q_NULLPTR);
KDateTime getDateTime(int* minsFromNow = 0, bool checkExpired = true, bool showErrorMessage = true, QWidget** errorWidget = 0) const;
KDateTime getDateTime(int* minsFromNow = Q_NULLPTR, bool checkExpired = true, bool showErrorMessage = true, QWidget** errorWidget = Q_NULLPTR) const;
void setDateTime(const DateTime&);
void setMinDateTimeIsCurrent();
void setMinDateTime(const KDateTime& = KDateTime());
......@@ -60,7 +60,7 @@ class AlarmTimeWidget : public QFrame
void enableAnyTime(bool enable);
void selectTimeFromNow(int minutes = 0);
void showMoreOptions(bool);
QSize sizeHint() const { return minimumSizeHint(); }
QSize sizeHint() const Q_DECL_OVERRIDE { return minimumSizeHint(); }
static QString i18n_TimeAfterPeriod();
static const int maxDelayTime; // maximum time from now
......
......@@ -61,7 +61,7 @@ using namespace KCal;
BirthdayDlg::BirthdayDlg(QWidget* parent)
: KDialog(parent),
mSpecialActionsButton(0)
mSpecialActionsButton(Q_NULLPTR)
{
setObjectName(QStringLiteral("BirthdayDlg")); // used by LikeBack
setCaption(i18nc("@title:window", "Import Birthdays From KAddressBook"));
......@@ -234,7 +234,7 @@ BirthdayDlg::BirthdayDlg(QWidget* parent)
Preferences::defaultSoundVolume(), -1, 0, Preferences::defaultSoundRepeat());
if (mSpecialActionsButton)
{
KAEvent::ExtraActionOptions opts(0);
KAEvent::ExtraActionOptions opts(Q_NULLPTR);
if (Preferences::defaultExecPreActionOnDeferral())
opts |= KAEvent::ExecPreActOnDeferral;
if (Preferences::defaultCancelOnPreActionError())
......
......@@ -35,7 +35,7 @@
using namespace KAlarmCal;
BirthdayModel* BirthdayModel::mInstance = 0;
BirthdayModel* BirthdayModel::mInstance = Q_NULLPTR;
BirthdayModel::BirthdayModel(Akonadi::ChangeRecorder* recorder)
: Akonadi::ContactsTreeModel(recorder)
......@@ -46,7 +46,7 @@ BirthdayModel::BirthdayModel(Akonadi::ChangeRecorder* recorder)
BirthdayModel::~BirthdayModel()
{
if (this == mInstance)
mInstance = 0;
mInstance = Q_NULLPTR;
}
BirthdayModel* BirthdayModel::instance()
......
......@@ -132,19 +132,19 @@ class CalendarUpdater : public QObject
};
CalendarMigrator* CalendarMigrator::mInstance = 0;
CalendarMigrator* CalendarMigrator::mInstance = Q_NULLPTR;
bool CalendarMigrator::mCompleted = false;
CalendarMigrator::CalendarMigrator(QObject* parent)
: QObject(parent),
mExistingAlarmTypes(0)
mExistingAlarmTypes(Q_NULLPTR)
{
}
CalendarMigrator::~CalendarMigrator()
{
qCDebug(KALARM_LOG);
mInstance = 0;
mInstance = Q_NULLPTR;
}
/******************************************************************************
......@@ -524,7 +524,7 @@ template <class Interface> Interface* CalendarMigrator::getAgentInterface(const
errorMessage = iface->lastError().message();
qCDebug(KALARM_LOG) << "D-Bus error accessing resource:" << errorMessage;
delete iface;
return 0;
return Q_NULLPTR;
}
return iface;
}
......@@ -539,7 +539,7 @@ CalendarCreator::CalendarCreator(const QString& resourceType, const KConfigGroup
mFinished(false)
{
// Read the resource configuration parameters from the config
const char* pathKey = 0;
const char* pathKey = Q_NULLPTR;
if (resourceType == QLatin1String("file"))
{
mResourceType = LocalFile;
......
......@@ -60,7 +60,7 @@ class CollectionMimeTypeFilterModel : public Akonadi::EntityMimeTypeFilterModel
{
Q_OBJECT
public:
explicit CollectionMimeTypeFilterModel(QObject* parent = 0);
explicit CollectionMimeTypeFilterModel(QObject* parent = Q_NULLPTR);
void setEventTypeFilter(CalEvent::Type);
void setFilterWritable(bool writable);
void setFilterEnabled(bool enabled);
......@@ -242,7 +242,7 @@ QVariant CollectionListModel::data(const QModelIndex& index, int role) const
= which are disabled for that alarm type, are unchecked.
=============================================================================*/
CollectionListModel* CollectionCheckListModel::mModel = 0;
CollectionListModel* CollectionCheckListModel::mModel = Q_NULLPTR;
int CollectionCheckListModel::mInstanceCount = 0;
CollectionCheckListModel::CollectionCheckListModel(CalEvent::Type type, QObject* parent)
......@@ -251,7 +251,7 @@ CollectionCheckListModel::CollectionCheckListModel(CalEvent::Type type, QObject*
{
++mInstanceCount;
if (!mModel)
mModel = new CollectionListModel(0);
mModel = new CollectionListModel(Q_NULLPTR);
setSourceModel(mModel); // the source model is NOT filtered by alarm type
mSelectionModel = new QItemSelectionModel(mModel);
setSelectionModel(mSelectionModel);
......@@ -279,7 +279,7 @@ CollectionCheckListModel::~CollectionCheckListModel()
if (--mInstanceCount <= 0)
{
delete mModel;
mModel = 0;
mModel = Q_NULLPTR;
}
}
......@@ -650,7 +650,7 @@ bool CollectionView::viewportEvent(QEvent* e)
= collection models.
=============================================================================*/
CollectionControlModel* CollectionControlModel::mInstance = 0;
CollectionControlModel* CollectionControlModel::mInstance = Q_NULLPTR;
bool CollectionControlModel::mAskDestination = false;
CollectionControlModel* CollectionControlModel::instance()
......@@ -662,7 +662,7 @@ CollectionControlModel* CollectionControlModel::instance()
CollectionControlModel::CollectionControlModel(QObject* parent)
: FavoriteCollectionsModel(AkonadiModel::instance(), KConfigGroup(KSharedConfig::openConfig(), "Collections"), parent),
mPopulatedCheckLoop(0)
mPopulatedCheckLoop(Q_NULLPTR)
{
// Initialise the list of enabled collections
EntityMimeTypeFilterModel* filter = new EntityMimeTypeFilterModel(this);
......@@ -759,8 +759,8 @@ CalEvent::Types CollectionControlModel::setEnabled(const Collection& collection,
CalEvent::Types CollectionControlModel::setEnabledStatus(const Collection& collection, CalEvent::Types types, bool inserted)
{
qCDebug(KALARM_LOG) << "id:" << collection.id() << ", types=" << types;
CalEvent::Types disallowedStdTypes(0);
CalEvent::Types stdTypes(0);
CalEvent::Types disallowedStdTypes(Q_NULLPTR);
CalEvent::Types stdTypes(Q_NULLPTR);
// Prevent the enabling of duplicate alarm types if another collection
// uses the same backend storage.
......@@ -1296,7 +1296,7 @@ bool CollectionControlModel::waitUntilPopulated(Collection::Id colId, int timeou
result = mPopulatedCheckLoop->exec();
}
delete mPopulatedCheckLoop;
mPopulatedCheckLoop = 0;
mPopulatedCheckLoop = Q_NULLPTR;
return result;
}
......@@ -1306,7 +1306,7 @@ bool CollectionControlModel::waitUntilPopulated(Collection::Id colId, int timeou
void CollectionControlModel::reset()
{
delete mPopulatedCheckLoop;
mPopulatedCheckLoop = 0;
mPopulatedCheckLoop = Q_NULLPTR;
// Clear the collections list. This is required because addCollection() or
// setCollections() don't work if the collections which they specify are
......
......@@ -82,8 +82,8 @@ class CollectionCheckListModel : public KCheckableProxyModel
~CollectionCheckListModel();
Akonadi::Collection collection(int row) const;
Akonadi::Collection collection(const QModelIndex&) const;
virtual QVariant data(const QModelIndex&, int role = Qt::DisplayRole) const;
virtual bool setData(const QModelIndex&, const QVariant& value, int role);
QVariant data(const QModelIndex&, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
bool setData(const QModelIndex&, const QVariant& value, int role) Q_DECL_OVERRIDE;
Q_SIGNALS:
void collectionTypeChange(CollectionCheckListModel*);
......@@ -252,7 +252,7 @@ class CollectionControlModel : public Akonadi::FavoriteCollectionsModel
* @param cancelled If non-null: set to true if the user cancelled
* the prompt dialogue; set to false if any other error.
*/
static Akonadi::Collection destination(CalEvent::Type, QWidget* promptparent = Q_NULLPTR, bool noPrompt = false, bool* cancelled = 0);
static Akonadi::Collection destination(CalEvent::Type, QWidget* promptparent = Q_NULLPTR, bool noPrompt = false, bool* cancelled = Q_NULLPTR);
/** Return the enabled collections which contain a specified mime type.
* If 'writable' is true, only writable collections are included.
......@@ -277,7 +277,7 @@ class CollectionControlModel : public Akonadi::FavoriteCollectionsModel
*/
bool waitUntilPopulated(Akonadi::Collection::Id colId = -1, int timeout = 0);
virtual QVariant data(const QModelIndex&, int role = Qt::DisplayRole) const;
QVariant data(const QModelIndex&, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
/** Return a bulleted list of alarm types for inclusion in an i18n message. */
static QString typeListForDisplay(CalEvent::Types);
......
......@@ -41,7 +41,7 @@ void CommandOptions::setError(const QString& error)
CommandOptions::CommandOptions()
: mCommand(NONE),
mEditActionSet(false),
mRecurrence(0),
mRecurrence(Q_NULLPTR),
mRepeatCount(0),
mRepeatInterval(0),
mLateCancel(0),
......
......@@ -83,7 +83,7 @@ class CommandOptions
private:
bool checkCommand(const QByteArray& command, Command, EditAlarmDlg::Type = EditAlarmDlg::NO_TYPE);
inline void setError(const QString& error);
void setErrorRequires(const char* opt, const char* opt2, const char* opt3 = 0);
void setErrorRequires(const char* opt, const char* opt2, const char* opt3 = Q_NULLPTR);
void setErrorParameter(const char* opt);
void setErrorIncompatible(const QByteArray& opt1, const QByteArray& opt2);
void checkEditType(EditAlarmDlg::Type type, const QByteArray& opt)
......
......@@ -457,7 +457,7 @@ KDateTime DBusHandler::convertDateTime(const QString& dateTime, const KDateTime&
*/
KAEvent::Flags DBusHandler::convertStartFlags(const KDateTime& start, unsigned flags)
{
KAEvent::Flags kaEventFlags = 0;
KAEvent::Flags kaEventFlags = Q_NULLPTR;
if (flags & REPEAT_AT_LOGIN) kaEventFlags |= KAEvent::REPEAT_AT_LOGIN;
if (flags & BEEP) kaEventFlags |= KAEvent::BEEP;
if (flags & SPEAK) kaEventFlags |= KAEvent::SPEAK;
......
......@@ -106,7 +106,7 @@ EditAlarmDlg* EditAlarmDlg::create(bool Template, Type type, QWidget* parent, Ge
case AUDIO: return new EditAudioAlarmDlg(Template, parent, getResource);
default: break;
}
return 0;
return Q_NULLPTR;
}