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

Use Q_NULLPTR

parent f9eff308
...@@ -631,7 +631,7 @@ KActionCollection *ActionManagerImpl::actionCollection() const ...@@ -631,7 +631,7 @@ KActionCollection *ActionManagerImpl::actionCollection() const
QAction *ActionManagerImpl::action(const QString &name) QAction *ActionManagerImpl::action(const QString &name)
{ {
return d->actionCollection != 0 ? d->actionCollection->action(name) : 0; return d->actionCollection != Q_NULLPTR ? d->actionCollection->action(name) : Q_NULLPTR;
} }
void ActionManagerImpl::setArticleActionsEnabled(bool enabled) void ActionManagerImpl::setArticleActionsEnabled(bool enabled)
......
...@@ -286,7 +286,7 @@ Part::Part(QWidget *parentWidget, QObject *parent, const QVariantList &) ...@@ -286,7 +286,7 @@ Part::Part(QWidget *parentWidget, QObject *parent, const QVariantList &)
trayIcon->setStatus(KStatusNotifierItem::Active); trayIcon->setStatus(KStatusNotifierItem::Active);
} }
QWidget *const notificationParent = isTrayIconEnabled() ? m_mainWidget->window() : 0; QWidget *const notificationParent = isTrayIconEnabled() ? m_mainWidget->window() : Q_NULLPTR;
NotificationManager::self()->setWidget(notificationParent, componentData().componentName()); NotificationManager::self()->setWidget(notificationParent, componentData().componentName());
connect(m_mainWidget.data(), &MainWidget::signalUnreadCountChanged, trayIcon, &TrayIcon::slotSetUnread); connect(m_mainWidget.data(), &MainWidget::signalUnreadCountChanged, trayIcon, &TrayIcon::slotSetUnread);
......
...@@ -74,13 +74,13 @@ void CreateFolderCommand::Private::doCreate() ...@@ -74,13 +74,13 @@ void CreateFolderCommand::Private::doCreate()
Folder *parentFolder = qobject_cast<Folder *>(m_selectedSubscription); Folder *parentFolder = qobject_cast<Folder *>(m_selectedSubscription);
if (!parentFolder) { if (!parentFolder) {
parentFolder = m_selectedSubscription ? m_selectedSubscription->parent() : 0; parentFolder = m_selectedSubscription ? m_selectedSubscription->parent() : Q_NULLPTR;
} }
if (!parentFolder) { if (!parentFolder) {
parentFolder = m_rootFolder; parentFolder = m_rootFolder;
} }
TreeNode *const after = (m_selectedSubscription && m_selectedSubscription->isGroup()) ? m_selectedSubscription : 0; TreeNode *const after = (m_selectedSubscription && m_selectedSubscription->isGroup()) ? m_selectedSubscription : Q_NULLPTR;
Folder *const newFolder = new Folder(name); Folder *const newFolder = new Folder(name);
parentFolder->insertChild(newFolder, after); parentFolder->insertChild(newFolder, after);
......
...@@ -366,7 +366,7 @@ bool Folder::subtreeContains(const TreeNode *node) const ...@@ -366,7 +366,7 @@ bool Folder::subtreeContains(const TreeNode *node) const
if (node == this) { if (node == this) {
return false; return false;
} }
const Folder *parent = node ? node->parent() : 0; const Folder *parent = node ? node->parent() : Q_NULLPTR;
while (parent) { while (parent) {
if (parent == this) { if (parent == this) {
return true; return true;
......
...@@ -707,7 +707,7 @@ void MainWidget::slotFeedAdd() ...@@ -707,7 +707,7 @@ void MainWidget::slotFeedAdd()
} }
TreeNode *const lastChild = !group->children().isEmpty() ? group->children().last() : 0; TreeNode *const lastChild = !group->children().isEmpty() ? group->children().last() : Q_NULLPTR;
addFeed(QString(), lastChild, group, false); addFeed(QString(), lastChild, group, false);
} }
......
...@@ -853,7 +853,7 @@ void KNote::createNoteFooter() ...@@ -853,7 +853,7 @@ void KNote::createNoteFooter()
void KNote::loadNoteContent(const Akonadi::Item &item) void KNote::loadNoteContent(const Akonadi::Item &item)
{ {
KMime::Message::Ptr noteMessage = item.payload<KMime::Message::Ptr>(); KMime::Message::Ptr noteMessage = item.payload<KMime::Message::Ptr>();
const KMime::Headers::Subject *const subject = noteMessage ? noteMessage->subject(false) : 0; const KMime::Headers::Subject *const subject = noteMessage ? noteMessage->subject(false) : Q_NULLPTR;
setName(subject ? subject->asUnicodeString() : QString()); setName(subject ? subject->asUnicodeString() : QString());
if (noteMessage->contentType()->isHTMLText()) { if (noteMessage->contentType()->isHTMLText()) {
m_editor->setAcceptRichText(true); m_editor->setAcceptRichText(true);
......
...@@ -50,7 +50,7 @@ QString KNotePrintObject::description() const ...@@ -50,7 +50,7 @@ QString KNotePrintObject::description() const
QString KNotePrintObject::name() const QString KNotePrintObject::name() const
{ {
KMime::Message::Ptr noteMessage = mItem.payload<KMime::Message::Ptr>(); KMime::Message::Ptr noteMessage = mItem.payload<KMime::Message::Ptr>();
const KMime::Headers::Subject *const subject = noteMessage ? noteMessage->subject(false) : 0; const KMime::Headers::Subject *const subject = noteMessage ? noteMessage->subject(false) : Q_NULLPTR;
return subject ? subject->asUnicodeString() : QString(); return subject ? subject->asUnicodeString() : QString();
} }
......
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