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

Const'ify pointer

parent e1107f88
Pipeline #55180 passed with stage
in 54 minutes and 39 seconds
......@@ -18,7 +18,7 @@ public:
explicit ViewerPluginTranslator(QObject *parent = nullptr, const QList<QVariant> & = QList<QVariant>());
ViewerPluginInterface *createView(QWidget *parent, KActionCollection *ac) override;
QString viewerPluginName() const override;
Q_REQUIRED_RESULT QString viewerPluginName() const override;
};
}
#endif // VIEWERPLUGINTRANSLATOR_H
......@@ -23,12 +23,12 @@ public:
~ViewerPluginTranslatorInterface() override;
void setText(const QString &text) override;
QList<QAction *> actions() const override;
Q_REQUIRED_RESULT QList<QAction *> actions() const override;
void showWidget() override;
ViewerPluginInterface::SpecificFeatureTypes featureTypes() const override;
Q_REQUIRED_RESULT ViewerPluginInterface::SpecificFeatureTypes featureTypes() const override;
private:
PimCommon::TranslatorWidget *widget();
Q_REQUIRED_RESULT PimCommon::TranslatorWidget *widget();
void createAction(KActionCollection *ac);
QList<QAction *> mAction;
PimCommon::TranslatorWidget *mTranslatorWidget = nullptr;
......
......@@ -13,14 +13,14 @@ using namespace MessageViewer;
EventDateTimeWidget::EventDateTimeWidget(QWidget *parent)
: QWidget(parent)
, mDateEdit(new KDateComboBox(this))
, mTimeEdit(new KTimeComboBox(this))
{
auto mainLayout = new QHBoxLayout(this);
mainLayout->setSpacing(0);
mainLayout->setContentsMargins({});
mDateEdit = new KDateComboBox;
mDateEdit->setObjectName(QStringLiteral("eventdatecombobox"));
mainLayout->addWidget(mDateEdit);
mTimeEdit = new KTimeComboBox;
mTimeEdit->setObjectName(QStringLiteral("eventtimecombobox"));
mainLayout->addWidget(mTimeEdit);
const QDateTime currentDateTime = QDateTime::currentDateTime();
......
......@@ -23,10 +23,10 @@ public:
void setMinimumDateTime(const QDateTime &dateTime);
void setDateTime(const QDateTime &dateTime);
QDateTime dateTime() const;
Q_REQUIRED_RESULT QDateTime dateTime() const;
QDate date() const;
QTime time() const;
Q_REQUIRED_RESULT QDate date() const;
Q_REQUIRED_RESULT QTime time() const;
void setTime(QTime time);
void setDate(QDate date);
......@@ -35,8 +35,8 @@ Q_SIGNALS:
private:
void slotDateTimeChanged();
KDateComboBox *mDateEdit = nullptr;
KTimeComboBox *mTimeEdit = nullptr;
KDateComboBox *const mDateEdit;
KTimeComboBox *const mTimeEdit;
};
}
......
......@@ -33,6 +33,9 @@ using namespace MessageViewer;
NoteEdit::NoteEdit(QWidget *parent)
: QWidget(parent)
, mNoteEdit(new QLineEdit(this))
, mCollectionCombobox(new Akonadi::CollectionComboBox(_k_noteEditStubModel, this))
, mSaveButton(new QPushButton(QIcon::fromTheme(QStringLiteral("view-pim-notes")), i18n("&Save"), this))
{
auto vbox = new QVBoxLayout(this);
vbox->setContentsMargins(5, 5, 5, 5);
......@@ -46,7 +49,6 @@ NoteEdit::NoteEdit(QWidget *parent)
QLabel *lab = new QLabel(i18n("Note:"), this);
hbox->addWidget(lab);
mNoteEdit = new QLineEdit(this);
mNoteEdit->setClearButtonEnabled(true);
mNoteEdit->setObjectName(QStringLiteral("noteedit"));
mNoteEdit->setFocus();
......@@ -56,7 +58,6 @@ NoteEdit::NoteEdit(QWidget *parent)
hbox->addSpacing(5);
mCollectionCombobox = new Akonadi::CollectionComboBox(_k_noteEditStubModel, this);
mCollectionCombobox->setAccessRightsFilter(Akonadi::Collection::CanCreateItem);
mCollectionCombobox->setMinimumWidth(250);
mCollectionCombobox->setMimeTypeFilter(QStringList() << Akonadi::NoteUtils::noteMimeType());
......@@ -83,7 +84,6 @@ NoteEdit::NoteEdit(QWidget *parent)
hbox->addStretch(1);
mSaveButton = new QPushButton(QIcon::fromTheme(QStringLiteral("view-pim-notes")), i18n("&Save"), this);
mSaveButton->setObjectName(QStringLiteral("save-button"));
mSaveButton->setEnabled(false);
#ifndef QT_NO_ACCESSIBILITY
......
......@@ -56,9 +56,9 @@ private:
void readConfig();
Akonadi::Collection mCollection;
KMime::Message::Ptr mMessage;
QLineEdit *mNoteEdit = nullptr;
Akonadi::CollectionComboBox *mCollectionCombobox = nullptr;
QPushButton *mSaveButton = nullptr;
QLineEdit *const mNoteEdit;
Akonadi::CollectionComboBox *const mCollectionCombobox;
QPushButton *const mSaveButton;
};
}
......
......@@ -38,12 +38,15 @@ using namespace MessageViewer;
TodoEdit::TodoEdit(QWidget *parent)
: QWidget(parent)
, mNoteEdit(new QLineEdit(this))
, mMsgWidget(new KMessageWidget(this))
, mSaveButton(new QPushButton(QIcon::fromTheme(QStringLiteral("task-new")), i18n("&Save"), this))
, mOpenEditorButton(new QPushButton(i18n("Open &Editor..."), this))
{
auto vbox = new QVBoxLayout(this);
vbox->setContentsMargins(5, 5, 5, 5);
vbox->setSpacing(2);
mMsgWidget = new KMessageWidget(this);
mMsgWidget->setCloseButtonVisible(true);
mMsgWidget->setMessageType(KMessageWidget::Positive);
mMsgWidget->setObjectName(QStringLiteral("msgwidget"));
......@@ -59,7 +62,6 @@ TodoEdit::TodoEdit(QWidget *parent)
QLabel *lab = new QLabel(i18n("Todo:"), this);
hbox->addWidget(lab);
mNoteEdit = new QLineEdit(this);
mNoteEdit->setClearButtonEnabled(true);
mNoteEdit->setObjectName(QStringLiteral("noteedit"));
mNoteEdit->setFocus();
......@@ -89,7 +91,6 @@ TodoEdit::TodoEdit(QWidget *parent)
vbox->addLayout(hbox);
hbox->addStretch(1);
mSaveButton = new QPushButton(QIcon::fromTheme(QStringLiteral("task-new")), i18n("&Save"), this);
mSaveButton->setObjectName(QStringLiteral("save-button"));
mSaveButton->setEnabled(false);
#ifndef QT_NO_ACCESSIBILITY
......@@ -98,7 +99,6 @@ TodoEdit::TodoEdit(QWidget *parent)
connect(mSaveButton, &QPushButton::clicked, this, &TodoEdit::slotReturnPressed);
hbox->addWidget(mSaveButton);
mOpenEditorButton = new QPushButton(i18n("Open &Editor..."), this);
mOpenEditorButton->setObjectName(QStringLiteral("open-editor-button"));
#ifndef QT_NO_ACCESSIBILITY
mOpenEditorButton->setAccessibleDescription(i18n("Open todo editor, where more details can be changed."));
......
......@@ -64,9 +64,9 @@ private:
KMime::Message::Ptr mMessage;
QLineEdit *mNoteEdit = nullptr;
Akonadi::CollectionComboBox *mCollectionCombobox = nullptr;
KMessageWidget *mMsgWidget = nullptr;
QPushButton *mSaveButton = nullptr;
QPushButton *mOpenEditorButton = nullptr;
KMessageWidget *const mMsgWidget;
QPushButton *const mSaveButton;
QPushButton *const mOpenEditorButton;
};
}
#endif // TODOEDIT_H
......@@ -51,6 +51,10 @@ ViewerPluginExternalScriptInfo ViewerPluginExternalScriptItem::scriptInfo() cons
ViewerPluginExternalConfigureWidget::ViewerPluginExternalConfigureWidget(QWidget *parent)
: QWidget(parent)
, mListExternal(new QListWidget(this))
, mAddScript(new QPushButton(i18n("Add Script..."), this))
, mRemoveScript(new QPushButton(i18n("Remove Script"), this))
, mModifyScript(new QPushButton(i18n("Modify Script..."), this))
{
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("layout"));
......@@ -63,7 +67,6 @@ ViewerPluginExternalConfigureWidget::ViewerPluginExternalConfigureWidget(QWidget
auto listLayout = new QHBoxLayout;
mainLayout->addLayout(listLayout);
mListExternal = new QListWidget(this);
mListExternal->setObjectName(QStringLiteral("listexternal"));
mListExternal->setSelectionMode(QAbstractItemView::SingleSelection);
listLayout->addWidget(mListExternal);
......@@ -73,17 +76,14 @@ ViewerPluginExternalConfigureWidget::ViewerPluginExternalConfigureWidget(QWidget
auto buttonLayout = new QVBoxLayout;
listLayout->addLayout(buttonLayout);
mAddScript = new QPushButton(i18n("Add Script..."), this);
connect(mAddScript, &QPushButton::clicked, this, &ViewerPluginExternalConfigureWidget::slotAddScript);
mAddScript->setObjectName(QStringLiteral("addscript"));
buttonLayout->addWidget(mAddScript);
mModifyScript = new QPushButton(i18n("Modify Script..."), this);
connect(mModifyScript, &QPushButton::clicked, this, &ViewerPluginExternalConfigureWidget::slotModifyScript);
mModifyScript->setObjectName(QStringLiteral("modifyscript"));
buttonLayout->addWidget(mModifyScript);
mRemoveScript = new QPushButton(i18n("Remove Script"), this);
connect(mRemoveScript, &QPushButton::clicked, this, &ViewerPluginExternalConfigureWidget::slotRemoveScript);
mRemoveScript->setObjectName(QStringLiteral("removescript"));
buttonLayout->addWidget(mRemoveScript);
......
......@@ -31,10 +31,10 @@ private:
void slotDoubleClicked(QListWidgetItem *item);
QStringList mFilesToRemove;
QListWidget *mListExternal = nullptr;
QPushButton *mAddScript = nullptr;
QPushButton *mRemoveScript = nullptr;
QPushButton *mModifyScript = nullptr;
QListWidget *const mListExternal;
QPushButton *const mAddScript;
QPushButton *const mRemoveScript;
QPushButton *const mModifyScript;
};
#endif // VIEWERPLUGINEXTERNALCONFIGUREWIDGET_H
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