Commit 34082236 authored by Andrius Štikonas's avatar Andrius Štikonas
Browse files

Let Qt handle deletion of QVBoxLayout pointers.

parent 8cb97c14
......@@ -34,7 +34,7 @@ KgpgDetailedInfo::KgpgDetailedInfo(QWidget *parent, const QString &boxLabel, con
setWindowTitle(i18n("Info"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout;
QVBoxLayout *mainLayout = new QVBoxLayout(this);
setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
......
......@@ -495,7 +495,7 @@ void KgpgEditor::slotFilePreDec()
QPointer<QDialog> popn = new QDialog(this);
popn->setWindowTitle(i18n("Decrypt File To"));
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout;
QVBoxLayout *mainLayout = new QVBoxLayout(popn);
popn->setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
popn->setModal( true );
......
......@@ -32,7 +32,7 @@ Md5Widget::Md5Widget(QWidget *parent, const QUrl &url)
setWindowTitle(i18n("MD5 Checksum"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close|QDialogButtonBox::Apply);
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout;
QVBoxLayout *mainLayout = new QVBoxLayout(this);
setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
......
......@@ -203,7 +203,7 @@ void KeyServer::slotSearch()
m_dialogserver = new QDialog(this );
m_dialogserver->setWindowTitle(i18n("Import Key From Keyserver"));
QVBoxLayout *mainLayout = new QVBoxLayout;
QVBoxLayout *mainLayout = new QVBoxLayout(m_dialogserver);
m_dialogserver->setLayout(mainLayout);
m_listpop = new searchRes(m_dialogserver);
......
......@@ -585,7 +585,7 @@ void KeysManager::slotGenerateKeyDone(KJob *job)
QPointer<QDialog> keyCreated = new QDialog(this);
keyCreated->setWindowTitle(i18n("New Key Pair Created"));
QVBoxLayout *mainLayout = new QVBoxLayout;
QVBoxLayout *mainLayout = new QVBoxLayout(keyCreated);
keyCreated->setLayout(mainLayout);
newKey *page = new newKey(keyCreated);
......@@ -881,7 +881,7 @@ void KeysManager::slotAddUid()
addUidWidget = new QDialog(this);
addUidWidget->setWindowTitle(i18n("Add New User Id"));
QVBoxLayout *mainLayout = new QVBoxLayout;
QVBoxLayout *mainLayout = new QVBoxLayout(addUidWidget);
addUidWidget->setLayout(mainLayout);
keyUid = new AddUid(addUidWidget);
mainLayout->addWidget(keyUid);
......@@ -1766,7 +1766,7 @@ void KeysManager::editGroup()
KGpgGroupNode *gnd = nd->toGroupNode();
QPointer<QDialog> dialogGroupEdit = new QDialog(this );
dialogGroupEdit->setWindowTitle(i18n("Group Properties"));
QVBoxLayout *mainLayout = new QVBoxLayout;
QVBoxLayout *mainLayout = new QVBoxLayout(dialogGroupEdit);
QWidget *mainWidget = new QWidget(this);
mainLayout->addWidget(mainWidget);
dialogGroupEdit->setLayout(mainLayout);
......@@ -2533,7 +2533,7 @@ void KeysManager::slotPreImportKey()
{
QPointer<QDialog> dial = new QDialog(this);
dial->setWindowTitle(i18n("Key Import"));
QVBoxLayout *mainLayout = new QVBoxLayout;
QVBoxLayout *mainLayout = new QVBoxLayout(dial);
QWidget *mainWidget = new QWidget(this);
mainLayout->addWidget(mainWidget);
dial->setLayout(mainLayout);
......
......@@ -43,7 +43,7 @@ KgpgKeyGenerate::KgpgKeyGenerate(QWidget *parent)
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout;
QVBoxLayout *mainLayout = new QVBoxLayout(this);
setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
okButton = buttonBox->button(QDialogButtonBox::Ok);
......
......@@ -46,7 +46,7 @@ KGpgRevokeDialog::KGpgRevokeDialog(QWidget* parent, const KGpgKeyNode *node)
setWindowTitle(i18n("Create Revocation Certificate"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout;
QVBoxLayout *mainLayout = new QVBoxLayout(this);
setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
......
......@@ -31,7 +31,7 @@ SelectExpiryDate::SelectExpiryDate(QWidget* parent, QDateTime date)
setWindowTitle(i18n("Choose New Expiration"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout;
QVBoxLayout *mainLayout = new QVBoxLayout(this);
setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
okButton = buttonBox->button(QDialogButtonBox::Ok);
......@@ -40,7 +40,6 @@ SelectExpiryDate::SelectExpiryDate(QWidget* parent, QDateTime date)
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
okButton->setDefault(true);
setModal(true);
QWidget *page = new QWidget(this);
m_unlimited = new QCheckBox(i18nc("Key has unlimited lifetime", "Unlimited"), page);
......
......@@ -46,7 +46,7 @@ KgpgSelectPublicKeyDlg::KgpgSelectPublicKeyDlg(QWidget *parent, KGpgItemModel *m
m_hideasciioption(hideasciioption)
{
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout;
QVBoxLayout *mainLayout = new QVBoxLayout(this);
setLayout(mainLayout);
mainLayout->setSizeConstraint(QLayout::SetMinimumSize);
mainLayout->addWidget(mainWidget);
......@@ -55,7 +55,7 @@ KgpgSelectPublicKeyDlg::KgpgSelectPublicKeyDlg(QWidget *parent, KGpgItemModel *m
m_okButton = buttonBox->button(QDialogButtonBox::Ok);
m_okButton->setDefault(true);
m_okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
m_detailsButton = new QPushButton;
m_detailsButton = new QPushButton(this);
m_detailsButton->setText(i18n("&O&ptions") + QStringLiteral(" >>"));
m_detailsButton->setIcon(QIcon::fromTheme(QStringLiteral("help-about")).pixmap(IconSize(KIconLoader::Toolbar)));
connect(m_detailsButton, &QPushButton::clicked, this, &KgpgSelectPublicKeyDlg::toggleDetails);
......
......@@ -38,7 +38,7 @@ KgpgSelectSecretKey::KgpgSelectSecretKey(QWidget *parent, KGpgItemModel *model,
setWindowTitle(i18n("Private Key List"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout;
QVBoxLayout *mainLayout = new QVBoxLayout(this);
setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
m_okButton = buttonBox->button(QDialogButtonBox::Ok);
......
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