summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-08-07 06:40:23 +0200
committerMontel Laurent <[email protected]>2017-08-07 06:40:23 +0200
commit87489dc2e0c6a9f3629b402eee0d37c154d76faf (patch)
tree19e232c8f5be8a50aa7fd9e453d2bcfb86a34569
parent6293e6bac5a5971100d1da64898bbb94f3795d2c (diff)
Use KSieveUi::ManageSieveWidget::ScriptInfo
-rw-r--r--src/sieveeditormainwidget.cpp8
-rw-r--r--src/sieveeditormainwidget.h4
-rw-r--r--src/sieveeditorscriptmanagerwidget.cpp4
-rw-r--r--src/sieveeditorscriptmanagerwidget.h2
4 files changed, 10 insertions, 8 deletions
diff --git a/src/sieveeditormainwidget.cpp b/src/sieveeditormainwidget.cpp
index 3bdaad0..394d791 100644
--- a/src/sieveeditormainwidget.cpp
+++ b/src/sieveeditormainwidget.cpp
@@ -120,9 +120,9 @@ void SieveEditorMainWidget::slotScriptRenamed(const QUrl &oldUrl, const QUrl &ne
updateStackedWidget();
}
-void SieveEditorMainWidget::slotCreateScriptPage(const QUrl &url, const QStringList &capabilities, bool isNewScript, const KSieveUi::SieveImapAccountSettings &sieveImapAccountSettings)
+void SieveEditorMainWidget::slotCreateScriptPage(const KSieveUi::ManageSieveWidget::ScriptInfo &info, bool isNewScript)
{
- QWidget *page = hasExistingPage(url);
+ QWidget *page = hasExistingPage(info.currentUrl);
if (page) {
mTabWidget->setCurrentWidget(page);
} else {
@@ -135,8 +135,8 @@ void SieveEditorMainWidget::slotCreateScriptPage(const QUrl &url, const QStringL
connect(editor, &SieveEditorPageWidget::copyAvailable, this, &SieveEditorMainWidget::copyAvailable);
connect(editor, &SieveEditorPageWidget::sieveEditorTabCurrentChanged, this, &SieveEditorMainWidget::sieveEditorTabCurrentChanged);
editor->setIsNewScript(isNewScript);
- editor->loadScript(url, capabilities, sieveImapAccountSettings);
- mTabWidget->addTab(editor, url.fileName());
+ editor->loadScript(info.currentUrl, info.currentCapabilities, info.sieveImapAccountSettings);
+ mTabWidget->addTab(editor, info.currentUrl.fileName());
mTabWidget->setCurrentWidget(editor);
if (isNewScript) {
editor->uploadScript(false, true);
diff --git a/src/sieveeditormainwidget.h b/src/sieveeditormainwidget.h
index fa41e3b..45cf4ae 100644
--- a/src/sieveeditormainwidget.h
+++ b/src/sieveeditormainwidget.h
@@ -23,6 +23,7 @@
#include <QSplitter>
#include <QUrl>
#include "ksieveui/sieveeditorwidget.h"
+#include <KSieveUi/ManageSieveWidget>
class QTabWidget;
class QStackedWidget;
class SieveEditorTabWidget;
@@ -30,6 +31,7 @@ class SieveEditorScriptManagerWidget;
class SieveEditorPageWidget;
class SieveEditorEmptyTabWidgetLabel;
class KActionCollection;
+
class SieveEditorMainWidget : public QSplitter
{
Q_OBJECT
@@ -101,7 +103,7 @@ Q_SIGNALS:
void sieveEditorTabCurrentChanged();
private Q_SLOTS:
- void slotCreateScriptPage(const QUrl &url, const QStringList &capabilities, bool isNewScript, const KSieveUi::SieveImapAccountSettings &sieveImapAccountSettings);
+ void slotCreateScriptPage(const KSieveUi::ManageSieveWidget::ScriptInfo &info, bool isNewScript);
void slotScriptDeleted(const QUrl &url);
void slotScriptRenamed(const QUrl &oldUrl, const QUrl &newUrl);
void slotScriptModified(bool modified, SieveEditorPageWidget *page);
diff --git a/src/sieveeditorscriptmanagerwidget.cpp b/src/sieveeditorscriptmanagerwidget.cpp
index 0240ca1..3c8172d 100644
--- a/src/sieveeditorscriptmanagerwidget.cpp
+++ b/src/sieveeditorscriptmanagerwidget.cpp
@@ -55,12 +55,12 @@ void SieveEditorScriptManagerWidget::slotUpdateButtons(QTreeWidgetItem *item)
void SieveEditorScriptManagerWidget::slotEditScript(const KSieveUi::ManageSieveWidget::ScriptInfo &info)
{
- Q_EMIT createScriptPage(info.currentUrl, info.currentCapabilities, false, info.sieveImapAccountSettings);
+ Q_EMIT createScriptPage(info, false);
}
void SieveEditorScriptManagerWidget::slotNewScript(const KSieveUi::ManageSieveWidget::ScriptInfo &info)
{
- Q_EMIT createScriptPage(info.currentUrl, info.currentCapabilities, true, info.sieveImapAccountSettings);
+ Q_EMIT createScriptPage(info, true);
}
void SieveEditorScriptManagerWidget::slotCreateNewScript()
diff --git a/src/sieveeditorscriptmanagerwidget.h b/src/sieveeditorscriptmanagerwidget.h
index a18fd1f..ea64eff 100644
--- a/src/sieveeditorscriptmanagerwidget.h
+++ b/src/sieveeditorscriptmanagerwidget.h
@@ -42,7 +42,7 @@ public:
void refreshList();
Q_SIGNALS:
- void createScriptPage(const QUrl &url, const QStringList &capabilities, bool isNewScript, const KSieveUi::SieveImapAccountSettings &sieveImapAccountSettings);
+ void createScriptPage(const KSieveUi::ManageSieveWidget::ScriptInfo &info, bool isNewScript);
void updateButtons(bool newScriptAction, bool editScriptAction, bool deleteScriptAction, bool desactivateScriptAction);
void scriptDeleted(const QUrl &url);
void serverSieveFound(bool hasServerSieve);