Commit ca41e2c4 authored by Laurent Montel's avatar Laurent Montel 😁

Coding style

parent db9e7aa1
......@@ -138,12 +138,12 @@ void SieveActionWidget::initWidget()
}
}
mHelpButton = new SieveHelpButton;
mHelpButton = new SieveHelpButton(this);
mHelpButton->setEnabled(false);
connect(mHelpButton, &SieveHelpButton::clicked, this, &SieveActionWidget::slotHelp);
mLayout->addWidget(mHelpButton, 1, 0);
mCommentButton = new QToolButton;
mCommentButton = new QToolButton(this);
mCommentButton->setToolTip(i18n("Add comment"));
mCommentButton->setEnabled(false);
mLayout->addWidget(mCommentButton, 1, 1);
......
......@@ -115,7 +115,7 @@ void SieveConditionWidget::initWidget()
}
}
mHelpButton = new SieveHelpButton;
mHelpButton = new SieveHelpButton(this);
mHelpButton->setEnabled(false);
mLayout->addWidget(mHelpButton, 1, 0);
connect(mHelpButton, &SieveHelpButton::clicked, this, &SieveConditionWidget::slotHelp);
......
......@@ -34,8 +34,8 @@
#include <QDomNode>
#include "libksieve_debug.h"
namespace KSieveUi
{
using namespace KSieveUi;
SieveForEveryPartWidget::SieveForEveryPartWidget(QWidget *parent)
: SieveWidgetPageAbstract(parent)
{
......@@ -115,5 +115,4 @@ void SieveForEveryPartWidget::loadScript(const QDomElement &element, QString &er
}
}
}
}
......@@ -35,8 +35,7 @@
#include "libksieve_debug.h"
#include <QDomNode>
namespace KSieveUi
{
using namespace KSieveUi;
static const int MINIMUMGLOBALVARIABLEACTION = 1;
static const int MAXIMUMGLOBALVARIABLEACTION = 15;
......@@ -328,5 +327,3 @@ void SieveGlobalVariableLister::loadSetVariable(const QDomElement &element, QStr
}
}
}
......@@ -36,8 +36,8 @@
#include <QDomNode>
#include "libksieve_debug.h"
namespace KSieveUi
{
using namespace KSieveUi;
static const int MINIMUMINCLUDEACTION = 1;
static const int MAXIMUMINCLUDEACTION = 20;
......@@ -332,5 +332,3 @@ void SieveIncludeWidgetLister::loadScript(const QDomElement &element, QString &e
w->loadScript(element, error);
}
}
......@@ -34,8 +34,8 @@
#include <QLabel>
#include "libksieve_debug.h"
namespace KSieveUi
{
using namespace KSieveUi;
SieveScriptBlockWidget::SieveScriptBlockWidget(SieveEditorGraphicalModeWidget *graphicalModeWidget, QWidget *parent)
: SieveWidgetPageAbstract(parent),
mMatchCondition(AndCondition),
......@@ -286,5 +286,3 @@ void SieveScriptBlockWidget::loadScript(const QDomElement &element, bool onlyAct
}
}
}
......@@ -32,8 +32,8 @@
#include <QVBoxLayout>
namespace KSieveUi
{
using namespace KSieveUi;
SieveScriptPage::SieveScriptPage(SieveEditorGraphicalModeWidget *sieveEditorGraphicalWidget, QWidget *parent)
: QWidget(parent),
mSieveGraphicalModeWidget(sieveEditorGraphicalWidget),
......@@ -179,6 +179,3 @@ SieveScriptBlockWidget *SieveScriptPage::blockIfWidget() const
{
return mBlockIfWidget;
}
}
......@@ -39,8 +39,8 @@ SieveScriptParsingErrorDialog::SieveScriptParsingErrorDialog(QWidget *parent)
mTextEdit = new KPIMTextEdit::RichTextEditorWidget(this);
mTextEdit->setReadOnly(true);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
QPushButton *user1Button = new QPushButton;
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this);
QPushButton *user1Button = new QPushButton(this);
buttonBox->addButton(user1Button, QDialogButtonBox::ActionRole);
connect(buttonBox, &QDialogButtonBox::rejected, this, &SieveScriptParsingErrorDialog::reject);
user1Button->setText(i18n("Save As..."));
......
......@@ -26,8 +26,7 @@
#include <QTabBar>
namespace KSieveUi
{
using namespace KSieveUi;
SieveScriptTabWidget::SieveScriptTabWidget(QWidget *parent)
: QTabWidget(parent)
......@@ -68,6 +67,3 @@ void SieveScriptTabWidget::slotTabContextMenuRequest(const QPoint &pos)
}
}
}
}
......@@ -19,8 +19,8 @@
#include "sievewidgetpageabstract.h"
namespace KSieveUi
{
using namespace KSieveUi;
SieveWidgetPageAbstract::SieveWidgetPageAbstract(QWidget *parent)
: QWidget(parent),
mType(BlockIf)
......@@ -40,6 +40,3 @@ SieveWidgetPageAbstract::PageType SieveWidgetPageAbstract::pageType() const
{
return mType;
}
}
......@@ -50,7 +50,7 @@ SieveEditor::SieveEditor(QWidget *parent)
setWindowTitle(i18n("Edit Sieve Script"));
QVBoxLayout *mainLayout = new QVBoxLayout(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
d->mOkButton = buttonBox->button(QDialogButtonBox::Ok);
d->mOkButton->setDefault(true);
d->mOkButton->setShortcut(Qt::CTRL | Qt::Key_Return);
......
......@@ -168,7 +168,6 @@ void SieveEditorMenuBar::slotUpdateActions()
mZoomResetAction->setEnabled(true);
mDebugSieveAction->setEnabled(!hasActionInHtmlModeToo);
mWordWrapAction->setEnabled(!hasActionInHtmlModeToo);
//TODO ?
mPrintAction->setEnabled(!hasActionInHtmlModeToo);
mPrintPreviewAction->setEnabled(!hasActionInHtmlModeToo);
}
......
......@@ -62,9 +62,8 @@ using namespace KSieveUi;
SieveEditorTextModeWidget::SieveEditorTextModeWidget(QWidget *parent)
: SieveEditorAbstractWidget(parent)
{
QVBoxLayout *lay = new QVBoxLayout;
QVBoxLayout *lay = new QVBoxLayout(this);
lay->setMargin(0);
setLayout(lay);
mMainSplitter = new QSplitter;
mMainSplitter->setOrientation(Qt::Vertical);
......@@ -185,8 +184,7 @@ SieveEditorTabWidget *SieveEditorTextModeWidget::tabWidget() const
void SieveEditorTextModeWidget::readConfig()
{
KConfigGroup group(KSharedConfig::openConfig(), "SieveEditor");
QList<int> size;
size << 400 << 100;
const QList<int> size = {400, 100};
mMainSplitter->setSizes(group.readEntry("mainSplitter", size));
mExtraSplitter->setSizes(group.readEntry("extraSplitter", size));
......
......@@ -94,7 +94,7 @@ FindBarBase::FindBarBase(QWidget *parent)
connect(mSearch, &KLineEdit::textChanged, this, &FindBarBase::autoSearch);
connect(mSearch, &KLineEdit::clearButtonClicked, this, &FindBarBase::slotClearSearch);
mStatus = new QLabel;
mStatus = new QLabel(this);
mStatus->setObjectName(QStringLiteral("status"));
QFontMetrics fm(mStatus->font());
mNotFoundString = i18n("Phrase not found");
......
......@@ -45,7 +45,7 @@ SieveEditorHelpHtmlWidget::SieveEditorHelpHtmlWidget(QWidget *parent)
mProgressIndicator->setObjectName(QStringLiteral("progressindicator"));
connect(mProgressIndicator, &SieveEditorLoadProgressIndicator::pixmapChanged, this, &SieveEditorHelpHtmlWidget::slotPixmapChanged);
connect(mProgressIndicator, &SieveEditorLoadProgressIndicator::loadFinished, this, &SieveEditorHelpHtmlWidget::slotLoadFinished);
mWebView = new SieveEditorWebEngineView;
mWebView = new SieveEditorWebEngineView(this);
mWebView->setObjectName(QStringLiteral("webview"));
connect(mWebView, &SieveEditorWebEngineView::titleChanged, this, &SieveEditorHelpHtmlWidget::slotTitleChanged);
connect(mWebView, &SieveEditorWebEngineView::loadStarted, this, &SieveEditorHelpHtmlWidget::slotLoadStarted);
......
......@@ -36,7 +36,7 @@ ParsingResultDialog::ParsingResultDialog(QWidget *parent)
: QDialog(parent)
{
setWindowTitle(i18n("Sieve Parsing"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
QPushButton *user1Button = new QPushButton(this);
......
......@@ -51,7 +51,7 @@ SieveScriptDebuggerFrontEndWidget::SieveScriptDebuggerFrontEndWidget(QWidget *pa
QFormLayout *formLayout = new QFormLayout;
mainLayout->addLayout(formLayout);
QLabel *emailLab = new QLabel(i18n("Email path:"));
QLabel *emailLab = new QLabel(i18n("Email path:"), this);
emailLab->setObjectName(QStringLiteral("emaillab"));
mEmailPath = new KUrlRequester(this);
......
......@@ -45,7 +45,7 @@ VacationPageWidget::VacationPageWidget(QWidget *parent)
mWasActive(false),
mHasDateSupport(false)
{
QVBoxLayout *lay = new QVBoxLayout;
QVBoxLayout *lay = new QVBoxLayout(this);
lay->setMargin(0);
mStackWidget = new QStackedWidget;
lay->addWidget(mStackWidget);
......@@ -80,7 +80,6 @@ VacationPageWidget::VacationPageWidget(QWidget *parent)
mStackWidget->addWidget(w);
mStackWidget->setCurrentIndex(Script);
setLayout(lay);
}
VacationPageWidget::~VacationPageWidget()
......
......@@ -528,7 +528,6 @@ void ManageSieveWidget::slotGotList(KManageSieve::SieveJob *job, bool success, c
}
d->mBlockSignal = false;
qCDebug(LIBKSIEVE_LOG) << " LOAD";
const bool hasKep14EditorMode = Util::hasKep14Support(job->sieveCapabilities(), listScript, activeScript);
if (hasKep14EditorMode) {
QUrl u = mUrls[parent];
......
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