Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KDE PIM Add-ons
Commits
e53fde3c
Commit
e53fde3c
authored
Feb 04, 2022
by
Laurent Montel
Browse files
Add isValid
parent
34719d5a
Pipeline
#132948
failed with stage
in 13 minutes and 45 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
plugins/messageviewerconfigureplugins/openurlwith/openurlwithconfigurecreatewidget.cpp
View file @
e53fde3c
...
...
@@ -43,3 +43,8 @@ void OpenUrlWithConfigureCreateWidget::setInfo(const OpenUrlWithInfo &i)
mServerName
->
setText
(
i
.
url
);
mCommand
->
setText
(
i
.
command
);
}
bool
OpenUrlWithConfigureCreateWidget
::
OpenUrlWithInfo
::
isValid
()
const
{
return
!
url
.
trimmed
().
isEmpty
()
&&
!
command
.
trimmed
().
isEmpty
();
}
plugins/messageviewerconfigureplugins/openurlwith/openurlwithconfigurecreatewidget.h
View file @
e53fde3c
...
...
@@ -15,6 +15,7 @@ public:
struct
OpenUrlWithInfo
{
QString
command
;
QString
url
;
Q_REQUIRED_RESULT
bool
isValid
()
const
;
};
explicit
OpenUrlWithConfigureCreateWidget
(
QWidget
*
parent
=
nullptr
);
...
...
@@ -22,7 +23,6 @@ public:
Q_REQUIRED_RESULT
OpenUrlWithInfo
info
()
const
;
void
setInfo
(
const
OpenUrlWithInfo
&
i
);
private:
QLineEdit
*
const
mServerName
;
QLineEdit
*
const
mCommand
;
...
...
plugins/messageviewerconfigureplugins/openurlwith/openurlwithconfigurewidget.cpp
View file @
e53fde3c
...
...
@@ -70,9 +70,11 @@ void OpenUrlWithConfigureWidget::slotAddRule()
QPointer
<
OpenUrlWithConfigureCreateDialog
>
dlg
=
new
OpenUrlWithConfigureCreateDialog
(
this
);
if
(
dlg
->
exec
())
{
const
OpenUrlWithConfigureCreateWidget
::
OpenUrlWithInfo
info
=
dlg
->
info
();
auto
item
=
new
QTreeWidgetItem
(
mTreeWidget
);
item
->
setText
(
0
,
info
.
url
);
item
->
setText
(
1
,
info
.
command
);
if
(
info
.
isValid
())
{
auto
item
=
new
QTreeWidgetItem
(
mTreeWidget
);
item
->
setText
(
0
,
info
.
url
);
item
->
setText
(
1
,
info
.
command
);
}
}
delete
dlg
;
}
...
...
@@ -88,8 +90,10 @@ void OpenUrlWithConfigureWidget::slotEditRule()
dlg
->
setInfo
(
info
);
if
(
dlg
->
exec
())
{
const
OpenUrlWithConfigureCreateWidget
::
OpenUrlWithInfo
info
=
dlg
->
info
();
item
->
setText
(
0
,
info
.
url
);
item
->
setText
(
1
,
info
.
command
);
if
(
info
.
isValid
())
{
item
->
setText
(
0
,
info
.
url
);
item
->
setText
(
1
,
info
.
command
);
}
}
delete
dlg
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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