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