summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrius Štikonas <andrius@stikonas.eu>2016-06-21 20:00:46 (GMT)
committerAndrius Štikonas <andrius@stikonas.eu>2016-06-21 20:00:46 (GMT)
commit34082236e764b7f7cca34d84a2b91ef7bd79a5cb (patch)
tree6349d72e6e3647fa30818fb41fa3b6655fdc2eab
parent8cb97c14e7984ea4401d6c055e18e44862f3ced1 (diff)
Let Qt handle deletion of QVBoxLayout pointers.
-rw-r--r--detailedconsole.cpp2
-rw-r--r--editor/kgpgeditor.cpp2
-rw-r--r--editor/kgpgmd5widget.cpp2
-rw-r--r--keyservers.cpp2
-rw-r--r--keysmanager.cpp8
-rw-r--r--kgpgkeygenerate.cpp2
-rw-r--r--kgpgrevokewidget.cpp2
-rw-r--r--selectexpirydate.cpp3
-rw-r--r--selectpublickeydialog.cpp4
-rw-r--r--selectsecretkey.cpp2
10 files changed, 14 insertions, 15 deletions
diff --git a/detailedconsole.cpp b/detailedconsole.cpp
index 7fd3f26..3ea5144 100644
--- a/detailedconsole.cpp
+++ b/detailedconsole.cpp
@@ -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);
diff --git a/editor/kgpgeditor.cpp b/editor/kgpgeditor.cpp
index d16ff25..d057dfe 100644
--- a/editor/kgpgeditor.cpp
+++ b/editor/kgpgeditor.cpp
@@ -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 );
diff --git a/editor/kgpgmd5widget.cpp b/editor/kgpgmd5widget.cpp
index 781c7e5..348821d 100644
--- a/editor/kgpgmd5widget.cpp
+++ b/editor/kgpgmd5widget.cpp
@@ -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()));
diff --git a/keyservers.cpp b/keyservers.cpp
index abb673f..0d6bf01 100644
--- a/keyservers.cpp
+++ b/keyservers.cpp
@@ -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);
diff --git a/keysmanager.cpp b/keysmanager.cpp
index cbb7212..2b96c76 100644
--- a/keysmanager.cpp
+++ b/keysmanager.cpp
@@ -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);
diff --git a/kgpgkeygenerate.cpp b/kgpgkeygenerate.cpp
index d7ed7d4..75c6db2 100644
--- a/kgpgkeygenerate.cpp
+++ b/kgpgkeygenerate.cpp
@@ -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);
diff --git a/kgpgrevokewidget.cpp b/kgpgrevokewidget.cpp
index 445cf64..4e1d86c 100644
--- a/kgpgrevokewidget.cpp
+++ b/kgpgrevokewidget.cpp
@@ -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);
diff --git a/selectexpirydate.cpp b/selectexpirydate.cpp
index e59f5a6..7ae6f0c 100644
--- a/selectexpirydate.cpp
+++ b/selectexpirydate.cpp
@@ -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);
diff --git a/selectpublickeydialog.cpp b/selectpublickeydialog.cpp
index 36c3b8a..efc632a 100644
--- a/selectpublickeydialog.cpp
+++ b/selectpublickeydialog.cpp
@@ -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);
diff --git a/selectsecretkey.cpp b/selectsecretkey.cpp
index e93c659..290045b 100644
--- a/selectsecretkey.cpp
+++ b/selectsecretkey.cpp
@@ -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);