Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
PIM
libksieve
Commits
5b1604bf
Commit
5b1604bf
authored
Jun 05, 2017
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start using AbstractRegexpEditorLineEdit
parent
bf553843
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
src/ksieveui/autocreatescripts/commonwidgets/selectmatchtypecombobox.cpp
...tocreatescripts/commonwidgets/selectmatchtypecombobox.cpp
+3
-0
src/ksieveui/autocreatescripts/sieveconditions/sieveconditionhasflag.cpp
...tocreatescripts/sieveconditions/sieveconditionhasflag.cpp
+9
-8
No files found.
src/ksieveui/autocreatescripts/commonwidgets/selectmatchtypecombobox.cpp
View file @
5b1604bf
...
...
@@ -74,6 +74,9 @@ void SelectMatchTypeComboBox::setCode(const QString &code, const QString &name,
const
int
index
=
findData
(
code
);
if
(
index
!=
-
1
)
{
setCurrentIndex
(
index
);
//TODO optimize
const
QString
value
=
itemData
(
index
).
toString
();
Q_EMIT
switchToRegexp
(
value
.
contains
(
QStringLiteral
(
"regex"
)));
}
else
{
AutoCreateScriptUtil
::
comboboxItemNotFound
(
code
,
name
,
error
);
setCurrentIndex
(
0
);
...
...
src/ksieveui/autocreatescripts/sieveconditions/sieveconditionhasflag.cpp
View file @
5b1604bf
...
...
@@ -67,8 +67,9 @@ QWidget *SieveConditionHasFlag::createParamWidget(QWidget *parent) const
QLabel
*
lab
=
new
QLabel
(
i18n
(
"Value:"
));
grid
->
addWidget
(
lab
,
row
,
0
);
QLineEdit
*
value
=
new
QLineEdit
;
connect
(
value
,
&
QLineEdit
::
textChanged
,
this
,
&
SieveConditionHasFlag
::
valueChanged
);
AbstractRegexpEditorLineEdit
*
value
=
AutoCreateScriptUtil
::
createRegexpEditorLineEdit
();
connect
(
value
,
&
AbstractRegexpEditorLineEdit
::
textChanged
,
this
,
&
SieveConditionHasFlag
::
valueChanged
);
connect
(
selecttype
,
&
SelectMatchTypeComboBox
::
switchToRegexp
,
value
,
&
AbstractRegexpEditorLineEdit
::
switchToRegexpEditorLineEdit
);
value
->
setObjectName
(
QStringLiteral
(
"value"
));
grid
->
addWidget
(
value
,
row
,
1
);
...
...
@@ -90,8 +91,8 @@ QString SieveConditionHasFlag::code(QWidget *w) const
result
+=
QLatin1String
(
"
\"
"
)
+
variableNameStr
+
QLatin1Char
(
'"'
);
}
const
Q
LineEdit
*
value
=
w
->
findChild
<
Q
LineEdit
*>
(
QStringLiteral
(
"value"
));
const
QString
valueStr
=
value
->
text
();
const
AbstractRegexpEditor
LineEdit
*
value
=
w
->
findChild
<
AbstractRegexpEditor
LineEdit
*>
(
QStringLiteral
(
"value"
));
const
QString
valueStr
=
value
->
code
();
result
+=
QLatin1String
(
"
\"
"
)
+
valueStr
+
QLatin1Char
(
'"'
);
}
return
result
+
AutoCreateScriptUtil
::
generateConditionComment
(
comment
());
...
...
@@ -169,16 +170,16 @@ bool SieveConditionHasFlag::setParamWidgetValue(const QDomElement &element, QWid
switch
(
strList
.
count
())
{
case
1
:
{
Q
LineEdit
*
value
=
w
->
findChild
<
Q
LineEdit
*>
(
QStringLiteral
(
"value"
));
value
->
set
Text
(
strList
.
at
(
0
));
AbstractRegexpEditor
LineEdit
*
value
=
w
->
findChild
<
AbstractRegexpEditor
LineEdit
*>
(
QStringLiteral
(
"value"
));
value
->
set
Code
(
strList
.
at
(
0
));
break
;
}
case
2
:
if
(
hasVariableSupport
)
{
QLineEdit
*
variableName
=
w
->
findChild
<
QLineEdit
*>
(
QStringLiteral
(
"variablename"
));
variableName
->
setText
(
strList
.
at
(
0
));
Q
LineEdit
*
value
=
w
->
findChild
<
Q
LineEdit
*>
(
QStringLiteral
(
"value"
));
value
->
set
Text
(
strList
.
at
(
1
));
AbstractRegexpEditor
LineEdit
*
value
=
w
->
findChild
<
AbstractRegexpEditor
LineEdit
*>
(
QStringLiteral
(
"value"
));
value
->
set
Code
(
strList
.
at
(
1
));
}
else
{
qCDebug
(
LIBKSIEVE_LOG
)
<<
" SieveConditionHasFlag has not variable support"
;
}
...
...
Write
Preview
Markdown
is supported
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