summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-02 06:13:27 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-02 06:13:27 (GMT)
commit882e57b8d0f16e3cbef061501a6be1c1e8649d5c (patch)
treee07e2ad343f92e5ff3a0b25350546f3e0536c79c
parentf8bf62d67e2782512442fb2565ae74cc2e45bc28 (diff)
Signal that we renamed old script
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/ksieveui/managescriptsjob/renamescriptjob.cpp13
-rw-r--r--src/ksieveui/managescriptsjob/renamescriptjob.h2
-rw-r--r--src/ksieveui/widgets/managesievewidget.cpp3
-rw-r--r--src/ksieveui/widgets/managesievewidget.h3
5 files changed, 13 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e40f36e..03d0708 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,7 +18,7 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
-set(PIM_VERSION "5.3.43")
+set(PIM_VERSION "5.3.44")
set(LIBKSIEVE_LIB_VERSION ${PIM_VERSION})
set(QT_REQUIRED_VERSION "5.6.0")
set(KMIME_LIB_VERSION "5.3.40")
diff --git a/src/ksieveui/managescriptsjob/renamescriptjob.cpp b/src/ksieveui/managescriptsjob/renamescriptjob.cpp
index 4d78b09..e9a4d44 100644
--- a/src/ksieveui/managescriptsjob/renamescriptjob.cpp
+++ b/src/ksieveui/managescriptsjob/renamescriptjob.cpp
@@ -33,6 +33,7 @@ public:
}
QString mNewName;
QUrl mOldUrl;
+ QUrl mNewUrl;
bool mIsActive;
};
@@ -74,7 +75,7 @@ void RenameScriptJob::start()
KManageSieve::SieveJob *job = KManageSieve::SieveJob::get(d->mOldUrl);
connect(job, &KManageSieve::SieveJob::result, this, &RenameScriptJob::slotGetResult);
} else {
- Q_EMIT finished(i18n("Impossible to start job"), false);
+ Q_EMIT finished(d->mOldUrl, d->mNewUrl, i18n("Impossible to start job"), false);
deleteLater();
}
}
@@ -84,15 +85,15 @@ void RenameScriptJob::slotGetResult(KManageSieve::SieveJob *job, bool success, c
Q_UNUSED(job);
Q_UNUSED(isActive);
if (!success) {
- Q_EMIT finished(i18n("An error occurred during loading the sieve script."), false);
+ Q_EMIT finished(d->mOldUrl, d->mNewUrl, i18n("An error occurred during loading the sieve script."), false);
deleteLater();
return;
}
QUrl u = d->mOldUrl;
u = u.adjusted(QUrl::RemoveFilename);
u.setPath(u.path() + QLatin1Char('/') + d->mNewName);
-
- KManageSieve::SieveJob *putJob = KManageSieve::SieveJob::put(u, script, d->mIsActive, d->mIsActive);
+ d->mNewUrl = u;
+ KManageSieve::SieveJob *putJob = KManageSieve::SieveJob::put(d->mNewUrl, script, d->mIsActive, d->mIsActive);
connect(putJob, &KManageSieve::SieveJob::result, this, &RenameScriptJob::slotPutScript);
}
@@ -100,7 +101,7 @@ void RenameScriptJob::slotPutScript(KManageSieve::SieveJob *job, bool success)
{
Q_UNUSED(job);
if (!success) {
- Q_EMIT finished(i18n("An error occurred during saving the sieve script."), false);
+ Q_EMIT finished(d->mOldUrl, d->mNewUrl, i18n("An error occurred during saving the sieve script."), false);
deleteLater();
return;
}
@@ -111,6 +112,6 @@ void RenameScriptJob::slotPutScript(KManageSieve::SieveJob *job, bool success)
void RenameScriptJob::slotDeleteResult(KManageSieve::SieveJob *job, bool success)
{
Q_UNUSED(job);
- Q_EMIT finished(success ? QString() : i18n("An error occurred during deleting the sieve script."), success);
+ Q_EMIT finished(d->mOldUrl, d->mNewUrl, success ? QString() : i18n("An error occurred during deleting the sieve script."), success);
deleteLater();
}
diff --git a/src/ksieveui/managescriptsjob/renamescriptjob.h b/src/ksieveui/managescriptsjob/renamescriptjob.h
index df10649..0cf5722 100644
--- a/src/ksieveui/managescriptsjob/renamescriptjob.h
+++ b/src/ksieveui/managescriptsjob/renamescriptjob.h
@@ -45,7 +45,7 @@ public:
void start();
Q_SIGNALS:
- void finished(const QString &error, bool success);
+ void finished(const QUrl &oldUrl, const QUrl &newUrl, const QString &error, bool success);
private Q_SLOTS:
void slotDeleteResult(KManageSieve::SieveJob *job, bool success);
diff --git a/src/ksieveui/widgets/managesievewidget.cpp b/src/ksieveui/widgets/managesievewidget.cpp
index 8464e4c..8242350 100644
--- a/src/ksieveui/widgets/managesievewidget.cpp
+++ b/src/ksieveui/widgets/managesievewidget.cpp
@@ -402,12 +402,13 @@ void ManageSieveWidget::slotRenameScript()
#endif
}
-void ManageSieveWidget::slotRenameFinished(const QString &errorStr, bool success)
+void ManageSieveWidget::slotRenameFinished(const QUrl &oldUrl, const QUrl &newUrl, const QString &errorStr, bool success)
{
if (!success) {
KMessageBox::error(this, errorStr, i18n("Rename Script"));
}
qCDebug(LIBKSIEVE_LOG) << " void ManageSieveWidget::slotRenameResult(KManageSieve::SieveJob *job, bool success)" << success;
+ Q_EMIT scriptRenamed(oldUrl, newUrl);
slotRefresh();
}
diff --git a/src/ksieveui/widgets/managesievewidget.h b/src/ksieveui/widgets/managesievewidget.h
index d2654ef..0cffa33 100644
--- a/src/ksieveui/widgets/managesievewidget.h
+++ b/src/ksieveui/widgets/managesievewidget.h
@@ -57,6 +57,7 @@ Q_SIGNALS:
void editScript(const QUrl &url, const QStringList &currentCapabilities);
void scriptDeleted(const QUrl &u);
void serverSieveFound(bool imapFound);
+ void scriptRenamed(const QUrl &oldUrl, const QUrl &newUrl);
protected:
virtual bool refreshList() = 0;
@@ -72,7 +73,7 @@ private Q_SLOTS:
void slotCancelFetch();
void slotRenameResult(KManageSieve::SieveJob *job, bool success);
- void slotRenameFinished(const QString &errorStr, bool success);
+ void slotRenameFinished(const QUrl &oldUrl, const QUrl &newUrl, const QString &errorStr, bool success);
public Q_SLOTS:
void slotRenameScript();