diff -Nru kpimtextedit-15.12.3/autotests/CMakeLists.txt kpimtextedit-16.04.3/autotests/CMakeLists.txt --- kpimtextedit-15.12.3/autotests/CMakeLists.txt 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/autotests/CMakeLists.txt 2016-06-30 11:49:53.000000000 +0000 @@ -1,6 +1,5 @@ include(ECMAddTests) -set(QT_REQUIRED_VERSION "5.2.0") find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS Test Widgets) ecm_add_tests( textutilstest.cpp editorutiltest.cpp NAME_PREFIX "kpimtextedit-" LINK_LIBRARIES Qt5::Test Qt5::Widgets KF5::Codecs KF5PimTextEdit KF5::IconThemes KF5::TextWidgets KF5::XmlGui) diff -Nru kpimtextedit-15.12.3/CMakeLists.txt kpimtextedit-16.04.3/CMakeLists.txt --- kpimtextedit-15.12.3/CMakeLists.txt 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/CMakeLists.txt 2016-06-30 11:49:53.000000000 +0000 @@ -3,7 +3,7 @@ project(KPimTextEdit) # ECM setup -find_package(ECM 5.16.0 CONFIG REQUIRED) +find_package(ECM 5.19.0 CONFIG REQUIRED) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) include(GenerateExportHeader) @@ -14,11 +14,11 @@ include(FeatureSummary) include(KDEInstallDirs) include(KDECMakeSettings) -include(KDEFrameworkCompilerSettings) +include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(ECMAddTests) -set(KF5_VERSION "5.16.0") -set(KPIMTEXTEDIT_LIB_VERSION "4.91.0") +set(KF5_VERSION "5.19.0") +set(KPIMTEXTEDIT_LIB_VERSION "5.2.3") ecm_setup_version(${KPIMTEXTEDIT_LIB_VERSION} VARIABLE_PREFIX KPIMTEXTEDIT VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kpimtextedit_version.h" @@ -29,6 +29,12 @@ set(QT_REQUIRED_VERSION "5.4.0") find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS Test Widgets DBus) find_package(Grantlee5 "5.0" CONFIG REQUIRED) +find_package(Qt5Designer NO_MODULE) +set_package_properties(Qt5Designer PROPERTIES + PURPOSE "Required to build the Qt Designer plugins" + TYPE OPTIONAL +) + ########### Find packages ########### find_package(KF5CoreAddons ${KF5_VERSION} CONFIG REQUIRED) @@ -42,6 +48,7 @@ find_package(KF5ConfigWidgets ${KF5_VERSION} CONFIG REQUIRED) find_package(KF5IconThemes ${KF5_VERSION} CONFIG REQUIRED) find_package(KF5XmlGui ${KF5_VERSION} CONFIG REQUIRED) +find_package(KF5DesignerPlugin ${KF5_VERSION} CONFIG REQUIRED) add_definitions(-DTRANSLATION_DOMAIN=\"libkpimtextedit\") add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII") diff -Nru kpimtextedit-15.12.3/debian/changelog kpimtextedit-16.04.3/debian/changelog --- kpimtextedit-15.12.3/debian/changelog 2016-04-14 22:43:12.000000000 +0000 +++ kpimtextedit-16.04.3/debian/changelog 2016-09-30 04:33:16.000000000 +0000 @@ -1,3 +1,24 @@ +kpimtextedit (16.04.3-0ubuntu1) yakkety; urgency=medium + + [ Scarlett Clark ] + * New upstream release + + [ Philip Muškovac ] + * Update the Vcs URLs now that the repositories are hosted on + Launchpad + + [ Scarlett Clark ] + * Bump SO version in install file. + * Refresh symbols. + * Add missing file. + * New upstream bugfix release + + [ Clive Johnston ] + * New upstream release (16.04.2) + * New upstream release (16.04.3) + + -- José Manuel Santamaría Lema Fri, 30 Sep 2016 06:33:16 +0200 + kpimtextedit (15.12.3-0ubuntu1) xenial; urgency=medium * New upstream bugfix release diff -Nru kpimtextedit-15.12.3/debian/control kpimtextedit-16.04.3/debian/control --- kpimtextedit-15.12.3/debian/control 2016-04-14 22:43:12.000000000 +0000 +++ kpimtextedit-16.04.3/debian/control 2016-09-30 04:33:16.000000000 +0000 @@ -5,33 +5,33 @@ Uploaders: Maximiliano Curia Build-Depends: cmake (>= 2.8.12~), debhelper (>= 9), - extra-cmake-modules (>= 5.16.0~), - kgendesignerplugin, - kio-dev (>= 5.16.0~), + extra-cmake-modules (>= 5.24.0~), + kgendesignerplugin (>= 5.24.0~), + kio-dev (>= 5.24.0~), libgrantlee5-dev (>= 5.0~), - libkf5codecs-dev (>= 5.16.0~), - libkf5configwidgets-dev (>= 5.16.0~), - libkf5coreaddons-dev (>= 5.16.0~), - libkf5emoticons-dev (>= 5.16.0~), - libkf5iconthemes-dev (>= 5.16.0~), - libkf5sonnet-dev (>= 5.16.0~), - libkf5textwidgets-dev (>= 5.16.0~), - libkf5widgetsaddons-dev (>= 5.16.0~), - libkf5xmlgui-dev (>= 5.16.0~), + libkf5codecs-dev (>= 5.24.0~), + libkf5configwidgets-dev (>= 5.24.0~), + libkf5coreaddons-dev (>= 5.24.0~), + libkf5emoticons-dev (>= 5.24.0~), + libkf5iconthemes-dev (>= 5.24.0~), + libkf5sonnet-dev (>= 5.24.0~), + libkf5textwidgets-dev (>= 5.24.0~), + libkf5widgetsaddons-dev (>= 5.24.0~), + libkf5xmlgui-dev (>= 5.24.0~), pkg-kde-tools (>> 0.15.15), - qtbase5-dev (>= 5.4.0~), - qttools5-dev + qtbase5-dev (>= 5.6.1~), + qttools5-dev (>= 5.6.1~) Standards-Version: 3.9.6 Homepage: https://projects.kde.org/projects/kde/pim/kpimtextedit -Vcs-Browser: http://anonscm.debian.org/cgit/pkg-kde/applications/kpimtextedit.git -Vcs-Git: git://anonscm.debian.org/pkg-kde/applications/kpimtextedit.git +Vcs-Browser: https://code.launchpad.net/~kubuntu-packagers/kubuntu-packaging/+git/kpimtextedit +Vcs-Git: git://git.launchpad.net/~kubuntu-packagers/kubuntu-packaging/+git/kpimtextedit Package: libkf5pimtextedit-dev Section: libdevel Architecture: any Multi-Arch: foreign Depends: libkf5pimtextedit5 (= ${binary:Version}), - libkf5textwidgets-dev (>= 5.16.0~), + libkf5textwidgets-dev (>= 5.21.0~), ${misc:Depends} Description: libkf5pimtextedit - development files KPIMTextedit provides a textedit with PIM-specific features. It also provides diff -Nru kpimtextedit-15.12.3/debian/libkf5pimtextedit5.install kpimtextedit-16.04.3/debian/libkf5pimtextedit5.install --- kpimtextedit-15.12.3/debian/libkf5pimtextedit5.install 2016-04-14 22:43:12.000000000 +0000 +++ kpimtextedit-16.04.3/debian/libkf5pimtextedit5.install 2016-09-30 04:33:16.000000000 +0000 @@ -1,2 +1,2 @@ -usr/lib/*/libKF5PimTextEdit.so.4.* usr/lib/*/libKF5PimTextEdit.so.5 +usr/lib/*/libKF5PimTextEdit.so.5.* diff -Nru kpimtextedit-15.12.3/debian/libkf5pimtextedit5.symbols kpimtextedit-16.04.3/debian/libkf5pimtextedit5.symbols --- kpimtextedit-15.12.3/debian/libkf5pimtextedit5.symbols 2016-04-14 22:43:12.000000000 +0000 +++ kpimtextedit-16.04.3/debian/libkf5pimtextedit5.symbols 2016-09-30 04:33:16.000000000 +0000 @@ -1,4 +1,4 @@ -# SymbolsHelper-Confirmed: 15.12.1 amd64 i386 +# SymbolsHelper-Confirmed: 16.04.0 amd64 i386 libKF5PimTextEdit.so.5 libkf5pimtextedit5 #MINVER# (optional=templinst)_ZN12KConfigGroup10writeEntryIdEEvPKcRKT_6QFlagsIN11KConfigBase15WriteConfigFlagEE@Base 15.12.0 _ZN12KPIMTextEdit10EditorUtil11reverseCaseER11QTextCursor@Base 15.12.0 @@ -40,12 +40,12 @@ _ZN12KPIMTextEdit14RichTextEditor14addIgnoreWordsERK11QStringList@Base 15.12.0 _ZN12KPIMTextEdit14RichTextEditor14clearDecoratorEv@Base 15.12.0 _ZN12KPIMTextEdit14RichTextEditor14deleteWordBackEv@Base 15.12.0 - _ZN12KPIMTextEdit14RichTextEditor14handleShortcutEPK9QKeyEvent@Base 15.12.0 + _ZN12KPIMTextEdit14RichTextEditor14handleShortcutEP9QKeyEvent@Base 16.04.0 _ZN12KPIMTextEdit14RichTextEditor14mousePopupMenuE6QPoint@Base 15.12.0 _ZN12KPIMTextEdit14RichTextEditor14setHighlighterEPN6Sonnet11HighlighterE@Base 15.12.0 _ZN12KPIMTextEdit14RichTextEditor15languageChangedERK7QString@Base 15.12.0 _ZN12KPIMTextEdit14RichTextEditor16contextMenuEventEP17QContextMenuEvent@Base 15.12.0 - _ZN12KPIMTextEdit14RichTextEditor16overrideShortcutEPK9QKeyEvent@Base 15.12.0 + _ZN12KPIMTextEdit14RichTextEditor16overrideShortcutEP9QKeyEvent@Base 16.04.0 _ZN12KPIMTextEdit14RichTextEditor16setSearchSupportEb@Base 15.12.0 _ZN12KPIMTextEdit14RichTextEditor16spellCheckStatusERK7QString@Base 15.12.0 _ZN12KPIMTextEdit14RichTextEditor16staticMetaObjectE@Base 15.12.0 @@ -124,11 +124,11 @@ _ZN12KPIMTextEdit15PlainTextEditor14addIgnoreWordsERK11QStringList@Base 15.12.0 _ZN12KPIMTextEdit15PlainTextEditor14clearDecoratorEv@Base 15.12.0 _ZN12KPIMTextEdit15PlainTextEditor14deleteWordBackEv@Base 15.12.0 - _ZN12KPIMTextEdit15PlainTextEditor14handleShortcutEPK9QKeyEvent@Base 15.12.0 + _ZN12KPIMTextEdit15PlainTextEditor14handleShortcutEP9QKeyEvent@Base 16.04.0 _ZN12KPIMTextEdit15PlainTextEditor14setHighlighterEPN6Sonnet11HighlighterE@Base 15.12.0 _ZN12KPIMTextEdit15PlainTextEditor15languageChangedERK7QString@Base 15.12.0 _ZN12KPIMTextEdit15PlainTextEditor16contextMenuEventEP17QContextMenuEvent@Base 15.12.0 - _ZN12KPIMTextEdit15PlainTextEditor16overrideShortcutEPK9QKeyEvent@Base 15.12.0 + _ZN12KPIMTextEdit15PlainTextEditor16overrideShortcutEP9QKeyEvent@Base 16.04.0 _ZN12KPIMTextEdit15PlainTextEditor16setSearchSupportEb@Base 15.12.0 _ZN12KPIMTextEdit15PlainTextEditor16spellCheckStatusERK7QString@Base 15.12.0 _ZN12KPIMTextEdit15PlainTextEditor16staticMetaObjectE@Base 15.12.0 @@ -194,6 +194,7 @@ _ZN12KPIMTextEdit16RichTextComposer15processKeyEventEP9QKeyEvent@Base 15.12.0 _ZN12KPIMTextEdit16RichTextComposer15textModeChangedENS0_4ModeE@Base 15.12.0 _ZN12KPIMTextEdit16RichTextComposer16activateRichTextEv@Base 15.12.0 + _ZN12KPIMTextEdit16RichTextComposer16setEnableActionsEb@Base 16.04.0 _ZN12KPIMTextEdit16RichTextComposer16staticMetaObjectE@Base 15.12.0 _ZN12KPIMTextEdit16RichTextComposer17createHighlighterEv@Base 15.12.0 _ZN12KPIMTextEdit16RichTextComposer17insertModeChangedEv@Base 15.12.0 @@ -288,6 +289,7 @@ _ZN12KPIMTextEdit18TextGoToLineWidget10moveToLineEi@Base 15.12.0 _ZN12KPIMTextEdit18TextGoToLineWidget11qt_metacallEN11QMetaObject4CallEiPPv@Base 15.12.0 _ZN12KPIMTextEdit18TextGoToLineWidget11qt_metacastEPKc@Base 15.12.0 + _ZN12KPIMTextEdit18TextGoToLineWidget12hideGotoLineEv@Base 16.04.0 _ZN12KPIMTextEdit18TextGoToLineWidget12slotCloseBarEv@Base 15.12.0 _ZN12KPIMTextEdit18TextGoToLineWidget12slotGoToLineEv@Base 15.12.0 _ZN12KPIMTextEdit18TextGoToLineWidget16staticMetaObjectE@Base 15.12.0 @@ -483,6 +485,14 @@ _ZN12KPIMTextEdit22RichTextComposerImagesD0Ev@Base 15.12.0 _ZN12KPIMTextEdit22RichTextComposerImagesD1Ev@Base 15.12.0 _ZN12KPIMTextEdit22RichTextComposerImagesD2Ev@Base 15.12.0 + _ZN12KPIMTextEdit22RichTextComposerWidget11qt_metacallEN11QMetaObject4CallEiPPv@Base 16.04.0 + _ZN12KPIMTextEdit22RichTextComposerWidget11qt_metacastEPKc@Base 16.04.0 + _ZN12KPIMTextEdit22RichTextComposerWidget16staticMetaObjectE@Base 16.04.0 + _ZN12KPIMTextEdit22RichTextComposerWidgetC1EP7QWidget@Base 16.04.0 + _ZN12KPIMTextEdit22RichTextComposerWidgetC2EP7QWidget@Base 16.04.0 + _ZN12KPIMTextEdit22RichTextComposerWidgetD0Ev@Base 16.04.0 + _ZN12KPIMTextEdit22RichTextComposerWidgetD1Ev@Base 16.04.0 + _ZN12KPIMTextEdit22RichTextComposerWidgetD2Ev@Base 16.04.0 _ZN12KPIMTextEdit23RichTextComposerActions11qt_metacallEN11QMetaObject4CallEiPPv@Base 15.12.0 _ZN12KPIMTextEdit23RichTextComposerActions11qt_metacastEPKc@Base 15.12.0 _ZN12KPIMTextEdit23RichTextComposerActions12setListStyleEi@Base 15.12.0 @@ -798,6 +808,8 @@ _ZNK12KPIMTextEdit22RichTextComposerImages14embeddedImagesEv@Base 15.12.0 _ZNK12KPIMTextEdit22RichTextComposerImages14imagesWithNameEv@Base 15.12.0 _ZNK12KPIMTextEdit22RichTextComposerImages20embeddedImageFormatsEv@Base 15.12.0 + _ZNK12KPIMTextEdit22RichTextComposerWidget10metaObjectEv@Base 16.04.0 + _ZNK12KPIMTextEdit22RichTextComposerWidget16richTextComposerEv@Base 16.04.0 _ZNK12KPIMTextEdit23RichTextComposerActions10metaObjectEv@Base 15.12.0 _ZNK12KPIMTextEdit23RichTextComposerActions15numberOfActionsEv@Base 15.12.0 _ZNK12KPIMTextEdit23RichTextComposerActions18richTextActionListEv@Base 15.12.0 @@ -865,6 +877,7 @@ _ZTIN12KPIMTextEdit21TextToSpeechInterfaceE@Base 15.12.0 _ZTIN12KPIMTextEdit22EmoticonTextEditActionE@Base 15.07.90 _ZTIN12KPIMTextEdit22RichTextComposerImagesE@Base 15.12.0 + _ZTIN12KPIMTextEdit22RichTextComposerWidgetE@Base 16.04.0 _ZTIN12KPIMTextEdit23RichTextComposerActionsE@Base 15.12.0 _ZTIN12KPIMTextEdit23SelectSpecialCharDialogE@Base 15.07.90 _ZTIN12KPIMTextEdit24RichTextExternalComposerE@Base 15.12.0 @@ -904,6 +917,7 @@ _ZTSN12KPIMTextEdit21TextToSpeechInterfaceE@Base 15.12.0 _ZTSN12KPIMTextEdit22EmoticonTextEditActionE@Base 15.07.90 _ZTSN12KPIMTextEdit22RichTextComposerImagesE@Base 15.12.0 + _ZTSN12KPIMTextEdit22RichTextComposerWidgetE@Base 16.04.0 _ZTSN12KPIMTextEdit23RichTextComposerActionsE@Base 15.12.0 _ZTSN12KPIMTextEdit23SelectSpecialCharDialogE@Base 15.07.90 _ZTSN12KPIMTextEdit24RichTextExternalComposerE@Base 15.12.0 @@ -943,6 +957,7 @@ _ZTVN12KPIMTextEdit21TextToSpeechInterfaceE@Base 15.12.0 _ZTVN12KPIMTextEdit22EmoticonTextEditActionE@Base 15.07.90 _ZTVN12KPIMTextEdit22RichTextComposerImagesE@Base 15.12.0 + _ZTVN12KPIMTextEdit22RichTextComposerWidgetE@Base 16.04.0 _ZTVN12KPIMTextEdit23RichTextComposerActionsE@Base 15.12.0 _ZTVN12KPIMTextEdit23SelectSpecialCharDialogE@Base 15.07.90 _ZTVN12KPIMTextEdit24RichTextExternalComposerE@Base 15.12.0 @@ -964,6 +979,7 @@ (c++)"non-virtual thunk to KPIMTextEdit::PlainTextEditor::~PlainTextEditor()@Base" 15.12.0 (c++)"non-virtual thunk to KPIMTextEdit::PlainTextEditorWidget::~PlainTextEditorWidget()@Base" 15.12.0 (c++)"non-virtual thunk to KPIMTextEdit::RichTextComposer::~RichTextComposer()@Base" 15.12.0 + (c++)"non-virtual thunk to KPIMTextEdit::RichTextComposerWidget::~RichTextComposerWidget()@Base" 16.04.0 (c++)"non-virtual thunk to KPIMTextEdit::RichTextEditFindBar::~RichTextEditFindBar()@Base" 15.12.0 (c++)"non-virtual thunk to KPIMTextEdit::RichTextEditor::~RichTextEditor()@Base" 15.12.0 (c++)"non-virtual thunk to KPIMTextEdit::RichTextEditorWidget::~RichTextEditorWidget()@Base" 15.12.0 diff -Nru kpimtextedit-15.12.3/debian/libkf5pimtextedit-dev.install kpimtextedit-16.04.3/debian/libkf5pimtextedit-dev.install --- kpimtextedit-15.12.3/debian/libkf5pimtextedit-dev.install 2016-04-14 22:43:12.000000000 +0000 +++ kpimtextedit-16.04.3/debian/libkf5pimtextedit-dev.install 2016-09-30 04:33:16.000000000 +0000 @@ -3,3 +3,4 @@ usr/lib/*/cmake/KF5PimTextEdit/ usr/lib/*/libKF5PimTextEdit.so usr/lib/*/qt5/mkspecs/modules/qt_KPIMTextEdit.pri +usr/lib/*/qt5/plugins/designer/kpimtexteditwidgets.so diff -Nru kpimtextedit-15.12.3/src/CMakeLists.txt kpimtextedit-16.04.3/src/CMakeLists.txt --- kpimtextedit-15.12.3/src/CMakeLists.txt 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/CMakeLists.txt 2016-06-30 11:49:53.000000000 +0000 @@ -26,6 +26,7 @@ composer-ng/richtextcomposerimages.cpp composer-ng/richtextcomposeremailquotedecorator.cpp composer-ng/richtextcomposeremailquotehighlighter.cpp + composer-ng/richtextcomposerwidget.cpp ) set(kpimtextedit_texttospeech_SRCS @@ -176,6 +177,7 @@ RichTextExternalComposer RichTextComposerActions RichTextComposerEmailQuoteHighlighter + RichTextComposerWidget REQUIRED_HEADERS KPimTextEdit_composerng_HEADERS PREFIX KPIMTextEdit RELATIVE composer-ng @@ -222,3 +224,5 @@ add_subdirectory(composer-ng/autotests) add_subdirectory(composer-ng/tests) endif() + +add_subdirectory(designer) diff -Nru kpimtextedit-15.12.3/src/composer-ng/autotests/CMakeLists.txt kpimtextedit-16.04.3/src/composer-ng/autotests/CMakeLists.txt --- kpimtextedit-15.12.3/src/composer-ng/autotests/CMakeLists.txt 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/composer-ng/autotests/CMakeLists.txt 2016-06-30 11:49:53.000000000 +0000 @@ -10,3 +10,4 @@ add_composer_ng_test(richtextcomposeractionstest.cpp) add_composer_ng_test(richtextexternalcomposertest.cpp) add_composer_ng_test(richtextcomposerimagestest.cpp) +add_composer_ng_test(richtextcomposerwidgettest.cpp) diff -Nru kpimtextedit-15.12.3/src/composer-ng/autotests/richtextcomposercontrolertest.h kpimtextedit-16.04.3/src/composer-ng/autotests/richtextcomposercontrolertest.h --- kpimtextedit-15.12.3/src/composer-ng/autotests/richtextcomposercontrolertest.h 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/composer-ng/autotests/richtextcomposercontrolertest.h 2016-06-30 11:49:53.000000000 +0000 @@ -45,7 +45,6 @@ void shouldTextSuperScript(); void shouldTextSubScript(); - }; #endif // RICHTEXTCOMPOSERCONTROLERTEST_H diff -Nru kpimtextedit-15.12.3/src/composer-ng/autotests/richtextcomposertest.cpp kpimtextedit-16.04.3/src/composer-ng/autotests/richtextcomposertest.cpp --- kpimtextedit-15.12.3/src/composer-ng/autotests/richtextcomposertest.cpp 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/composer-ng/autotests/richtextcomposertest.cpp 2016-06-30 11:49:53.000000000 +0000 @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -473,6 +474,24 @@ QCOMPARE(edit.composerControler()->toWrappedPlainText(), text); } +void RichTextComposerTest::testEnableDisableActions() +{ + KPIMTextEdit::RichTextComposer composer; + KActionCollection *actionCollection = new KActionCollection(&composer); + composer.createActions(actionCollection); + bool enableAction = true; + composer.setEnableActions(enableAction); + Q_FOREACH (QAction *act, composer.actions()) { + QCOMPARE(act->isEnabled(), enableAction); + } + + enableAction = false; + composer.setEnableActions(enableAction); + Q_FOREACH (QAction *act, composer.actions()) { + QCOMPARE(act->isEnabled(), enableAction); + } +} + void RichTextComposerTest::shouldHaveDefaultValue() { KPIMTextEdit::RichTextComposer composer; diff -Nru kpimtextedit-15.12.3/src/composer-ng/autotests/richtextcomposertest.h kpimtextedit-16.04.3/src/composer-ng/autotests/richtextcomposertest.h --- kpimtextedit-15.12.3/src/composer-ng/autotests/richtextcomposertest.h 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/composer-ng/autotests/richtextcomposertest.h 2016-06-30 11:49:53.000000000 +0000 @@ -40,6 +40,7 @@ void testDeleteLine_data(); void testLoadImage(); void testWrappedPlainText(); + void testEnableDisableActions(); }; #endif // RICHTEXTCOMPOSERTEST_H diff -Nru kpimtextedit-15.12.3/src/composer-ng/autotests/richtextcomposerwidgettest.cpp kpimtextedit-16.04.3/src/composer-ng/autotests/richtextcomposerwidgettest.cpp --- kpimtextedit-15.12.3/src/composer-ng/autotests/richtextcomposerwidgettest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ kpimtextedit-16.04.3/src/composer-ng/autotests/richtextcomposerwidgettest.cpp 2016-06-30 11:49:53.000000000 +0000 @@ -0,0 +1,42 @@ +/* + Copyright (c) 2015 Montel Laurent + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License, version 2, as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "richtextcomposerwidgettest.h" +#include "../richtextcomposerwidget.h" +#include +#include + +RichTextComposerWidgetTest::RichTextComposerWidgetTest(QObject *parent) + : QObject(parent) +{ + +} + +RichTextComposerWidgetTest::~RichTextComposerWidgetTest() +{ + +} + +void RichTextComposerWidgetTest::shouldHaveDefaultValue() +{ + KPIMTextEdit::RichTextComposerWidget w; + KPIMTextEdit::RichTextComposer *composer = w.findChild(QStringLiteral("richtextcomposer")); + QVERIFY(composer); + QVERIFY(w.richTextComposer()); +} + +QTEST_MAIN(RichTextComposerWidgetTest) diff -Nru kpimtextedit-15.12.3/src/composer-ng/autotests/richtextcomposerwidgettest.h kpimtextedit-16.04.3/src/composer-ng/autotests/richtextcomposerwidgettest.h --- kpimtextedit-15.12.3/src/composer-ng/autotests/richtextcomposerwidgettest.h 1970-01-01 00:00:00.000000000 +0000 +++ kpimtextedit-16.04.3/src/composer-ng/autotests/richtextcomposerwidgettest.h 2016-06-30 11:49:53.000000000 +0000 @@ -0,0 +1,34 @@ +/* + Copyright (c) 2015 Montel Laurent + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License, version 2, as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef RICHTEXTCOMPOSERWIDGETTEST_H +#define RICHTEXTCOMPOSERWIDGETTEST_H + +#include + +class RichTextComposerWidgetTest : public QObject +{ + Q_OBJECT +public: + explicit RichTextComposerWidgetTest(QObject *parent = Q_NULLPTR); + ~RichTextComposerWidgetTest(); + +private Q_SLOTS: + void shouldHaveDefaultValue(); +}; + +#endif // RICHTEXTCOMPOSERWIDGETTEST_H diff -Nru kpimtextedit-15.12.3/src/composer-ng/richtextcomposeractions.cpp kpimtextedit-16.04.3/src/composer-ng/richtextcomposeractions.cpp --- kpimtextedit-15.12.3/src/composer-ng/richtextcomposeractions.cpp 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/composer-ng/richtextcomposeractions.cpp 2016-06-30 11:49:53.000000000 +0000 @@ -145,44 +145,48 @@ { //Alignment d->action_align_left = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-justify-left")), - i18nc("@action", "Align &Left"), this); + i18nc("@action", "Align &Left"), this); d->action_align_left->setIconText(i18nc("@label left justify", "Left")); d->richTextActionList.append((d->action_align_left)); d->action_align_left->setObjectName(QStringLiteral("format_align_left")); connect(d->action_align_left, &KToggleAction::triggered, d->composerControler, &RichTextComposerControler::alignLeft); - if (ac) + if (ac) { ac->addAction(QStringLiteral("format_align_left"), d->action_align_left); + } d->action_align_center = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-justify-center")), - i18nc("@action", "Align &Center"), this); + i18nc("@action", "Align &Center"), this); d->action_align_center->setIconText(i18nc("@label center justify", "Center")); d->richTextActionList.append((d->action_align_center)); d->action_align_center->setObjectName(QStringLiteral("format_align_center")); connect(d->action_align_center, &KToggleAction::triggered, d->composerControler, &RichTextComposerControler::alignCenter); - if (ac) + if (ac) { ac->addAction(QStringLiteral("format_align_center"), d->action_align_center); + } d->action_align_right = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-justify-right")), - i18nc("@action", "Align &Right"), this); + i18nc("@action", "Align &Right"), this); d->action_align_right->setIconText(i18nc("@label right justify", "Right")); d->richTextActionList.append((d->action_align_right)); d->action_align_right->setObjectName(QStringLiteral("format_align_right")); connect(d->action_align_right, &KToggleAction::triggered, d->composerControler, &RichTextComposerControler::alignRight); - if (ac) + if (ac) { ac->addAction(QStringLiteral("format_align_right"), d->action_align_right); + } d->action_align_justify = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-justify-fill")), - i18nc("@action", "&Justify"), this); + i18nc("@action", "&Justify"), this); d->action_align_justify->setIconText(i18nc("@label justify fill", "Justify")); d->richTextActionList.append((d->action_align_justify)); d->action_align_justify->setObjectName(QStringLiteral("format_align_justify")); connect(d->action_align_justify, &KToggleAction::triggered, d->composerControler, &RichTextComposerControler::alignJustify); - if (ac) + if (ac) { ac->addAction(QStringLiteral("format_align_justify"), d->action_align_justify); + } QActionGroup *alignmentGroup = new QActionGroup(this); alignmentGroup->addAction(d->action_align_left); @@ -192,24 +196,26 @@ //Align text d->action_direction_ltr = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-text-direction-ltr")), - i18nc("@action", "Left-to-Right"), this); + i18nc("@action", "Left-to-Right"), this); d->action_direction_ltr->setIconText(i18nc("@label left-to-right", "Left-to-Right")); d->richTextActionList.append(d->action_direction_ltr); d->action_direction_ltr->setObjectName(QStringLiteral("direction_ltr")); connect(d->action_direction_ltr, &KToggleAction::triggered, d->composerControler, &RichTextComposerControler::makeLeftToRight); - if (ac) + if (ac) { ac->addAction(QStringLiteral("direction_ltr"), d->action_direction_ltr); + } d->action_direction_rtl = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-text-direction-rtl")), - i18nc("@action", "Right-to-Left"), this); + i18nc("@action", "Right-to-Left"), this); d->action_direction_rtl->setIconText(i18nc("@label right-to-left", "Right-to-Left")); d->richTextActionList.append(d->action_direction_rtl); d->action_direction_rtl->setObjectName(QStringLiteral("direction_rtl")); connect(d->action_direction_rtl, &KToggleAction::triggered, d->composerControler, &RichTextComposerControler::makeRightToLeft); - if (ac) + if (ac) { ac->addAction(QStringLiteral("direction_rtl"), d->action_direction_rtl); + } QActionGroup *directionGroup = new QActionGroup(this); directionGroup->addAction(d->action_direction_ltr); @@ -217,22 +223,24 @@ // Sub/Super script d->action_text_subscript = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-text-subscript")), - i18nc("@action", "Subscript"), this); + i18nc("@action", "Subscript"), this); d->richTextActionList.append((d->action_text_subscript)); d->action_text_subscript->setObjectName(QStringLiteral("format_text_subscript")); connect(d->action_text_subscript, &KToggleAction::triggered, d->composerControler, &RichTextComposerControler::setTextSubScript); - if (ac) + if (ac) { ac->addAction(QStringLiteral("format_text_subscript"), d->action_text_subscript); + } d->action_text_superscript = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-text-superscript")), - i18nc("@action", "Superscript"), this); + i18nc("@action", "Superscript"), this); d->richTextActionList.append((d->action_text_superscript)); d->action_text_superscript->setObjectName(QStringLiteral("format_text_superscript")); connect(d->action_text_superscript, &KToggleAction::triggered, d->composerControler, &RichTextComposerControler::setTextSuperScript); - if (ac) + if (ac) { ac->addAction(QStringLiteral("format_text_superscript"), d->action_text_superscript); + } d->action_text_bold = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-text-bold")), i18nc("@action boldify selected text", "&Bold"), this); @@ -248,7 +256,7 @@ connect(d->action_text_bold, &KToggleAction::triggered, d->composerControler, &RichTextComposerControler::setTextBold); d->action_text_italic = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-text-italic")), - i18nc("@action italicize selected text", "&Italic"), this); + i18nc("@action italicize selected text", "&Italic"), this); QFont italic; italic.setItalic(true); d->action_text_italic->setFont(italic); @@ -261,7 +269,7 @@ connect(d->action_text_italic, &KToggleAction::triggered, d->composerControler, &RichTextComposerControler::setTextItalic); d->action_text_underline = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-text-underline")), - i18nc("@action underline selected text", "&Underline"), this); + i18nc("@action underline selected text", "&Underline"), this); QFont underline; underline.setUnderline(true); d->action_text_underline->setFont(underline); @@ -274,58 +282,65 @@ connect(d->action_text_underline, &KToggleAction::triggered, d->composerControler, &RichTextComposerControler::setTextUnderline); d->action_text_strikeout = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-text-strikethrough")), - i18nc("@action", "&Strike Out"), this); + i18nc("@action", "&Strike Out"), this); QFont strikeout; strikeout.setStrikeOut(true); d->action_text_strikeout->setFont(strikeout); d->richTextActionList.append((d->action_text_strikeout)); - if (ac) + if (ac) { ac->addAction(QStringLiteral("format_text_strikeout"), d->action_text_strikeout); + } d->action_text_strikeout->setObjectName(QStringLiteral("format_text_strikeout")); - if (ac) + if (ac) { ac->setDefaultShortcut(d->action_text_strikeout, Qt::CTRL + Qt::Key_L); + } connect(d->action_text_strikeout, &KToggleAction::triggered, d->composerControler, &RichTextComposerControler::setTextStrikeOut); //Font Family d->action_font_family = new KFontAction(i18nc("@action", "&Font"), this); d->richTextActionList.append((d->action_font_family)); d->action_font_family->setObjectName(QStringLiteral("format_font_family")); - if (ac) + if (ac) { ac->addAction(QStringLiteral("format_font_family"), d->action_font_family); + } connect(d->action_font_family, SIGNAL(triggered(QString)), d->composerControler, SLOT(setFontFamily(QString))); //Font Size d->action_font_size = new KFontSizeAction(i18nc("@action", "Font &Size"), this); d->richTextActionList.append((d->action_font_size)); d->action_font_size->setObjectName(QStringLiteral("format_font_size")); - if (ac) + if (ac) { ac->addAction(QStringLiteral("format_font_size"), d->action_font_size); + } connect(d->action_font_size, &KFontSizeAction::fontSizeChanged, d->composerControler, &RichTextComposerControler::setFontSize); d->action_insert_horizontal_rule = new QAction(QIcon::fromTheme(QStringLiteral("insert-horizontal-rule")), - i18nc("@action", "Insert Rule Line"), this); + i18nc("@action", "Insert Rule Line"), this); d->richTextActionList.append((d->action_insert_horizontal_rule)); d->action_insert_horizontal_rule->setObjectName(QStringLiteral("insert_horizontal_rule")); - if (ac) + if (ac) { ac->addAction(QStringLiteral("insert_horizontal_rule"), d->action_insert_horizontal_rule); + } connect(d->action_insert_horizontal_rule, &QAction::triggered, d->composerControler, &RichTextComposerControler::insertHorizontalRule); //Foreground Color d->action_text_foreground_color = new QAction(QIcon::fromTheme(QStringLiteral("format-stroke-color")), - i18nc("@action", "Text &Color..."), this); + i18nc("@action", "Text &Color..."), this); d->action_text_foreground_color->setIconText(i18nc("@label stroke color", "Color")); d->richTextActionList.append((d->action_text_foreground_color)); d->action_text_foreground_color->setObjectName(QStringLiteral("format_text_foreground_color")); - if (ac) + if (ac) { ac->addAction(QStringLiteral("format_text_foreground_color"), d->action_text_foreground_color); + } connect(d->action_text_foreground_color, &QAction::triggered, d->composerControler, &RichTextComposerControler::setChangeTextForegroundColor); //Background Color d->action_text_background_color = new QAction(QIcon::fromTheme(QStringLiteral("format-fill-color")), - i18nc("@action", "Text &Highlight..."), this); + i18nc("@action", "Text &Highlight..."), this); d->richTextActionList.append((d->action_text_background_color)); - if (ac) + if (ac) { ac->addAction(QStringLiteral("format_text_background_color"), d->action_text_background_color); + } d->action_text_background_color->setObjectName(QStringLiteral("format_text_background_color")); connect(d->action_text_background_color, &QAction::triggered, d->composerControler, &RichTextComposerControler::setChangeTextBackgroundColor); @@ -333,8 +348,9 @@ i18nc("@action", "Link"), this); d->richTextActionList.append((d->action_manage_link)); d->action_manage_link->setObjectName(QStringLiteral("manage_link")); - if (ac) + if (ac) { ac->addAction(QStringLiteral("manage_link"), d->action_manage_link); + } connect(d->action_manage_link, &QAction::triggered, d->composerControler, &RichTextComposerControler::manageLink); @@ -342,8 +358,9 @@ i18nc("@action", "Increase Indent"), this); d->richTextActionList.append((d->action_list_indent)); d->action_list_indent->setObjectName(QStringLiteral("format_list_indent_more")); - if (ac) + if (ac) { ac->addAction(QStringLiteral("format_list_indent_more"), d->action_list_indent); + } connect(d->action_list_indent, &QAction::triggered, d->composerControler, &RichTextComposerControler::indentListMore); connect(d->action_list_indent, &QAction::triggered, @@ -352,15 +369,16 @@ i18nc("@action", "Decrease Indent"), this); d->richTextActionList.append((d->action_list_dedent)); d->action_list_dedent->setObjectName(QStringLiteral("format_list_indent_less")); - if (ac) + if (ac) { ac->addAction(QStringLiteral("format_list_indent_less"), d->action_list_dedent); + } connect(d->action_list_dedent, &QAction::triggered, d->composerControler, &RichTextComposerControler::indentListLess); connect(d->action_list_dedent, &QAction::triggered, this, &RichTextComposerActions::slotUpdateMiscActions); d->action_list_style = new KSelectAction(QIcon::fromTheme(QStringLiteral("format-list-unordered")), - i18nc("@title:menu", "List Style"), this); + i18nc("@title:menu", "List Style"), this); QStringList listStyles; listStyles << i18nc("@item:inmenu no list style", "None") << i18nc("@item:inmenu disc list style", "Disc") @@ -376,8 +394,9 @@ d->action_list_style->setCurrentItem(0); d->richTextActionList.append((d->action_list_style)); d->action_list_style->setObjectName(QStringLiteral("format_list_style")); - if (ac) + if (ac) { ac->addAction(QStringLiteral("format_list_style"), d->action_list_style); + } connect(d->action_list_style, SIGNAL(triggered(int)), this, SLOT(setListStyle(int))); connect(d->action_list_style, SIGNAL(triggered()), @@ -456,7 +475,7 @@ d->richTextActionList.append(d->action_delete_line); d->action_format_reset = - new QAction(QIcon::fromTheme(QStringLiteral("draw-eraser")), i18n("Reset Font Settings"), this); + new QAction(QIcon::fromTheme(QStringLiteral("draw-eraser")), i18n("Reset Font Settings"), this); d->action_format_reset->setIconText(i18n("Reset Font")); d->action_format_reset->setObjectName(QStringLiteral("format_reset")); connect(d->action_format_reset, &QAction::triggered, d->composerControler, &RichTextComposerControler::slotFormatReset); @@ -464,7 +483,7 @@ d->richTextActionList.append(d->action_format_reset); d->action_format_painter = new KToggleAction(QIcon::fromTheme(QStringLiteral("draw-brush")), - i18nc("@action", "Format Painter"), this); + i18nc("@action", "Format Painter"), this); d->richTextActionList.append(d->action_format_painter); d->action_format_painter->setObjectName(QStringLiteral("format_painter")); if (ac) { diff -Nru kpimtextedit-15.12.3/src/composer-ng/richtextcomposercontroler.cpp kpimtextedit-16.04.3/src/composer-ng/richtextcomposercontroler.cpp --- kpimtextedit-15.12.3/src/composer-ng/richtextcomposercontroler.cpp 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/composer-ng/richtextcomposercontroler.cpp 2016-06-30 11:49:53.000000000 +0000 @@ -104,7 +104,6 @@ } } - void RichTextComposerControler::RichTextComposerControlerPrivate::mergeFormatOnWordOrSelection(const QTextCharFormat &format) { QTextCursor cursor = richtextComposer->textCursor(); @@ -665,7 +664,6 @@ text.replace(QChar::Nbsp, QChar::fromLatin1(' ')); } - bool RichTextComposerControler::isFormattingUsed() const { if (richTextComposer()->textMode() == RichTextComposer::Plain) { @@ -875,7 +873,6 @@ return temp; } - QString RichTextComposerControler::toWrappedPlainText() const { QTextDocument *doc = richTextComposer()->document(); diff -Nru kpimtextedit-15.12.3/src/composer-ng/richtextcomposer.cpp kpimtextedit-16.04.3/src/composer-ng/richtextcomposer.cpp --- kpimtextedit-15.12.3/src/composer-ng/richtextcomposer.cpp 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/composer-ng/richtextcomposer.cpp 2016-06-30 11:49:53.000000000 +0000 @@ -33,6 +33,7 @@ #include #include +#include #include #include @@ -95,6 +96,13 @@ return d->richTextComposerActions->richTextActionList(); } +void RichTextComposer::setEnableActions(bool state) +{ + Q_FOREACH (QAction *act, richTextActionList()) { + act->setEnabled(state); + } +} + void RichTextComposer::createActions(KActionCollection *ac) { d->richTextComposerActions->createActions(ac); @@ -526,7 +534,6 @@ return KPIMTextEdit::RichTextEditor::canInsertFromMimeData(source); } - void RichTextComposer::mouseReleaseEvent(QMouseEvent *event) { if (d->composerControler->painterActive()) { diff -Nru kpimtextedit-15.12.3/src/composer-ng/richtextcomposer.h kpimtextedit-16.04.3/src/composer-ng/richtextcomposer.h --- kpimtextedit-15.12.3/src/composer-ng/richtextcomposer.h 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/composer-ng/richtextcomposer.h 2016-06-30 11:49:53.000000000 +0000 @@ -100,6 +100,7 @@ void createActions(KActionCollection *ac); QList richTextActionList() const; + void setEnableActions(bool state); KPIMTextEdit::RichTextComposerControler *composerControler() const; KPIMTextEdit::RichTextExternalComposer *externalComposer() const; diff -Nru kpimtextedit-15.12.3/src/composer-ng/richtextcomposerimages.cpp kpimtextedit-16.04.3/src/composer-ng/richtextcomposerimages.cpp --- kpimtextedit-15.12.3/src/composer-ng/richtextcomposerimages.cpp 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/composer-ng/richtextcomposerimages.cpp 2016-06-30 11:49:53.000000000 +0000 @@ -193,7 +193,7 @@ buffer.open(QIODevice::WriteOnly); normalImage->image.save(&buffer, "PNG"); - qsrand(QDateTime::currentDateTime().toTime_t() + qHash(normalImage->name)); + qsrand(QDateTime::currentDateTimeUtc().toTime_t() + qHash(normalImage->name)); QSharedPointer embeddedImage(new EmbeddedImage()); retImages.append(embeddedImage); embeddedImage->image = KCodecs::Codec::codecForName("base64")->encode(buffer.buffer()); diff -Nru kpimtextedit-15.12.3/src/composer-ng/richtextcomposerwidget.cpp kpimtextedit-16.04.3/src/composer-ng/richtextcomposerwidget.cpp --- kpimtextedit-15.12.3/src/composer-ng/richtextcomposerwidget.cpp 1970-01-01 00:00:00.000000000 +0000 +++ kpimtextedit-16.04.3/src/composer-ng/richtextcomposerwidget.cpp 2016-06-30 11:49:53.000000000 +0000 @@ -0,0 +1,55 @@ +/* + Copyright (c) 2015 Montel Laurent + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License, version 2, as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ +#include "richtextcomposerwidget.h" +#include +#include +#include + +using namespace KPIMTextEdit; + +class KPIMTextEdit::RichTextComposerWidgetPrivate +{ +public: + RichTextComposerWidgetPrivate() + : richTextComposer(Q_NULLPTR) + { + + } + KPIMTextEdit::RichTextComposer *richTextComposer; +}; + +RichTextComposerWidget::RichTextComposerWidget(QWidget *parent) + : QWidget(parent), + d(new KPIMTextEdit::RichTextComposerWidgetPrivate) +{ + QHBoxLayout *layout = new QHBoxLayout(this); + layout->setMargin(0); + d->richTextComposer = new KPIMTextEdit::RichTextComposer(this); + d->richTextComposer->setObjectName(QStringLiteral("richtextcomposer")); + RichTextEditorWidget *editorWidget = new RichTextEditorWidget(d->richTextComposer, this); + layout->addWidget(editorWidget); +} + +RichTextComposerWidget::~RichTextComposerWidget() +{ + delete d; +} + +KPIMTextEdit::RichTextComposer *RichTextComposerWidget::richTextComposer() const +{ + return d->richTextComposer; +} diff -Nru kpimtextedit-15.12.3/src/composer-ng/richtextcomposerwidget.h kpimtextedit-16.04.3/src/composer-ng/richtextcomposerwidget.h --- kpimtextedit-15.12.3/src/composer-ng/richtextcomposerwidget.h 1970-01-01 00:00:00.000000000 +0000 +++ kpimtextedit-16.04.3/src/composer-ng/richtextcomposerwidget.h 2016-06-30 11:49:53.000000000 +0000 @@ -0,0 +1,44 @@ +/* + Copyright (c) 2015 Montel Laurent + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License, version 2, as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef RICHTEXTCOMPOSERWIDGET_H +#define RICHTEXTCOMPOSERWIDGET_H + +#include +#include "kpimtextedit_export.h" +namespace KPIMTextEdit +{ +class RichTextComposerWidgetPrivate; +class RichTextComposer; +/** + * @brief The RichTextComposerWidget class + * @since 5.2 + */ +class KPIMTEXTEDIT_EXPORT RichTextComposerWidget : public QWidget +{ + Q_OBJECT +public: + explicit RichTextComposerWidget(QWidget *parent = Q_NULLPTR); + ~RichTextComposerWidget(); + + KPIMTextEdit::RichTextComposer *richTextComposer() const; +private: + RichTextComposerWidgetPrivate *const d; +}; +} + +#endif // RICHTEXTCOMPOSERWIDGET_H diff -Nru kpimtextedit-15.12.3/src/composer-ng/tests/richtextcomposerwidget_gui.cpp kpimtextedit-16.04.3/src/composer-ng/tests/richtextcomposerwidget_gui.cpp --- kpimtextedit-15.12.3/src/composer-ng/tests/richtextcomposerwidget_gui.cpp 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/composer-ng/tests/richtextcomposerwidget_gui.cpp 2016-06-30 11:49:53.000000000 +0000 @@ -15,7 +15,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ - #include #include #include diff -Nru kpimtextedit-15.12.3/src/designer/CMakeLists.txt kpimtextedit-16.04.3/src/designer/CMakeLists.txt --- kpimtextedit-15.12.3/src/designer/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ kpimtextedit-16.04.3/src/designer/CMakeLists.txt 2016-06-30 11:49:53.000000000 +0000 @@ -0,0 +1,20 @@ +if (Qt5Designer_FOUND) + kf5designerplugin_add_plugin(kpimtexteditwidgets kpimtexteditwidgets.widgets) + target_link_libraries(kpimtexteditwidgets + KF5::PimTextEdit + ) + if(NOT WIN32) + # Since there are no libraries provided by this module, + # there is no point including the build tree in RPath, + # and then having to edit it at install time. + set_target_properties(kpimtexteditwidgets PROPERTIES + SKIP_BUILD_RPATH TRUE + BUILD_WITH_INSTALL_RPATH TRUE + ) + endif() + + install(TARGETS + kpimtexteditwidgets + DESTINATION ${KDE_INSTALL_QTPLUGINDIR}/designer + ) +endif() diff -Nru kpimtextedit-15.12.3/src/designer/kpimtexteditwidgets.widgets kpimtextedit-16.04.3/src/designer/kpimtexteditwidgets.widgets --- kpimtextedit-15.12.3/src/designer/kpimtexteditwidgets.widgets 1970-01-01 00:00:00.000000000 +0000 +++ kpimtextedit-16.04.3/src/designer/kpimtexteditwidgets.widgets 2016-06-30 11:49:53.000000000 +0000 @@ -0,0 +1,27 @@ +[Global] +PluginName=KPimTextEditWidgets + +[KPIMTextEdit::RichTextEditorWidget] +ToolTip=A RichTextEditor (KDE-PIM) +WhatsThis=A RichTextEditor. +IncludeFile=kpimtextedit/richtexteditorwidget.h +Group=Input (KDE-PIM) + +[KPIMTextEdit::PlainTextEditorWidget] +ToolTip=A PlainTextEditor (KDE-PIM) +WhatsThis=A PlainTextEditor. +IncludeFile=kpimtextedit/plaintexteditorwidget.h +Group=Input (KDE-PIM) + +[KPIMTextEdit::RichTextComposer] +ToolTip=A RichText Composer (KDE-PIM) +WhatsThis=A RichText Composer. +IncludeFile=kpimtextedit/richtextcomposer.h +Group=Input (KDE-PIM) + +[KPIMTextEdit::RichTextComposerWidget] +ToolTip=A RichText Composer Widget(KDE-PIM) +WhatsThis=A RichText Composer Widget. +IncludeFile=kpimtextedit/richtextcomposerwidget.h +Group=Input (KDE-PIM) + diff -Nru kpimtextedit-15.12.3/src/insertimagewidget.cpp kpimtextedit-16.04.3/src/insertimagewidget.cpp --- kpimtextedit-15.12.3/src/insertimagewidget.cpp 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/insertimagewidget.cpp 2016-06-30 11:49:53.000000000 +0000 @@ -42,6 +42,7 @@ : imageRatio(-1), q(qq) { QVBoxLayout *lay = new QVBoxLayout(q); + lay->setMargin(0); QHBoxLayout *hbox = new QHBoxLayout; QLabel *lab = new QLabel(i18n("Image Location:")); imageUrlRequester = new KUrlRequester; diff -Nru kpimtextedit-15.12.3/src/inserttablewidget.cpp kpimtextedit-16.04.3/src/inserttablewidget.cpp --- kpimtextedit-15.12.3/src/inserttablewidget.cpp 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/inserttablewidget.cpp 2016-06-30 11:49:53.000000000 +0000 @@ -49,6 +49,7 @@ mBorder->setSuffix(i18n(" px")); QGridLayout *gridLayout = new QGridLayout; + gridLayout->setMargin(0); gridLayout->addWidget(new QLabel(i18n("Rows:")), 0, 0); gridLayout->addWidget(mRows, 0, 1); @@ -58,7 +59,6 @@ gridLayout->addWidget(new QLabel(i18n("Border:")), 2, 0); gridLayout->addWidget(mBorder, 2, 1); - mTypeOfLength = new KComboBox; q->connect(mTypeOfLength, SIGNAL(activated(int)), q, SLOT(slotTypeOfLengthChanged(int))); // xgettext: no-c-format diff -Nru kpimtextedit-15.12.3/src/Messages.sh kpimtextedit-16.04.3/src/Messages.sh --- kpimtextedit-15.12.3/src/Messages.sh 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/Messages.sh 2016-06-30 11:49:53.000000000 +0000 @@ -1,2 +1,2 @@ #! /bin/sh -$XGETTEXT `find . -name "*.cpp" -o -name "*.h"` -o $podir/libkpimtextedit.pot +$XGETTEXT `find . -name "*.cpp" -o -name "*.h" | grep -v '/tests/'` -o $podir/libkpimtextedit.pot diff -Nru kpimtextedit-15.12.3/src/selectspecialchardialog.h kpimtextedit-16.04.3/src/selectspecialchardialog.h --- kpimtextedit-15.12.3/src/selectspecialchardialog.h 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/selectspecialchardialog.h 2016-06-30 11:49:53.000000000 +0000 @@ -49,7 +49,7 @@ void autoInsertChar(); Q_SIGNALS: - void charSelected(QChar ); + void charSelected(QChar); private: SelectSpecialCharDialogPrivate *const d; diff -Nru kpimtextedit-15.12.3/src/slidecontainer.cpp kpimtextedit-16.04.3/src/slidecontainer.cpp --- kpimtextedit-15.12.3/src/slidecontainer.cpp 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/slidecontainer.cpp 2016-06-30 11:49:53.000000000 +0000 @@ -35,6 +35,7 @@ mSlidingOut(false) { setFixedHeight(0); + hide(); } QWidget *SlideContainer::content() const @@ -71,6 +72,7 @@ void SlideContainer::slideIn() { mSlidingOut = false; + show(); mContent->show(); mContent->adjustSize(); delete mAnim.data(); @@ -148,6 +150,7 @@ { if (height() == 0) { mSlidingOut = false; + hide(); slidedOut(); } else { slidedIn(); diff -Nru kpimtextedit-15.12.3/src/syntaxhighlighterbase.cpp kpimtextedit-16.04.3/src/syntaxhighlighterbase.cpp --- kpimtextedit-15.12.3/src/syntaxhighlighterbase.cpp 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/syntaxhighlighterbase.cpp 2016-06-30 11:49:53.000000000 +0000 @@ -37,8 +37,8 @@ Q_FOREACH (const Rule &rule, m_rules) { const QRegularExpression expression(rule.pattern); if (!expression.isValid()) { - const QString errorString = expression.errorString(); - qDebug() << "expression is invalid, pattern:" << rule.pattern << " error :" << errorString; + const QString errorString = expression.errorString(); + qDebug() << "expression is invalid, pattern:" << rule.pattern << " error :" << errorString; } QRegularExpressionMatch match = expression.match(text); diff -Nru kpimtextedit-15.12.3/src/tableformatdialog.cpp kpimtextedit-16.04.3/src/tableformatdialog.cpp --- kpimtextedit-15.12.3/src/tableformatdialog.cpp 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/tableformatdialog.cpp 2016-06-30 11:49:53.000000000 +0000 @@ -47,6 +47,7 @@ QWidget *page = new QWidget(q); QVBoxLayout *lay = new QVBoxLayout(page); + lay->setMargin(0); tableWidget = new InsertTableWidget; lay->addWidget(tableWidget); diff -Nru kpimtextedit-15.12.3/src/texteditor/commonwidget/texteditfindbarbase.cpp kpimtextedit-16.04.3/src/texteditor/commonwidget/texteditfindbarbase.cpp --- kpimtextedit-15.12.3/src/texteditor/commonwidget/texteditfindbarbase.cpp 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/texteditor/commonwidget/texteditfindbarbase.cpp 2016-06-30 11:49:53.000000000 +0000 @@ -210,7 +210,9 @@ mFindWidget->search()->setText(QString()); mReplaceWidget->replace()->setText(QString()); clearSelections(); - if (mHideWhenClose) { + mReplaceWidget->hide(); + updateGeometry(); + if (mHideWhenClose) { hide(); } Q_EMIT hideFindBar(); diff -Nru kpimtextedit-15.12.3/src/texteditor/commonwidget/textgotolinewidget.cpp kpimtextedit-16.04.3/src/texteditor/commonwidget/textgotolinewidget.cpp --- kpimtextedit-15.12.3/src/texteditor/commonwidget/textgotolinewidget.cpp 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/texteditor/commonwidget/textgotolinewidget.cpp 2016-06-30 11:49:53.000000000 +0000 @@ -116,6 +116,7 @@ void TextGoToLineWidget::slotCloseBar() { hide(); + Q_EMIT hideGotoLine(); } bool TextGoToLineWidget::event(QEvent *e) diff -Nru kpimtextedit-15.12.3/src/texteditor/commonwidget/textgotolinewidget.h kpimtextedit-16.04.3/src/texteditor/commonwidget/textgotolinewidget.h --- kpimtextedit-15.12.3/src/texteditor/commonwidget/textgotolinewidget.h 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/texteditor/commonwidget/textgotolinewidget.h 2016-06-30 11:49:53.000000000 +0000 @@ -36,6 +36,7 @@ void setMaximumLineCount(int max); Q_SIGNALS: void moveToLine(int); + void hideGotoLine(); protected: bool event(QEvent *e) Q_DECL_OVERRIDE; diff -Nru kpimtextedit-15.12.3/src/texteditor/plaintexteditor/plaintexteditfindbar.cpp kpimtextedit-16.04.3/src/texteditor/plaintexteditor/plaintexteditfindbar.cpp --- kpimtextedit-15.12.3/src/texteditor/plaintexteditor/plaintexteditfindbar.cpp 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/texteditor/plaintexteditor/plaintexteditfindbar.cpp 2016-06-30 11:49:53.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (C) 2012-2015 Laurent Montel +/* Copyright (C) 2012-2016 Laurent Montel * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public diff -Nru kpimtextedit-15.12.3/src/texteditor/plaintexteditor/plaintexteditfindbar.h kpimtextedit-16.04.3/src/texteditor/plaintexteditor/plaintexteditfindbar.h --- kpimtextedit-15.12.3/src/texteditor/plaintexteditor/plaintexteditfindbar.h 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/texteditor/plaintexteditor/plaintexteditfindbar.h 2016-06-30 11:49:53.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (C) 2012-2015 Laurent Montel +/* Copyright (C) 2012-2016 Laurent Montel * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public diff -Nru kpimtextedit-15.12.3/src/texteditor/plaintexteditor/plaintexteditor.cpp kpimtextedit-16.04.3/src/texteditor/plaintexteditor/plaintexteditor.cpp --- kpimtextedit-15.12.3/src/texteditor/plaintexteditor/plaintexteditor.cpp 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/texteditor/plaintexteditor/plaintexteditor.cpp 2016-06-30 11:49:53.000000000 +0000 @@ -163,40 +163,46 @@ } if (!isReadOnly() && spellCheckingSupport()) { - QAction *spellCheckAction = popup->addAction(QIcon::fromTheme(QStringLiteral("tools-check-spelling")), i18n("Check Spelling..."), this, SLOT(slotCheckSpelling())); - if (emptyDocument) { - spellCheckAction->setEnabled(false); + if (!d->speller) { + d->speller = new Sonnet::Speller(); } - popup->addSeparator(); - QAction *autoSpellCheckAction = popup->addAction(i18n("Auto Spell Check"), this, SLOT(slotToggleAutoSpellCheck())); - autoSpellCheckAction->setCheckable(true); - autoSpellCheckAction->setChecked(checkSpellingEnabled()); - popup->addAction(autoSpellCheckAction); - - if (checkSpellingEnabled() && d->activateLanguageMenu) { - QMenu *languagesMenu = new QMenu(i18n("Spell Checking Language"), popup); - QActionGroup *languagesGroup = new QActionGroup(languagesMenu); - languagesGroup->setExclusive(true); - if (!d->speller) { - d->speller = new Sonnet::Speller(); + if (!d->speller->availableBackends().isEmpty()) { + QAction *spellCheckAction = popup->addAction(QIcon::fromTheme(QStringLiteral("tools-check-spelling")), i18n("Check Spelling..."), this, SLOT(slotCheckSpelling())); + if (emptyDocument) { + spellCheckAction->setEnabled(false); } - - QMapIterator i(d->speller->availableDictionaries()); - - while (i.hasNext()) { - i.next(); - - QAction *languageAction = languagesMenu->addAction(i.key()); - languageAction->setCheckable(true); - languageAction->setChecked(spellCheckingLanguage() == i.value() || (spellCheckingLanguage().isEmpty() - && d->speller->defaultLanguage() == i.value())); - languageAction->setData(i.value()); - languageAction->setActionGroup(languagesGroup); - connect(languageAction, &QAction::triggered, this, &PlainTextEditor::slotLanguageSelected); + popup->addSeparator(); + QAction *autoSpellCheckAction = popup->addAction(i18n("Auto Spell Check"), this, SLOT(slotToggleAutoSpellCheck())); + autoSpellCheckAction->setCheckable(true); + autoSpellCheckAction->setChecked(checkSpellingEnabled()); + popup->addAction(autoSpellCheckAction); + + if (checkSpellingEnabled() && d->activateLanguageMenu) { + QMenu *languagesMenu = new QMenu(i18n("Spell Checking Language"), popup); + QActionGroup *languagesGroup = new QActionGroup(languagesMenu); + languagesGroup->setExclusive(true); + + QMapIterator i(d->speller->availableDictionaries()); + + QString defaultSpellcheckingLanguage = spellCheckingLanguage(); + if (defaultSpellcheckingLanguage.isEmpty()) { + //TODO fix default value + defaultSpellcheckingLanguage = d->speller->defaultLanguage(); + } + while (i.hasNext()) { + i.next(); + + QAction *languageAction = languagesMenu->addAction(i.key()); + languageAction->setCheckable(true); + languageAction->setChecked(defaultSpellcheckingLanguage == i.value()); + languageAction->setData(i.value()); + languageAction->setActionGroup(languagesGroup); + connect(languageAction, &QAction::triggered, this, &PlainTextEditor::slotLanguageSelected); + } + popup->addMenu(languagesMenu); } - popup->addMenu(languagesMenu); + popup->addSeparator(); } - popup->addSeparator(); } if (d->supportFeatures & TextToSpeech) { if (KPIMTextEdit::TextToSpeech::self()->isReady()) { @@ -340,10 +346,15 @@ void PlainTextEditor::slotCheckSpelling() { if (document()->isEmpty()) { - KMessageBox::information(this, i18n("Nothing to spell check.")); + slotDisplayMessageIndicator(i18n("Nothing to spell check.")); return; } Sonnet::BackgroundChecker *backgroundSpellCheck = new Sonnet::BackgroundChecker; + if (backgroundSpellCheck->speller().availableBackends().isEmpty()) { + slotDisplayMessageIndicator(i18n("No backend available for spell checking.")); + delete backgroundSpellCheck; + return; + } if (!d->spellCheckingLanguage.isEmpty()) { backgroundSpellCheck->changeLanguage(d->spellCheckingLanguage); } @@ -443,7 +454,7 @@ return QPlainTextEdit::event(ev); } -bool PlainTextEditor::overrideShortcut(const QKeyEvent *event) +bool PlainTextEditor::overrideShortcut(QKeyEvent *event) { const int key = event->key() | event->modifiers(); if (KStandardShortcut::copy().contains(key)) { @@ -486,11 +497,13 @@ return true; } else if (event->matches(QKeySequence::SelectAll)) { // currently missing in QTextEdit return true; + } else if (event == QKeySequence::DeleteEndOfLine) { + return true; } return false; } -bool PlainTextEditor::handleShortcut(const QKeyEvent *event) +bool PlainTextEditor::handleShortcut(QKeyEvent *event) { const int key = event->key() | event->modifiers(); @@ -603,6 +616,17 @@ insertPlainText(text); // TODO: check if this is html? (MiB) } return true; + } else if (event == QKeySequence::DeleteEndOfLine) { + QTextCursor cursor = textCursor(); + QTextBlock block = cursor.block(); + if (cursor.position() == block.position() + block.length() - 2) { + cursor.movePosition(QTextCursor::Right, QTextCursor::KeepAnchor); + } else { + cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor); + } + cursor.removeSelectedText(); + setTextCursor(cursor); + return true; } return false; } diff -Nru kpimtextedit-15.12.3/src/texteditor/plaintexteditor/plaintexteditor.h kpimtextedit-16.04.3/src/texteditor/plaintexteditor/plaintexteditor.h --- kpimtextedit-15.12.3/src/texteditor/plaintexteditor/plaintexteditor.h 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/texteditor/plaintexteditor/plaintexteditor.h 2016-06-30 11:49:53.000000000 +0000 @@ -97,8 +97,8 @@ void contextMenuEvent(QContextMenuEvent *event) Q_DECL_OVERRIDE; bool event(QEvent *ev) Q_DECL_OVERRIDE; void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE; - bool overrideShortcut(const QKeyEvent *event); - bool handleShortcut(const QKeyEvent *event); + bool overrideShortcut(QKeyEvent *event); + bool handleShortcut(QKeyEvent *event); virtual Sonnet::SpellCheckDecorator *createSpellCheckDecorator(); void setHighlighter(Sonnet::Highlighter *_highLighter); diff -Nru kpimtextedit-15.12.3/src/texteditor/plaintexteditor/plaintextsyntaxspellcheckinghighlighter.cpp kpimtextedit-16.04.3/src/texteditor/plaintexteditor/plaintextsyntaxspellcheckinghighlighter.cpp --- kpimtextedit-15.12.3/src/texteditor/plaintexteditor/plaintextsyntaxspellcheckinghighlighter.cpp 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/texteditor/plaintexteditor/plaintextsyntaxspellcheckinghighlighter.cpp 2016-06-30 11:49:53.000000000 +0000 @@ -69,8 +69,8 @@ Q_FOREACH (const KPIMTextEdit::Rule &rule, d->rules) { const QRegularExpression expression(rule.pattern); if (!expression.isValid()) { - const QString errorString = expression.errorString(); - qDebug() << "expression is invalid, pattern:" << rule.pattern << " error :" << errorString; + const QString errorString = expression.errorString(); + qDebug() << "expression is invalid, pattern:" << rule.pattern << " error :" << errorString; } QRegularExpressionMatch match = expression.match(text); diff -Nru kpimtextedit-15.12.3/src/texteditor/richtexteditor/richtexteditor.cpp kpimtextedit-16.04.3/src/texteditor/richtexteditor/richtexteditor.cpp --- kpimtextedit-15.12.3/src/texteditor/richtexteditor/richtexteditor.cpp 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/texteditor/richtexteditor/richtexteditor.cpp 2016-06-30 11:49:53.000000000 +0000 @@ -46,6 +46,7 @@ #include #include #include +#include using namespace KPIMTextEdit; class Q_DECL_HIDDEN RichTextEditor::RichTextEditorPrivate @@ -185,40 +186,46 @@ } if (!isReadOnly() && spellCheckingSupport()) { - QAction *spellCheckAction = popup->addAction(QIcon::fromTheme(QStringLiteral("tools-check-spelling")), i18n("Check Spelling..."), this, SLOT(slotCheckSpelling())); - if (emptyDocument) { - spellCheckAction->setEnabled(false); + if (!d->speller) { + d->speller = new Sonnet::Speller(); } - popup->addSeparator(); - QAction *autoSpellCheckAction = popup->addAction(i18n("Auto Spell Check"), this, SLOT(slotToggleAutoSpellCheck())); - autoSpellCheckAction->setCheckable(true); - autoSpellCheckAction->setChecked(checkSpellingEnabled()); - popup->addAction(autoSpellCheckAction); - - if (checkSpellingEnabled() && d->activateLanguageMenu) { - QMenu *languagesMenu = new QMenu(i18n("Spell Checking Language"), popup); - QActionGroup *languagesGroup = new QActionGroup(languagesMenu); - languagesGroup->setExclusive(true); - if (!d->speller) { - d->speller = new Sonnet::Speller(); + if (!d->speller->availableBackends().isEmpty()) { + QAction *spellCheckAction = popup->addAction(QIcon::fromTheme(QStringLiteral("tools-check-spelling")), i18n("Check Spelling..."), this, SLOT(slotCheckSpelling())); + if (emptyDocument) { + spellCheckAction->setEnabled(false); } - - QMapIterator i(d->speller->availableDictionaries()); - - while (i.hasNext()) { - i.next(); - - QAction *languageAction = languagesMenu->addAction(i.key()); - languageAction->setCheckable(true); - languageAction->setChecked(spellCheckingLanguage() == i.value() || (spellCheckingLanguage().isEmpty() - && d->speller->defaultLanguage() == i.value())); - languageAction->setData(i.value()); - languageAction->setActionGroup(languagesGroup); - connect(languageAction, &QAction::triggered, this, &RichTextEditor::slotLanguageSelected); + popup->addSeparator(); + QAction *autoSpellCheckAction = popup->addAction(i18n("Auto Spell Check"), this, SLOT(slotToggleAutoSpellCheck())); + autoSpellCheckAction->setCheckable(true); + autoSpellCheckAction->setChecked(checkSpellingEnabled()); + popup->addAction(autoSpellCheckAction); + + if (checkSpellingEnabled() && d->activateLanguageMenu) { + QMenu *languagesMenu = new QMenu(i18n("Spell Checking Language"), popup); + QActionGroup *languagesGroup = new QActionGroup(languagesMenu); + languagesGroup->setExclusive(true); + + QMapIterator i(d->speller->availableDictionaries()); + + QString defaultSpellcheckingLanguage = spellCheckingLanguage(); + if (defaultSpellcheckingLanguage.isEmpty()) { + defaultSpellcheckingLanguage = d->speller->defaultLanguage(); + } + + while (i.hasNext()) { + i.next(); + + QAction *languageAction = languagesMenu->addAction(i.key()); + languageAction->setCheckable(true); + languageAction->setChecked(defaultSpellcheckingLanguage == i.value()); + languageAction->setData(i.value()); + languageAction->setActionGroup(languagesGroup); + connect(languageAction, &QAction::triggered, this, &RichTextEditor::slotLanguageSelected); + } + popup->addMenu(languagesMenu); } - popup->addMenu(languagesMenu); + popup->addSeparator(); } - popup->addSeparator(); } if (allowTabSupport() && !isReadOnly()) { @@ -408,6 +415,11 @@ return; } Sonnet::BackgroundChecker *backgroundSpellCheck = new Sonnet::BackgroundChecker; + if (backgroundSpellCheck->speller().availableBackends().isEmpty()) { + slotDisplayMessageIndicator(i18n("No backend available for spell checking.")); + delete backgroundSpellCheck; + return; + } if (!d->spellCheckingLanguage.isEmpty()) { backgroundSpellCheck->changeLanguage(d->spellCheckingLanguage); } @@ -671,7 +683,7 @@ return QTextEdit::event(ev); } -bool RichTextEditor::handleShortcut(const QKeyEvent *event) +bool RichTextEditor::handleShortcut(QKeyEvent *event) { const int key = event->key() | event->modifiers(); @@ -784,11 +796,23 @@ insertPlainText(text); // TODO: check if this is html? (MiB) } return true; + } else if (event == QKeySequence::DeleteEndOfLine) { + QTextCursor cursor = textCursor(); + QTextBlock block = cursor.block(); + if (cursor.position() == block.position() + block.length() - 2) { + cursor.movePosition(QTextCursor::Right, QTextCursor::KeepAnchor); + } else { + cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor); + } + cursor.removeSelectedText(); + setTextCursor(cursor); + return true; } + return false; } -bool RichTextEditor::overrideShortcut(const QKeyEvent *event) +bool RichTextEditor::overrideShortcut(QKeyEvent *event) { const int key = event->key() | event->modifiers(); @@ -832,6 +856,8 @@ return true; } else if (event->matches(QKeySequence::SelectAll)) { // currently missing in QTextEdit return true; + } else if (event == QKeySequence::DeleteEndOfLine) { + return true; } return false; } diff -Nru kpimtextedit-15.12.3/src/texteditor/richtexteditor/richtexteditor.h kpimtextedit-16.04.3/src/texteditor/richtexteditor/richtexteditor.h --- kpimtextedit-15.12.3/src/texteditor/richtexteditor/richtexteditor.h 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/texteditor/richtexteditor/richtexteditor.h 2016-06-30 11:49:53.000000000 +0000 @@ -96,7 +96,7 @@ public Q_SLOTS: void slotDisplayMessageIndicator(const QString &message); void slotSpeakText(); - void slotCheckSpelling(); + void slotCheckSpelling(); void slotZoomReset(); private Q_SLOTS: @@ -135,8 +135,8 @@ private: void addIgnoreWordsToHighLighter(); - bool handleShortcut(const QKeyEvent *event); - bool overrideShortcut(const QKeyEvent *event); + bool handleShortcut(QKeyEvent *event); + bool overrideShortcut(QKeyEvent *event); void deleteWordBack(); void deleteWordForward(); void highlightWord(int length, int pos); diff -Nru kpimtextedit-15.12.3/src/texttospeech/texttospeechconfiginterface.cpp kpimtextedit-16.04.3/src/texttospeech/texttospeechconfiginterface.cpp --- kpimtextedit-15.12.3/src/texttospeech/texttospeechconfiginterface.cpp 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/texttospeech/texttospeechconfiginterface.cpp 2016-06-30 11:49:53.000000000 +0000 @@ -24,7 +24,7 @@ TextToSpeechConfigInterface::TextToSpeechConfigInterface(QObject *parent) : AbstractTextToSpeechConfigInterface(parent) #if KPIMTEXTEDIT_HAVE_TEXTTOSPEECH - ,mTextToSpeech(new QTextToSpeech(this)) + , mTextToSpeech(new QTextToSpeech(this)) #endif { @@ -39,7 +39,7 @@ { QStringList lst; #if KPIMTEXTEDIT_HAVE_TEXTTOSPEECH - Q_FOREACH(const QVoice &voice, mTextToSpeech->availableVoices()) { + Q_FOREACH (const QVoice &voice, mTextToSpeech->availableVoices()) { lst << voice.name(); } #endif @@ -77,6 +77,10 @@ { #if KPIMTEXTEDIT_HAVE_TEXTTOSPEECH delete mTextToSpeech; +#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) mTextToSpeech = new QTextToSpeech(this, engineName); +#else + mTextToSpeech = new QTextToSpeech(engineName, QVariantMap(), this); +#endif #endif } diff -Nru kpimtextedit-15.12.3/src/texttospeech/texttospeechconfigwidget.cpp kpimtextedit-16.04.3/src/texttospeech/texttospeechconfigwidget.cpp --- kpimtextedit-15.12.3/src/texttospeech/texttospeechconfigwidget.cpp 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/texttospeech/texttospeechconfigwidget.cpp 2016-06-30 11:49:53.000000000 +0000 @@ -74,7 +74,6 @@ layout->addRow(i18n("Voice:"), mVoice); connect(mVoice, static_cast(&QComboBox::currentIndexChanged), this, &TextToSpeechConfigWidget::valueChanged); - QTimer::singleShot(0, this, SLOT(slotUpdateSettings())); } diff -Nru kpimtextedit-15.12.3/src/texttospeech/texttospeechconfigwidget.h kpimtextedit-16.04.3/src/texttospeech/texttospeechconfigwidget.h --- kpimtextedit-15.12.3/src/texttospeech/texttospeechconfigwidget.h 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/texttospeech/texttospeechconfigwidget.h 2016-06-30 11:49:53.000000000 +0000 @@ -40,7 +40,7 @@ private Q_SLOTS: void valueChanged(); void slotUpdateSettings(); - void slotEngineChanged(); + void slotEngineChanged(); void slotLanguageChanged(); Q_SIGNALS: diff -Nru kpimtextedit-15.12.3/src/texttospeech/texttospeech.cpp kpimtextedit-16.04.3/src/texttospeech/texttospeech.cpp --- kpimtextedit-15.12.3/src/texttospeech/texttospeech.cpp 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/texttospeech/texttospeech.cpp 2016-06-30 11:49:53.000000000 +0000 @@ -67,12 +67,20 @@ KConfigGroup grp = config.group("Settings"); const QString engineName = grp.readEntry("engine"); if (!mTextToSpeech) { +#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) mTextToSpeech = new QTextToSpeech(this, engineName); +#else + mTextToSpeech = new QTextToSpeech(engineName, QVariantMap(), this); +#endif connect(mTextToSpeech, &QTextToSpeech::stateChanged, this, &TextToSpeech::slotStateChanged); } else if (mDefaultEngine != engineName) { disconnect(mTextToSpeech, &QTextToSpeech::stateChanged, this, &TextToSpeech::slotStateChanged); delete mTextToSpeech; +#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) mTextToSpeech = new QTextToSpeech(this, engineName); +#else + mTextToSpeech = new QTextToSpeech(engineName, QVariantMap(), this); +#endif connect(mTextToSpeech, &QTextToSpeech::stateChanged, this, &TextToSpeech::slotStateChanged); } mDefaultEngine = engineName; @@ -200,7 +208,7 @@ { QStringList lst; #if KPIMTEXTEDIT_HAVE_TEXTTOSPEECH - Q_FOREACH(const QVoice &voice, mTextToSpeech->availableVoices()) { + Q_FOREACH (const QVoice &voice, mTextToSpeech->availableVoices()) { lst << voice.name(); } #endif diff -Nru kpimtextedit-15.12.3/src/texttospeech/texttospeechinterface.cpp kpimtextedit-16.04.3/src/texttospeech/texttospeechinterface.cpp --- kpimtextedit-15.12.3/src/texttospeech/texttospeechinterface.cpp 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/src/texttospeech/texttospeechinterface.cpp 2016-06-30 11:49:53.000000000 +0000 @@ -31,7 +31,6 @@ TextToSpeechWidget *mTextToSpeechWidget; }; - TextToSpeechInterface::TextToSpeechInterface(TextToSpeechWidget *textToSpeechWidget, QObject *parent) : AbstractTextToSpeechInterface(parent), d(new KPIMTextEdit::TextToSpeechInterfacePrivate(textToSpeechWidget)) diff -Nru kpimtextedit-15.12.3/tests/CMakeLists.txt kpimtextedit-16.04.3/tests/CMakeLists.txt --- kpimtextedit-15.12.3/tests/CMakeLists.txt 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/tests/CMakeLists.txt 2016-06-30 11:49:53.000000000 +0000 @@ -1,7 +1,4 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../src ${CMAKE_CURRENT_BINARY_DIR}/../src) -#add_executable(textedit_demo textedit_demo.cpp) -#target_link_libraries(textedit_demo KF5PimTextEdit) - add_executable(inserthtmldialog_demo inserthtmldialog_demo.cpp) target_link_libraries(inserthtmldialog_demo KF5PimTextEdit) diff -Nru kpimtextedit-15.12.3/tests/syntaxhighlightertest_demo.cpp kpimtextedit-16.04.3/tests/syntaxhighlightertest_demo.cpp --- kpimtextedit-15.12.3/tests/syntaxhighlightertest_demo.cpp 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/tests/syntaxhighlightertest_demo.cpp 2016-06-30 11:49:53.000000000 +0000 @@ -26,7 +26,6 @@ #include - SyntaxHighlighterTest::SyntaxHighlighterTest(QTextDocument *doc) : KPIMTextEdit::SyntaxHighlighterBase(doc) { diff -Nru kpimtextedit-15.12.3/tests/syntaxhighlightertest_demo.h kpimtextedit-16.04.3/tests/syntaxhighlightertest_demo.h --- kpimtextedit-15.12.3/tests/syntaxhighlightertest_demo.h 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/tests/syntaxhighlightertest_demo.h 2016-06-30 11:49:53.000000000 +0000 @@ -32,6 +32,4 @@ void init(); }; - - #endif diff -Nru kpimtextedit-15.12.3/tests/textedit_demo.cpp kpimtextedit-16.04.3/tests/textedit_demo.cpp --- kpimtextedit-15.12.3/tests/textedit_demo.cpp 2015-11-14 13:48:50.000000000 +0000 +++ kpimtextedit-16.04.3/tests/textedit_demo.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2014 Volker Krause - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - -#include "../src/textedit.h" - -#include -#include - -int main(int argv, char **argc) -{ - QApplication app(argv, argc); - KPIMTextEdit::TextEdit textEdit; - textEdit.enableImageActions(); - textEdit.enableEmoticonActions(); - textEdit.enableInsertHtmlActions(); - textEdit.enableInsertTableActions(); - textEdit.show(); - - QToolBar bar; - foreach (QAction *action, textEdit.createActions()) { - bar.addAction(action); - } - bar.show(); - - return app.exec(); -} -