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
P
PIM Sieve Editor
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
1
Merge Requests
1
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
PIM Sieve Editor
Commits
2ac9dae9
Commit
2ac9dae9
authored
Jul 16, 2016
by
David Faure
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SieveEditor: port to libksieve API changes
Differential Revision:
https://phabricator.kde.org/D2190
parent
2acdf4b0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
8 deletions
+15
-8
CMakeLists.txt
CMakeLists.txt
+1
-1
src/sieveeditorpagewidget.cpp
src/sieveeditorpagewidget.cpp
+13
-6
src/sieveeditorpagewidget.h
src/sieveeditorpagewidget.h
+1
-1
No files found.
CMakeLists.txt
View file @
2ac9dae9
...
...
@@ -43,7 +43,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${sieveeditor_SOURCE_DIR})
set
(
MESSAGELIB_LIB_VERSION_LIB
"5.2.91"
)
set
(
PIMCOMMON_LIB_VERSION_LIB
"5.2.80"
)
set
(
LIBKSIEVE_LIB_VERSION_LIB
"5.2.8
2
"
)
set
(
LIBKSIEVE_LIB_VERSION_LIB
"5.2.8
3
"
)
set
(
QT_REQUIRED_VERSION
"5.6.0"
)
find_package
(
Qt5
${
QT_REQUIRED_VERSION
}
CONFIG REQUIRED Widgets Network Test
)
...
...
src/sieveeditorpagewidget.cpp
View file @
2ac9dae9
...
...
@@ -56,17 +56,19 @@ void SieveEditorPageWidget::slotCheckSyntaxClicked()
const
QString
script
=
mSieveEditorWidget
->
script
();
if
(
script
.
isEmpty
())
{
return
;
}
mSieveEditorWidget
->
addNormalMessage
(
i18n
(
"Uploading script to server for checking it, please wait..."
));
KManageSieve
::
SieveJob
*
job
=
KManageSieve
::
SieveJob
::
put
(
mCurrentURL
,
script
,
mWasActive
,
mWasActive
);
job
->
setInteractive
(
false
);
connect
(
job
,
&
KManageSieve
::
SieveJob
::
errorMessage
,
this
,
&
SieveEditorPageWidget
::
slotPutResultDebug
);
connect
(
job
,
&
KManageSieve
::
SieveJob
::
result
,
this
,
&
SieveEditorPageWidget
::
slotPutResultDebug
);
}
void
SieveEditorPageWidget
::
slotPutResultDebug
(
KManageSieve
::
SieveJob
*
,
bool
success
,
const
QString
&
errorMsg
)
void
SieveEditorPageWidget
::
slotPutResultDebug
(
KManageSieve
::
SieveJob
*
job
,
bool
success
)
{
if
(
success
)
{
mSieveEditorWidget
->
addOkMessage
(
i18n
(
"No errors found."
));
}
else
{
const
QString
errorMsg
=
job
->
errorString
();
if
(
errorMsg
.
isEmpty
())
{
mSieveEditorWidget
->
addFailedMessage
(
i18n
(
"An unknown error was encountered."
));
}
else
{
...
...
@@ -74,8 +76,7 @@ void SieveEditorPageWidget::slotPutResultDebug(KManageSieve::SieveJob *, bool su
}
}
//Put original script after check otherwise we will put a script even if we don't click on ok
KManageSieve
::
SieveJob
*
job
=
KManageSieve
::
SieveJob
::
put
(
mCurrentURL
,
mSieveEditorWidget
->
originalScript
(),
mWasActive
,
mWasActive
);
job
->
setInteractive
(
false
);
KManageSieve
::
SieveJob
*
restoreJob
=
KManageSieve
::
SieveJob
::
put
(
mCurrentURL
,
mSieveEditorWidget
->
originalScript
(),
mWasActive
,
mWasActive
);
mSieveEditorWidget
->
resultDone
();
}
...
...
@@ -134,7 +135,13 @@ void SieveEditorPageWidget::slotPutResult(KManageSieve::SieveJob *job, bool succ
mSieveEditorWidget
->
updateOriginalScript
();
mSieveEditorWidget
->
setModified
(
false
);
}
else
{
//TODO error
const
QString
msg
=
job
->
errorString
();
if
(
msg
.
isEmpty
())
KMessageBox
::
error
(
Q_NULLPTR
,
i18n
(
"Uploading the Sieve script failed.
\n
"
"The server responded:
\n
%1"
,
msg
,
i18n
(
"Sieve Error"
)));
else
{
KMessageBox
::
error
(
Q_NULLPTR
,
msg
,
i18n
(
"Sieve Error"
));
}
}
}
...
...
src/sieveeditorpagewidget.h
View file @
2ac9dae9
...
...
@@ -97,7 +97,7 @@ Q_SIGNALS:
private
Q_SLOTS
:
void
slotGetResult
(
KManageSieve
::
SieveJob
*
,
bool
success
,
const
QString
&
script
,
bool
isActive
);
void
slotCheckSyntaxClicked
();
void
slotPutResultDebug
(
KManageSieve
::
SieveJob
*
,
bool
success
,
const
QString
&
errorMsg
);
void
slotPutResultDebug
(
KManageSieve
::
SieveJob
*
,
bool
success
);
void
slotPutResult
(
KManageSieve
::
SieveJob
*
,
bool
success
);
void
slotValueChanged
(
bool
b
);
...
...
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