diff --git a/CMakeLists.txt b/CMakeLists.txt index cde8dcc3..7afdcdfb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,105 +1,104 @@ cmake_minimum_required(VERSION 3.5) set(KDEPIM_VERSION_NUMBER "5.12.40") project(kaddressbook VERSION ${KDEPIM_VERSION_NUMBER}) set(KDE_APPLICATIONS_VERSION "19.11.70") set(KF5_MIN_VERSION "5.63.0") find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) include(ECMInstallIcons) include(ECMSetupVersion) include(ECMAddTests) include(GenerateExportHeader) include(ECMGenerateHeaders) include(FeatureSummary) include(CheckFunctionExists) include(ECMGeneratePriFile) include(KDEInstallDirs) include(KDECMakeSettings) include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(ECMAddAppIcon) include(ECMQtDeclareLoggingCategory) # Do NOT add quote set(KDEPIM_DEV_VERSION alpha) # add an extra space if(DEFINED KDEPIM_DEV_VERSION) set(KDEPIM_DEV_VERSION " ${KDEPIM_DEV_VERSION}") endif() set(KDEPIM_VERSION "${KDEPIM_VERSION_NUMBER}${KDEPIM_DEV_VERSION} (${KDE_APPLICATIONS_VERSION})") set(KPIMTEXTEDIT_LIB_VERSION "5.12.40") set(AKONADI_VERSION "5.12.40") set(KONTACTINTERFACE_LIB_VERSION "5.12.40") set(KDEPIM_LIB_VERSION "${KDEPIM_VERSION_NUMBER}") set(KDEPIM_LIB_SOVERSION "5") set(QT_REQUIRED_VERSION "5.11.0") find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test DBus PrintSupport) set(LIBKDEPIM_LIB_VERSION_LIB "5.12.40") set(KDEPIM_APPS_LIB_VERSION_LIB "5.12.40") set(LIBGRANTLEETHEME_LIB_VERSION_LIB "5.12.40") set(PIMCOMMON_LIB_VERSION_LIB "5.12.40") set(LIBKLEO_LIB_VERSION "5.12.40") # Find KF5 package find_package(KF5DBusAddons ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5DocTools ${KF5_MIN_VERSION} REQUIRED) find_package(KF5KCMUtils ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5Crash ${KF5_MIN_VERSION} REQUIRED) -find_package(KF5IconThemes ${KF5_MIN_VERSION} REQUIRED) find_package(KF5Libkleo ${LIBKLEO_LIB_VERSION} CONFIG REQUIRED) option(DOMAIN_EXPERIMENTAL "Enable this feature if you want to build experimental domain library. Not Stable yet." FALSE) # Find KdepimLibs Package find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED) find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED) find_package(KF5KontactInterface ${KONTACTINTERFACE_LIB_VERSION} CONFIG REQUIRED) find_package(KF5Libkdepim ${LIBKDEPIM_LIB_VERSION_LIB} CONFIG REQUIRED) find_package(KF5KdepimDBusInterfaces ${KDEPIM_APPS_LIB_VERSION_LIB} CONFIG REQUIRED) find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED) find_package(KF5KaddressbookGrantlee ${KDEPIM_APPS_LIB_VERSION_LIB} CONFIG REQUIRED) find_package(KF5KaddressbookImportExport ${KDEPIM_APPS_LIB_VERSION_LIB} CONFIG REQUIRED) find_package(KF5GrantleeTheme ${LIBGRANTLEETHEME_LIB_VERSION_LIB} CONFIG REQUIRED) set(GPGMEPP_LIB_VERSION "1.11.1") find_package(Gpgmepp ${GPGMEPP_LIB_VERSION} CONFIG REQUIRED) find_package(KF5AkonadiSearch "5.12.40" CONFIG REQUIRED) set_package_properties(KF5AkonadiSearch PROPERTIES DESCRIPTION "The Akonadi Search libraries" URL "https://www.kde.org" TYPE REQUIRED PURPOSE "Provides search capabilities in KMail and Akonadi") include_directories(${kaddressbook_SOURCE_DIR} ${kaddressbook_BINARY_DIR}) find_package(KF5Prison ${KF5_MIN_VERSION} CONFIG REQUIRED) add_definitions(-DTRANSLATION_DOMAIN=\"kaddressbook\") set(CMAKE_CXX_STANDARD 14) if (EXISTS "${CMAKE_SOURCE_DIR}/.git") add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000) endif() add_definitions(-DQT_NO_FOREACH) add_subdirectory(src) add_subdirectory(kontactplugin) install(FILES kaddressbook.renamecategories kaddressbook.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) if(KF5DocTools_FOUND) add_subdirectory(doc) endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 873aa626..22336042 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,148 +1,147 @@ configure_file(kaddressbook-version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/kaddressbook-version.h @ONLY) include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/printing/ ) if (DOMAIN_EXPERIMENTAL) add_subdirectory(domain) add_subdirectory(akonadi) endif() add_subdirectory(icons) add_subdirectory(printing) add_subdirectory(kconf_update) add_subdirectory(configuration) if(QGpgme_FOUND) add_definitions(-DHAVE_QGPGME) endif() set(kaddressbook_qrc_SRCS) qt5_add_resources(kaddressbook_qrc_SRCS kaddressbook.qrc) set(kaddressbook_printing_SRCS printing/detailled/detailledstyle.cpp printing/mike/mikesstyle.cpp printing/printingwizard.cpp printing/printprogress.cpp printing/printstyle.cpp printing/ringbinder/ringbinderstyle.cpp printing/compact/compactstyle.cpp printing/grantlee/grantleeprintstyle.cpp printing/stylepage.cpp ) ki18n_wrap_ui(kaddressbook_printing_SRCS printing/ringbinder/rbs_appearance.ui printing/detailled/ds_appearance.ui printing/compact/compactstyle.ui ) set(kaddressbook_plugin_SRCS plugininterface/kaddressbookplugininterface.cpp ) set(kaddressbook_LIB_SRCS aboutdata.cpp categoryfilterproxymodel.cpp categoryselectwidget.cpp contactsorter.cpp contactswitcher.cpp globalcontactmodel.cpp mainwidget.cpp manageshowcollectionproperties.cpp modelcolumnmanager.cpp widgets/quicksearchwidget.cpp kaddressbookmigrateapplication.cpp ${kaddressbook_printing_SRCS} ${kaddressbook_plugin_SRCS} ) ecm_qt_declare_logging_category(kaddressbook_LIB_SRCS HEADER kaddressbook_debug.h IDENTIFIER KADDRESSBOOK_LOG CATEGORY_NAME org.kde.pim.kaddressbook) qt5_add_dbus_adaptor( kaddressbook_LIB_SRCS org.kde.kaddressbook.xml mainwidget.h MainWidget) kconfig_add_kcfg_files(kaddressbook_LIB_SRCS settings/settings.kcfgc) add_library(kaddressbookprivate ${kaddressbook_LIB_SRCS}) generate_export_header(kaddressbookprivate BASE_NAME kaddressbook) target_link_libraries(kaddressbookprivate PUBLIC KF5::PimCommonAkonadi PRIVATE KF5::Libkdepim KF5::KaddressbookGrantlee KF5::AkonadiCore KF5::Contacts KF5::AkonadiContact KF5::KCMUtils KF5::Codecs KF5::GrantleeTheme - KF5::IconThemes KF5::Completion KF5::XmlGui KF5::JobWidgets KF5::KIOWidgets Qt5::PrintSupport KF5::AkonadiSearchDebug KF5::I18n KF5::KaddressbookImportExport KF5::Prison ) if(QGpgme_FOUND) target_link_libraries(kaddressbookprivate PRIVATE QGpgme) endif() target_include_directories(kaddressbookprivate PUBLIC "$") set_target_properties(kaddressbookprivate PROPERTIES VERSION ${KDEPIM_LIB_VERSION} SOVERSION ${KDEPIM_LIB_SOVERSION}) install(TARGETS kaddressbookprivate ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP) ########### next target ############### set(kaddressbook_SRCS kaddressbook_debug.cpp main.cpp mainwindow.cpp ${kaddressbook_qrc_SRCS} ) file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/icons/*-apps-kaddressbook.png") ecm_add_app_icon(kaddressbook_SRCS ICONS ${ICONS_SRCS}) add_executable(kaddressbook ${kaddressbook_SRCS}) target_link_libraries(kaddressbook KF5::KontactInterface kaddressbookprivate KF5::Crash ) install(TARGETS kaddressbook ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) install(PROGRAMS data/org.kde.kaddressbook.desktop data/kaddressbook-importer.desktop DESTINATION ${KDE_INSTALL_APPDIR}) install(FILES data/org.kde.kaddressbook.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) set(kaddressbook_PART_SRCS kaddressbookpart.cpp kaddressbook_debug.cpp ${kaddressbook_qrc_SRCS}) add_library(kaddressbookpart MODULE ${kaddressbook_PART_SRCS}) -target_link_libraries(kaddressbookpart kaddressbookprivate KF5::Parts KF5::IconThemes) +target_link_libraries(kaddressbookpart kaddressbookprivate KF5::Parts) install(TARGETS kaddressbookpart DESTINATION ${KDE_INSTALL_PLUGINDIR}) install(FILES data/kaddressbookpart.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}) install(FILES viewertemplates/contact.html viewertemplates/contact_embedded.html viewertemplates/contact_row.html viewertemplates/contactgroup.html viewertemplates/contactgroup_embedded.html viewertemplates/contactgroup_additionalfieldrow.html viewertemplates/contactgroup_memberrow.html viewertemplates/theme.desktop DESTINATION ${KDE_INSTALL_DATADIR}/kaddressbook/viewertemplates/default/ ) install(DIRECTORY printing/grantlee/themes/ DESTINATION ${KDE_INSTALL_DATADIR}/kaddressbook/printing/themes/ ) diff --git a/src/configuration/CMakeLists.txt b/src/configuration/CMakeLists.txt index 05fa5ef4..181f68da 100644 --- a/src/configuration/CMakeLists.txt +++ b/src/configuration/CMakeLists.txt @@ -1,25 +1,24 @@ set(kcm_config_plugins_SRCS kaddressbook_config_plugins.cpp kaddressbookconfigpluginlistwidget.cpp ../plugininterface/kaddressbookplugininterface.cpp ) ecm_qt_declare_logging_category(kcm_config_plugins_SRCS HEADER kaddressbook_debug.h IDENTIFIER KADDRESSBOOK_LOG CATEGORY_NAME org.kde.pim.kaddressbook) add_library(kaddressbook_config_plugins MODULE ${kcm_config_plugins_SRCS}) target_link_libraries(kaddressbook_config_plugins KF5::KCMUtils KF5::I18n - KF5::IconThemes KF5::PimCommon kaddressbookprivate KF5::XmlGui KF5::KaddressbookImportExport ) kcoreaddons_desktop_to_json(kaddressbook_config_plugins kaddressbook_config_plugins.desktop SERVICE_TYPES kcmodule.desktop) install(FILES kaddressbook_config_plugins.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}) install(TARGETS kaddressbook_config_plugins DESTINATION ${KDE_INSTALL_PLUGINDIR}) diff --git a/src/kaddressbookpart.cpp b/src/kaddressbookpart.cpp index 1ecde6c9..f339abec 100644 --- a/src/kaddressbookpart.cpp +++ b/src/kaddressbookpart.cpp @@ -1,98 +1,96 @@ /* This file is part of KAddressBook. Copyright (c) 2009-2019 Laurent Montel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 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 "kaddressbookpart.h" #include "mainwidget.h" #include "kaddressbookmigrateapplication.h" #include "kaddressbook_debug.h" -#include #include #include #include #include #include #include #include K_PLUGIN_FACTORY(KAddressBookFactory, registerPlugin(); ) KAddressBookPart::KAddressBookPart(QWidget *parentWidget, QObject *parent, const QVariantList &) : KParts::ReadOnlyPart(parent) { setComponentName(QStringLiteral("kaddressbook"), i18n("KAddressBook")); KAddressBookMigrateApplication migrate; migrate.migrate(); - KIconLoader::global()->addAppDir(QStringLiteral("kaddressbook")); // create a canvas to insert our widget QWidget *canvas = new QWidget(parentWidget); canvas->setFocusPolicy(Qt::ClickFocus); setWidget(canvas); QVBoxLayout *topLayout = new QVBoxLayout(canvas); mMainWidget = new MainWidget(this, canvas); initAction(); topLayout->addWidget(mMainWidget); topLayout->setContentsMargins(0, 0, 0, 0); setXMLFile(QStringLiteral("kaddressbookui.rc")); } void KAddressBookPart::updateQuickSearchText() { mMainWidget->updateQuickSearchText(); } void KAddressBookPart::initAction() { QAction *action = new QAction(QIcon::fromTheme(QStringLiteral("configure")), i18n("&Configure KAddressBook..."), this); actionCollection()->addAction(QStringLiteral("kaddressbook_configure"), action); connect(action, &QAction::triggered, mMainWidget, &MainWidget::configure); } void KAddressBookPart::newContact() { mMainWidget->newContact(); } void KAddressBookPart::newGroup() { mMainWidget->newGroup(); } KAddressBookPart::~KAddressBookPart() { } bool KAddressBookPart::openFile() { return false; } void KAddressBookPart::guiActivateEvent(KParts::GUIActivateEvent *e) { KParts::ReadOnlyPart::guiActivateEvent(e); mMainWidget->initializePluginActions(); } #include "kaddressbookpart.moc" diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index a860e5e6..7ae960c9 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -1,15 +1,14 @@ set(newdesigntest_SRCS main.cpp ) add_executable(newdesigntest ${newdesigntest_SRCS}) target_link_libraries(newdesigntest Qt5::Widgets KF5::Contacts KF5::I18n KF5::Completion - KF5::IconThemes KF5::WidgetsAddons )