Commit 157dd581 authored by Volker Krause's avatar Volker Krause
Browse files

Split KIdentityManagement into a core and widgets library

We have many more users of the core classes than the configuration UI,
including many of the background processes. For those we now avoid linking
against a bunch of unnecessary and not exactly lightweight UI libraries,
such as the entire rich text editing stack.
parent 8959e13f
Pipeline #136996 passed with stages
in 49 seconds
# SPDX-FileCopyrightText: none
# SPDX-License-Identifier: BSD-3-Clause
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
set(PIM_VERSION "5.19.41")
set(PIM_VERSION "5.19.42")
project(KIdentityManagement VERSION ${PIM_VERSION})
......
......@@ -3,7 +3,7 @@
include(ECMAddTests)
find_package(Qt${QT_MAJOR_VERSION}Test ${QT_REQUIRED_VERSION} CONFIG REQUIRED)
ecm_add_tests( identitytest.cpp signaturetest.cpp NAME_PREFIX "kpimidentity-" LINK_LIBRARIES KF5IdentityManagement
ecm_add_tests( identitytest.cpp signaturetest.cpp NAME_PREFIX "kpimidentity-" LINK_LIBRARIES KF5IdentityManagementWidgets
KF5::PimTextEdit Qt${QT_MAJOR_VERSION}::Test KF5::ConfigCore KF5::TextWidgets KF5::XmlGui KF5::CoreAddons)
target_compile_definitions(signaturetest PRIVATE
......
......@@ -11,7 +11,7 @@
#include "signaturetest.h"
#include "qtest.h"
#include "../src/signaturerichtexteditor.cpp"
#include "../src/widgets/signaturerichtexteditor.cpp"
#include "signature.h"
#include <KActionCollection>
......
# SPDX-FileCopyrightText: none
# SPDX-FileCopyrightText: Volker Krause <vkrause@kde.org>
# SPDX-License-Identifier: BSD-3-Clause
add_library(KF5IdentityManagement)
add_library(KF5::IdentityManagement ALIAS KF5IdentityManagement)
qt_add_dbus_adaptor(kidentity_dbs_adaptor_SRCS org.kde.pim.IdentityManager.xml identitymanager.h KIdentityManagement::IdentityManager )
target_sources(KF5IdentityManagement PRIVATE
${kidentity_dbs_adaptor_SRCS}
identity.cpp
identitycombo.cpp
identitymanager.cpp
signature.cpp
signatureconfigurator.cpp
signaturerichtexteditor.cpp
signaturerichtexteditor_p.h
utils.cpp
utils.h
identitycombo.h
signature.h
identitymanager.h
identity.h
signatureconfigurator.h
)
ecm_qt_declare_logging_category(KF5IdentityManagement HEADER kidentitymanagement_debug.h
IDENTIFIER KIDENTITYMANAGEMENT_LOG CATEGORY_NAME org.kde.pim.kidentitymanagement
OLD_CATEGORY_NAMES log_kidentitymanagement
DESCRIPTION "kidentitymanagement (pim lib)" EXPORT KIDENTITYMANAGEMENT)
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(KF5IdentityManagement PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(KF5IdentityManagement BASE_NAME kidentitymanagement)
target_include_directories(KF5IdentityManagement INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF}/KIdentityManagement;${KDE_INSTALL_INCLUDEDIR_KF}/KIdentityManagement/kidentitymanagement;>")
target_include_directories(KF5IdentityManagement PUBLIC "$<BUILD_INTERFACE:${KIdentityManagement_SOURCE_DIR}/src;${KIdentityManagement_BINARY_DIR}/src>")
target_link_libraries(KF5IdentityManagement
PUBLIC
KF5::CoreAddons
KF5::PimTextEdit
PRIVATE
KF5::Codecs
Qt${QT_MAJOR_VERSION}::Network
KF5::I18n
KF5::WidgetsAddons
KF5::XmlGui
KF5::KIOWidgets
KF5::ConfigCore
)
set_target_properties(KF5IdentityManagement PROPERTIES
VERSION ${KIDENTITYMANAGEMENT_VERSION}
SOVERSION ${KIDENTITYMANAGEMENT_SOVERSION}
EXPORT_NAME IdentityManagement
)
install(TARGETS KF5IdentityManagement EXPORT KF5IdentityManagementTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
########### Generate Headers ###############
ecm_generate_headers(KIdentityManagement_CamelCase_HEADERS
HEADER_NAMES
Identity
IdentityCombo
IdentityManager
Signature
SignatureConfigurator
Utils
PREFIX KIdentityManagement
REQUIRED_HEADERS KIdentityManagement_HEADERS
)
########### install files ###############
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/kidentitymanagement_export.h
${KIdentityManagement_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KIdentityManagement/kidentitymanagement
COMPONENT Devel
)
install(FILES ${KIdentityManagement_CamelCase_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KIdentityManagement/KIdentityManagement/
COMPONENT Devel
)
install(FILES org.kde.pim.IdentityManager.xml DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR} RENAME kf5_org.kde.pim.IdentityManager.xml)
ecm_generate_pri_file(BASE_NAME KIdentityManagement LIB_NAME KF5IdentityManagement DEPS "KCoreAddons KPimTextEdit" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF}/KIdentityManagement)
install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
ecm_qt_install_logging_categories(EXPORT KIDENTITYMANAGEMENT FILE kidentitymanagement.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
if (BUILD_QCH)
ecm_add_qch(
KF5IdentityManagement_QCH
NAME KIdentityManagement
BASE_NAME KF5IdentityManagement
VERSION ${PIM_VERSION}
ORG_DOMAIN org.kde
SOURCES # using only public headers, to cover only public API
${KIdentityManagement_HEADERS}
#MD_MAINPAGE "${CMAKE_SOURCE_DIR}/README.md"
#IMAGE_DIRS "${CMAKE_SOURCE_DIR}/docs/pics"
LINK_QCHS
Qt5Core_QCH
Qt5Gui_QCH
Qt5Widgets_QCH
INCLUDE_DIRS
${CMAKE_CURRENT_BINARY_DIR}
BLANK_MACROS
KIDENTITYMANAGEMENT_EXPORT
TAGFILE_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR}
QCH_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR}
COMPONENT Devel
)
endif()
add_subdirectory(core)
add_subdirectory(widgets)
# SPDX-FileCopyrightText: none
# SPDX-License-Identifier: BSD-3-Clause
add_library(KF5IdentityManagement)
add_library(KF5::IdentityManagement ALIAS KF5IdentityManagement)
qt_add_dbus_adaptor(kidentity_dbs_adaptor_SRCS org.kde.pim.IdentityManager.xml identitymanager.h KIdentityManagement::IdentityManager )
target_sources(KF5IdentityManagement PRIVATE
${kidentity_dbs_adaptor_SRCS}
identity.cpp
identitymanager.cpp
signature.cpp
utils.cpp
utils.h
signature.h
identitymanager.h
identity.h
)
ecm_qt_declare_logging_category(KF5IdentityManagement HEADER kidentitymanagement_debug.h
IDENTIFIER KIDENTITYMANAGEMENT_LOG CATEGORY_NAME org.kde.pim.kidentitymanagement
OLD_CATEGORY_NAMES log_kidentitymanagement
DESCRIPTION "kidentitymanagement (pim lib)" EXPORT KIDENTITYMANAGEMENT)
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(KF5IdentityManagement PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(KF5IdentityManagement BASE_NAME kidentitymanagement)
target_include_directories(KF5IdentityManagement INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF}/KIdentityManagement;${KDE_INSTALL_INCLUDEDIR_KF}/KIdentityManagement/kidentitymanagement;>")
target_include_directories(KF5IdentityManagement PUBLIC "$<BUILD_INTERFACE:${KIdentityManagement_SOURCE_DIR}/src;${KIdentityManagement_BINARY_DIR}/src>")
target_link_libraries(KF5IdentityManagement
PUBLIC
Qt${QT_MAJOR_VERSION}::Gui
PRIVATE
KF5::CoreAddons
KF5::ConfigCore
KF5::Codecs
KF5::I18n
Qt${QT_MAJOR_VERSION}::DBus
Qt${QT_MAJOR_VERSION}::Network
)
set_target_properties(KF5IdentityManagement PROPERTIES
VERSION ${KIDENTITYMANAGEMENT_VERSION}
SOVERSION ${KIDENTITYMANAGEMENT_SOVERSION}
EXPORT_NAME IdentityManagement
)
install(TARGETS KF5IdentityManagement EXPORT KF5IdentityManagementTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
########### Generate Headers ###############
ecm_generate_headers(KIdentityManagement_CamelCase_HEADERS
HEADER_NAMES
Identity
IdentityManager
Signature
Utils
PREFIX KIdentityManagement
REQUIRED_HEADERS KIdentityManagement_HEADERS
)
########### install files ###############
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/kidentitymanagement_export.h
${KIdentityManagement_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KIdentityManagement/kidentitymanagement
COMPONENT Devel
)
install(FILES ${KIdentityManagement_CamelCase_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KIdentityManagement/KIdentityManagement/
COMPONENT Devel
)
install(FILES org.kde.pim.IdentityManager.xml DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR} RENAME kf5_org.kde.pim.IdentityManager.xml)
ecm_generate_pri_file(BASE_NAME KIdentityManagement LIB_NAME KF5IdentityManagement DEPS "KCoreAddons KPimTextEdit" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF}/KIdentityManagement)
install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
ecm_qt_install_logging_categories(EXPORT KIDENTITYMANAGEMENT FILE kidentitymanagement.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
if (BUILD_QCH)
ecm_add_qch(
KF5IdentityManagement_QCH
NAME KIdentityManagement
BASE_NAME KF5IdentityManagement
VERSION ${PIM_VERSION}
ORG_DOMAIN org.kde
SOURCES # using only public headers, to cover only public API
${KIdentityManagement_HEADERS}
#MD_MAINPAGE "${CMAKE_SOURCE_DIR}/README.md"
#IMAGE_DIRS "${CMAKE_SOURCE_DIR}/docs/pics"
LINK_QCHS
Qt5Core_QCH
Qt5Gui_QCH
Qt5Widgets_QCH
INCLUDE_DIRS
${CMAKE_CURRENT_BINARY_DIR}
BLANK_MACROS
KIDENTITYMANAGEMENT_EXPORT
TAGFILE_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR}
QCH_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR}
COMPONENT Devel
)
endif()
......@@ -365,4 +365,3 @@ protected:
QHash<QString, QVariant> mPropertiesMap;
};
}
......@@ -6,11 +6,12 @@
#pragma once
#include "kidentitymanagement_export.h"
#include <QObject>
#include <QStringList>
#include <QVector>
#include <kidentitymanagement_export.h>
#include <QStringList>
#include <memory>
namespace KIdentityManagement
......@@ -223,4 +224,3 @@ private:
Q_PRIVATE_SLOT(d, void slotIdentitiesChanged(const QString &id))
};
} // namespace
......@@ -218,4 +218,3 @@ private:
Q_DECLARE_OPERATORS_FOR_FLAGS(Signature::AddedText)
}
......@@ -27,4 +27,3 @@ Q_REQUIRED_RESULT KIDENTITYMANAGEMENT_EXPORT bool thatIsMe(const QString &email)
*/
Q_REQUIRED_RESULT KIDENTITYMANAGEMENT_EXPORT const QSet<QString> &allEmails();
}
# SPDX-FileCopyrightText: none
# SPDX-License-Identifier: BSD-3-Clause
add_library(KF5IdentityManagementWidgets)
add_library(KF5::IdentityManagementWidgets ALIAS KF5IdentityManagementWidgets)
target_sources(KF5IdentityManagementWidgets PRIVATE
identitycombo.cpp
signatureconfigurator.cpp
signaturerichtexteditor.cpp
signaturerichtexteditor_p.h
identitycombo.h
signatureconfigurator.h
)
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(KF5IdentityManagementWidgets PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(KF5IdentityManagementWidgets BASE_NAME kidentitymanagementwidgets)
target_include_directories(KF5IdentityManagementWidgets INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF}/KIdentityManagementWidgets;${KDE_INSTALL_INCLUDEDIR_KF}/KIdentityManagementWidgets/kidentitymanagement;>")
target_include_directories(KF5IdentityManagementWidgets PUBLIC "$<BUILD_INTERFACE:${KIdentityManagement_SOURCE_DIR}/src;${KIdentityManagement_BINARY_DIR}/src>")
target_link_libraries(KF5IdentityManagementWidgets
PUBLIC
KF5IdentityManagement
Qt${QT_MAJOR_VERSION}::Widgets
PRIVATE
KF5::CoreAddons
KF5::PimTextEdit
KF5::Codecs
Qt${QT_MAJOR_VERSION}::Network
KF5::I18n
KF5::WidgetsAddons
KF5::XmlGui
KF5::KIOWidgets
KF5::ConfigCore
)
set_target_properties(KF5IdentityManagementWidgets PROPERTIES
VERSION ${KIDENTITYMANAGEMENT_VERSION}
SOVERSION ${KIDENTITYMANAGEMENT_SOVERSION}
EXPORT_NAME IdentityManagementWidgets
)
install(TARGETS KF5IdentityManagementWidgets EXPORT KF5IdentityManagementTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
########### Generate Headers ###############
ecm_generate_headers(KIdentityManagementWidgets_CamelCase_HEADERS
HEADER_NAMES
IdentityCombo
SignatureConfigurator
PREFIX KIdentityManagement
REQUIRED_HEADERS KIdentityManagementWidgets_HEADERS
)
########### install files ###############
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/kidentitymanagementwidgets_export.h
${KIdentityManagementWidgets_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KIdentityManagementWidgets/kidentitymanagement
COMPONENT Devel
)
install(FILES ${KIdentityManagementWidgets_CamelCase_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KIdentityManagementWidgets/KIdentityManagement/
COMPONENT Devel
)
ecm_generate_pri_file(BASE_NAME KIdentityManagementWidgets LIB_NAME KF5IdentityManagementWidgets DEPS "KIdentityManagement KPimTextEdit" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF}/KIdentityManagementWidgets)
install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
if (BUILD_QCH)
ecm_add_qch(
KF5IdentityManagementWidgets_QCH
NAME KIdentityManagementWidgets
BASE_NAME KF5IdentityManagementWidgets
VERSION ${PIM_VERSION}
ORG_DOMAIN org.kde
SOURCES # using only public headers, to cover only public API
${KIdentityManagementWidgets_HEADERS}
#MD_MAINPAGE "${CMAKE_SOURCE_DIR}/README.md"
#IMAGE_DIRS "${CMAKE_SOURCE_DIR}/docs/pics"
LINK_QCHS
Qt5Core_QCH
Qt5Gui_QCH
Qt5Widgets_QCH
INCLUDE_DIRS
${CMAKE_CURRENT_BINARY_DIR}
BLANK_MACROS
KIDENTITYMANAGEMENTWIDGETS_EXPORT
TAGFILE_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR}
QCH_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR}
COMPONENT Devel
)
endif()
......@@ -16,7 +16,7 @@
#pragma once
#include "kidentitymanagement_export.h"
#include "kidentitymanagementwidgets_export.h"
#include <QComboBox>
namespace KIdentityManagement
......@@ -28,7 +28,7 @@ class Identity;
* @brief The IdentityCombo class
* @author Marc Mutz \<mutz@kde.org\>
*/
class KIDENTITYMANAGEMENT_EXPORT IdentityCombo : public QComboBox
class KIDENTITYMANAGEMENTWIDGETS_EXPORT IdentityCombo : public QComboBox
{
Q_OBJECT
public:
......@@ -79,4 +79,3 @@ private:
//@endcond
};
}
......@@ -9,7 +9,7 @@
#pragma once
#include "kidentitymanagement_export.h"
#include "kidentitymanagementwidgets_export.h"
#include "signature.h" // for Signature::Type
#include <QWidget>
#include <memory>
......@@ -24,7 +24,7 @@ class SignatureConfiguratorPrivate;
* You can set a signature via setSignature(), let the user edit the
* signature and when done, read the signature back.
*/
class KIDENTITYMANAGEMENT_EXPORT SignatureConfigurator : public QWidget
class KIDENTITYMANAGEMENTWIDGETS_EXPORT SignatureConfigurator : public QWidget
{
Q_OBJECT
public:
......@@ -136,4 +136,3 @@ private:
//@endcond
};
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment