Commit 628ff4cb authored by Laurent Montel's avatar Laurent Montel
Browse files

const'ify pointer + add parent

parent 35bfe306
Pipeline #220166 passed with stage
in 13 minutes and 7 seconds
......@@ -20,21 +20,21 @@ static const char myConfigGroupName[] = "GravatarUpdateDialog";
}
GravatarUpdateDialog::GravatarUpdateDialog(QWidget *parent)
: QDialog(parent)
, mGravatarUpdateWidget(new GravatarUpdateWidget(this))
, mSaveImageButton(new QPushButton(i18n("Save Image"), this))
, mSaveUrlButton(new QPushButton(i18n("Save Image URL"), this))
{
auto mainLayout = new QVBoxLayout(this);
setWindowTitle(i18nc("@title:window", "Check and update Gravatar"));
mGravatarUpdateWidget = new GravatarUpdateWidget(this);
connect(mGravatarUpdateWidget, &GravatarUpdateWidget::activateDialogButton, this, &GravatarUpdateDialog::slotActivateButton);
mGravatarUpdateWidget->setObjectName(QStringLiteral("gravatarupdatewidget"));
mainLayout->addWidget(mGravatarUpdateWidget);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel, this);
buttonBox->setObjectName(QStringLiteral("buttonbox"));
mSaveImageButton = new QPushButton(i18n("Save Image"), this);
mSaveImageButton->setEnabled(false);
buttonBox->addButton(mSaveImageButton, QDialogButtonBox::ActionRole);
connect(mSaveImageButton, &QPushButton::clicked, this, &GravatarUpdateDialog::slotSaveImage);
mSaveUrlButton = new QPushButton(i18n("Save Image URL"), this);
buttonBox->addButton(mSaveUrlButton, QDialogButtonBox::ActionRole);
mSaveUrlButton->setEnabled(false);
connect(mSaveUrlButton, &QPushButton::clicked, this, &GravatarUpdateDialog::slotSaveUrl);
......
......@@ -35,9 +35,9 @@ private:
void slotActivateButton(bool state);
void readConfig();
void writeConfig();
GravatarUpdateWidget *mGravatarUpdateWidget = nullptr;
QPushButton *mSaveImageButton = nullptr;
QPushButton *mSaveUrlButton = nullptr;
GravatarUpdateWidget *const mGravatarUpdateWidget;
QPushButton *const mSaveImageButton;
QPushButton *const mSaveUrlButton;
bool mSaveUrl = false;
};
}
......@@ -25,21 +25,21 @@ GravatarUpdateWidget::GravatarUpdateWidget(QWidget *parent)
auto hboxEmail = new QHBoxLayout;
auto lab = new QLabel(i18n("Email:"));
auto lab = new QLabel(i18n("Email:"), this);
lab->setObjectName(QStringLiteral("emaillabel"));
hboxEmail->addWidget(lab);
mEmailLab = new QLabel;
mEmailLab = new QLabel(this);
mEmailLab->setObjectName(QStringLiteral("email"));
hboxEmail->addWidget(mEmailLab);
mainLayout->addLayout(hboxEmail, 0, 0);
mSearchGravatar = new QPushButton(i18n("Search"));
mSearchGravatar = new QPushButton(i18n("Search"), this);
mSearchGravatar->setEnabled(false);
mSearchGravatar->setObjectName(QStringLiteral("search"));
mainLayout->addWidget(mSearchGravatar, 4, 0);
connect(mSearchGravatar, &QAbstractButton::clicked, this, &GravatarUpdateWidget::slotSearchGravatar);
mResultGravatar = new QLabel;
mResultGravatar = new QLabel(this);
QFont font = mResultGravatar->font();
font.setBold(true);
mResultGravatar->setFont(font);
......
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