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

Const'ify pointer here too

parent b392df79
Pipeline #57909 passed with stage
in 39 minutes and 32 seconds
......@@ -24,7 +24,7 @@ protected:
Q_REQUIRED_RESULT QString getErrorString(SendLaterJob::Error code, const QString &detail) const override;
private:
SendLaterInfo mInfo;
const SendLaterInfo mInfo;
};
}
......@@ -24,7 +24,7 @@ protected:
Q_REQUIRED_RESULT QString getErrorString(Error error, const QString &detail) const override;
private:
Akonadi::Item::Id mItem;
const Akonadi::Item::Id mItem;
};
}
......@@ -17,26 +17,26 @@ using namespace MessageComposer;
SendLaterTimeDateWidget::SendLaterTimeDateWidget(QWidget *parent)
: QWidget(parent)
, mTimeComboBox(new KTimeComboBox(this))
, mDateComboBox(new KDateComboBox(this))
{
auto lay = new QHBoxLayout(this);
lay->setContentsMargins({});
QDateTime t = QDateTime::currentDateTime();
t = t.addSecs(60 * 60);
mTimeComboBox.reset(new KTimeComboBox);
connect(mTimeComboBox.get(), &KTimeComboBox::timeChanged, this, &SendLaterTimeDateWidget::slotDateTimeChanged);
connect(mTimeComboBox, &KTimeComboBox::timeChanged, this, &SendLaterTimeDateWidget::slotDateTimeChanged);
mTimeComboBox->setObjectName(QStringLiteral("time_sendlater"));
mDateComboBox.reset(new KDateComboBox);
mDateComboBox->setOptions(KDateComboBox::EditDate | KDateComboBox::SelectDate | KDateComboBox::DatePicker | KDateComboBox::DateKeywords
| KDateComboBox::WarnOnInvalid);
mDateComboBox->setObjectName(QStringLiteral("date_sendlater"));
connect(mDateComboBox->lineEdit(), &QLineEdit::textChanged, this, &SendLaterTimeDateWidget::dateChanged);
mDateComboBox->setMinimumDate(t.date(), i18n("You cannot select a date prior to the current date."));
connect(mDateComboBox.get(), &KDateComboBox::dateChanged, this, &SendLaterTimeDateWidget::slotDateTimeChanged);
connect(mDateComboBox, &KDateComboBox::dateChanged, this, &SendLaterTimeDateWidget::slotDateTimeChanged);
lay->addWidget(mDateComboBox.get());
lay->addWidget(mTimeComboBox.get());
lay->addWidget(mDateComboBox);
lay->addWidget(mTimeComboBox);
}
SendLaterTimeDateWidget::~SendLaterTimeDateWidget() = default;
......
......@@ -9,8 +9,6 @@
#include <QDateTime>
#include <QWidget>
#include <memory>
class KTimeComboBox;
class KDateComboBox;
......@@ -33,8 +31,8 @@ Q_SIGNALS:
private:
void slotDateTimeChanged();
std::unique_ptr<KTimeComboBox> mTimeComboBox;
std::unique_ptr<KDateComboBox> mDateComboBox;
KTimeComboBox *const mTimeComboBox;
KDateComboBox *const mDateComboBox;
};
}
......@@ -22,7 +22,7 @@ class MESSAGECOMPOSER_EXPORT ConvertSnippetVariableMenu : public QObject
public:
explicit ConvertSnippetVariableMenu(bool onlyMenuForCustomizeAttachmentFileName, QWidget *parentWidget, QObject *parent = nullptr);
~ConvertSnippetVariableMenu() override;
QMenu *menu() const;
Q_REQUIRED_RESULT QMenu *menu() const;
Q_SIGNALS:
void insertVariable(MessageComposer::ConvertSnippetVariablesUtil::VariableType type);
......
......@@ -25,6 +25,7 @@ using namespace MessageComposer;
Composer::Composer(QWidget *parent)
: QWidget(parent)
, mRecipients(new RecipientsEditor(this))
{
auto topLayout = new QGridLayout(this);
topLayout->setContentsMargins(4, 4, 4, 4);
......@@ -35,7 +36,6 @@ Composer::Composer(QWidget *parent)
auto edit = new QLineEdit(this);
topLayout->addWidget(edit, 0, 1);
mRecipients = new RecipientsEditor(this);
topLayout->addWidget(mRecipients, 1, 0, 1, 2);
qDebug() << "SIZEHINT:" << mRecipients->sizeHint();
......
......@@ -18,12 +18,12 @@ class Composer : public QWidget
{
Q_OBJECT
public:
Composer(QWidget *parent);
explicit Composer(QWidget *parent);
public Q_SLOTS:
void slotClose();
private:
MessageComposer::RecipientsEditor *mRecipients = nullptr;
MessageComposer::RecipientsEditor *const mRecipients;
};
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