Commit 2f0f7be3 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use Q_REQUIRED_RESULT + const'ify pointer

parent c00699cc
Pipeline #194091 passed with stage
in 12 minutes and 12 seconds
......@@ -38,11 +38,11 @@ using namespace CalendarSupport;
ArchiveDialog::ArchiveDialog(const Akonadi::ETMCalendar::Ptr &cal, Akonadi::IncidenceChanger *changer, QWidget *parent)
: QDialog(parent)
, mUser1Button(new QPushButton(this))
{
setWindowTitle(i18nc("@title:window", "Archive/Delete Past Events and To-dos"));
auto mainLayout = new QVBoxLayout(this);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel, this);
mUser1Button = new QPushButton(this);
buttonBox->addButton(mUser1Button, QDialogButtonBox::ActionRole);
connect(buttonBox, &QDialogButtonBox::rejected, this, &ArchiveDialog::reject);
mUser1Button->setDefault(true);
......
......@@ -57,6 +57,6 @@ private:
QCheckBox *mTodos = nullptr;
Akonadi::IncidenceChanger *mChanger = nullptr;
Akonadi::ETMCalendar::Ptr mCalendar;
QPushButton *mUser1Button = nullptr;
QPushButton *const mUser1Button;
};
}
......@@ -48,7 +48,7 @@ protected:
int depth() const override;
private:
QComboBox *mBox = nullptr;
QComboBox *const mBox;
int mCurrentDepth = 0;
};
......
......@@ -36,10 +36,10 @@ private:
/** Splits period blocks in the provided list, so that each period occurs on one day */
KCalendarCore::Period::List splitPeriodsByDay(const KCalendarCore::Period::List &freePeriods);
QString day(int index) const;
QString date(int index) const;
QString stringify(int index) const;
QString tooltipify(int index) const;
Q_REQUIRED_RESULT QString day(int index) const;
Q_REQUIRED_RESULT QString date(int index) const;
Q_REQUIRED_RESULT QString stringify(int index) const;
Q_REQUIRED_RESULT QString tooltipify(int index) const;
KCalendarCore::Period::List mPeriodList;
friend class FreePeriodModelTest;
......
......@@ -28,6 +28,7 @@ QAbstractItemModel *NoteEditDialog::_k_noteEditStubModel = nullptr;
NoteEditDialog::NoteEditDialog(QWidget *parent)
: QDialog(parent)
, mNoteTitle(new QLineEdit(this))
{
setAttribute(Qt::WA_DeleteOnClose);
setWindowTitle(i18nc("@title:window", "Create Note"));
......@@ -55,7 +56,6 @@ NoteEditDialog::NoteEditDialog(QWidget *parent)
hbox->setContentsMargins(0, 0, 0, 0);
hbox->setSpacing(2);
mNoteTitle = new QLineEdit(this);
mNoteTitle->setClearButtonEnabled(true);
mNoteTitle->setObjectName(QStringLiteral("notetitle"));
mNoteTitle->setFocus();
......
......@@ -62,7 +62,7 @@ private:
void writeConfig();
Akonadi::Collection mCollection;
Akonadi::Item mItem;
QLineEdit *mNoteTitle = nullptr;
QLineEdit *const mNoteTitle;
QPushButton *mOkButton = nullptr;
KPIMTextEdit::RichTextEditorWidget *mNoteText = nullptr;
Akonadi::CollectionComboBox *mCollectionCombobox = nullptr;
......
......@@ -128,27 +128,27 @@ class CalPrintDay : public CalPrintTimetable
public:
CalPrintDay();
~CalPrintDay() override;
QString groupName() const override
Q_REQUIRED_RESULT QString groupName() const override
{
return QStringLiteral("Print day");
}
QString description() const override
Q_REQUIRED_RESULT QString description() const override
{
return i18n("Print da&y");
}
QString info() const override
Q_REQUIRED_RESULT QString info() const override
{
return i18n("Prints all events of a single day on one page");
}
int sortID() const override
Q_REQUIRED_RESULT int sortID() const override
{
return CalPrinterBase::Day;
}
bool enabled() const override
Q_REQUIRED_RESULT bool enabled() const override
{
return true;
}
......
Supports Markdown
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