diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-03-20 00:40:44 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-03-20 00:40:44 +0000 |
commit | 4cbcc855382a06088e2f016f62cafdbcb7e40665 (patch) | |
tree | 356496503d52354aa6d9f2d36126302fed5f3a73 /kde-apps/messagelib/files | |
parent | fcc5224904648a8e6eb528d7603154160a20022f (diff) |
gentoo resync : 20.03.2022
Diffstat (limited to 'kde-apps/messagelib/files')
3 files changed, 282 insertions, 0 deletions
diff --git a/kde-apps/messagelib/files/messagelib-21.12.3-speech-optional-1.patch b/kde-apps/messagelib/files/messagelib-21.12.3-speech-optional-1.patch new file mode 100644 index 000000000000..39f48362a4ce --- /dev/null +++ b/kde-apps/messagelib/files/messagelib-21.12.3-speech-optional-1.patch @@ -0,0 +1,131 @@ +From a8d74999570b1dd6025548593e2d06b37afadce0 Mon Sep 17 00:00:00 2001 +From: Laurent Montel <montel@kde.org> +Date: Mon, 14 Feb 2022 19:07:53 +0100 +Subject: [PATCH] Fix build without texttospeech + +--- + .../mailsourceviewtextbrowserwidget.cpp | 19 ++++++++++++++++--- + .../widgets/mailsourceviewtextbrowserwidget.h | 9 +++++++++ + 2 files changed, 25 insertions(+), 3 deletions(-) + +diff --git a/messageviewer/src/widgets/mailsourceviewtextbrowserwidget.cpp b/messageviewer/src/widgets/mailsourceviewtextbrowserwidget.cpp +index 5c0050002..0e5b61c1e 100644 +--- a/messageviewer/src/widgets/mailsourceviewtextbrowserwidget.cpp ++++ b/messageviewer/src/widgets/mailsourceviewtextbrowserwidget.cpp +@@ -38,16 +38,20 @@ using namespace MessageViewer; + MailSourceViewTextBrowserWidget::MailSourceViewTextBrowserWidget(const QString &syntax, QWidget *parent) + : QWidget(parent) + , mSliderContainer(new KPIMTextEdit::SlideContainer(this)) ++#if KPIMTEXTEDIT_TEXT_TO_SPEECH + , mTextToSpeechWidget(new KPIMTextEdit::TextToSpeechWidget(this)) ++#endif + { + auto lay = new QVBoxLayout(this); ++#if KPIMTEXTEDIT_TEXT_TO_SPEECH + lay->setContentsMargins({}); + mTextToSpeechWidget->setObjectName(QStringLiteral("texttospeech")); + lay->addWidget(mTextToSpeechWidget); +- + auto textToSpeechInterface = new KPIMTextEdit::TextToSpeechInterface(mTextToSpeechWidget, this); +- + mTextBrowser = new MailSourceViewTextBrowser(textToSpeechInterface); ++#else ++ mTextBrowser = new MailSourceViewTextBrowser(this); ++#endif + mTextBrowser->setObjectName(QStringLiteral("textbrowser")); + mTextBrowser->setLineWrapMode(QPlainTextEdit::NoWrap); + mTextBrowser->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard); +@@ -104,12 +108,17 @@ MessageViewer::MailSourceViewTextBrowser *MailSourceViewTextBrowserWidget::textB + { + return mTextBrowser; + } +- ++#if KPIMTEXTEDIT_TEXT_TO_SPEECH + MailSourceViewTextBrowser::MailSourceViewTextBrowser(KPIMTextEdit::TextToSpeechInterface *textToSpeechInterface, QWidget *parent) + : QPlainTextEdit(parent) + , mTextToSpeechInterface(textToSpeechInterface) + { + } ++#endif ++MailSourceViewTextBrowser::MailSourceViewTextBrowser(QWidget *parent) ++ : QPlainTextEdit(parent) ++{ ++} + + void MailSourceViewTextBrowser::contextMenuEvent(QContextMenuEvent *event) + { +@@ -117,6 +126,7 @@ void MailSourceViewTextBrowser::contextMenuEvent(QContextMenuEvent *event) + if (popup) { + popup->addSeparator(); + popup->addAction(KStandardAction::find(this, &MailSourceViewTextBrowser::findText, this)); ++#if KPIMTEXTEDIT_TEXT_TO_SPEECH + // Code from KTextBrowser + if (mTextToSpeechInterface->isReady()) { + popup->addSeparator(); +@@ -125,6 +135,7 @@ void MailSourceViewTextBrowser::contextMenuEvent(QContextMenuEvent *event) + this, + &MailSourceViewTextBrowser::slotSpeakText); + } ++#endif + popup->addSeparator(); + popup->addAction(KStandardAction::saveAs(this, &MailSourceViewTextBrowser::slotSaveAs, this)); + +@@ -140,6 +151,7 @@ void MailSourceViewTextBrowser::slotSaveAs() + + void MailSourceViewTextBrowser::slotSpeakText() + { ++#if KPIMTEXTEDIT_TEXT_TO_SPEECH + QString text; + if (textCursor().hasSelection()) { + text = textCursor().selectedText(); +@@ -147,4 +159,5 @@ void MailSourceViewTextBrowser::slotSpeakText() + text = toPlainText(); + } + mTextToSpeechInterface->say(text); ++#endif + } +diff --git a/messageviewer/src/widgets/mailsourceviewtextbrowserwidget.h b/messageviewer/src/widgets/mailsourceviewtextbrowserwidget.h +index 84f0eb8ae..500402f9a 100644 +--- a/messageviewer/src/widgets/mailsourceviewtextbrowserwidget.h ++++ b/messageviewer/src/widgets/mailsourceviewtextbrowserwidget.h +@@ -12,6 +12,8 @@ + #include <KSyntaxHighlighting/Repository> + #include <QPlainTextEdit> + #include <QSyntaxHighlighter> ++#include <kpimtextedit/kpimtextedit-texttospeech.h> ++ + namespace KPIMTextEdit + { + class SlideContainer; +@@ -50,14 +52,19 @@ private: + MailSourceViewTextBrowser *mTextBrowser = nullptr; + FindBarSourceView *mFindBar = nullptr; + KPIMTextEdit::SlideContainer *const mSliderContainer; ++#if KPIMTEXTEDIT_TEXT_TO_SPEECH + KPIMTextEdit::TextToSpeechWidget *const mTextToSpeechWidget; ++#endif + }; + + class MailSourceViewTextBrowser : public QPlainTextEdit + { + Q_OBJECT + public: ++#if KPIMTEXTEDIT_TEXT_TO_SPEECH + explicit MailSourceViewTextBrowser(KPIMTextEdit::TextToSpeechInterface *textToSpeechInterface, QWidget *parent = nullptr); ++#endif ++ explicit MailSourceViewTextBrowser(QWidget *parent); + + protected: + void contextMenuEvent(QContextMenuEvent *event) override; +@@ -67,6 +74,8 @@ Q_SIGNALS: + private: + void slotSpeakText(); + void slotSaveAs(); ++#if KPIMTEXTEDIT_TEXT_TO_SPEECH + KPIMTextEdit::TextToSpeechInterface *mTextToSpeechInterface = nullptr; ++#endif + }; + } +-- +GitLab + diff --git a/kde-apps/messagelib/files/messagelib-21.12.3-speech-optional-2.patch b/kde-apps/messagelib/files/messagelib-21.12.3-speech-optional-2.patch new file mode 100644 index 000000000000..a00fab7d585f --- /dev/null +++ b/kde-apps/messagelib/files/messagelib-21.12.3-speech-optional-2.patch @@ -0,0 +1,95 @@ +From da4ba2b7dc18ba20994dad54e754ed1d9d9c7a48 Mon Sep 17 00:00:00 2001 +From: Laurent Montel <montel@kde.org> +Date: Mon, 14 Feb 2022 19:16:56 +0100 +Subject: [PATCH] Compile without text to speech support + +--- + messageviewer/src/viewer/viewer_p.cpp | 10 ++++++---- + messageviewer/src/viewer/viewer_p.h | 8 +++++--- + 2 files changed, 11 insertions(+), 7 deletions(-) + +diff --git a/messageviewer/src/viewer/viewer_p.cpp b/messageviewer/src/viewer/viewer_p.cpp +index 5e7af8e01..15e71482f 100644 +--- a/messageviewer/src/viewer/viewer_p.cpp ++++ b/messageviewer/src/viewer/viewer_p.cpp +@@ -1403,11 +1403,11 @@ void ViewerPrivate::createWidgets() + mOpenSavedFileFolderWidget = new OpenSavedFileFolderWidget(readerBox); + mOpenSavedFileFolderWidget->setObjectName(QStringLiteral("opensavefilefolderwidget")); + readerBoxVBoxLayout->addWidget(mOpenSavedFileFolderWidget); +- ++#if KPIMTEXTEDIT_TEXT_TO_SPEECH + mTextToSpeechWidget = new KPIMTextEdit::TextToSpeechWidget(readerBox); + mTextToSpeechWidget->setObjectName(QStringLiteral("texttospeechwidget")); + readerBoxVBoxLayout->addWidget(mTextToSpeechWidget); +- ++#endif + mViewer = new MailWebEngineView(mActionCollection, readerBox); + mViewer->setViewer(this); + readerBoxVBoxLayout->addWidget(mViewer); +@@ -1609,12 +1609,12 @@ void ViewerPrivate::createActions() + ac->setDefaultShortcut(loadExternalReferenceAction, QKeySequence(Qt::SHIFT | Qt::CTRL | Qt::Key_R)); + connect(loadExternalReferenceAction, &QAction::triggered, this, &ViewerPrivate::slotLoadExternalReference); + MessageViewer::Util::addHelpTextAction(loadExternalReferenceAction, i18n("Load external references from the Internet for this message.")); +- ++#if KPIMTEXTEDIT_TEXT_TO_SPEECH + mSpeakTextAction = new QAction(i18n("Speak Text"), this); + mSpeakTextAction->setIcon(QIcon::fromTheme(QStringLiteral("preferences-desktop-text-to-speech"))); + ac->addAction(QStringLiteral("speak_text"), mSpeakTextAction); + connect(mSpeakTextAction, &QAction::triggered, this, &ViewerPrivate::slotSpeakText); +- ++#endif + auto purposeMenuWidget = new MailfilterPurposeMenuWidget(mViewer, this); + mShareTextAction = new QAction(i18n("Share Text..."), this); + mShareTextAction->setMenu(purposeMenuWidget->menu()); +@@ -2605,10 +2605,12 @@ void ViewerPrivate::replyMessage(KMime::Content *atmNode, bool replyToAll) + + void ViewerPrivate::slotSpeakText() + { ++#if KPIMTEXTEDIT_TEXT_TO_SPEECH + const QString text = mViewer->selectedText(); + if (!text.isEmpty()) { + mTextToSpeechWidget->say(text); + } ++#endif + } + + QUrl ViewerPrivate::imageUrl() const +diff --git a/messageviewer/src/viewer/viewer_p.h b/messageviewer/src/viewer/viewer_p.h +index 88cb605e5..467163a2a 100644 +--- a/messageviewer/src/viewer/viewer_p.h ++++ b/messageviewer/src/viewer/viewer_p.h +@@ -13,18 +13,18 @@ + #include "messageviewer_private_export.h" + #include "viewer.h" //not so nice, it is actually for the enums from MailViewer + #include "widgets/opensavedfilefolderwidget.h" +-#include <PimCommon/ShareServiceUrlManager> +-#include <WebEngineViewer/CheckPhishingUrlUtil> +- + #include <Akonadi/Item> + #include <Akonadi/Monitor> + #include <Akonadi/Session> + #include <KIO/Job> + #include <KMime/Message> + #include <KService> ++#include <PimCommon/ShareServiceUrlManager> + #include <QPointer> + #include <QUrl> + #include <QVector> ++#include <WebEngineViewer/CheckPhishingUrlUtil> ++#include <kpimtextedit/kpimtextedit-texttospeech.h> + + #include <QObject> + #include <QTimer> +@@ -695,7 +695,9 @@ public: + MessageViewer::OpenSavedFileFolderWidget *mOpenSavedFileFolderWidget = nullptr; + WebEngineViewer::SubmittedFormWarningWidget *mSubmittedFormWarning = nullptr; + WebEngineViewer::TrackingWarningWidget *mMailTrackingWarning = nullptr; ++#if KPIMTEXTEDIT_TEXT_TO_SPEECH + KPIMTextEdit::TextToSpeechWidget *mTextToSpeechWidget = nullptr; ++#endif + Viewer::DisplayFormatMessage mDisplayFormatMessageOverwrite; + KPIMTextEdit::SlideContainer *mSliderContainer = nullptr; + PimCommon::ShareServiceUrlManager *mShareServiceManager = nullptr; +-- +GitLab + diff --git a/kde-apps/messagelib/files/messagelib-21.12.3-speech-optional-3.patch b/kde-apps/messagelib/files/messagelib-21.12.3-speech-optional-3.patch new file mode 100644 index 000000000000..092df18f4498 --- /dev/null +++ b/kde-apps/messagelib/files/messagelib-21.12.3-speech-optional-3.patch @@ -0,0 +1,56 @@ +From 141b7862a292323fa41c9f863e16f49e548d8bfa Mon Sep 17 00:00:00 2001 +From: Andreas Sturmlechner <asturm@gentoo.org> +Date: Thu, 24 Feb 2022 16:04:59 +0100 +Subject: [PATCH] Fix build without texttospeech + +Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> +--- + messageviewer/src/utils/messageviewerutil.cpp | 1 - + messageviewer/src/viewer/viewer_p.cpp | 2 ++ + messageviewer/src/widgets/mailsourceviewtextbrowserwidget.cpp | 2 ++ + 3 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/messageviewer/src/utils/messageviewerutil.cpp b/messageviewer/src/utils/messageviewerutil.cpp +index 607fa65cb..e2446c13a 100644 +--- a/messageviewer/src/utils/messageviewerutil.cpp ++++ b/messageviewer/src/utils/messageviewerutil.cpp +@@ -41,7 +41,6 @@ + #include "MessageCore/StringUtil" + #include "messageviewer_debug.h" + #include "messageviewerutil_p.h" +-#include <KPIMTextEdit/TextToSpeech> + #include <MimeTreeParser/NodeHelper> + + #include <PimCommon/RenameFileDialog> +diff --git a/messageviewer/src/viewer/viewer_p.cpp b/messageviewer/src/viewer/viewer_p.cpp +index b989b294a..22587635c 100644 +--- a/messageviewer/src/viewer/viewer_p.cpp ++++ b/messageviewer/src/viewer/viewer_p.cpp +@@ -129,7 +129,9 @@ + #include <Akonadi/CollectionFetchScope> + + #include <KJobWidgets/KJobWidgets> ++#if KPIMTEXTEDIT_TEXT_TO_SPEECH + #include <KPIMTextEdit/TextToSpeechWidget> ++#endif + #include <QApplication> + #include <QStandardPaths> + #include <QWebEngineSettings> +diff --git a/messageviewer/src/widgets/mailsourceviewtextbrowserwidget.cpp b/messageviewer/src/widgets/mailsourceviewtextbrowserwidget.cpp +index 0e5b61c1e..67ac5bf1a 100644 +--- a/messageviewer/src/widgets/mailsourceviewtextbrowserwidget.cpp ++++ b/messageviewer/src/widgets/mailsourceviewtextbrowserwidget.cpp +@@ -13,8 +13,10 @@ + #include "messageviewer/messageviewerutil.h" + #include "messageviewer_debug.h" + #include <KPIMTextEdit/SlideContainer> ++#if KPIMTEXTEDIT_TEXT_TO_SPEECH + #include <KPIMTextEdit/TextToSpeechInterface> + #include <KPIMTextEdit/TextToSpeechWidget> ++#endif + #include <PimCommon/PimUtil> + + #include <KSyntaxHighlighting/Definition> +-- +2.35.1 + |