diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -146,7 +146,7 @@ set(CALENDARSUPPORT_LIB_VERSION_LIB "5.2.80") set(EVENTVIEW_LIB_VERSION_LIB "5.2.80") set(KDGANTT2_LIB_VERSION_LIB "5.2.80") - set(LIBKSIEVE_LIB_VERSION_LIB "5.2.82") + set(LIBKSIEVE_LIB_VERSION_LIB "5.2.83") find_package(KF5WebEngineViewer ${MESSAGELIB_LIB_VERSION_LIB} CONFIG REQUIRED) set(WEBENGINE_TYPE "QtWebEngine") diff --git a/sieveeditor/CMakeLists.txt b/sieveeditor/CMakeLists.txt --- a/sieveeditor/CMakeLists.txt +++ b/sieveeditor/CMakeLists.txt @@ -43,7 +43,7 @@ set(MESSAGELIB_LIB_VERSION_LIB "5.2.91") set(PIMCOMMON_LIB_VERSION_LIB "5.2.80") - set(LIBKSIEVE_LIB_VERSION_LIB "5.2.82") + set(LIBKSIEVE_LIB_VERSION_LIB "5.2.83") set(QT_REQUIRED_VERSION "5.6.0") find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Network Test) diff --git a/sieveeditor/src/sieveeditorpagewidget.h b/sieveeditor/src/sieveeditorpagewidget.h --- a/sieveeditor/src/sieveeditorpagewidget.h +++ b/sieveeditor/src/sieveeditorpagewidget.h @@ -97,7 +97,7 @@ 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); diff --git a/sieveeditor/src/sieveeditorpagewidget.cpp b/sieveeditor/src/sieveeditorpagewidget.cpp --- a/sieveeditor/src/sieveeditorpagewidget.cpp +++ b/sieveeditor/src/sieveeditorpagewidget.cpp @@ -56,26 +56,27 @@ 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 { mSieveEditorWidget->addFailedMessage(errorMsg); } } //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 @@ 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")); + } } }