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

Const'ify pointer

parent 0046f988
Pipeline #60303 passed with stage
in 53 minutes and 5 seconds
......@@ -20,8 +20,8 @@ AttendeeSelector::AttendeeSelector(QWidget *parent)
{
setWindowTitle(i18nc("@title:window", "Select Attendees"));
auto mainLayout = new QVBoxLayout(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
QWidget *mainWidget = new QWidget(this);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
auto mainWidget = new QWidget(this);
mainLayout->addWidget(mainWidget);
mOkButton = buttonBox->button(QDialogButtonBox::Ok);
mOkButton->setDefault(true);
......
......@@ -19,26 +19,26 @@
DelegateSelector::DelegateSelector(QWidget *parent)
: QDialog(parent)
, mDelegate(new PimCommon::AddresseeLineEdit(this))
, mRsvp(new QCheckBox(i18n("Keep me informed about status changes of this incidence."), this))
{
setWindowTitle(i18nc("@title:window", "Select delegate"));
auto mainLayout = new QVBoxLayout(this);
QLabel *label = new QLabel(i18n("Delegate:"), this);
auto label = new QLabel(i18n("Delegate:"), this);
label->setObjectName(QStringLiteral("label"));
mainLayout->addWidget(label);
mDelegate = new PimCommon::AddresseeLineEdit(this);
mDelegate->setObjectName(QStringLiteral("delegate"));
mainLayout->addWidget(mDelegate);
connect(mDelegate, &PimCommon::AddresseeLineEdit::textChanged, this, &DelegateSelector::slotTextChanged);
mRsvp = new QCheckBox(i18n("Keep me informed about status changes of this incidence."), this);
mRsvp->setObjectName(QStringLiteral("informcheckbox"));
mRsvp->setChecked(true);
mainLayout->addWidget(mRsvp);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
buttonBox->setObjectName(QStringLiteral("buttonbox"));
mOkButton = buttonBox->button(QDialogButtonBox::Ok);
mOkButton->setObjectName(QStringLiteral("okbutton"));
......
......@@ -31,8 +31,8 @@ public:
private:
void slotTextChanged(const QString &text);
PimCommon::AddresseeLineEdit *mDelegate = nullptr;
QCheckBox *mRsvp = nullptr;
PimCommon::AddresseeLineEdit *const mDelegate;
QCheckBox *const mRsvp;
QPushButton *mOkButton = nullptr;
};
......@@ -19,7 +19,7 @@ class MemoryCalendarMemento : public QObject, public MimeTreeParser::Interface::
public:
MemoryCalendarMemento();
bool finished() const;
Q_REQUIRED_RESULT bool finished() const;
Akonadi::CalendarBase::Ptr calendar() const;
void detach() override;
......
......@@ -17,6 +17,7 @@
ReactionToInvitationDialog::ReactionToInvitationDialog(QWidget *parent)
: QDialog(parent)
, mPlainTextEditor(new KPIMTextEdit::PlainTextEditorWidget(this))
{
auto layout = new QVBoxLayout(this);
layout->setObjectName(QStringLiteral("layout"));
......@@ -25,7 +26,6 @@ ReactionToInvitationDialog::ReactionToInvitationDialog(QWidget *parent)
label->setObjectName(QStringLiteral("label"));
layout->addWidget(label);
mPlainTextEditor = new KPIMTextEdit::PlainTextEditorWidget(this);
mPlainTextEditor->setObjectName(QStringLiteral("plaintexteditor"));
layout->addWidget(mPlainTextEditor);
connect(mPlainTextEditor->editor(), &KPIMTextEdit::PlainTextEditor::textChanged, this, &ReactionToInvitationDialog::slotTextChanged);
......
......@@ -19,13 +19,13 @@ public:
explicit ReactionToInvitationDialog(QWidget *parent = nullptr);
~ReactionToInvitationDialog() override;
QString comment() const;
Q_REQUIRED_RESULT QString comment() const;
private:
void slotTextChanged();
void writeConfig();
void readConfig();
KPIMTextEdit::PlainTextEditorWidget *mPlainTextEditor = nullptr;
KPIMTextEdit::PlainTextEditorWidget *const mPlainTextEditor;
QPushButton *mOkButton = nullptr;
};
......@@ -26,8 +26,8 @@ public Q_SLOTS:
void onITipMessageProcessed(Akonadi::ITIPHandler::Result, const QString &errorMessage);
public:
QString errorMessage() const;
Akonadi::ITIPHandler::Result result() const;
Q_REQUIRED_RESULT QString errorMessage() const;
Q_REQUIRED_RESULT Akonadi::ITIPHandler::Result result() const;
private:
QString m_errorMessage;
......
......@@ -27,6 +27,6 @@ private:
Published,
};
QString render(const GnuPGWKSMessagePart &mp, WKSStatus status) const;
Q_REQUIRED_RESULT QString render(const GnuPGWKSMessagePart &mp, WKSStatus status) const;
};
......@@ -37,15 +37,15 @@ public:
~GnuPGWKSMessagePart() override = default;
ConfirmationType confirmationType() const;
QString sender() const;
QString address() const;
QString fingerprint() const;
QString nonce() const;
Q_REQUIRED_RESULT ConfirmationType confirmationType() const;
Q_REQUIRED_RESULT QString sender() const;
Q_REQUIRED_RESULT QString address() const;
Q_REQUIRED_RESULT QString fingerprint() const;
Q_REQUIRED_RESULT QString nonce() const;
protected:
void parseContent(KMime::Content *node);
ConfirmationType stringToType(const QStringRef &str);
Q_REQUIRED_RESULT ConfirmationType stringToType(const QStringRef &str);
QString mSender;
QString mAddress;
......
......@@ -25,6 +25,6 @@ public:
private:
bool sendConfirmation(MessageViewer::Viewer *viewerInstance, const GnuPGWKSMessagePart &mp) const;
QByteArray createConfirmation(const KMime::Message::Ptr &msg) const;
Q_REQUIRED_RESULT QByteArray createConfirmation(const KMime::Message::Ptr &msg) const;
};
......@@ -20,6 +20,6 @@ public:
bool render(const MimeTreeParser::MessagePartPtr &msgPart, MessageViewer::HtmlWriter *htmlWriter, MessageViewer::RenderContext *context) const override;
private:
QString render(const PgpKeyMessagePart &mp) const;
Q_REQUIRED_RESULT QString render(const PgpKeyMessagePart &mp) const;
};
......@@ -24,13 +24,13 @@ public:
PgpKeyMemento();
~PgpKeyMemento() override;
bool isRunning() const;
Q_REQUIRED_RESULT bool isRunning() const;
void setRunning(bool running);
GpgME::Key key() const;
QString error() const;
Q_REQUIRED_RESULT GpgME::Key key() const;
Q_REQUIRED_RESULT QString error() const;
bool start(const QString &fingerprint);
Q_REQUIRED_RESULT bool start(const QString &fingerprint);
void exec(const QString &fingerprint);
void detach() override;
......
......@@ -32,21 +32,21 @@ public:
explicit PgpKeyMessagePart(MimeTreeParser::Interface::BodyPart *part);
~PgpKeyMessagePart() override = default;
QDateTime keyDate() const;
QString userID() const;
QString keyID() const;
QString fingerprint() const;
Q_REQUIRED_RESULT QDateTime keyDate() const;
Q_REQUIRED_RESULT QString userID() const;
Q_REQUIRED_RESULT QString keyID() const;
Q_REQUIRED_RESULT QString fingerprint() const;
QString error() const;
Q_REQUIRED_RESULT QString error() const;
void setError(const QString &error);
void setKey(const GpgME::Key &key);
GpgME::Key key() const;
Q_REQUIRED_RESULT GpgME::Key key() const;
QByteArray rawKey() const;
Q_REQUIRED_RESULT QByteArray rawKey() const;
void setSearchRunning(bool searchRunning);
bool searchRunning() const;
Q_REQUIRED_RESULT bool searchRunning() const;
protected:
void parseContent(KMime::Content *node);
......
......@@ -20,7 +20,7 @@ public:
QString name;
};
QVector<Device> devices() const;
Q_REQUIRED_RESULT QVector<Device> devices() const;
void sendToDevice(const QString &fileName, const QString &deviceId);
};
......
......@@ -39,19 +39,19 @@ public:
static const char *identifier();
bool isParsed(const KMime::ContentIndex &index) const;
Q_REQUIRED_RESULT bool isParsed(const KMime::ContentIndex &index) const;
void setParsed(const KMime::ContentIndex &index);
void setMessageDate(const QDateTime &contextDt);
void appendData(const QVector<QVariant> &data);
bool hasData() const;
Q_REQUIRED_RESULT bool hasData() const;
struct TripData {
QVector<QVariant> reservations;
KCalendarCore::Event::Ptr event;
bool expanded;
};
QVector<TripData> data();
Q_REQUIRED_RESULT QVector<TripData> data();
void toggleExpanded(int index);
void addPass(KPkPass::Pass *pass, const QByteArray &rawData);
......
......@@ -17,7 +17,8 @@ public:
ItineraryRenderer();
void setKDEConnectHandler(ItineraryKDEConnectHandler *kdeConnect);
bool render(const MimeTreeParser::MessagePartPtr &msgPart, MessageViewer::HtmlWriter *htmlWriter, MessageViewer::RenderContext *context) const override;
Q_REQUIRED_RESULT bool
render(const MimeTreeParser::MessagePartPtr &msgPart, MessageViewer::HtmlWriter *htmlWriter, MessageViewer::RenderContext *context) const override;
private:
ItineraryKDEConnectHandler *m_kdeConnect = nullptr;
......
......@@ -27,7 +27,7 @@ public:
bool handleContextMenuRequest(MimeTreeParser::Interface::BodyPart *part, const QString &path, const QPoint &p) const override;
QString statusBarMessage(MimeTreeParser::Interface::BodyPart *part, const QString &path) const override;
static bool hasItineraryApp();
static Q_REQUIRED_RESULT bool hasItineraryApp();
private:
ItineraryMemento *memento(MimeTreeParser::Interface::BodyPart *part) const;
......@@ -35,7 +35,7 @@ private:
void addToCalendar(ItineraryMemento *memento) const;
void openInApp(MimeTreeParser::Interface::BodyPart *part) const;
void openWithKDEConnect(MimeTreeParser::Interface::BodyPart *part, const QString &deviceId) const;
QString createItineraryFile(MimeTreeParser::Interface::BodyPart *part) const;
Q_REQUIRED_RESULT QString createItineraryFile(MimeTreeParser::Interface::BodyPart *part) const;
ItineraryKDEConnectHandler *m_kdeConnect = nullptr;
......
......@@ -16,7 +16,7 @@ public:
void setText(const QString &str);
virtual QString toHtml() const = 0;
virtual Q_REQUIRED_RESULT QString toHtml() const = 0;
protected:
QString mText;
......
......@@ -18,6 +18,10 @@
FolderConfigureSettingsPageWidget::FolderConfigureSettingsPageWidget(QWidget *parent)
: QWidget(parent)
, mCollectionExpiryWidget(new FolderConfigureSettingsExperyWidget(this))
, mFolderConfigureSettingsGeneralWidget(new FolderConfigureSettingsGeneralWidget(this))
, mCollectionTemplateWidget(new FolderConfigureSettingsTemplateWidget(this))
, mFolderConfigureSettingsViewWidget(new FolderConfigureSettingsViewWidget(this))
{
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
......@@ -28,22 +32,18 @@ FolderConfigureSettingsPageWidget::FolderConfigureSettingsPageWidget(QWidget *pa
mainLayout->addWidget(tab);
// General
mFolderConfigureSettingsGeneralWidget = new FolderConfigureSettingsGeneralWidget(this);
mFolderConfigureSettingsGeneralWidget->setObjectName(QStringLiteral("mFolderConfigureSettingsGeneralWidget"));
tab->addTab(mFolderConfigureSettingsGeneralWidget, i18n("General"));
// View
mFolderConfigureSettingsViewWidget = new FolderConfigureSettingsViewWidget(this);
mFolderConfigureSettingsViewWidget->setObjectName(QStringLiteral("mFolderConfigureSettingsViewWidget"));
tab->addTab(mFolderConfigureSettingsViewWidget, i18n("View"));
// Expiry => add Tab
mCollectionExpiryWidget = new FolderConfigureSettingsExperyWidget(this);
mCollectionExpiryWidget->setObjectName(QStringLiteral("mCollectionExpiryWidget"));
tab->addTab(mCollectionExpiryWidget, i18n("Expiry"));
// Template
mCollectionTemplateWidget = new FolderConfigureSettingsTemplateWidget(this);
mCollectionTemplateWidget->setObjectName(QStringLiteral("mCollectionTemplateWidget"));
tab->addTab(mCollectionTemplateWidget, i18n("Template"));
}
......
......@@ -23,9 +23,9 @@ public:
void save(const Akonadi::Collection::List &cols);
private:
FolderConfigureSettingsExperyWidget *mCollectionExpiryWidget = nullptr;
FolderConfigureSettingsGeneralWidget *mFolderConfigureSettingsGeneralWidget = nullptr;
FolderConfigureSettingsTemplateWidget *mCollectionTemplateWidget = nullptr;
FolderConfigureSettingsViewWidget *mFolderConfigureSettingsViewWidget = nullptr;
FolderConfigureSettingsExperyWidget *const mCollectionExpiryWidget;
FolderConfigureSettingsGeneralWidget *const mFolderConfigureSettingsGeneralWidget;
FolderConfigureSettingsTemplateWidget *const mCollectionTemplateWidget;
FolderConfigureSettingsViewWidget *const mFolderConfigureSettingsViewWidget;
};
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