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

Coding style

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