Commit 8f18b44f authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

use nullptr

parent b909f5a6
......@@ -54,7 +54,7 @@ void DialPhoneNumberAction::dialNumber(const KContacts::PhoneNumber &number)
// synchronize
ContactActionsSettings::self()->load();
QDialer *dialer = NULL;
QDialer *dialer = nullptr;
// we handle skype separated
if (ContactActionsSettings::self()->dialPhoneNumberAction() == ContactActionsSettings::UseSkype) {
dialer = new QSkypeDialer(QStringLiteral("AkonadiContacts"));
......@@ -65,7 +65,7 @@ void DialPhoneNumberAction::dialNumber(const KContacts::PhoneNumber &number)
}
if (dialer) {
if (!dialer->dialNumber(strippedDialNumber(number.number().trimmed()))) {
KMessageBox::sorry(0, dialer->errorMessage());
KMessageBox::sorry(nullptr, dialer->errorMessage());
}
delete dialer;
return;
......@@ -74,7 +74,7 @@ void DialPhoneNumberAction::dialNumber(const KContacts::PhoneNumber &number)
QString command = ContactActionsSettings::self()->phoneCommand();
if (command.isEmpty()) {
KMessageBox::sorry(0, i18n("There is no application set which could be executed.\nPlease go to the settings dialog and configure one."));
KMessageBox::sorry(nullptr, i18n("There is no application set which could be executed.\nPlease go to the settings dialog and configure one."));
return;
}
......@@ -85,5 +85,5 @@ void DialPhoneNumberAction::dialNumber(const KContacts::PhoneNumber &number)
command = command.replace(QStringLiteral("%N"), number.number());
command = command.replace(QStringLiteral("%n"), strippedDialNumber(number.number().trimmed()));
KRun::runCommand(command, 0);
KRun::runCommand(command, nullptr);
}
......@@ -66,7 +66,7 @@ static QDBusInterface *searchEkigaDBusInterface()
}
QEkigaDialer::QEkigaDialer(const QString &applicationName)
: QDialer(applicationName), mInterface(0)
: QDialer(applicationName), mInterface(nullptr)
{
}
......@@ -101,7 +101,7 @@ bool QEkigaDialer::initializeEkiga()
if (!mInterface->isValid()) {
delete mInterface;
mInterface = 0;
mInterface = nullptr;
mErrorMessage = i18n("Ekiga Public API (D-Bus) seems to be disabled.");
return false;
......
......@@ -64,7 +64,7 @@ static QDBusInterface *searchSkypeDBusInterface()
}
QSkypeDialer::QSkypeDialer(const QString &applicationName)
: QDialer(applicationName), mInterface(0)
: QDialer(applicationName), mInterface(nullptr)
{
}
......@@ -103,7 +103,7 @@ bool QSkypeDialer::initializeSkype()
if (!mInterface->isValid()) {
delete mInterface;
mInterface = 0;
mInterface = nullptr;
mErrorMessage = i18n("Skype Public API (D-Bus) seems to be disabled.");
return false;
......@@ -112,7 +112,7 @@ bool QSkypeDialer::initializeSkype()
QDBusReply<QString> reply = mInterface->call(QStringLiteral("Invoke"), QStringLiteral("NAME %1").arg(mApplicationName));
if (reply.value() != QLatin1String("OK")) {
delete mInterface;
mInterface = 0;
mInterface = nullptr;
mErrorMessage = i18n("Skype registration failed.");
return false;
......@@ -121,7 +121,7 @@ bool QSkypeDialer::initializeSkype()
reply = mInterface->call(QStringLiteral("Invoke"), QStringLiteral("PROTOCOL 1"));
if (reply.value() != QLatin1String("PROTOCOL 1")) {
delete mInterface;
mInterface = 0;
mInterface = nullptr;
mErrorMessage = i18n("Protocol mismatch.");
return false;
......
......@@ -57,7 +57,7 @@ void SendSmsAction::sendSms(const KContacts::PhoneNumber &phoneNumber)
QString command = ContactActionsSettings::self()->smsCommand();
if (command.isEmpty()) {
KMessageBox::sorry(0, i18n("There is no application set which could be executed.\nPlease go to the settings dialog and configure one."));
KMessageBox::sorry(nullptr, i18n("There is no application set which could be executed.\nPlease go to the settings dialog and configure one."));
return;
}
......@@ -66,7 +66,7 @@ void SendSmsAction::sendSms(const KContacts::PhoneNumber &phoneNumber)
delete dlg;
return;
}
const QString message = (dlg != 0 ? dlg->message() : QString());
const QString message = (dlg != nullptr ? dlg->message() : QString());
delete dlg;
// we handle skype separated
......@@ -76,7 +76,7 @@ void SendSmsAction::sendSms(const KContacts::PhoneNumber &phoneNumber)
// I'm not sure whether here should be a notification.
// Skype can do a notification itself if whished.
} else {
KMessageBox::sorry(0, dialer.errorMessage());
KMessageBox::sorry(nullptr, dialer.errorMessage());
}
return;
......@@ -91,5 +91,5 @@ void SendSmsAction::sendSms(const KContacts::PhoneNumber &phoneNumber)
command = command.replace(QStringLiteral("%t"), message);
//Bug: 293232 In KDE3 We used %F to replace text
command = command.replace(QStringLiteral("%F"), message);
KRun::runCommand(command, 0);
KRun::runCommand(command, nullptr);
}
......@@ -56,7 +56,7 @@ void ShowAddressAction::showAddress(const KContacts::Address &address)
replaceArguments(commandTemplate, address);
if (!commandTemplate.isEmpty()) {
KRun::runCommand(commandTemplate, 0);
KRun::runCommand(commandTemplate, nullptr);
}
} else if (ContactActionsSettings::self()->showAddressAction() == ContactActionsSettings::UseGooglemap) {
QString urlTemplate = QStringLiteral("https://maps.google.com/maps?q=%s,%l,%c");
......
......@@ -35,7 +35,7 @@ using namespace Akonadi;
ContactDefaultActions::ContactDefaultActions(QObject *parent)
: QObject(parent)
, d(0)
, d(nullptr)
{
}
......
......@@ -50,13 +50,13 @@ public:
Private(ContactEditor::Mode mode, ContactEditor::DisplayMode displayMode, AbstractContactEditorWidget *editorWidget, ContactEditor *parent)
: mParent(parent)
, mMode(mode)
, mMonitor(0)
, mMonitor(nullptr)
, mReadOnly(false)
{
if (editorWidget) {
mEditorWidget = editorWidget;
} else {
mEditorWidget = new ContactEditorWidget(displayMode == FullMode ? ContactEditorWidget::FullMode : ContactEditorWidget::VCardMode, 0);
mEditorWidget = new ContactEditorWidget(displayMode == FullMode ? ContactEditorWidget::FullMode : ContactEditorWidget::VCardMode, nullptr);
}
QVBoxLayout *layout = new QVBoxLayout(mParent);
......@@ -204,7 +204,7 @@ void ContactEditor::Private::setupMonitor()
ContactEditor::ContactEditor(Mode mode, QWidget *parent)
: QWidget(parent)
, d(new Private(mode, FullMode, 0, this))
, d(new Private(mode, FullMode, nullptr, this))
{
}
......@@ -216,7 +216,7 @@ ContactEditor::ContactEditor(Mode mode, AbstractContactEditorWidget *editorWidge
ContactEditor::ContactEditor(Mode mode, DisplayMode displayMode, QWidget *parent)
: QWidget(parent)
, d(new Private(mode, displayMode, 0, this))
, d(new Private(mode, displayMode, nullptr, this))
{
}
......
......@@ -46,7 +46,7 @@ public:
Private(ContactEditorDialog::Mode mode, ContactEditorDialog::DisplayMode displaymode, AbstractContactEditorWidget *editorWidget,
ContactEditorDialog *parent)
: q(parent)
, mAddressBookBox(0)
, mAddressBookBox(nullptr)
, mMode(mode)
{
q->setWindowTitle(mode == ContactEditorDialog::CreateMode ? i18n("New Contact") : i18n("Edit Contact"));
......@@ -137,7 +137,7 @@ public:
ContactEditorDialog::ContactEditorDialog(Mode mode, QWidget *parent)
: QDialog(parent)
, d(new Private(mode, FullMode, 0, this))
, d(new Private(mode, FullMode, nullptr, this))
{
}
......@@ -149,7 +149,7 @@ ContactEditorDialog::ContactEditorDialog(Mode mode, AbstractContactEditorWidget
ContactEditorDialog::ContactEditorDialog(Mode mode, DisplayMode displayMode, QWidget *parent)
: QDialog(parent)
, d(new Private(mode, displayMode, 0, this))
, d(new Private(mode, displayMode, nullptr, this))
{
}
......
......@@ -47,9 +47,9 @@ using namespace Akonadi;
ContactGroupEditor::Private::Private(ContactGroupEditor *parent)
: mParent(parent)
, mMonitor(0)
, mMonitor(nullptr)
, mReadOnly(false)
, mGroupModel(0)
, mGroupModel(nullptr)
{
}
......
......@@ -116,7 +116,7 @@ public:
Private()
: mButtonSize(16, 16)
, mIcon(QIcon::fromTheme(QStringLiteral("list-remove")))
, mItemView(0)
, mItemView(nullptr)
{
}
......
......@@ -45,8 +45,8 @@ class Q_DECL_HIDDEN ContactGroupEditorDialog::Private
public:
Private(ContactGroupEditorDialog *qq, ContactGroupEditorDialog::Mode mode)
: q(qq)
, mAddressBookBox(0)
, mEditor(0)
, mAddressBookBox(nullptr)
, mEditor(nullptr)
, mMode(mode)
, okButton(nullptr)
{
......
......@@ -35,7 +35,7 @@
ContactGroupLineEdit::ContactGroupLineEdit(QWidget *parent)
: QLineEdit(parent)
, mCompleter(0)
, mCompleter(nullptr)
, mContainsReference(false)
{
setClearButtonEnabled(true);
......
......@@ -47,8 +47,8 @@ class Q_DECL_HIDDEN ContactGroupViewer::Private
public:
Private(ContactGroupViewer *parent)
: mParent(parent)
, mExpandJob(0)
, mParentCollectionFetchJob(0)
, mExpandJob(nullptr)
, mParentCollectionFetchJob(nullptr)
{
mBrowser = new TextBrowser;
......@@ -105,7 +105,7 @@ public:
void _k_expandResult(KJob *job)
{
mExpandJob = 0;
mExpandJob = nullptr;
if (!job->error()) {
ContactGroupExpandJob *expandJob = qobject_cast<ContactGroupExpandJob *>(job);
......@@ -116,7 +116,7 @@ public:
if (mParentCollectionFetchJob) {
mParent->disconnect(mParentCollectionFetchJob, SIGNAL(result(KJob*)), mParent, SLOT(slotParentCollectionFetched(KJob*)));
delete mParentCollectionFetchJob;
mParentCollectionFetchJob = 0;
mParentCollectionFetchJob = nullptr;
}
mParentCollectionFetchJob = new CollectionFetchJob(mCurrentItem.parentCollection(), CollectionFetchJob::Base, mParent);
......@@ -125,7 +125,7 @@ public:
void slotParentCollectionFetched(KJob *job)
{
mParentCollectionFetchJob = 0;
mParentCollectionFetchJob = nullptr;
mCurrentAddressBookName.clear();
if (!job->error()) {
......@@ -185,7 +185,7 @@ void ContactGroupViewer::setContactGroup(const Akonadi::Item &group)
void ContactGroupViewer::setContactGroupFormatter(AbstractContactGroupFormatter *formatter)
{
if (formatter == 0) {
if (formatter == nullptr) {
d->mContactGroupFormatter = d->mStandardContactGroupFormatter;
} else {
d->mContactGroupFormatter = formatter;
......
......@@ -36,7 +36,7 @@ class Q_DECL_HIDDEN ContactsFilterProxyModel::Private
{
public:
Private()
: flags(0)
: flags(nullptr)
, mExcludeVirtualCollections(false)
{
}
......@@ -139,7 +139,7 @@ Qt::ItemFlags ContactsFilterProxyModel::flags(const QModelIndex &index) const
{
if (!index.isValid()) {
// Don't crash
return 0;
return nullptr;
}
const Akonadi::Collection collection = index.data(Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>();
if (collection.isValid()) {
......
......@@ -55,7 +55,7 @@ public:
Private(ContactViewer *parent)
: mParent(parent)
, mBrowser(nullptr)
, mParentCollectionFetchJob(0)
, mParentCollectionFetchJob(nullptr)
{
mStandardContactFormatter = new StandardContactFormatter;
mContactFormatter = mStandardContactFormatter;
......@@ -243,7 +243,7 @@ public:
void slotParentCollectionFetched(KJob *job)
{
mParentCollectionFetchJob = 0;
mParentCollectionFetchJob = nullptr;
QString addressBookName;
......@@ -313,12 +313,12 @@ KContacts::Addressee ContactViewer::rawContact() const
void ContactViewer::setContactFormatter(AbstractContactFormatter *formatter)
{
if (formatter == 0) {
if (formatter == nullptr) {
d->mContactFormatter = d->mStandardContactFormatter;
} else {
d->mContactFormatter = formatter;
delete d->mStandardContactFormatter;
d->mStandardContactFormatter = 0;
d->mStandardContactFormatter = nullptr;
}
}
......@@ -347,7 +347,7 @@ void ContactViewer::itemChanged(const Item &contactItem)
if (d->mParentCollectionFetchJob) {
disconnect(d->mParentCollectionFetchJob, SIGNAL(result(KJob*)), this, SLOT(slotParentCollectionFetched(KJob*)));
delete d->mParentCollectionFetchJob;
d->mParentCollectionFetchJob = 0;
d->mParentCollectionFetchJob = nullptr;
}
d->mParentCollectionFetchJob = new CollectionFetchJob(contactItem.parentCollection(), CollectionFetchJob::Base, this);
......
......@@ -39,7 +39,7 @@ class Q_DECL_HIDDEN ContactViewerDialog::Private
public:
Private(ContactViewerDialog *parent)
: q(parent)
, mViewer(0)
, mViewer(nullptr)
{
}
......
......@@ -116,7 +116,7 @@ QImage ImageLoader::loadImage(const QUrl &url, bool *ok, bool selectPictureSize)
ImageWidget::ImageWidget(Type type, QWidget *parent)
: QPushButton(parent)
, mImageLoader(0)
, mImageLoader(nullptr)
, mType(type)
, mHasImage(false)
, mReadOnly(false)
......
......@@ -79,7 +79,7 @@ public:
EmailAddressSelectionDialog::EmailAddressSelectionDialog(QWidget *parent)
: QDialog(parent)
, d(new Private(this, 0))
, d(new Private(this, nullptr))
{
}
......
......@@ -176,7 +176,7 @@ void EmailAddressSelectionWidget::Private::init()
EmailAddressSelectionWidget::EmailAddressSelectionWidget(QWidget *parent)
: QWidget(parent)
, d(new Private(true, this, 0))
, d(new Private(true, this, nullptr))
{
}
......
......@@ -45,8 +45,8 @@ public:
Private(KActionCollection *actionCollection, QWidget *parentWidget, StandardContactActionManager *parent)
: mActionCollection(actionCollection)
, mParentWidget(parentWidget)
, mCollectionSelectionModel(0)
, mItemSelectionModel(0)
, mCollectionSelectionModel(nullptr)
, mItemSelectionModel(nullptr)
, mParent(parent)
{
mGenericManager = new StandardActionManager(actionCollection, parentWidget);
......@@ -641,7 +641,7 @@ QAction *StandardContactActionManager::action(Type type) const
return d->mActions.value(type);
}
return 0;
return nullptr;
}
QAction *StandardContactActionManager::action(StandardActionManager::Type type) const
......
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