summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-10-06 13:42:50 +0200
committerMontel Laurent <[email protected]>2017-10-06 13:42:50 +0200
commit5bb7d3c93f7f31e7dcf3e6e573e4b358b5f53f50 (patch)
treefbfabc76e839cf9dfae0e816e2db2cb9ae3cb266
parent4694baeac69306075123db0376f84f5e68cf361e (diff)
Fix error found by cppcheck
-rw-r--r--src/ksieveui/autocreatescripts/sievescriptlistbox.cpp2
-rw-r--r--src/ksieveui/vacation/vacationcreatescriptjob.cpp3
2 files changed, 2 insertions, 3 deletions
diff --git a/src/ksieveui/autocreatescripts/sievescriptlistbox.cpp b/src/ksieveui/autocreatescripts/sievescriptlistbox.cpp
index 9c33b64..51591b4 100644
--- a/src/ksieveui/autocreatescripts/sievescriptlistbox.cpp
+++ b/src/ksieveui/autocreatescripts/sievescriptlistbox.cpp
@@ -521,7 +521,7 @@ void SieveScriptListBox::loadBlock(QXmlStreamReader &n, SieveScriptPage *current
const SieveGlobalVariableActionWidget::VariableElement var = currentPage->globalVariableWidget()->loadSetVariable(n, error);
if (var.isValid()) {
qCDebug(LIBKSIEVE_LOG) << "It's not a global variable";
- if (!currentPage || (typeBlock == TypeBlockIf) || (typeBlock == TypeBlockElse) || (typeBlock == TypeBlockElsif)) {
+ if ((typeBlock == TypeBlockIf) || (typeBlock == TypeBlockElse) || (typeBlock == TypeBlockElsif)) {
currentPage = createNewScript(scriptName.isEmpty() ? createUniqName() : scriptName, comment);
}
typeBlock = TypeBlockAction;
diff --git a/src/ksieveui/vacation/vacationcreatescriptjob.cpp b/src/ksieveui/vacation/vacationcreatescriptjob.cpp
index 11145d4..7410fb6 100644
--- a/src/ksieveui/vacation/vacationcreatescriptjob.cpp
+++ b/src/ksieveui/vacation/vacationcreatescriptjob.cpp
@@ -126,9 +126,8 @@ void VacationCreateScriptJob::slotGetScript(KManageSieve::SieveJob *job, bool su
mSieveJob = nullptr;
QString script = mScript;
if (success || !oldScript.trimmed().isEmpty()) {
- //TODO ???? why using script for two method ?
script = VacationUtils::mergeRequireLine(oldScript, mScript);
- script = VacationUtils::updateVacationBlock(oldScript, mScript);
+ script = VacationUtils::updateVacationBlock(oldScript, script);
}
if (mKep14Support) {
mSieveJob = KManageSieve::SieveJob::put(mUrl, mScript, false, false);