summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-09-01 12:02:00 (GMT)
committerMontel Laurent <montel@kde.org>2016-09-01 12:02:16 (GMT)
commitf8ea2f6c868862c9e125d0bda07e35c999395037 (patch)
treecfbac7b4015e369ef4b9c2cc3d422307d585bf62
parent4bd0d450d5fcdddf69d328704a42e188e5523d47 (diff)
Add parent directly
-rw-r--r--src/ksieveui/autocreatescripts/autocreatescriptdialog.cpp7
-rw-r--r--src/ksieveui/autocreatescripts/sieveactions/widgets/selectfileintowidget.cpp5
-rw-r--r--src/ksieveui/autocreatescripts/sieveactions/widgets/selectflagswidget.cpp7
-rw-r--r--src/ksieveui/autocreatescripts/sieveeditorgraphicalmodewidget.cpp3
-rw-r--r--src/ksieveui/autocreatescripts/sieveforeverypartwidget.cpp3
-rw-r--r--src/ksieveui/autocreatescripts/sieveglobalvariablewidget.cpp7
-rw-r--r--src/ksieveui/autocreatescripts/sievescriptblockwidget.cpp4
-rw-r--r--src/ksieveui/autocreatescripts/sievescriptdescriptiondialog.cpp9
-rw-r--r--src/ksieveui/autocreatescripts/sievescriptlistbox.cpp5
-rw-r--r--src/ksieveui/autocreatescripts/sievescriptpage.cpp11
-rw-r--r--src/ksieveui/autocreatescripts/sievescriptparsingerrordialog.cpp11
-rw-r--r--src/ksieveui/debug/sievedebugdialog.cpp8
-rw-r--r--src/ksieveui/editor/sieveeditor.cpp4
-rw-r--r--src/ksieveui/editor/sievetexteditwidget.cpp3
-rw-r--r--src/ksieveui/scriptsparsing/parsingresultdialog.cpp5
15 files changed, 40 insertions, 52 deletions
diff --git a/src/ksieveui/autocreatescripts/autocreatescriptdialog.cpp b/src/ksieveui/autocreatescripts/autocreatescriptdialog.cpp
index 9a2a18f..4b7eb9e 100644
--- a/src/ksieveui/autocreatescripts/autocreatescriptdialog.cpp
+++ b/src/ksieveui/autocreatescripts/autocreatescriptdialog.cpp
@@ -37,16 +37,15 @@ AutoCreateScriptDialog::AutoCreateScriptDialog(QWidget *parent)
: QDialog(parent)
{
setWindowTitle(i18n("Create sieve filter"));
- QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
- QVBoxLayout *mainLayout = new QVBoxLayout;
- setLayout(mainLayout);
+ QVBoxLayout *mainLayout = new QVBoxLayout(this);
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, &QDialogButtonBox::accepted, this, &AutoCreateScriptDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &AutoCreateScriptDialog::reject);
okButton->setFocus();
- mEditor = new SieveEditorGraphicalModeWidget;
+ mEditor = new SieveEditorGraphicalModeWidget(this);
mainLayout->addWidget(mEditor);
mainLayout->addWidget(buttonBox);
readConfig();
diff --git a/src/ksieveui/autocreatescripts/sieveactions/widgets/selectfileintowidget.cpp b/src/ksieveui/autocreatescripts/sieveactions/widgets/selectfileintowidget.cpp
index 16d9c98..8639b62 100644
--- a/src/ksieveui/autocreatescripts/sieveactions/widgets/selectfileintowidget.cpp
+++ b/src/ksieveui/autocreatescripts/sieveactions/widgets/selectfileintowidget.cpp
@@ -35,9 +35,8 @@ SelectFileIntoDialog::SelectFileIntoDialog(QWidget *parent)
setWindowTitle(i18n("Select folder"));
- QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
- QVBoxLayout *mainLayout = new QVBoxLayout;
- setLayout(mainLayout);
+ QVBoxLayout *mainLayout = new QVBoxLayout(this);
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
diff --git a/src/ksieveui/autocreatescripts/sieveactions/widgets/selectflagswidget.cpp b/src/ksieveui/autocreatescripts/sieveactions/widgets/selectflagswidget.cpp
index a99b2d9..39b138d 100644
--- a/src/ksieveui/autocreatescripts/sieveactions/widgets/selectflagswidget.cpp
+++ b/src/ksieveui/autocreatescripts/sieveactions/widgets/selectflagswidget.cpp
@@ -34,10 +34,9 @@ SelectFlagsListDialog::SelectFlagsListDialog(QWidget *parent)
: QDialog(parent)
{
setWindowTitle(i18n("Flags"));
- QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
- QVBoxLayout *mainLayout = new QVBoxLayout;
- setLayout(mainLayout);
- mListWidget = new SelectFlagsListWidget;
+ QVBoxLayout *mainLayout = new QVBoxLayout(this);
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
+ mListWidget = new SelectFlagsListWidget(this);
mainLayout->addWidget(mListWidget);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
diff --git a/src/ksieveui/autocreatescripts/sieveeditorgraphicalmodewidget.cpp b/src/ksieveui/autocreatescripts/sieveeditorgraphicalmodewidget.cpp
index 5cedac8..c2b073e 100644
--- a/src/ksieveui/autocreatescripts/sieveeditorgraphicalmodewidget.cpp
+++ b/src/ksieveui/autocreatescripts/sieveeditorgraphicalmodewidget.cpp
@@ -42,7 +42,7 @@ QStringList SieveEditorGraphicalModeWidget::sCapabilities = QStringList();
SieveEditorGraphicalModeWidget::SieveEditorGraphicalModeWidget(QWidget *parent)
: SieveEditorAbstractWidget(parent)
{
- QVBoxLayout *vlay = new QVBoxLayout;
+ QVBoxLayout *vlay = new QVBoxLayout(this);
vlay->setMargin(0);
mSplitter = new QSplitter;
@@ -63,7 +63,6 @@ SieveEditorGraphicalModeWidget::SieveEditorGraphicalModeWidget(QWidget *parent)
connect(mSieveParsingWarning, &SieveEditorParsingMissingFeatureWarning::switchToTextMode, this, &SieveEditorGraphicalModeWidget::slotSwitchToTextMode);
vlay->addWidget(mSieveParsingWarning);
- setLayout(vlay);
readConfig();
}
diff --git a/src/ksieveui/autocreatescripts/sieveforeverypartwidget.cpp b/src/ksieveui/autocreatescripts/sieveforeverypartwidget.cpp
index 327af89..760ed2a 100644
--- a/src/ksieveui/autocreatescripts/sieveforeverypartwidget.cpp
+++ b/src/ksieveui/autocreatescripts/sieveforeverypartwidget.cpp
@@ -39,7 +39,7 @@ namespace KSieveUi
SieveForEveryPartWidget::SieveForEveryPartWidget(QWidget *parent)
: SieveWidgetPageAbstract(parent)
{
- QVBoxLayout *topLayout = new QVBoxLayout;
+ QVBoxLayout *topLayout = new QVBoxLayout(this);
QWidget *w = new QWidget;
QHBoxLayout *lay = new QHBoxLayout;
@@ -66,7 +66,6 @@ SieveForEveryPartWidget::SieveForEveryPartWidget(QWidget *parent)
connect(mForLoop, &QCheckBox::clicked, mName, &QLineEdit::setEnabled);
setPageType(KSieveUi::SieveScriptBlockWidget::ForEveryPart);
- setLayout(topLayout);
}
SieveForEveryPartWidget::~SieveForEveryPartWidget()
diff --git a/src/ksieveui/autocreatescripts/sieveglobalvariablewidget.cpp b/src/ksieveui/autocreatescripts/sieveglobalvariablewidget.cpp
index c935b9a..fadc23a 100644
--- a/src/ksieveui/autocreatescripts/sieveglobalvariablewidget.cpp
+++ b/src/ksieveui/autocreatescripts/sieveglobalvariablewidget.cpp
@@ -158,16 +158,15 @@ void SieveGlobalVariableActionWidget::updateAddRemoveButton(bool addButtonEnable
SieveGlobalVariableWidget::SieveGlobalVariableWidget(QWidget *parent)
: SieveWidgetPageAbstract(parent)
{
- QVBoxLayout *lay = new QVBoxLayout;
- mHelpButton = new SieveHelpButton;
+ QVBoxLayout *lay = new QVBoxLayout(this);
+ mHelpButton = new SieveHelpButton(this);
lay->addWidget(mHelpButton);
connect(mHelpButton, &SieveHelpButton::clicked, this, &SieveGlobalVariableWidget::slotHelp);
- mIncludeLister = new SieveGlobalVariableLister;
+ mIncludeLister = new SieveGlobalVariableLister(this);
connect(mIncludeLister, &SieveGlobalVariableLister::valueChanged, this, &SieveGlobalVariableWidget::valueChanged);
lay->addWidget(mIncludeLister, 0, Qt::AlignTop);
setPageType(KSieveUi::SieveScriptBlockWidget::GlobalVariable);
- setLayout(lay);
}
SieveGlobalVariableWidget::~SieveGlobalVariableWidget()
diff --git a/src/ksieveui/autocreatescripts/sievescriptblockwidget.cpp b/src/ksieveui/autocreatescripts/sievescriptblockwidget.cpp
index 49ea720..52973eb 100644
--- a/src/ksieveui/autocreatescripts/sievescriptblockwidget.cpp
+++ b/src/ksieveui/autocreatescripts/sievescriptblockwidget.cpp
@@ -40,7 +40,7 @@ SieveScriptBlockWidget::SieveScriptBlockWidget(QWidget *parent)
: SieveWidgetPageAbstract(parent),
mMatchCondition(AndCondition)
{
- QVBoxLayout *topLayout = new QVBoxLayout;
+ QVBoxLayout *topLayout = new QVBoxLayout(this);
topLayout->setMargin(0);
mConditions = new QGroupBox(i18n("Conditions"));
@@ -94,8 +94,6 @@ SieveScriptBlockWidget::SieveScriptBlockWidget(QWidget *parent)
connect(mAddBlockType, &QPushButton::clicked, this, &SieveScriptBlockWidget::slotAddBlock);
topLayout->addLayout(newBlockLayout);
-
- setLayout(topLayout);
}
SieveScriptBlockWidget::~SieveScriptBlockWidget()
diff --git a/src/ksieveui/autocreatescripts/sievescriptdescriptiondialog.cpp b/src/ksieveui/autocreatescripts/sievescriptdescriptiondialog.cpp
index ad13e06..1ff3b48 100644
--- a/src/ksieveui/autocreatescripts/sievescriptdescriptiondialog.cpp
+++ b/src/ksieveui/autocreatescripts/sievescriptdescriptiondialog.cpp
@@ -33,15 +33,16 @@ SieveScriptDescriptionDialog::SieveScriptDescriptionDialog(QWidget *parent)
: QDialog(parent)
{
setWindowTitle(i18n("Description"));
- QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
- QVBoxLayout *mainLayout = new QVBoxLayout;
- setLayout(mainLayout);
+ QVBoxLayout *mainLayout = new QVBoxLayout(this);
+
+ mEdit = new KPIMTextEdit::PlainTextEditorWidget(this);
+
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, &QDialogButtonBox::accepted, this, &SieveScriptDescriptionDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &SieveScriptDescriptionDialog::reject);
- mEdit = new KPIMTextEdit::PlainTextEditorWidget;
mainLayout->addWidget(mEdit);
mainLayout->addWidget(buttonBox);
diff --git a/src/ksieveui/autocreatescripts/sievescriptlistbox.cpp b/src/ksieveui/autocreatescripts/sievescriptlistbox.cpp
index 99c79a1..ed9963d 100644
--- a/src/ksieveui/autocreatescripts/sievescriptlistbox.cpp
+++ b/src/ksieveui/autocreatescripts/sievescriptlistbox.cpp
@@ -96,8 +96,8 @@ SieveScriptListBox::SieveScriptListBox(const QString &title, QWidget *parent)
: QGroupBox(title, parent),
mScriptNumber(0)
{
- QVBoxLayout *layout = new QVBoxLayout();
- mSieveListScript = new QListWidget;
+ QVBoxLayout *layout = new QVBoxLayout(this);
+ mSieveListScript = new QListWidget(this);
layout->addWidget(mSieveListScript);
//----------- the first row of buttons
@@ -166,7 +166,6 @@ SieveScriptListBox::SieveScriptListBox(const QString &title, QWidget *parent)
hbHBoxLayout->addWidget(mBtnDescription);
layout->addWidget(hb);
- setLayout(layout);
connect(mBtnNew, &QPushButton::clicked, this, &SieveScriptListBox::slotNew);
connect(mBtnDelete, &QPushButton::clicked, this, &SieveScriptListBox::slotDelete);
diff --git a/src/ksieveui/autocreatescripts/sievescriptpage.cpp b/src/ksieveui/autocreatescripts/sievescriptpage.cpp
index 7b15d6b..d2451dd 100644
--- a/src/ksieveui/autocreatescripts/sievescriptpage.cpp
+++ b/src/ksieveui/autocreatescripts/sievescriptpage.cpp
@@ -41,23 +41,23 @@ SieveScriptPage::SieveScriptPage(QWidget *parent)
mGlobalVariableWidget(Q_NULLPTR),
mBlockIfWidget(Q_NULLPTR)
{
- QVBoxLayout *topLayout = new QVBoxLayout;
+ QVBoxLayout *topLayout = new QVBoxLayout(this);
topLayout->setMargin(0);
- mTabWidget = new SieveScriptTabWidget;
+ mTabWidget = new SieveScriptTabWidget(this);
connect(mTabWidget, &SieveScriptTabWidget::tabCloseRequested, this, &SieveScriptPage::slotCloseTab);
if (SieveEditorGraphicalModeWidget::sieveCapabilities().contains(QStringLiteral("include"))) {
- mIncludeWidget = new SieveIncludeWidget;
+ mIncludeWidget = new SieveIncludeWidget(this);
connect(mIncludeWidget, &SieveIncludeWidget::valueChanged, this, &SieveScriptPage::valueChanged);
mTabWidget->addTab(mIncludeWidget, i18n("Includes"));
- mGlobalVariableWidget = new SieveGlobalVariableWidget;
+ mGlobalVariableWidget = new SieveGlobalVariableWidget(this);
connect(mGlobalVariableWidget, &SieveGlobalVariableWidget::valueChanged, this, &SieveScriptPage::valueChanged);
mTabWidget->addTab(mGlobalVariableWidget, i18n("Global Variable"));
}
if (SieveEditorGraphicalModeWidget::sieveCapabilities().contains(QStringLiteral("foreverypart"))) {
- mForEveryPartWidget = new SieveForEveryPartWidget;
+ mForEveryPartWidget = new SieveForEveryPartWidget(this);
connect(mForEveryPartWidget, &SieveForEveryPartWidget::valueChanged, this, &SieveScriptPage::valueChanged);
mTabWidget->addTab(mForEveryPartWidget, i18n("ForEveryPart"));
}
@@ -66,7 +66,6 @@ SieveScriptPage::SieveScriptPage(QWidget *parent)
mTabWidget->addTab(mBlockIfWidget, blockName(KSieveUi::SieveScriptBlockWidget::BlockIf));
topLayout->addWidget(mTabWidget);
mTabWidget->setCurrentWidget(mBlockIfWidget);
- setLayout(topLayout);
}
SieveScriptPage::~SieveScriptPage()
diff --git a/src/ksieveui/autocreatescripts/sievescriptparsingerrordialog.cpp b/src/ksieveui/autocreatescripts/sievescriptparsingerrordialog.cpp
index fe190e7..61b6534 100644
--- a/src/ksieveui/autocreatescripts/sievescriptparsingerrordialog.cpp
+++ b/src/ksieveui/autocreatescripts/sievescriptparsingerrordialog.cpp
@@ -34,17 +34,16 @@ SieveScriptParsingErrorDialog::SieveScriptParsingErrorDialog(QWidget *parent)
: QDialog(parent)
{
setWindowTitle(i18n("Sieve Parsing Error"));
+ QVBoxLayout *mainLayout = new QVBoxLayout(this);
+
+ mTextEdit = new KPIMTextEdit::RichTextEditorWidget(this);
+ mTextEdit->setReadOnly(true);
+
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
- QVBoxLayout *mainLayout = new QVBoxLayout;
- setLayout(mainLayout);
QPushButton *user1Button = new QPushButton;
buttonBox->addButton(user1Button, QDialogButtonBox::ActionRole);
connect(buttonBox, &QDialogButtonBox::rejected, this, &SieveScriptParsingErrorDialog::reject);
user1Button->setText(i18n("Save As..."));
-
- mTextEdit = new KPIMTextEdit::RichTextEditorWidget(this);
-
- mTextEdit->setReadOnly(true);
readConfig();
connect(user1Button, &QPushButton::clicked, this, &SieveScriptParsingErrorDialog::slotSaveAs);
mainLayout->addWidget(mTextEdit);
diff --git a/src/ksieveui/debug/sievedebugdialog.cpp b/src/ksieveui/debug/sievedebugdialog.cpp
index e9521b4..9443e2c 100644
--- a/src/ksieveui/debug/sievedebugdialog.cpp
+++ b/src/ksieveui/debug/sievedebugdialog.cpp
@@ -36,10 +36,7 @@ SieveDebugDialog::SieveDebugDialog(QWidget *parent)
mShutDownJob(Q_NULLPTR)
{
setWindowTitle(i18n("Sieve Diagnostics"));
- QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
- QVBoxLayout *mainLayout = new QVBoxLayout;
- setLayout(mainLayout);
- connect(buttonBox, &QDialogButtonBox::rejected, this, &SieveDebugDialog::reject);
+ QVBoxLayout *mainLayout = new QVBoxLayout(this);
// Collect all accounts
const Akonadi::AgentInstance::List lst = KSieveUi::Util::imapAgentInstances();
@@ -50,6 +47,9 @@ SieveDebugDialog::SieveDebugDialog(QWidget *parent)
mEdit = new KPIMTextEdit::PlainTextEditorWidget(this);
mEdit->setReadOnly(true);
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this);
+ connect(buttonBox, &QDialogButtonBox::rejected, this, &SieveDebugDialog::reject);
+
mainLayout->addWidget(mEdit);
mainLayout->addWidget(buttonBox);
diff --git a/src/ksieveui/editor/sieveeditor.cpp b/src/ksieveui/editor/sieveeditor.cpp
index a6a5b14..b4dd753 100644
--- a/src/ksieveui/editor/sieveeditor.cpp
+++ b/src/ksieveui/editor/sieveeditor.cpp
@@ -48,9 +48,9 @@ SieveEditor::SieveEditor(QWidget *parent)
d(new KSieveUi::SieveEditorPrivate)
{
setWindowTitle(i18n("Edit Sieve Script"));
+ QVBoxLayout *mainLayout = new QVBoxLayout(this);
+
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
- QVBoxLayout *mainLayout = new QVBoxLayout;
- setLayout(mainLayout);
d->mOkButton = buttonBox->button(QDialogButtonBox::Ok);
d->mOkButton->setDefault(true);
d->mOkButton->setShortcut(Qt::CTRL | Qt::Key_Return);
diff --git a/src/ksieveui/editor/sievetexteditwidget.cpp b/src/ksieveui/editor/sievetexteditwidget.cpp
index 9205bbd..8df6015 100644
--- a/src/ksieveui/editor/sievetexteditwidget.cpp
+++ b/src/ksieveui/editor/sievetexteditwidget.cpp
@@ -59,9 +59,8 @@ SieveTextEditWidget::~SieveTextEditWidget()
void SieveTextEditWidget::initialize(KSieveUi::SieveTextEdit *custom)
{
- QVBoxLayout *mainLayout = new QVBoxLayout;
+ QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setMargin(0);
- setLayout(mainLayout);
if (custom) {
d->mTextEdit = custom;
} else {
diff --git a/src/ksieveui/scriptsparsing/parsingresultdialog.cpp b/src/ksieveui/scriptsparsing/parsingresultdialog.cpp
index f6b9bc9..25a789b 100644
--- a/src/ksieveui/scriptsparsing/parsingresultdialog.cpp
+++ b/src/ksieveui/scriptsparsing/parsingresultdialog.cpp
@@ -38,9 +38,8 @@ ParsingResultDialog::ParsingResultDialog(QWidget *parent)
setWindowTitle(i18n("Sieve Parsing"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
- QVBoxLayout *mainLayout = new QVBoxLayout;
- setLayout(mainLayout);
- QPushButton *user1Button = new QPushButton;
+ QVBoxLayout *mainLayout = new QVBoxLayout(this);
+ QPushButton *user1Button = new QPushButton(this);
buttonBox->addButton(user1Button, QDialogButtonBox::ActionRole);
connect(buttonBox, &QDialogButtonBox::rejected, this, &ParsingResultDialog::reject);
user1Button->setText(i18n("Save As..."));