Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
KDE PIM Add-ons
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PIM
KDE PIM Add-ons
Commits
ac3b1b62
Commit
ac3b1b62
authored
May 21, 2017
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Verify if kregexpeditor is installed
parent
a0a31c35
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
sieveeditor/regexeditorlineedit/regexpeditorlineedit.cpp
sieveeditor/regexeditorlineedit/regexpeditorlineedit.cpp
+8
-3
sieveeditor/regexeditorlineedit/regexpeditorlineedit.h
sieveeditor/regexeditorlineedit/regexpeditorlineedit.h
+1
-0
No files found.
sieveeditor/regexeditorlineedit/regexpeditorlineedit.cpp
View file @
ac3b1b62
...
...
@@ -25,6 +25,7 @@
#include <QLineEdit>
#include <QPushButton>
#include <KLocalizedString>
#include <KServiceTypeTrader>
K_PLUGIN_FACTORY_WITH_JSON
(
RegexpEditorLineEditFactory
,
"regexepeditorlineedit.json"
,
registerPlugin
<
RegexpEditorLineEdit
>
();
...
...
@@ -33,6 +34,7 @@ K_PLUGIN_FACTORY_WITH_JSON(RegexpEditorLineEditFactory, "regexepeditorlineedit.j
RegexpEditorLineEdit
::
RegexpEditorLineEdit
(
QWidget
*
parent
,
const
QList
<
QVariant
>
&
)
:
KSieveUi
::
AbstractRegexpEditorLineEdit
(
parent
)
,
mIsRegExpMode
(
false
)
,
mRegexEditorInstalled
(
false
)
{
QHBoxLayout
*
mainLayout
=
new
QHBoxLayout
(
this
);
mainLayout
->
setObjectName
(
QStringLiteral
(
"mainlayout"
));
...
...
@@ -45,8 +47,9 @@ RegexpEditorLineEdit::RegexpEditorLineEdit(QWidget *parent, const QList<QVariant
mRegExpEditorButton
->
setObjectName
(
QStringLiteral
(
"regexpbutton"
));
mRegExpEditorButton
->
setToolTip
(
i18n
(
"Create Regular Expression"
));
mainLayout
->
addWidget
(
mRegExpEditorButton
);
//hide button ?
mRegexEditorInstalled
=
!
KServiceTypeTrader
::
self
()
->
query
(
QStringLiteral
(
"KRegExpEditor/KRegExpEditor"
)).
isEmpty
();
//Hidden by default
mRegExpEditorButton
->
setVisible
(
false
);
}
RegexpEditorLineEdit
::~
RegexpEditorLineEdit
()
...
...
@@ -56,7 +59,9 @@ RegexpEditorLineEdit::~RegexpEditorLineEdit()
void
RegexpEditorLineEdit
::
switchToRegexpEditorLineEdit
(
bool
regexpEditor
)
{
mIsRegExpMode
=
regexpEditor
;
//TODO update
if
(
mRegexEditorInstalled
)
{
mRegExpEditorButton
->
setVisible
(
mIsRegExpMode
);
}
}
void
RegexpEditorLineEdit
::
setCode
(
const
QString
&
str
)
...
...
sieveeditor/regexeditorlineedit/regexpeditorlineedit.h
View file @
ac3b1b62
...
...
@@ -38,6 +38,7 @@ private:
QLineEdit
*
mLineEdit
;
QPushButton
*
mRegExpEditorButton
;
bool
mIsRegExpMode
;
bool
mRegexEditorInstalled
;
};
#endif // REGEXPEDITORLINEEDIT_H
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