summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-08-25 11:52:57 (GMT)
committerMontel Laurent <montel@kde.org>2016-08-25 11:52:57 (GMT)
commitf927c5c37a016090849a525e742f73986333a41a (patch)
tree5f253b96de5a02ebb0d696fa7469fecd9ec6b475
parent5ff33fb7d5b8b408ea46415cade24232d56cb15c (diff)
Add autocorrection
-rw-r--r--kmail/editorplugins/autocorrection/CMakeLists.txt2
-rw-r--r--kmail/editorplugins/autocorrection/autocorrectionplugineditorjob.cpp16
-rw-r--r--kmail/editorplugins/autocorrection/autocorrectionplugineditorjob.h13
-rw-r--r--kmail/editorplugins/autocorrection/autotests/CMakeLists.txt2
4 files changed, 27 insertions, 6 deletions
diff --git a/kmail/editorplugins/autocorrection/CMakeLists.txt b/kmail/editorplugins/autocorrection/CMakeLists.txt
index 6b512f6..f94815a 100644
--- a/kmail/editorplugins/autocorrection/CMakeLists.txt
+++ b/kmail/editorplugins/autocorrection/CMakeLists.txt
@@ -7,7 +7,7 @@ set(kmail_autocorrectioneditorplugin_SRCS
add_library(kmail_autocorrectioneditorplugin MODULE ${kmail_autocorrectioneditorplugin_SRCS})
target_link_libraries(kmail_autocorrectioneditorplugin
- KF5::IconThemes KF5::MessageComposer KF5::XmlGui KF5::I18n
+ KF5::IconThemes KF5::MessageComposer KF5::XmlGui KF5::I18n KF5::PimCommon
)
install(TARGETS kmail_autocorrectioneditorplugin DESTINATION ${PLUGIN_INSTALL_DIR}/kmail)
diff --git a/kmail/editorplugins/autocorrection/autocorrectionplugineditorjob.cpp b/kmail/editorplugins/autocorrection/autocorrectionplugineditorjob.cpp
index 7e832cd..de626d4 100644
--- a/kmail/editorplugins/autocorrection/autocorrectionplugineditorjob.cpp
+++ b/kmail/editorplugins/autocorrection/autocorrectionplugineditorjob.cpp
@@ -20,7 +20,8 @@
#include "autocorrectionplugineditorjob.h"
AutoCorrectionPluginEditorJob::AutoCorrectionPluginEditorJob(QObject *parent)
- : QObject(parent)
+ : QObject(parent),
+ mAutoCorrection(Q_NULLPTR)
{
}
@@ -30,7 +31,16 @@ AutoCorrectionPluginEditorJob::~AutoCorrectionPluginEditorJob()
}
-void AutoCorrectionPluginEditorJob::start()
+bool AutoCorrectionPluginEditorJob::start()
{
- //TODOO
+ if (!mAutoCorrection) {
+ return false;
+ }
+ //TODO
+ return true;
+}
+
+void AutoCorrectionPluginEditorJob::setAutoCorrection(PimCommon::AutoCorrection *autoCorrection)
+{
+ mAutoCorrection = autoCorrection;
}
diff --git a/kmail/editorplugins/autocorrection/autocorrectionplugineditorjob.h b/kmail/editorplugins/autocorrection/autocorrectionplugineditorjob.h
index f99d54c..e287195 100644
--- a/kmail/editorplugins/autocorrection/autocorrectionplugineditorjob.h
+++ b/kmail/editorplugins/autocorrection/autocorrectionplugineditorjob.h
@@ -21,6 +21,11 @@
#define AUTOCORRECTIONPLUGINEDITORJOB_H
#include <QObject>
+#include <QTextDocument>
+namespace PimCommon
+{
+class AutoCorrection;
+}
class AutoCorrectionPluginEditorJob : public QObject
{
@@ -29,7 +34,13 @@ public:
explicit AutoCorrectionPluginEditorJob(QObject *parent = Q_NULLPTR);
~AutoCorrectionPluginEditorJob();
- void start();
+ bool start();
+
+ void setAutoCorrection(PimCommon::AutoCorrection *autoCorrection);
+
+private:
+ QTextDocument mTextDocument;
+ PimCommon::AutoCorrection *mAutoCorrection;
};
#endif // AUTOCORRECTIONPLUGINEDITORJOB_H
diff --git a/kmail/editorplugins/autocorrection/autotests/CMakeLists.txt b/kmail/editorplugins/autocorrection/autotests/CMakeLists.txt
index 8ead0df..0b24f92 100644
--- a/kmail/editorplugins/autocorrection/autotests/CMakeLists.txt
+++ b/kmail/editorplugins/autocorrection/autotests/CMakeLists.txt
@@ -5,7 +5,7 @@ macro(add_kmail_editorplugin_unittest _source _additional)
add_test( ${_name} ${_name} )
ecm_mark_as_test(kmail_editorplugin-${_name})
- target_link_libraries( ${_name} Qt5::Test KF5::XmlGui KF5::IconThemes KF5::MessageComposer KF5::I18n)
+ target_link_libraries( ${_name} Qt5::Test KF5::XmlGui KF5::IconThemes KF5::MessageComposer KF5::I18n KF5::PimCommon)
endmacro ()
add_kmail_editorplugin_unittest(autocorrectionplugineditortest.cpp "../autocorrectionplugineditor.cpp;../autocorrectionplugineditorinterface.cpp")