summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Montel <[email protected]>2017-12-28 07:05:05 +0100
committerLaurent Montel <[email protected]>2017-12-28 07:05:05 +0100
commit2d9003dd256f0afebb2766f55744621e9c1e7642 (patch)
tree3b2cef0cd0fd455c5bea845566644f6b5d58c5ba
parenta3400ee577076833199619c2246f204afcf101ad (diff)
Save textcursor
-rw-r--r--kmail/editorplugins/insertshorturl/CMakeLists.txt2
-rw-r--r--kmail/editorplugins/insertshorturl/insertshorturlplugineditorinterface.cpp3
-rw-r--r--kmail/editorplugins/insertshorturl/shorturlengineplugin/isgdshorturlengineplugin/CMakeLists.txt2
-rw-r--r--kmail/editorplugins/insertshorturl/shorturlengineplugin/shorturlengineinterface.cpp5
-rw-r--r--kmail/editorplugins/insertshorturl/shorturlengineplugin/shorturlengineinterface.h3
-rw-r--r--kmail/editorplugins/insertshorturl/shorturlengineplugin/tinyurlengineplugin/CMakeLists.txt2
-rw-r--r--kmail/editorplugins/insertshorturl/shorturlengineplugin/triopabshorturlengineplugin/CMakeLists.txt2
-rw-r--r--kmail/editorplugins/insertshorturl/shorturlengineplugin/ur1cashorturlengineplugin/CMakeLists.txt2
8 files changed, 14 insertions, 7 deletions
diff --git a/kmail/editorplugins/insertshorturl/CMakeLists.txt b/kmail/editorplugins/insertshorturl/CMakeLists.txt
index 09e7406..de7150c 100644
--- a/kmail/editorplugins/insertshorturl/CMakeLists.txt
+++ b/kmail/editorplugins/insertshorturl/CMakeLists.txt
@@ -10,7 +10,7 @@ generate_export_header(shorturlpluginprivate BASE_NAME shorturl)
target_link_libraries(shorturlpluginprivate
PRIVATE
- Qt5::Network KF5::I18n KF5::CoreAddons
+ Qt5::Network KF5::I18n KF5::CoreAddons Qt5::Gui
)
set_target_properties(shorturlpluginprivate
diff --git a/kmail/editorplugins/insertshorturl/insertshorturlplugineditorinterface.cpp b/kmail/editorplugins/insertshorturl/insertshorturlplugineditorinterface.cpp
index 33520f4..ea5f13b 100644
--- a/kmail/editorplugins/insertshorturl/insertshorturlplugineditorinterface.cpp
+++ b/kmail/editorplugins/insertshorturl/insertshorturlplugineditorinterface.cpp
@@ -99,10 +99,9 @@ void InsertShorturlPluginEditorInterface::exec()
Q_EMIT message(i18n("No network connection detected, we cannot shorten URL."));
return;
}
- /*
+ mCurrentEngine->setTextCursor(textCursor);
mCurrentEngine->setShortUrl(urlStr);
mCurrentEngine->generateShortUrl();
- */
//textCursor.insertText(newText);
}
}
diff --git a/kmail/editorplugins/insertshorturl/shorturlengineplugin/isgdshorturlengineplugin/CMakeLists.txt b/kmail/editorplugins/insertshorturl/shorturlengineplugin/isgdshorturlengineplugin/CMakeLists.txt
index 4b5514a..a5b290b 100644
--- a/kmail/editorplugins/insertshorturl/shorturlengineplugin/isgdshorturlengineplugin/CMakeLists.txt
+++ b/kmail/editorplugins/insertshorturl/shorturlengineplugin/isgdshorturlengineplugin/CMakeLists.txt
@@ -8,6 +8,6 @@ kcoreaddons_add_plugin(pimcommon_isgdshorturlengineplugin JSON pimcommon_isgdsho
${pimcommon_isgdshorturlengineplugin_SRCS} INSTALL_NAMESPACE pimcommon)
target_link_libraries(pimcommon_isgdshorturlengineplugin
- KF5::Service KF5::I18n Qt5::Network KF5::CoreAddons shorturlpluginprivate
+ KF5::Service KF5::I18n Qt5::Network KF5::CoreAddons shorturlpluginprivate Qt5::Gui
)
diff --git a/kmail/editorplugins/insertshorturl/shorturlengineplugin/shorturlengineinterface.cpp b/kmail/editorplugins/insertshorturl/shorturlengineplugin/shorturlengineinterface.cpp
index 6fd6618..0b8eca1 100644
--- a/kmail/editorplugins/insertshorturl/shorturlengineplugin/shorturlengineinterface.cpp
+++ b/kmail/editorplugins/insertshorturl/shorturlengineplugin/shorturlengineinterface.cpp
@@ -60,3 +60,8 @@ QString ShortUrlEngineInterface::pluginName() const
{
return mEnginePlugin->pluginName();
}
+
+void ShortUrlEngineInterface::setTextCursor(const QTextCursor &cursor)
+{
+ mTextCursor = cursor;
+}
diff --git a/kmail/editorplugins/insertshorturl/shorturlengineplugin/shorturlengineinterface.h b/kmail/editorplugins/insertshorturl/shorturlengineplugin/shorturlengineinterface.h
index 3c84f7c..a0b8dbc 100644
--- a/kmail/editorplugins/insertshorturl/shorturlengineplugin/shorturlengineinterface.h
+++ b/kmail/editorplugins/insertshorturl/shorturlengineplugin/shorturlengineinterface.h
@@ -22,6 +22,7 @@
#include <QObject>
#include <QNetworkReply>
+#include <QTextCursor>
#include "shorturl_export.h"
class QNetworkAccessManager;
class ShortUrlEnginePlugin;
@@ -37,6 +38,7 @@ public:
virtual QString engineName() const = 0;
QString pluginName() const;
+ void setTextCursor(const QTextCursor &cursor);
protected Q_SLOTS:
void slotErrorFound(QNetworkReply::NetworkError error);
@@ -46,6 +48,7 @@ Q_SIGNALS:
protected:
QString mOriginalUrl;
+ QTextCursor mTextCursor;
bool mErrorFound = false;
QNetworkAccessManager *mNetworkAccessManager = nullptr;
ShortUrlEnginePlugin *mEnginePlugin = nullptr;
diff --git a/kmail/editorplugins/insertshorturl/shorturlengineplugin/tinyurlengineplugin/CMakeLists.txt b/kmail/editorplugins/insertshorturl/shorturlengineplugin/tinyurlengineplugin/CMakeLists.txt
index 9997336..bffffee 100644
--- a/kmail/editorplugins/insertshorturl/shorturlengineplugin/tinyurlengineplugin/CMakeLists.txt
+++ b/kmail/editorplugins/insertshorturl/shorturlengineplugin/tinyurlengineplugin/CMakeLists.txt
@@ -8,6 +8,6 @@ kcoreaddons_add_plugin(pimcommon_tinyurlengineplugin JSON pimcommon_tinyurlengin
target_link_libraries(pimcommon_tinyurlengineplugin
- KF5::Service KF5::I18n Qt5::Network KF5::CoreAddons shorturlpluginprivate
+ KF5::Service KF5::I18n Qt5::Network KF5::CoreAddons shorturlpluginprivate Qt5::Gui
)
diff --git a/kmail/editorplugins/insertshorturl/shorturlengineplugin/triopabshorturlengineplugin/CMakeLists.txt b/kmail/editorplugins/insertshorturl/shorturlengineplugin/triopabshorturlengineplugin/CMakeLists.txt
index a4e3819..a269a7b 100644
--- a/kmail/editorplugins/insertshorturl/shorturlengineplugin/triopabshorturlengineplugin/CMakeLists.txt
+++ b/kmail/editorplugins/insertshorturl/shorturlengineplugin/triopabshorturlengineplugin/CMakeLists.txt
@@ -7,6 +7,6 @@ kcoreaddons_add_plugin(pimcommon_triopabshorturlengineplugin JSON pimcommon_trio
${pimcommon_triopabshorturlengineplugin_SRCS} INSTALL_NAMESPACE pimcommon)
target_link_libraries(pimcommon_triopabshorturlengineplugin
- KF5::Service KF5::I18n Qt5::Network KF5::CoreAddons shorturlpluginprivate
+ KF5::Service KF5::I18n Qt5::Network KF5::CoreAddons shorturlpluginprivate Qt5::Gui
)
diff --git a/kmail/editorplugins/insertshorturl/shorturlengineplugin/ur1cashorturlengineplugin/CMakeLists.txt b/kmail/editorplugins/insertshorturl/shorturlengineplugin/ur1cashorturlengineplugin/CMakeLists.txt
index 40cd744..38c9315 100644
--- a/kmail/editorplugins/insertshorturl/shorturlengineplugin/ur1cashorturlengineplugin/CMakeLists.txt
+++ b/kmail/editorplugins/insertshorturl/shorturlengineplugin/ur1cashorturlengineplugin/CMakeLists.txt
@@ -9,6 +9,6 @@ kcoreaddons_add_plugin(pimcommon_ur1cashorturlengineplugin JSON pimcommon_ur1cas
${pimcommon_ur1cashorturlengineplugin_SRCS} INSTALL_NAMESPACE pimcommon)
target_link_libraries(pimcommon_ur1cashorturlengineplugin
- KF5::Service KF5::I18n Qt5::Network KF5::CoreAddons shorturlpluginprivate
+ KF5::Service KF5::I18n Qt5::Network KF5::CoreAddons shorturlpluginprivate Qt5::Gui
)