Commit 329f63a7 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

const'ify pointer

parent f77f7e97
Pipeline #70597 failed with stage
in 18 minutes and 42 seconds
......@@ -15,11 +15,11 @@
ViewerPluginExternalEditDialog::ViewerPluginExternalEditDialog(QWidget *parent)
: QDialog(parent)
, mEditWidget(new ViewerPluginExternalEditWidget(this))
{
setWindowTitle(i18nc("@title:window", "Add or Modify External Script"));
auto mainLayout = new QVBoxLayout(this);
mEditWidget = new ViewerPluginExternalEditWidget(this);
mEditWidget->setObjectName(QStringLiteral("editwidget"));
mainLayout->addWidget(mEditWidget);
connect(mEditWidget, &ViewerPluginExternalEditWidget::scriptIsValid, this, &ViewerPluginExternalEditDialog::slotScriptIsValid);
......
......@@ -29,7 +29,7 @@ private:
void saveConfig();
void slotScriptIsValid(bool valid);
void slotAccepted();
ViewerPluginExternalEditWidget *mEditWidget = nullptr;
ViewerPluginExternalEditWidget *const mEditWidget;
QPushButton *mOkButton = nullptr;
};
......@@ -15,22 +15,23 @@
ViewerPluginExternalEditWidget::ViewerPluginExternalEditWidget(QWidget *parent)
: QWidget(parent)
, mName(new QLineEdit(this))
, mDescription(new QLineEdit(this))
, mCommandLine(new QLineEdit(this))
, mExecutable(new KUrlRequester(this))
{
auto mainLayout = new QFormLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mainLayout->setContentsMargins({});
mName = new QLineEdit(this);
mName->setObjectName(QStringLiteral("name"));
mainLayout->addRow(i18n("Name:"), mName);
new KPIM::LineEditCatchReturnKey(mName, this);
mDescription = new QLineEdit(this);
mDescription->setObjectName(QStringLiteral("description"));
mainLayout->addRow(i18n("Description:"), mDescription);
new KPIM::LineEditCatchReturnKey(mDescription, this);
mCommandLine = new QLineEdit(this);
mCommandLine->setClearButtonEnabled(true);
mCommandLine->setObjectName(QStringLiteral("commandline"));
mCommandLine->setPlaceholderText(i18n("Add command arguments..."));
......@@ -59,7 +60,6 @@ ViewerPluginExternalEditWidget::ViewerPluginExternalEditWidget(QWidget *parent)
mainLayout->addWidget(formatHelp);
mExecutable = new KUrlRequester(this);
mExecutable->setObjectName(QStringLiteral("mEditorRequester"));
mExecutable->setMimeTypeFilters(
......
......@@ -32,9 +32,9 @@ private:
ViewerPluginExternalScriptInfo mScriptInfo;
QStringList mExistingsNames;
QString mCommandWhatsThis;
QLineEdit *mName = nullptr;
QLineEdit *mDescription = nullptr;
QLineEdit *mCommandLine = nullptr;
KUrlRequester *mExecutable = nullptr;
QLineEdit *const mName;
QLineEdit *const mDescription;
QLineEdit *const mCommandLine;
KUrlRequester *const mExecutable;
};
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