Commit 18cf88c3 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use auto vs auto * where it's possible

parent 1db6f10c
Pipeline #49709 skipped
......@@ -62,7 +62,7 @@ AddHostDialog::AddHostDialog(KLDAP::LdapServer *server, QWidget *parent)
, d(new KLDAP::AddHostDialogPrivate(this))
{
setWindowTitle(i18nc("@title:window", "Add Host"));
auto *mainLayout = new QVBoxLayout(this);
auto mainLayout = new QVBoxLayout(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
d->mOkButton = buttonBox->button(QDialogButtonBox::Ok);
d->mOkButton->setDefault(true);
......@@ -76,7 +76,7 @@ AddHostDialog::AddHostDialog(KLDAP::LdapServer *server, QWidget *parent)
QWidget *page = new QWidget(this);
mainLayout->addWidget(page);
mainLayout->addWidget(buttonBox);
auto *layout = new QHBoxLayout(page);
auto layout = new QHBoxLayout(page);
layout->setContentsMargins(0, 0, 0, 0);
d->mCfg = new KLDAP::LdapConfigWidget(KLDAP::LdapConfigWidget::W_USER | KLDAP::LdapConfigWidget::W_PASS | KLDAP::LdapConfigWidget::W_BINDDN
......
......@@ -175,7 +175,7 @@ void LdapClientSearch::Private::readConfig()
mNoLDAPLookup = true;
} else {
for (int j = 0; j < numHosts; ++j) {
auto *ldapClient = new LdapClient(j, q);
auto ldapClient = new LdapClient(j, q);
auto job = new LdapSearchClientReadConfigServerJob;
job->setCurrentIndex(j);
job->setActive(true);
......
......@@ -180,7 +180,7 @@ void LdapClientSearchConfigReadConfigJob::readConfig()
void LdapClientSearchConfigReadConfigJob::readLdapPasswordFinished(QKeychain::Job *baseJob)
{
auto *job = qobject_cast<ReadPasswordJob *>(baseJob);
auto job = qobject_cast<ReadPasswordJob *>(baseJob);
Q_ASSERT(job);
if (!job->error()) {
mServer.setPassword(job->textData());
......
......@@ -146,7 +146,7 @@ void LdapConfigureWidget::slotMoveUp()
return;
}
auto *above = static_cast<LdapWidgetItem *>(mHostListView->item(mHostListView->row(item) - 1));
auto above = static_cast<LdapWidgetItem *>(mHostListView->item(mHostListView->row(item) - 1));
if (!above) {
return;
}
......@@ -171,7 +171,7 @@ void LdapConfigureWidget::slotMoveDown()
return;
}
auto *below = static_cast<LdapWidgetItem *>(mHostListView->item(mHostListView->row(item) + 1));
auto below = static_cast<LdapWidgetItem *>(mHostListView->item(mHostListView->row(item) + 1));
if (!below) {
return;
}
......@@ -192,7 +192,7 @@ void LdapConfigureWidget::load()
int count = group.readEntry("NumSelectedHosts", 0);
for (int i = 0; i < count; ++i) {
auto *item = new LdapWidgetItem(mHostListView, true);
auto item = new LdapWidgetItem(mHostListView, true);
item->setCheckState(Qt::Checked);
auto job = new LdapWidgetItemReadConfigServerJob(this);
job->setCurrentIndex(i);
......@@ -261,13 +261,13 @@ void LdapConfigureWidget::save()
void LdapConfigureWidget::initGUI()
{
auto *layout = new QVBoxLayout(this);
auto layout = new QVBoxLayout(this);
layout->setObjectName(QStringLiteral("layout"));
layout->setContentsMargins(0, 0, 0, 0);
QGroupBox *groupBox = new QGroupBox(i18n("LDAP Servers"));
layout->addWidget(groupBox);
auto *mainLayout = new QVBoxLayout;
auto mainLayout = new QVBoxLayout;
mainLayout->setObjectName(QStringLiteral("mainlayout"));
groupBox->setLayout(mainLayout);
......@@ -278,7 +278,7 @@ void LdapConfigureWidget::initGUI()
QWidget *hBox = new QWidget(this);
mainLayout->addWidget(hBox);
auto *hBoxHBoxLayout = new QHBoxLayout(hBox);
auto hBoxHBoxLayout = new QHBoxLayout(hBox);
hBoxHBoxLayout->setContentsMargins(0, 0, 0, 0);
hBoxHBoxLayout->setSpacing(6);
// Contents of the hbox: listview and up/down buttons on the right (vbox)
......@@ -287,7 +287,7 @@ void LdapConfigureWidget::initGUI()
mHostListView->setSortingEnabled(false);
QWidget *upDownBox = new QWidget(hBox);
auto *upDownBoxVBoxLayout = new QVBoxLayout(upDownBox);
auto upDownBoxVBoxLayout = new QVBoxLayout(upDownBox);
upDownBoxVBoxLayout->setContentsMargins(0, 0, 0, 0);
hBoxHBoxLayout->addWidget(upDownBox);
upDownBoxVBoxLayout->setSpacing(6);
......@@ -305,7 +305,7 @@ void LdapConfigureWidget::initGUI()
upDownBoxVBoxLayout->addWidget(spacer);
upDownBoxVBoxLayout->setStretchFactor(spacer, 100);
auto *buttons = new QDialogButtonBox(this);
auto buttons = new QDialogButtonBox(this);
QPushButton *add = buttons->addButton(i18n("&Add Host..."), QDialogButtonBox::ActionRole);
connect(add, &QPushButton::clicked, this, &LdapConfigureWidget::slotAddHost);
mEditButton = buttons->addButton(i18n("&Edit Host..."), QDialogButtonBox::ActionRole);
......
......@@ -249,7 +249,7 @@ void LdapConfigWidget::Private::initWidget()
if (mFeatures & W_SECBOX) {
QGroupBox *btgroup = new QGroupBox(i18n("Security"), mParent);
auto *hbox = new QHBoxLayout;
auto hbox = new QHBoxLayout;
btgroup->setLayout(hbox);
mSecNo = new QRadioButton(i18nc("@option:radio set no security", "No"), btgroup);
mSecNo->setObjectName(QStringLiteral("kcfg_ldapnosec"));
......@@ -278,9 +278,9 @@ void LdapConfigWidget::Private::initWidget()
if (mFeatures & W_AUTHBOX) {
QGroupBox *authbox = new QGroupBox(i18n("Authentication"), mParent);
auto *vbox = new QVBoxLayout;
auto vbox = new QVBoxLayout;
authbox->setLayout(vbox);
auto *hbox = new QHBoxLayout;
auto hbox = new QHBoxLayout;
vbox->addLayout(hbox);
mAnonymous = new QRadioButton(i18nc("@option:radio anonymous authentication", "Anonymous"), authbox);
......
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