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
f63257ec
Commit
f63257ec
authored
Nov 02, 2016
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
USe new class to check script
parent
48b64ee6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
23 deletions
+15
-23
CMakeLists.txt
CMakeLists.txt
+1
-1
src/sieveeditorpagewidget.cpp
src/sieveeditorpagewidget.cpp
+12
-20
src/sieveeditorpagewidget.h
src/sieveeditorpagewidget.h
+2
-2
No files found.
CMakeLists.txt
View file @
f63257ec
...
@@ -45,7 +45,7 @@ set(KDEPIM_LIB_VERSION "${KDEPIM_VERSION_NUMBER}")
...
@@ -45,7 +45,7 @@ set(KDEPIM_LIB_VERSION "${KDEPIM_VERSION_NUMBER}")
set
(
KDEPIM_LIB_SOVERSION
"5"
)
set
(
KDEPIM_LIB_SOVERSION
"5"
)
set
(
MESSAGELIB_LIB_VERSION_LIB
"5.3.47"
)
set
(
MESSAGELIB_LIB_VERSION_LIB
"5.3.47"
)
set
(
LIBKSIEVE_LIB_VERSION_LIB
"5.3.4
4
"
)
set
(
LIBKSIEVE_LIB_VERSION_LIB
"5.3.4
5
"
)
set
(
PIMCOMMON_LIB_VERSION_LIB
"5.3.41"
)
set
(
PIMCOMMON_LIB_VERSION_LIB
"5.3.41"
)
set
(
QT_REQUIRED_VERSION
"5.6.0"
)
set
(
QT_REQUIRED_VERSION
"5.6.0"
)
...
...
src/sieveeditorpagewidget.cpp
View file @
f63257ec
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
#include "sieveeditorpagewidget.h"
#include "sieveeditorpagewidget.h"
#include "ksieveui/sieveeditorwidget.h"
#include "ksieveui/sieveeditorwidget.h"
#include "ksieveui/checkscriptjob.h"
#include "sieveeditorglobalconfig.h"
#include "sieveeditorglobalconfig.h"
#include <kmanagesieve/sievejob.h>
#include <kmanagesieve/sievejob.h>
...
@@ -28,7 +29,7 @@
...
@@ -28,7 +29,7 @@
#include "sieveeditor_debug.h"
#include "sieveeditor_debug.h"
#include <QVBoxLayout>
#include <QVBoxLayout>
//#define USE_CHECK_SIEVE_METHOD 1
SieveEditorPageWidget
::
SieveEditorPageWidget
(
QWidget
*
parent
)
SieveEditorPageWidget
::
SieveEditorPageWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
),
:
QWidget
(
parent
),
mWasActive
(
false
),
mWasActive
(
false
),
...
@@ -60,31 +61,22 @@ void SieveEditorPageWidget::slotCheckSyntaxClicked()
...
@@ -60,31 +61,22 @@ void SieveEditorPageWidget::slotCheckSyntaxClicked()
}
}
mSieveEditorWidget
->
addNormalMessage
(
i18n
(
"Uploading script to server for checking it, please wait..."
));
mSieveEditorWidget
->
addNormalMessage
(
i18n
(
"Uploading script to server for checking it, please wait..."
));
#ifdef USE_CHECK_SIEVE_METHOD
KSieveUi
::
CheckScriptJob
*
checkScriptJob
=
new
KSieveUi
::
CheckScriptJob
(
this
);
KManageSieve
::
SieveJob
*
job
=
KManageSieve
::
SieveJob
::
check
(
mCurrentURL
,
script
);
connect
(
checkScriptJob
,
&
KSieveUi
::
CheckScriptJob
::
finished
,
this
,
&
SieveEditorPageWidget
::
slotCheckScriptJobFinished
);
c
onnect
(
job
,
&
KManageSieve
::
SieveJob
::
result
,
this
,
&
SieveEditorPageWidget
::
slotPutResultDebug
);
c
heckScriptJob
->
setUrl
(
mCurrentURL
);
#else
checkScriptJob
->
setIsActive
(
mWasActive
);
KManageSieve
::
SieveJob
*
job
=
KManageSieve
::
SieveJob
::
put
(
mCurrentURL
,
script
,
mWasActive
,
mWasActive
);
checkScriptJob
->
setCurrentScript
(
script
);
c
onnect
(
job
,
&
KManageSieve
::
SieveJob
::
result
,
this
,
&
SieveEditorPageWidget
::
slotPutResultDebug
);
c
heckScriptJob
->
setOriginalScript
(
mSieveEditorWidget
->
originalScript
()
);
#endif
checkScriptJob
->
start
();
}
}
void
SieveEditorPageWidget
::
slot
PutResultDebug
(
KManageSieve
::
SieveJob
*
job
,
bool
success
)
void
SieveEditorPageWidget
::
slot
CheckScriptJobFinished
(
const
QString
&
errorMsg
,
bool
success
)
{
{
if
(
success
)
{
if
(
success
)
{
mSieveEditorWidget
->
addOkMessage
(
i18n
(
"No errors found."
)
);
mSieveEditorWidget
->
addOkMessage
(
errorMsg
);
}
else
{
}
else
{
const
QString
errorMsg
=
job
->
errorString
();
mSieveEditorWidget
->
addFailedMessage
(
errorMsg
);
if
(
errorMsg
.
isEmpty
())
{
mSieveEditorWidget
->
addFailedMessage
(
i18n
(
"An unknown error was encountered."
));
}
else
{
mSieveEditorWidget
->
addFailedMessage
(
errorMsg
);
}
}
}
#ifndef USE_CHECK_SIEVE_METHOD
//Put original script after check otherwise we will put a script even if we don't click on ok
KManageSieve
::
SieveJob
*
restoreJob
=
KManageSieve
::
SieveJob
::
put
(
mCurrentURL
,
mSieveEditorWidget
->
originalScript
(),
mWasActive
,
mWasActive
);
#endif
mSieveEditorWidget
->
resultDone
();
mSieveEditorWidget
->
resultDone
();
}
}
...
...
src/sieveeditorpagewidget.h
View file @
f63257ec
...
@@ -98,9 +98,9 @@ Q_SIGNALS:
...
@@ -98,9 +98,9 @@ Q_SIGNALS:
private
Q_SLOTS
:
private
Q_SLOTS
:
void
slotGetResult
(
KManageSieve
::
SieveJob
*
,
bool
success
,
const
QString
&
script
,
bool
isActive
);
void
slotGetResult
(
KManageSieve
::
SieveJob
*
,
bool
success
,
const
QString
&
script
,
bool
isActive
);
void
slotCheckSyntaxClicked
();
void
slotCheckSyntaxClicked
();
void
slotPutResultDebug
(
KManageSieve
::
SieveJob
*
,
bool
success
);
void
slotPutResult
(
KManageSieve
::
SieveJob
*
,
bool
success
);
void
slotPutResult
(
KManageSieve
::
SieveJob
*
,
bool
success
);
void
slotValueChanged
(
bool
b
);
void
slotValueChanged
(
bool
b
);
void
slotCheckScriptJobFinished
(
const
QString
&
errorMsg
,
bool
success
);
private:
private:
void
setModified
(
bool
b
);
void
setModified
(
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