Commit fc142a54 authored by David Jarvie's avatar David Jarvie

Reinstate 0 instead of Q_NULLPTR for non-pointer types

parent 72d8c523
......@@ -252,7 +252,7 @@ void AlarmTimeWidget::init(Mode mode, const QString& title)
void AlarmTimeWidget::setReadOnly(bool ro)
{
mAtTimeRadio->setReadOnly(ro);
mDateEdit->setOptions(ro ? KDateComboBox::Options(Q_NULLPTR) : KDateComboBox::EditDate | KDateComboBox::SelectDate | KDateComboBox::DatePicker);
mDateEdit->setOptions(ro ? KDateComboBox::Options(0) : KDateComboBox::EditDate | KDateComboBox::SelectDate | KDateComboBox::DatePicker);
mTimeEdit->setReadOnly(ro);
if (mAnyTimeCheckBox)
mAnyTimeCheckBox->setReadOnly(ro);
......
......@@ -234,7 +234,7 @@ BirthdayDlg::BirthdayDlg(QWidget* parent)
Preferences::defaultSoundVolume(), -1, 0, Preferences::defaultSoundRepeat());
if (mSpecialActionsButton)
{
KAEvent::ExtraActionOptions opts(Q_NULLPTR);
KAEvent::ExtraActionOptions opts(0);
if (Preferences::defaultExecPreActionOnDeferral())
opts |= KAEvent::ExecPreActOnDeferral;
if (Preferences::defaultCancelOnPreActionError())
......
......@@ -137,7 +137,7 @@ bool CalendarMigrator::mCompleted = false;
CalendarMigrator::CalendarMigrator(QObject* parent)
: QObject(parent),
mExistingAlarmTypes(Q_NULLPTR)
mExistingAlarmTypes(0)
{
}
......
......@@ -759,8 +759,8 @@ CalEvent::Types CollectionControlModel::setEnabled(const Collection& collection,
CalEvent::Types CollectionControlModel::setEnabledStatus(const Collection& collection, CalEvent::Types types, bool inserted)
{
qCDebug(KALARM_LOG) << "id:" << collection.id() << ", types=" << types;
CalEvent::Types disallowedStdTypes(Q_NULLPTR);
CalEvent::Types stdTypes(Q_NULLPTR);
CalEvent::Types disallowedStdTypes(0);
CalEvent::Types stdTypes(0);
// Prevent the enabling of duplicate alarm types if another collection
// uses the same backend storage.
......
......@@ -457,7 +457,7 @@ KDateTime DBusHandler::convertDateTime(const QString& dateTime, const KDateTime&
*/
KAEvent::Flags DBusHandler::convertStartFlags(const KDateTime& start, unsigned flags)
{
KAEvent::Flags kaEventFlags = Q_NULLPTR;
KAEvent::Flags kaEventFlags = 0;
if (flags & REPEAT_AT_LOGIN) kaEventFlags |= KAEvent::REPEAT_AT_LOGIN;
if (flags & BEEP) kaEventFlags |= KAEvent::BEEP;
if (flags & SPEAK) kaEventFlags |= KAEvent::SPEAK;
......
......@@ -798,7 +798,7 @@ void EditAlarmDlg::setEvent(KAEvent& event, const QString& text, bool trial)
*/
KAEvent::Flags EditAlarmDlg::getAlarmFlags() const
{
KAEvent::Flags flags(Q_NULLPTR);
KAEvent::Flags flags(0);
if (mShowInKorganizer && mShowInKorganizer->isEnabled() && mShowInKorganizer->isChecked())
flags |= KAEvent::COPY_KORGANIZER;
if (mRecurrenceEdit->repeatType() == RecurrenceEdit::AT_LOGIN)
......
......@@ -36,10 +36,10 @@ class PageFrame : public QFrame
explicit PageFrame(QWidget* parent = nullptr) : QFrame(parent) { }
protected:
virtual void showEvent(QShowEvent*) override { emit shown(); }
void showEvent(QShowEvent*) override { emit shown(); }
Q_SIGNALS:
void shown();
void shown();
};
class TextEdit : public KTextEdit
......@@ -47,11 +47,11 @@ class TextEdit : public KTextEdit
Q_OBJECT
public:
explicit TextEdit(QWidget* parent);
virtual QSize sizeHint() const override { return minimumSizeHint(); }
virtual QSize minimumSizeHint() const override { return minimumSize(); }
QSize sizeHint() const override { return minimumSizeHint(); }
QSize minimumSizeHint() const override { return minimumSize(); }
protected:
virtual void dragEnterEvent(QDragEnterEvent*) override;
void dragEnterEvent(QDragEnterEvent*) override;
};
class CommandEdit : public QWidget
......@@ -65,8 +65,8 @@ class CommandEdit : public QWidget
QString text(EditAlarmDlg*, bool showErrorMessage) const;
void setText(const AlarmText&);
void setReadOnly(bool);
virtual QSize minimumSizeHint() const override;
virtual QSize sizeHint() const override { return minimumSizeHint(); }
QSize minimumSizeHint() const override;
QSize sizeHint() const override { return minimumSizeHint(); }
Q_SIGNALS:
void scriptToggled(bool);
......
......@@ -108,7 +108,7 @@ bool showFileErrMessage(const QString& filename, FileErr, FileErr
QString pathOrUrl(const QString& url);
QString browseFile(const QString& caption, QString& defaultDir, const QString& initialFile = QString(),
const QString& filter = QString(), KFile::Modes mode = Q_NULLPTR, QWidget* parent = Q_NULLPTR);
const QString& filter = QString(), KFile::Modes mode = 0, QWidget* parent = Q_NULLPTR);
bool editNewAlarm(const QString& templateName, QWidget* parent = Q_NULLPTR);
void editNewAlarm(EditAlarmDlg::Type, QWidget* parent = Q_NULLPTR);
void editNewAlarm(KAEvent::SubAction, QWidget* parent = Q_NULLPTR, const AlarmText* = Q_NULLPTR);
......
......@@ -687,7 +687,7 @@ QByteArray autoDetectCharset(const QString& text)
}
}
}
return Q_NULLPTR;
return QByteArray();
}
//-----------------------------------------------------------------------------
......
......@@ -49,13 +49,13 @@ class Label : public QLabel
* @param parent The parent object of this widget.
* @param f Flags. See QWidget constructor for details.
*/
explicit Label(QWidget* parent, Qt::WindowFlags f = Q_NULLPTR);
explicit Label(QWidget* parent, Qt::WindowFlags f = 0);
/** Constructs a label that displays @p text.
* @param text Text string to display.
* @param parent The parent object of this widget.
* @param f Flags. See QWidget constructor for details.
*/
Label(const QString& text, QWidget* parent, Qt::WindowFlags f = Q_NULLPTR);
Label(const QString& text, QWidget* parent, Qt::WindowFlags f = 0);
/** Constructs a label, with a buddy widget, that displays @p text.
* @param buddy Buddy widget which receives the keyboard focus when the
* label's accelerator key is pressed. If @p buddy is a radio
......@@ -65,7 +65,7 @@ class Label : public QLabel
* @param parent The parent object of this widget.
* @param f Flags. See QWidget constructor for details.
*/
Label(QWidget* buddy, const QString& text, QWidget* parent, Qt::WindowFlags f = Q_NULLPTR);
Label(QWidget* buddy, const QString& text, QWidget* parent, Qt::WindowFlags f = 0);
/** Sets the label's buddy widget which receives the keyboard focus when the
* label's accelerator key is pressed. If @p buddy is a radio button,
* @p buddy is in addition selected when the accelerator key is pressed.
......
......@@ -48,7 +48,7 @@ class ExtraSpinBox : public SpinBox
void painted();
protected:
virtual void paintEvent(QPaintEvent*) override;
void paintEvent(QPaintEvent*) override;
private:
int mInhibitPaintSignal;
......@@ -75,14 +75,14 @@ class SpinMirror : public QGraphicsView
void setButtonPos(const QPoint&);
protected:
virtual bool event(QEvent*) override;
virtual void resizeEvent(QResizeEvent*) override;
bool event(QEvent*) override;
void resizeEvent(QResizeEvent*) override;
virtual void styleChange(QStyle&);
virtual void mousePressEvent(QMouseEvent* e) override { mouseEvent(e); }
virtual void mouseReleaseEvent(QMouseEvent* e) override { mouseEvent(e); }
virtual void mouseMoveEvent(QMouseEvent* e) override { mouseEvent(e); }
virtual void mouseDoubleClickEvent(QMouseEvent* e) override { mouseEvent(e); }
virtual void wheelEvent(QWheelEvent*) override;
void mousePressEvent(QMouseEvent* e) override { mouseEvent(e); }
void mouseReleaseEvent(QMouseEvent* e) override { mouseEvent(e); }
void mouseMoveEvent(QMouseEvent* e) override { mouseEvent(e); }
void mouseDoubleClickEvent(QMouseEvent* e) override { mouseEvent(e); }
void wheelEvent(QWheelEvent*) override;
private:
void mouseEvent(QMouseEvent*);
......
......@@ -43,7 +43,7 @@ int main(int argc, char* argv[])
migrate.migrate();
KLocalizedString::setApplicationDomain("kalarm");
K4AboutData aboutData(PROGRAM_NAME, Q_NULLPTR, ki18n("KAlarm"), KALARM_VERSION,
K4AboutData aboutData(PROGRAM_NAME, 0, ki18n("KAlarm"), KALARM_VERSION,
ki18n("Personal alarm message, command and email scheduler for KDE"),
K4AboutData::License_GPL,
ki18n("Copyright 2001-2014, David Jarvie"), KLocalizedString(), "http://www.astrojar.org.uk/kalarm");
......
......@@ -1417,7 +1417,7 @@ void EditPrefTab::restore(bool, bool allTabs)
case TimePeriod::Minutes: index = 0; break;
}
mReminderUnits->setCurrentIndex(index);
KAEvent::ExtraActionOptions opts(Q_NULLPTR);
KAEvent::ExtraActionOptions opts(0);
if (Preferences::defaultExecPreActionOnDeferral())
opts |= KAEvent::ExecPreActOnDeferral;
if (Preferences::defaultCancelOnPreActionError())
......
......@@ -278,7 +278,7 @@ RecurrenceEdit::RecurrenceEdit(bool readOnly, QWidget* parent)
"<para><note>This applies to the main recurrence only. It does not limit any sub-repetition which will occur regardless after the last main recurrence.</note></para>"));
mRangeButtonGroup->addButton(mEndDateButton);
mEndDateEdit = new KDateComboBox(mRangeButtonBox);
mEndDateEdit->setOptions(mReadOnly ? KDateComboBox::Options(Q_NULLPTR) : KDateComboBox::EditDate | KDateComboBox::SelectDate | KDateComboBox::DatePicker);
mEndDateEdit->setOptions(mReadOnly ? KDateComboBox::Options(0) : KDateComboBox::EditDate | KDateComboBox::SelectDate | KDateComboBox::DatePicker);
static const QString tzText = i18nc("@info", "This uses the same time zone as the start time.");
mEndDateEdit->setWhatsThis(xi18nc("@info:whatsthis",
"<para>Enter the last date to repeat the alarm.</para><para>%1</para>", tzText));
......@@ -338,7 +338,7 @@ RecurrenceEdit::RecurrenceEdit(bool readOnly, QWidget* parent)
vlayout->setMargin(0);
hlayout->addLayout(vlayout);
mExceptionDateEdit = new KDateComboBox(mExceptionGroup);
mExceptionDateEdit->setOptions(mReadOnly ? KDateComboBox::Options(Q_NULLPTR) : KDateComboBox::EditDate | KDateComboBox::SelectDate | KDateComboBox::DatePicker);
mExceptionDateEdit->setOptions(mReadOnly ? KDateComboBox::Options(0) : KDateComboBox::EditDate | KDateComboBox::SelectDate | KDateComboBox::DatePicker);
mExceptionDateEdit->setDate(KDateTime::currentLocalDate());
mExceptionDateEdit->setWhatsThis(i18nc("@info:whatsthis",
"Enter a date to insert in the exceptions list. "
......
......@@ -98,9 +98,9 @@ class DayWeekRule : public Rule
void setDays(bool);
void setDays(const QBitArray& days);
void setDay(int dayOfWeek);
virtual QWidget* validate(QString& errorMessage) override;
virtual void saveState() override;
virtual bool stateChanged() const override;
QWidget* validate(QString& errorMessage) override;
void saveState() override;
bool stateChanged() const override;
private:
CheckBox* mDayBox[7];
......@@ -141,8 +141,8 @@ class MonthYearRule : public Rule
void setDate(int dayOfMonth);
void setPosition(int week, int dayOfWeek);
void setDefaultValues(int dayOfMonth, int dayOfWeek);
virtual void saveState() override;
virtual bool stateChanged() const override;
void saveState() override;
bool stateChanged() const override;
Q_SIGNALS:
void typeChanged(DayPosType);
......@@ -193,15 +193,15 @@ class YearlyRule : public MonthYearRule
void setDefaultValues(int dayOfMonth, int dayOfWeek, int month);
KARecurrence::Feb29Type feb29Type() const;
void setFeb29Type(KARecurrence::Feb29Type);
virtual QWidget* validate(QString& errorMessage) override;
virtual void saveState() override;
virtual bool stateChanged() const override;
QWidget* validate(QString& errorMessage) override;
void saveState() override;
bool stateChanged() const override;
protected:
virtual void daySelected(int day) override;
void daySelected(int day) override;
protected Q_SLOTS:
virtual void clicked(QAbstractButton*) override;
void clicked(QAbstractButton*) override;
private Q_SLOTS:
void enableFeb29();
......
......@@ -611,7 +611,7 @@ void ResourceSelector::showInfo()
name, id, calType, alarmTypeString, storage, location, perms, enabled, std);
// Display the collection information. Because the user requested
// the information, don't raise a KNotify event.
KAMessageBox::information(this, text, QString(), QString(), Q_NULLPTR);
KAMessageBox::information(this, text, QString(), QString(), 0);
}
}
......
......@@ -48,7 +48,7 @@
SpecialActionsButton::SpecialActionsButton(bool enableCheckboxes, QWidget* parent)
: QPushButton(i18nc("@action:button", "Special Actions..."), parent),
mOptions(Q_NULLPTR),
mOptions(0),
mEnableCheckboxes(enableCheckboxes),
mReadOnly(false)
{
......@@ -248,7 +248,7 @@ QString SpecialActions::postAction() const
KAEvent::ExtraActionOptions SpecialActions::options() const
{
KAEvent::ExtraActionOptions opts = Q_NULLPTR;
KAEvent::ExtraActionOptions opts = 0;
if (mExecOnDeferral->isChecked()) opts |= KAEvent::ExecPreActOnDeferral;
if (mCancelOnError->isChecked()) opts |= KAEvent::CancelOnPreActError;
if (mDontShowError->isChecked()) opts |= KAEvent::DontShowPreActError;
......
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