diff --git a/CMakeLists.txt b/CMakeLists.txt index f41b7b7..1e9b3b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,132 +1,131 @@ cmake_minimum_required(VERSION 3.5) set(PIM_VERSION "5.12.41") project(KPimTextEdit VERSION ${PIM_VERSION}) # ECM setup set(KF5_MIN_VERSION "5.61.0") find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) if (POLICY CMP0053) cmake_policy(SET CMP0053 NEW) endif() include(KDEInstallDirs) include(KDECMakeSettings) include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(GenerateExportHeader) include(ECMGenerateHeaders) include(ECMGeneratePriFile) include(ECMSetupVersion) include(FeatureSummary) include(ECMAddTests) include(ECMQtDeclareLoggingCategory) set(KPIMTEXTEDIT_LIB_VERSION ${PIM_VERSION}) ecm_setup_version(PROJECT VARIABLE_PREFIX KPIMTEXTEDIT VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kpimtextedit_version.h" PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5PimTextEditConfigVersion.cmake" SOVERSION 5 ) set(QT_REQUIRED_VERSION "5.11.0") find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS Widgets) find_package(Grantlee5 "5.1" CONFIG REQUIRED) set_package_properties(Grantlee5 PROPERTIES DESCRIPTION "A plug-in based String Template system for Qt" URL "https://github.com/steveire/grantlee" PURPOSE "Required for the RichText composer" TYPE REQUIRED ) find_package(KF5DesignerPlugin ${KF5_MIN_VERSION} CONFIG) set_package_properties(KF5DesignerPlugin PROPERTIES DESCRIPTION "KF5 designer plugin" TYPE OPTIONAL) ########### Find packages ########### find_package(KF5Codecs ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5Config ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5ConfigWidgets ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5CoreAddons ${KF5_MIN_VERSION} CONFIG REQUIRED) -find_package(KF5Emoticons ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5IconThemes ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5KIO ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5Sonnet ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5SyntaxHighlighting ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5WidgetsAddons ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5XmlGui ${KF5_MIN_VERSION} CONFIG REQUIRED) set(USE_NEW_DESIGNERPLUGIN_MACRO false) if (ECM_VERSION VERSION_GREATER "5.61.0") option(BUILD_DESIGNERPLUGIN "Build plugin for Qt Designer" ON) add_feature_info(DESIGNERPLUGIN ${BUILD_DESIGNERPLUGIN} "Build plugin for Qt Designer") set(USE_NEW_DESIGNERPLUGIN_MACRO true) else() find_package(KF5DesignerPlugin ${KF5_MIN_VERSION} CONFIG) set_package_properties(KF5DesignerPlugin PROPERTIES DESCRIPTION "KF5 designer plugin" TYPE OPTIONAL) endif() add_definitions(-DTRANSLATION_DOMAIN=\"libkpimtextedit\") if (EXISTS "${CMAKE_SOURCE_DIR}/.git") add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000) endif() add_definitions(-DQT_NO_FOREACH) find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS TextToSpeech) if(BUILD_TESTING) find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS Test) add_definitions(-DBUILD_TESTING) endif() ########### Targets ########### add_subdirectory(src) if(BUILD_TESTING) find_package(KF5TextWidgets ${KF5_MIN_VERSION} CONFIG REQUIRED) add_subdirectory(autotests) add_subdirectory(tests) endif() ########### CMake Config Files ########### set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5PimTextEdit") configure_package_config_file( "${CMAKE_CURRENT_SOURCE_DIR}/KF5PimTextEditConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/KF5PimTextEditConfig.cmake" INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} ) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/KF5PimTextEditConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/KF5PimTextEditConfigVersion.cmake" DESTINATION "${CMAKECONFIG_INSTALL_DIR}" COMPONENT Devel ) install(EXPORT KF5PimTextEditTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5PimTextEditTargets.cmake NAMESPACE KF5:: ) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kpimtextedit_version.h DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel ) install(FILES kpimtextedit.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bd5242c..3a330e6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,232 +1,231 @@ set(kpimtextedit_texteditor_SRCS texteditor/plaintexteditor/plaintexteditfindbar.cpp texteditor/plaintexteditor/plaintexteditor.cpp texteditor/plaintexteditor/plaintexteditorwidget.cpp texteditor/plaintexteditor/plaintextsyntaxspellcheckinghighlighter.cpp texteditor/commonwidget/textfindreplacewidget.cpp texteditor/commonwidget/texteditfindbarbase.cpp texteditor/commonwidget/textgotolinewidget.cpp texteditor/commonwidget/textmessageindicator.cpp texteditor/richtexteditor/richtexteditor.cpp texteditor/richtexteditor/richtexteditfindbar.cpp texteditor/richtexteditor/richtexteditorwidget.cpp ) set(kpimtextedit_composerng_SRCS composer-ng/richtextcomposer.cpp composer-ng/richtextcomposercontroler.cpp composer-ng/richtextcomposeractions.cpp composer-ng/klinkdialog.cpp composer-ng/nestedlisthelper.cpp composer-ng/richtextexternalcomposer.cpp composer-ng/richtextcomposerimages.cpp composer-ng/richtextcomposeremailquotedecorator.cpp composer-ng/richtextcomposeremailquotehighlighter.cpp composer-ng/richtextcomposerwidget.cpp ) set(kpimtextedit_texttospeech_SRCS texttospeech/texttospeech.cpp texttospeech/texttospeechwidget.cpp texttospeech/texttospeechconfigwidget.cpp texttospeech/texttospeechinterface.cpp texttospeech/abstracttexttospeechinterface.cpp texttospeech/abstracttexttospeechconfiginterface.cpp texttospeech/texttospeechconfiginterface.cpp texttospeech/texttospeechconfigdialog.cpp texttospeech/texttospeechlanguagecombobox.cpp texttospeech/texttospeechactions.cpp ) set(kpimtextedit_grantlee_builder_SRCS grantleebuilder/plaintextmarkupbuilder.cpp grantleebuilder/markupdirector.cpp ) set(kpimtextedit_emoticon_builder_SRCS emoticon/emoticontexteditaction.cpp emoticon/emoticontexteditselector.cpp emoticon/emoticonunicodetab.cpp emoticon/emoticonlistwidgetselector.cpp ) set(kpimtextedit_SRCS ${kpimtextedit_emoticon_builder_SRCS} inserthtmldialog.cpp insertimagedialog.cpp insertimagewidget.cpp inserttabledialog.cpp selectspecialchardialog.cpp tableactionmenu.cpp tablecellformatdialog.cpp tableformatdialog.cpp textutils.cpp inserttablewidget.cpp texteditorcompleter.cpp inserthtmleditor.cpp slidecontainer.cpp editorutil.cpp ) ecm_qt_declare_logging_category(kpimtextedit_SRCS HEADER kpimtextedit_debug.h IDENTIFIER KPIMTEXTEDIT_LOG CATEGORY_NAME org.kde.pim.kpimtextedit) add_library(KF5PimTextEdit ${kpimtextedit_SRCS} ${kpimtextedit_texteditor_SRCS} ${kpimtextedit_texttospeech_SRCS} ${kpimtextedit_composerng_SRCS} ${kpimtextedit_grantlee_builder_SRCS}) generate_export_header(KF5PimTextEdit BASE_NAME kpimtextedit) add_library(KF5::PimTextEdit ALIAS KF5PimTextEdit) target_include_directories(KF5PimTextEdit INTERFACE "$") target_include_directories(KF5PimTextEdit PUBLIC "$") target_link_libraries(KF5PimTextEdit PRIVATE - KF5::Emoticons KF5::Codecs KF5::SonnetUi KF5::SonnetCore KF5::WidgetsAddons KF5::KIOWidgets KF5::ConfigWidgets KF5::IconThemes Grantlee5::TextDocument KF5::XmlGui KF5::I18n KF5::SyntaxHighlighting Qt5::TextToSpeech ) set_target_properties(KF5PimTextEdit PROPERTIES VERSION ${KPIMTEXTEDIT_VERSION_STRING} SOVERSION ${KPIMTEXTEDIT_SOVERSION} EXPORT_NAME PimTextEdit ) install(TARGETS KF5PimTextEdit EXPORT KF5PimTextEditTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}) ########### Generate Headers ############### ecm_generate_headers(KPimTextEdit_CamelCase_HEADERS HEADER_NAMES EditorUtil SelectSpecialCharDialog SlideContainer TextEditorCompleter TextUtils PREFIX KPIMTextEdit REQUIRED_HEADERS kpimtextedit_HEADERS ) ecm_generate_headers(KPimTextEdit_CamelCaseemoticon_HEADERS HEADER_NAMES EmoticonUnicodeTab PREFIX KPIMTextEditemoticon REQUIRED_HEADERS kpimtextedit_HEADERS RELATIVE emoticon ) ecm_generate_headers(PimCommon_CamelCasetextrichtexteditor_HEADERS HEADER_NAMES RichTextEditorWidget RichTextEditor REQUIRED_HEADERS PimCommon_richtexteditor_HEADERS PREFIX KPIMTextEdit RELATIVE texteditor/richtexteditor ) ecm_generate_headers(PimCommon_CamelCaseplaintexteditor_HEADERS HEADER_NAMES PlainTextEditor PlainTextEditorWidget PlainTextEditFindBar PlainTextSyntaxSpellCheckingHighlighter REQUIRED_HEADERS PimCommon_plaintexteditor_HEADERS PREFIX KPIMTextEdit RELATIVE texteditor/plaintexteditor ) ecm_generate_headers(PimCommon_CamelCasetexteditor_commonwidget_HEADERS HEADER_NAMES TextGotoLineWidget TextEditFindBarBase REQUIRED_HEADERS PimCommon_texteditor_commonwidget_HEADERS PREFIX KPIMTextEdit RELATIVE texteditor/commonwidget ) ecm_generate_headers(KPimTextEdit_CamelCasetexttospeechs_HEADERS HEADER_NAMES TextToSpeech TextToSpeechActions TextToSpeechInterface TextToSpeechWidget AbstractTextToSpeechInterface REQUIRED_HEADERS KPimTextEdit_texttospeechs_HEADERS PREFIX KPIMTextEdit RELATIVE texttospeech ) ecm_generate_headers(KPimTextEdit_Camelcasecomposerng_HEADERS HEADER_NAMES RichTextComposer RichTextComposerControler RichTextComposerImages RichTextExternalComposer RichTextComposerActions RichTextComposerEmailQuoteHighlighter RichTextComposerWidget REQUIRED_HEADERS KPimTextEdit_composerng_HEADERS PREFIX KPIMTextEdit RELATIVE composer-ng ) ########### install files ############### install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kpimtextedit_export.h ${kpimtextedit_HEADERS} ${KPimTextEdit_texttospeechs_HEADERS} ${PimCommon_richtexteditor_HEADERS} ${PimCommon_texteditor_commonwidget_HEADERS} ${PimCommon_plaintexteditor_HEADERS} ${KPimTextEdit_composerng_HEADERS} ${KPimTextEdit_emoticon_HEADERS} DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KPIMTextEdit/kpimtextedit COMPONENT Devel ) install(FILES ${KPimTextEdit_CamelCase_HEADERS} ${PimCommon_CamelCasetextrichtexteditor_HEADERS} ${PimCommon_CamelCaseplaintexteditor_HEADERS} ${KPimTextEdit_CamelCasetexttospeechs_HEADERS} ${PimCommon_CamelCasetexteditor_commonwidget_HEADERS} ${KPimTextEdit_Camelcasecomposerng_HEADERS} ${KPimTextEdit_CamelCaseemoticon_HEADERS} DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KPIMTextEdit/KPIMTextEdit/ COMPONENT Devel ) ecm_generate_pri_file(BASE_NAME KPIMTextEdit LIB_NAME KF5PIMTextEdit DEPS "" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/KPIMTextEdit/) install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR}) if (BUILD_TESTING) add_subdirectory(texteditor/plaintexteditor/autotests) add_subdirectory(texteditor/richtexteditor/autotests) add_subdirectory(texteditor/commonwidget/autotests) add_subdirectory(texteditor/plaintexteditor/tests) add_subdirectory(texteditor/richtexteditor/tests) add_subdirectory(texttospeech/autotests) add_subdirectory(texttospeech/tests) add_subdirectory(composer-ng/autotests) add_subdirectory(composer-ng/tests) endif() add_subdirectory(designer) diff --git a/src/emoticon/emoticontexteditselector.cpp b/src/emoticon/emoticontexteditselector.cpp index 1c10a20..00ff022 100644 --- a/src/emoticon/emoticontexteditselector.cpp +++ b/src/emoticon/emoticontexteditselector.cpp @@ -1,59 +1,58 @@ /* Copyright (c) 2012-2019 Montel Laurent based on code from kopete 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 "emoticontexteditselector.h" #include "emoticonunicodetab.h" #include "textutils.h" -#include #include using namespace KPIMTextEdit; EmoticonTextEditSelector::EmoticonTextEditSelector(QWidget *parent) : QWidget(parent) { QHBoxLayout *lay = new QHBoxLayout(this); lay->setSpacing(0); lay->setContentsMargins(0, 0, 0, 0); mUnicodeTab = new EmoticonUnicodeTab(this); lay->addWidget(mUnicodeTab); connect(mUnicodeTab, &EmoticonUnicodeTab::itemSelected, this, &EmoticonTextEditSelector::slotItemSelected); } EmoticonTextEditSelector::~EmoticonTextEditSelector() { } void EmoticonTextEditSelector::slotItemSelected(const QString &str) { Q_EMIT itemSelected(str); if (isVisible() && parentWidget() && parentWidget()->inherits("QMenu")) { parentWidget()->close(); } } void EmoticonTextEditSelector::loadEmoticons() { if (mUnicodeTab->count() == 0) { mUnicodeTab->loadEmoticons(); } }