Commit 9d6347bf authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use Q_NULLPTR

parent 2b9c67c1
......@@ -66,11 +66,11 @@ private Q_SLOTS:
{
AkonadiTest::checkTestIsIsolated();
DummyKernel *kernel = new DummyKernel(0);
DummyKernel *kernel = new DummyKernel(Q_NULLPTR);
CommonKernel->registerKernelIf(kernel);
CommonKernel->registerSettingsIf(kernel);
mFolderTreeWidget = new MailCommon::FolderTreeWidget(0);
mFolderTreeWidget = new MailCommon::FolderTreeWidget(Q_NULLPTR);
const QStringList resourceOrder{"akonadi_knut_resource_2", "akonadi_knut_resource_0"}; // _1 isn't specified so it goes at the end
mFolderTreeWidget->entityOrderProxy()->setTopLevelOrder(resourceOrder);
......
......@@ -192,7 +192,7 @@ void CollectionExpiryPage::saveAndExpire(Akonadi::Collection &collection, bool s
expireNow = false; // settings are not valid
}
MailCommon::ExpireCollectionAttribute *attribute = 0;
MailCommon::ExpireCollectionAttribute *attribute = Q_NULLPTR;
if (expireToFolder.isValid() && moveToRB->isChecked()) {
if (expireToFolder.id() == collection.id()) {
KMessageBox::error(this, i18n("Please select a different folder than the current folder to expire messages into.\nIf this is not done, expired messages will be permanently deleted."),
......
......@@ -52,11 +52,11 @@ using namespace MailCommon;
CollectionGeneralPage::CollectionGeneralPage(QWidget *parent)
: CollectionPropertiesPage(parent),
mContentsComboBox(0),
mIncidencesForComboBox(0),
mSharedSeenFlagsCheckBox(0),
mNameEdit(0),
mFolderCollection(0)
mContentsComboBox(Q_NULLPTR),
mIncidencesForComboBox(Q_NULLPTR),
mSharedSeenFlagsCheckBox(Q_NULLPTR),
mNameEdit(Q_NULLPTR),
mFolderCollection(Q_NULLPTR)
{
setObjectName(QStringLiteral("MailCommon::CollectionGeneralPage"));
setPageTitle(i18nc("@title:tab General settings for a folder.", "General"));
......
......@@ -38,7 +38,7 @@ FilterActionAddHeaderTest::~FilterActionAddHeaderTest()
void FilterActionAddHeaderTest::shouldCreateWidget()
{
MailCommon::FilterActionAddHeader filter;
QWidget *widget = filter.createParamWidget(0);
QWidget *widget = filter.createParamWidget(Q_NULLPTR);
QVERIFY(widget);
PimCommon::MinimumComboBox *comboBox = widget->findChild<PimCommon::MinimumComboBox *>(QStringLiteral("combo"));
QVERIFY(comboBox);
......@@ -63,7 +63,7 @@ void FilterActionAddHeaderTest::shouldAddValue_data()
void FilterActionAddHeaderTest::shouldClearWidget()
{
MailCommon::FilterActionAddHeader filter;
QWidget *widget = filter.createParamWidget(0);
QWidget *widget = filter.createParamWidget(Q_NULLPTR);
PimCommon::MinimumComboBox *comboBox = widget->findChild<PimCommon::MinimumComboBox *>(QStringLiteral("combo"));
KLineEdit *lineEdit = widget->findChild<KLineEdit *>(QStringLiteral("ledit"));
comboBox->lineEdit()->setText(QStringLiteral("test"));
......@@ -197,7 +197,7 @@ void FilterActionAddHeaderTest::shouldAddValue()
QFETCH(QString, resultvalue);
MailCommon::FilterActionAddHeader filter;
QWidget *widget = filter.createParamWidget(0);
QWidget *widget = filter.createParamWidget(Q_NULLPTR);
filter.argsFromString(argsinput);
filter.setParamWidgetValue(widget);
PimCommon::MinimumComboBox *comboBox = widget->findChild<PimCommon::MinimumComboBox *>(QStringLiteral("combo"));
......
......@@ -39,7 +39,7 @@ FilterActionAddToAddressBookTest::~FilterActionAddToAddressBookTest()
void FilterActionAddToAddressBookTest::shouldHaveDefaultValue()
{
MailCommon::FilterActionAddToAddressBook filter;
QWidget *w = filter.createParamWidget(0);
QWidget *w = filter.createParamWidget(Q_NULLPTR);
PimCommon::MinimumComboBox *headerCombo = w->findChild<PimCommon::MinimumComboBox *>(QStringLiteral("HeaderComboBox"));
QVERIFY(headerCombo);
......
......@@ -32,8 +32,8 @@ FilterActionDeleteTest::~FilterActionDeleteTest()
void FilterActionDeleteTest::shouldHaveDefaultValue()
{
MailCommon::FilterActionDelete filter(0);
QWidget *w = filter.createParamWidget(0);
MailCommon::FilterActionDelete filter(Q_NULLPTR);
QWidget *w = filter.createParamWidget(Q_NULLPTR);
QVERIFY(w);
QLabel *lab = dynamic_cast<QLabel *>(w);
......@@ -43,7 +43,7 @@ void FilterActionDeleteTest::shouldHaveDefaultValue()
void FilterActionDeleteTest::shouldReturnSieveValue()
{
MailCommon::FilterActionDelete filter(0);
MailCommon::FilterActionDelete filter(Q_NULLPTR);
QCOMPARE(filter.sieveCode(), QStringLiteral("discard;"));
}
......
......@@ -36,7 +36,7 @@ FilterActionExecTest::~FilterActionExecTest()
void FilterActionExecTest::shouldHaveDefaultValue()
{
MailCommon::FilterActionExec filter;
QWidget *w = filter.createParamWidget(0);
QWidget *w = filter.createParamWidget(Q_NULLPTR);
KUrlRequester *requester = w->findChild<KUrlRequester *>(QStringLiteral("requester"));
QVERIFY(requester);
......
......@@ -39,7 +39,7 @@ FilterActionMissingIdentityDialogTest::~FilterActionMissingIdentityDialogTest()
void FilterActionMissingIdentityDialogTest::initTestCase()
{
DummyKernel *kernel = new DummyKernel(0);
DummyKernel *kernel = new DummyKernel(Q_NULLPTR);
CommonKernel->registerKernelIf(kernel); //register KernelIf early, it is used by the Filter classes
CommonKernel->registerSettingsIf(kernel); //SettingsIf is used in FolderTreeWidget
}
......
......@@ -46,7 +46,7 @@ void FilterActionMoveTest::shouldHaveRequiresPart()
void FilterActionMoveTest::shouldHaveDefaultValue()
{
MailCommon::FilterActionMove filter;
QWidget *w = filter.createParamWidget(0);
QWidget *w = filter.createParamWidget(Q_NULLPTR);
QVERIFY(w);
MailCommon::FolderRequester *requester = dynamic_cast<MailCommon::FolderRequester *>(w);
QVERIFY(requester);
......
......@@ -42,7 +42,7 @@ void FilterActionPlaySoundTest::shouldBeValid()
void FilterActionPlaySoundTest::shouldHaveDefaultValue()
{
MailCommon::FilterActionPlaySound filter;
QWidget *w = filter.createParamWidget(0);
QWidget *w = filter.createParamWidget(Q_NULLPTR);
QVERIFY(w);
QCOMPARE(w->objectName(), QStringLiteral("soundwidget"));
MailCommon::SoundTestWidget *soundTest = dynamic_cast<MailCommon::SoundTestWidget *>(w);
......
......@@ -34,7 +34,7 @@ FilterActionRemoveHeaderTest::~FilterActionRemoveHeaderTest()
void FilterActionRemoveHeaderTest::shouldHaveDefaultValue()
{
MailCommon::FilterActionRemoveHeader filter;
QWidget *w = filter.createParamWidget(0);
QWidget *w = filter.createParamWidget(Q_NULLPTR);
PimCommon::MinimumComboBox *comboBox = dynamic_cast<PimCommon::MinimumComboBox *>(w);
QVERIFY(comboBox);
QVERIFY(comboBox->isEditable());
......
......@@ -33,7 +33,7 @@ FilterActionReplyToTest::~FilterActionReplyToTest()
void FilterActionReplyToTest::shouldHaveDefaultValue()
{
MailCommon::FilterActionReplyTo filter;
QWidget *w = filter.createParamWidget(0);
QWidget *w = filter.createParamWidget(Q_NULLPTR);
QCOMPARE(w->objectName(), QStringLiteral("emailaddressrequester"));
}
......
......@@ -36,7 +36,7 @@ FilterActionRewriteHeaderTest::~FilterActionRewriteHeaderTest()
void FilterActionRewriteHeaderTest::shouldHaveDefaultValue()
{
MailCommon::FilterActionRewriteHeader filter;
QWidget *w = filter.createParamWidget(0);
QWidget *w = filter.createParamWidget(Q_NULLPTR);
PimCommon::MinimumComboBox *combo = w->findChild<PimCommon::MinimumComboBox *>(QStringLiteral("combo"));
QVERIFY(combo);
QVERIFY(combo->count() > 0);
......
......@@ -34,7 +34,7 @@ FilterActionSendFakeDispositionTest::~FilterActionSendFakeDispositionTest()
void FilterActionSendFakeDispositionTest::shouldHaveDefaultValue()
{
MailCommon::FilterActionSendFakeDisposition filter;
QWidget *w = filter.createParamWidget(0);
QWidget *w = filter.createParamWidget(Q_NULLPTR);
QCOMPARE(w->objectName(), QStringLiteral("combobox"));
PimCommon::MinimumComboBox *comboBox = dynamic_cast<PimCommon::MinimumComboBox *>(w);
......
......@@ -35,7 +35,7 @@ FilterActionSetStatusTest::~FilterActionSetStatusTest()
void FilterActionSetStatusTest::shouldHaveDefaultValue()
{
MailCommon::FilterActionSetStatus filter;
QWidget *w = filter.createParamWidget(0);
QWidget *w = filter.createParamWidget(Q_NULLPTR);
QCOMPARE(w->objectName(), QStringLiteral("combobox"));
PimCommon::MinimumComboBox *comboBox = dynamic_cast<PimCommon::MinimumComboBox *>(w);
QVERIFY(comboBox);
......
......@@ -23,7 +23,7 @@ void FilterActionSetTransportTest::shouldBeEmpty()
void FilterActionSetTransportTest::shouldHaveDefaultValue()
{
MailCommon::FilterActionSetTransport filter;
QWidget *w = filter.createParamWidget(0);
QWidget *w = filter.createParamWidget(Q_NULLPTR);
QCOMPARE(w->objectName(), QStringLiteral("transportcombobox"));
MailTransport::TransportComboBox *transportCombobox = dynamic_cast<MailTransport::TransportComboBox *>(w);
......
......@@ -54,7 +54,7 @@ FilterActionWithAddressTest::~FilterActionWithAddressTest()
void FilterActionWithAddressTest::shouldHaveDefaultValue()
{
TestFilterActionWithAddress filter;
QWidget *w = filter.createParamWidget(0);
QWidget *w = filter.createParamWidget(Q_NULLPTR);
QCOMPARE(w->objectName(), QStringLiteral("emailaddressrequester"));
Akonadi::EmailAddressRequester *requester = dynamic_cast<Akonadi::EmailAddressRequester *>(w);
QVERIFY(requester);
......@@ -64,7 +64,7 @@ void FilterActionWithAddressTest::shouldHaveDefaultValue()
void FilterActionWithAddressTest::shouldAssignValue()
{
TestFilterActionWithAddress filter;
QWidget *w = filter.createParamWidget(0);
QWidget *w = filter.createParamWidget(Q_NULLPTR);
Akonadi::EmailAddressRequester *requester = dynamic_cast<Akonadi::EmailAddressRequester *>(w);
filter.argsFromString(QStringLiteral("foo"));
filter.setParamWidgetValue(w);
......
......@@ -54,7 +54,7 @@ FilterActionWithUrlTest::~FilterActionWithUrlTest()
void FilterActionWithUrlTest::shouldHaveDefaultValue()
{
TestFilterActionWithUrl filter;
QWidget *w = filter.createParamWidget(0);
QWidget *w = filter.createParamWidget(Q_NULLPTR);
KUrlRequester *requester = w->findChild<KUrlRequester *>(QStringLiteral("requester"));
QVERIFY(requester);
QToolButton *toolButton = w->findChild<QToolButton *>(QStringLiteral("helpbutton"));
......@@ -64,7 +64,7 @@ void FilterActionWithUrlTest::shouldHaveDefaultValue()
void FilterActionWithUrlTest::shouldClearWidget()
{
TestFilterActionWithUrl filter;
QWidget *w = filter.createParamWidget(0);
QWidget *w = filter.createParamWidget(Q_NULLPTR);
KUrlRequester *requester = w->findChild<KUrlRequester *>(QStringLiteral("requester"));
requester->setUrl(QUrl::fromLocalFile("/foo/bla"));
QVERIFY(!requester->url().isEmpty());
......@@ -75,7 +75,7 @@ void FilterActionWithUrlTest::shouldClearWidget()
void FilterActionWithUrlTest::shouldAddValue()
{
TestFilterActionWithUrl filter;
QWidget *w = filter.createParamWidget(0);
QWidget *w = filter.createParamWidget(Q_NULLPTR);
KUrlRequester *requester = w->findChild<KUrlRequester *>(QStringLiteral("requester"));
filter.argsFromString(QStringLiteral("/foo"));
filter.setParamWidgetValue(w);
......@@ -85,7 +85,7 @@ void FilterActionWithUrlTest::shouldAddValue()
void FilterActionWithUrlTest::shouldApplyValue()
{
TestFilterActionWithUrl filter;
QWidget *w = filter.createParamWidget(0);
QWidget *w = filter.createParamWidget(Q_NULLPTR);
filter.argsFromString(QStringLiteral("foo"));
filter.setParamWidgetValue(w);
filter.applyParamWidgetValue(w);
......@@ -109,7 +109,7 @@ void FilterActionWithUrlTest::shouldTestUrl()
QFETCH(QString, urlstr);
QFETCH(QString, output);
TestFilterActionWithUrl filter;
QWidget *w = filter.createParamWidget(0);
QWidget *w = filter.createParamWidget(Q_NULLPTR);
filter.argsFromString(urlstr);
filter.setParamWidgetValue(w);
filter.applyParamWidgetValue(w);
......
......@@ -65,7 +65,7 @@ QString FilterAction::informationAboutNotValidAction() const
FilterAction *FilterAction::newAction()
{
return 0;
return Q_NULLPTR;
}
QWidget *FilterAction::createParamWidget(QWidget *parent) const
......
......@@ -35,7 +35,7 @@ FilterAction *FilterActionAddTag::newAction()
FilterActionAddTag::FilterActionAddTag(QObject *parent)
: FilterAction(QStringLiteral("add tag"), i18n("Add Tag"), parent),
mComboBox(0)
mComboBox(Q_NULLPTR)
{
mList = FilterManager::instance()->tagList();
connect(FilterManager::instance(), &FilterManager::tagListingFinished, this, &FilterActionAddTag::slotTagListingFinished);
......
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