Commit 90b6ac7e authored by Laurent Montel's avatar Laurent Montel 😁

Use Q_NULLPTR

parent f87b7dcb
...@@ -143,7 +143,7 @@ Attachment::Ptr AttachmentHandler::find(const QString &attachmentName, ...@@ -143,7 +143,7 @@ Attachment::Ptr AttachmentHandler::find(const QString &attachmentName,
return find(attachmentName, incidence); return find(attachmentName, incidence);
} }
static QTemporaryFile *s_tempFile = 0; static QTemporaryFile *s_tempFile = Q_NULLPTR;
static QUrl tempFileForAttachment(const Attachment::Ptr &attachment) static QUrl tempFileForAttachment(const Attachment::Ptr &attachment)
{ {
...@@ -165,7 +165,7 @@ static QUrl tempFileForAttachment(const Attachment::Ptr &attachment) ...@@ -165,7 +165,7 @@ static QUrl tempFileForAttachment(const Attachment::Ptr &attachment)
if (tf.size() != attachment->size()) { if (tf.size() != attachment->size()) {
//whoops. failed to write the entire attachment. return an invalid URL. //whoops. failed to write the entire attachment. return an invalid URL.
delete s_tempFile; delete s_tempFile;
s_tempFile = 0; s_tempFile = Q_NULLPTR;
return url; return url;
} }
...@@ -186,7 +186,7 @@ bool AttachmentHandler::view(const Attachment::Ptr &attachment) ...@@ -186,7 +186,7 @@ bool AttachmentHandler::view(const Attachment::Ptr &attachment)
// put the attachment in a temporary file and launch it // put the attachment in a temporary file and launch it
QUrl tempUrl = tempFileForAttachment(attachment); QUrl tempUrl = tempFileForAttachment(attachment);
if (tempUrl.isValid()) { if (tempUrl.isValid()) {
stat = KRun::runUrl(tempUrl, attachment->mimeType(), 0, true); stat = KRun::runUrl(tempUrl, attachment->mimeType(), Q_NULLPTR, true);
} else { } else {
stat = false; stat = false;
KMessageBox::error( KMessageBox::error(
...@@ -194,7 +194,7 @@ bool AttachmentHandler::view(const Attachment::Ptr &attachment) ...@@ -194,7 +194,7 @@ bool AttachmentHandler::view(const Attachment::Ptr &attachment)
i18n("Unable to create a temporary file for the attachment.")); i18n("Unable to create a temporary file for the attachment."));
} }
delete s_tempFile; delete s_tempFile;
s_tempFile = 0; s_tempFile = Q_NULLPTR;
} }
return stat; return stat;
} }
...@@ -257,7 +257,7 @@ bool AttachmentHandler::saveAs(const Attachment::Ptr &attachment) ...@@ -257,7 +257,7 @@ bool AttachmentHandler::saveAs(const Attachment::Ptr &attachment)
i18n("Unable to create a temporary file for the attachment.")); i18n("Unable to create a temporary file for the attachment."));
} }
delete s_tempFile; delete s_tempFile;
s_tempFile = 0; s_tempFile = Q_NULLPTR;
} }
return stat; return stat;
} }
......
...@@ -152,7 +152,7 @@ bool CalendarUtilsPrivate::purgeCompletedSubTodos(const KCalCore::Todo::Ptr &tod ...@@ -152,7 +152,7 @@ bool CalendarUtilsPrivate::purgeCompletedSubTodos(const KCalCore::Todo::Ptr &tod
if (deleteThisTodo) { if (deleteThisTodo) {
if (todo->isCompleted()) { if (todo->isCompleted()) {
if (!mChanger->deleteIncidence(mCalendar->item(todo), 0)) { if (!mChanger->deleteIncidence(mCalendar->item(todo), Q_NULLPTR)) {
allPurged = false; allPurged = false;
} }
} else { } else {
...@@ -259,7 +259,7 @@ void CalendarUtils::purgeCompletedTodos() ...@@ -259,7 +259,7 @@ void CalendarUtils::purgeCompletedTodos()
// endMultiModify(); // endMultiModify();
if (!allDeleted) { if (!allDeleted) {
KMessageBox::information( KMessageBox::information(
0, Q_NULLPTR,
i18nc("@info", i18nc("@info",
"Unable to purge to-dos with uncompleted children."), "Unable to purge to-dos with uncompleted children."),
i18nc("@title:window", "Delete To-do"), i18nc("@title:window", "Delete To-do"),
......
...@@ -36,7 +36,7 @@ class IncidenceAttachmentModelPrivate ...@@ -36,7 +36,7 @@ class IncidenceAttachmentModelPrivate
IncidenceAttachmentModelPrivate(IncidenceAttachmentModel *qq, IncidenceAttachmentModelPrivate(IncidenceAttachmentModel *qq,
const QPersistentModelIndex &modelIndex, const QPersistentModelIndex &modelIndex,
const Akonadi::Item &item = Akonadi::Item()) const Akonadi::Item &item = Akonadi::Item())
: q_ptr(qq), m_modelIndex(modelIndex), m_item(item), m_monitor(0) : q_ptr(qq), m_modelIndex(modelIndex), m_item(item), m_monitor(Q_NULLPTR)
{ {
if (modelIndex.isValid()) { if (modelIndex.isValid()) {
QObject::connect(modelIndex.model(), SIGNAL(dataChanged(QModelIndex,QModelIndex)), QObject::connect(modelIndex.model(), SIGNAL(dataChanged(QModelIndex,QModelIndex)),
......
...@@ -196,7 +196,7 @@ QMimeData *CalendarSupport::createMimeData(const Akonadi::Item::List &items, ...@@ -196,7 +196,7 @@ QMimeData *CalendarSupport::createMimeData(const Akonadi::Item::List &items,
const KDateTime::Spec &timeSpec) const KDateTime::Spec &timeSpec)
{ {
if (items.isEmpty()) { if (items.isEmpty()) {
return 0; return Q_NULLPTR;
} }
KCalCore::MemoryCalendar::Ptr cal(new KCalCore::MemoryCalendar(timeSpec)); KCalCore::MemoryCalendar::Ptr cal(new KCalCore::MemoryCalendar(timeSpec));
...@@ -215,7 +215,7 @@ QMimeData *CalendarSupport::createMimeData(const Akonadi::Item::List &items, ...@@ -215,7 +215,7 @@ QMimeData *CalendarSupport::createMimeData(const Akonadi::Item::List &items,
} }
if (incidencesFound == 0) { if (incidencesFound == 0) {
return 0; return Q_NULLPTR;
} }
std::unique_ptr<QMimeData> mimeData(new QMimeData); std::unique_ptr<QMimeData> mimeData(new QMimeData);
......
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