Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit d9f86c7c authored by Laurent Montel's avatar Laurent Montel 😁

Fix insert text even in subject

parent 5bc24655
cmake_minimum_required(VERSION 3.5)
set(KDEPIM_VERSION_NUMBER "5.10.90")
set(KDEPIM_VERSION_NUMBER "5.10.91")
project(kmail VERSION ${KDEPIM_VERSION_NUMBER})
......@@ -66,7 +66,7 @@ find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED DBus Network Test Widget
set(LIBGRAVATAR_VERSION_LIB "5.10.90")
set(MAILCOMMON_LIB_VERSION_LIB "5.10.90")
set(KDEPIM_APPS_LIB_VERSION_LIB "5.10.90")
set(MESSAGELIB_LIB_VERSION_LIB "5.10.90")
set(MESSAGELIB_LIB_VERSION_LIB "5.10.91")
set(LIBKLEO_LIB_VERSION_LIB "5.10.90")
set(PIMCOMMON_LIB_VERSION_LIB "5.10.90")
set(LIBKDEPIM_LIB_VERSION_LIB "5.10.90")
......
......@@ -146,3 +146,20 @@ void KMComposerGlobalAction::slotInsertEmoticon(const QString &str)
static_cast<QTextEdit *>(fw)->insertPlainText(str);
}
}
void KMComposerGlobalAction::slotInsertText(const QString &str)
{
QWidget *fw = mComposerWin->focusWidget();
if (!fw) {
return;
}
if (::qobject_cast<PimCommon::LineEditWithAutoCorrection *>(fw)) {
static_cast<PimCommon::LineEditWithAutoCorrection *>(fw)->insertPlainText(str);
} else if (::qobject_cast<KLineEdit *>(fw)) {
//Don't insert emoticon in mail linedit
//static_cast<KLineEdit *>(fw)->insert(str);
} else if (::qobject_cast<KMComposerEditorNg *>(fw)) {
static_cast<QTextEdit *>(fw)->insertPlainText(str);
}
}
......@@ -35,6 +35,7 @@ public Q_SLOTS:
void slotPaste();
void slotMarkAll();
void slotInsertEmoticon(const QString &str);
void slotInsertText(const QString &str);
private:
Q_DISABLE_COPY(KMComposerGlobalAction)
KMComposerWin *mComposerWin = nullptr;
......
......@@ -242,6 +242,7 @@ KMComposerWin::KMComposerWin(const KMime::Message::Ptr &aMsg, bool lastSignState
mPluginEditorManagerInterface = new KMailPluginEditorManagerInterface(this);
connect(mPluginEditorManagerInterface, &KMailPluginEditorManagerInterface::message, this, &KMComposerWin::slotMessage);
connect(mPluginEditorManagerInterface, &KMailPluginEditorManagerInterface::insertText, this, &KMComposerWin::slotEditorPluginInsertText);
mPluginEditorCheckBeforeSendManagerInterface = new KMailPluginEditorCheckBeforeSendManagerInterface(this);
mPluginEditorInitManagerInterface = new KMailPluginEditorInitManagerInterface(this);
mPluginEditorConvertTextManagerInterface = new KMailPluginEditorConvertTextManagerInterface(this);
......@@ -3630,3 +3631,8 @@ void KMComposerWin::slotMessage(const QString &str)
{
KMessageBox::information(this, str, i18n("Plugin Editor Information"));
}
void KMComposerWin::slotEditorPluginInsertText(const QString &str)
{
mGlobalAction->slotInsertText(str);
}
......@@ -546,6 +546,7 @@ private:
int validateLineWrapWidth();
void slotSelectionChanged();
void slotMessage(const QString &str);
void slotEditorPluginInsertText(const QString &str);
Akonadi::Collection mCollectionForNewMessage;
QMap<QByteArray, QString> mExtraHeaders;
......
......@@ -78,6 +78,7 @@ void KMailPluginEditorManagerInterface::initializePlugins()
interface->setPlugin(plugin);
connect(interface, &MessageComposer::PluginEditorInterface::emitPluginActivated, this, &KMailPluginEditorManagerInterface::slotPluginActivated);
connect(interface, &MessageComposer::PluginEditorInterface::message, this, &KMailPluginEditorManagerInterface::message);
connect(interface, &MessageComposer::PluginEditorInterface::insertText, this, &KMailPluginEditorManagerInterface::insertText);
mListPluginInterface.append(interface);
}
}
......
......@@ -55,6 +55,7 @@ public:
Q_SIGNALS:
void textSelectionChanged(bool hasSelection);
void message(const QString &str);
void insertText(const QString &str);
private:
Q_DISABLE_COPY(KMailPluginEditorManagerInterface)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment