Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
libksieve
Commits
4f16b16e
Commit
4f16b16e
authored
Oct 31, 2021
by
Laurent Montel
😁
Browse files
Modernize code
parent
54b26bb2
Pipeline
#92790
canceled with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/ksieveui/autocreatescripts/sieveactionwidgetlister.cpp
View file @
4f16b16e
...
...
@@ -112,31 +112,28 @@ void SieveActionWidget::initWidget()
mComboBox
->
setEditable
(
false
);
mComboBox
->
setMinimumWidth
(
50
);
const
QVector
<
KSieveUi
::
SieveAction
*>
list
=
KSieveUi
::
SieveActionList
::
actionList
(
mSieveGraphicalModeWidget
);
QVector
<
KSieveUi
::
SieveAction
*>::
const_iterator
it
;
QVector
<
KSieveUi
::
SieveAction
*>::
const_iterator
end
(
list
.
constEnd
());
int
index
=
0
;
QStringList
listCapabilities
=
mSieveGraphicalModeWidget
->
sieveCapabilities
();
// imapflags was old name of imap4flags but still used.
if
(
listCapabilities
.
contains
(
QLatin1String
(
"imap4flags"
)))
{
listCapabilities
.
append
(
QStringLiteral
(
"imapflags"
));
}
for
(
index
=
0
,
it
=
list
.
constBegin
();
it
!=
end
;
++
it
,
++
index
)
{
if
(
(
*
it
)
->
needCheckIfServerHasCapability
())
{
if
(
listCapabilities
.
contains
(
(
*
it
)
->
serverNeedsCapability
()))
{
for
(
const
auto
&
action
:
list
)
{
if
(
action
->
needCheckIfServerHasCapability
())
{
if
(
listCapabilities
.
contains
(
action
->
serverNeedsCapability
()))
{
// append to the list of actions:
mActionList
.
append
(
*
it
);
connect
(
*
it
,
&
SieveAction
::
valueChanged
,
this
,
&
SieveActionWidget
::
valueChanged
);
mActionList
.
append
(
action
);
connect
(
action
,
&
SieveAction
::
valueChanged
,
this
,
&
SieveActionWidget
::
valueChanged
);
// add (i18n-ized) name to combo box
mComboBox
->
addItem
(
(
*
it
)
->
label
(),
(
*
it
)
->
name
());
mComboBox
->
addItem
(
action
->
label
(),
action
->
name
());
}
else
{
delete
(
*
it
);
delete
(
action
);
}
}
else
{
// append to the list of actions:
mActionList
.
append
(
*
it
);
connect
(
*
it
,
&
SieveAction
::
valueChanged
,
this
,
&
SieveActionWidget
::
valueChanged
);
mActionList
.
append
(
action
);
connect
(
action
,
&
SieveAction
::
valueChanged
,
this
,
&
SieveActionWidget
::
valueChanged
);
// add (i18n-ized) name to combo box
mComboBox
->
addItem
(
(
*
it
)
->
label
(),
(
*
it
)
->
name
());
mComboBox
->
addItem
(
action
->
label
(),
action
->
name
());
}
}
...
...
src/ksieveui/debug/sievedebugdialog.cpp
View file @
4f16b16e
...
...
@@ -220,9 +220,8 @@ void SieveDebugDialog::slotGetScriptList(KManageSieve::SieveJob *job, bool succe
if
(
caps
.
isEmpty
())
{
mEdit
->
editor
()
->
appendPlainText
(
i18n
(
"(No special capabilities available)"
));
}
else
{
QStringList
::
const_iterator
end
=
caps
.
constEnd
();
for
(
QStringList
::
const_iterator
it
=
caps
.
constBegin
();
it
!=
end
;
++
it
)
{
mEdit
->
editor
()
->
appendPlainText
(
QLatin1String
(
"* "
)
+
*
it
+
QLatin1Char
(
'\n'
));
for
(
const
auto
&
str
:
caps
)
{
mEdit
->
editor
()
->
appendPlainText
(
QLatin1String
(
"* "
)
+
str
+
QLatin1Char
(
'\n'
));
}
mEdit
->
editor
()
->
appendPlainText
(
QStringLiteral
(
"
\n
"
));
}
...
...
@@ -233,9 +232,8 @@ void SieveDebugDialog::slotGetScriptList(KManageSieve::SieveJob *job, bool succe
mEdit
->
editor
()
->
appendPlainText
(
i18n
(
"(No Sieve scripts available on this server)
\n\n
"
));
}
else
{
mScriptList
=
scriptList
;
QStringList
::
const_iterator
end
=
scriptList
.
constEnd
();
for
(
QStringList
::
const_iterator
it
=
scriptList
.
constBegin
();
it
!=
end
;
++
it
)
{
mEdit
->
editor
()
->
appendPlainText
(
QLatin1String
(
"* "
)
+
*
it
+
QLatin1Char
(
'\n'
));
for
(
const
auto
&
str
:
scriptList
)
{
mEdit
->
editor
()
->
appendPlainText
(
QLatin1String
(
"* "
)
+
str
+
QLatin1Char
(
'\n'
));
}
mEdit
->
editor
()
->
appendPlainText
(
QStringLiteral
(
"
\n
"
));
mEdit
->
editor
()
->
appendPlainText
(
i18n
(
"Active script: '%1'
\n\n
"
,
activeScript
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment