Commit d452d428 authored by David Jarvie's avatar David Jarvie
Browse files

Restructure in preparation for merge from kalarmcal into kalarm

The KAlarmCal library is now only used by KAlarm. This prepares for
merging its code into KAlarm.
parent a1443c5d
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: none
# Ignore the following files
*~
*.[oa]
*.diff
*.kate-swp
*.kdev4
.kdev_include_paths
*.kdevelop.pcs
*.moc
*.moc.cpp
*.orig
*.user
.*.swp
.swp.*
Doxyfile
Makefile
/build*/
.cmake/
CMakeLists.txt.user*
*.unc-backup*
compile_commands.json
.clang-format
.clangd
.idea
/cmake-build*
.cache
# SPDX-FileCopyrightText: 2020-2022 Laurent Montel <montel@kde.org>
# SPDX-License-Identifier: CC0-1.0
include:
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux.yml
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/freebsd.yml
# SPDX-FileCopyrightText: None
# SPDX-License-Identifier: CC0-1.0
Dependencies:
- 'on': ['@all']
'require':
'frameworks/extra-cmake-modules': '@latest'
'frameworks/kcalendarcore' : '@latest'
'frameworks/kholidays': '@latest'
'frameworks/ki18n': '@latest'
'frameworks/kconfig': '@latest'
'pim/akonadi' : '@same'
'pim/kcalutils' : '@same'
'pim/kidentitymanagement' : '@same'
EXTRA tipsandthis,defines,qenums,null
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: none
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
set(PIM_VERSION "5.19.40")
project(KAlarmCal VERSION ${PIM_VERSION})
# ECM setup
set(KF5_MIN_VERSION "5.91.0")
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(GenerateExportHeader)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
include(ECMSetupVersion)
include(FeatureSummary)
include(ECMQtDeclareLoggingCategory)
include(ECMDeprecationSettings)
include(ECMAddQch)
option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF)
add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)")
set(CALENDARUTILS_LIB_VERSION "5.19.40")
set(IDENTITYMANAGER_LIB_VERSION "5.19.40")
set(AKONADI_LIB_VERSION "5.19.40")
ecm_setup_version(PROJECT VARIABLE_PREFIX KALARMCAL
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kalarmcal_version.h"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5AlarmCalendarConfigVersion.cmake"
SOVERSION 5
)
########### Find packages ###########
find_package(KF5CalendarCore ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Config ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Holidays ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Akonadi ${AKONADI_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5IdentityManagement ${IDENTITYMANAGER_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED)
ecm_set_disabled_deprecation_versions(QT 5.15.2 KF 5.91.0)
if (QT_MAJOR_VERSION STREQUAL "6")
find_package(Qt6Core5Compat)
endif()
option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" OFF)
set(COMPILE_WITH_UNITY_CMAKE_SUPPORT OFF)
if (USE_UNITY_CMAKE_SUPPORT)
set(COMPILE_WITH_UNITY_CMAKE_SUPPORT ON)
endif()
########### Targets ###########
add_subdirectory(src)
add_subdirectory(serializers)
if(BUILD_TESTING)
add_subdirectory(autotests)
endif()
########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5AlarmCalendar")
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/KF5AlarmCalendarConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/KF5AlarmCalendarConfig.cmake"
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/KF5AlarmCalendarConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/KF5AlarmCalendarConfigVersion.cmake"
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
COMPONENT Devel
)
install(EXPORT KF5AlarmCalendarTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5AlarmCalendarTargets.cmake NAMESPACE KF5::)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/kalarmcal_version.h
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KAlarmCal COMPONENT Devel
)
ecm_qt_install_logging_categories(
EXPORT KALARMCAL
FILE kalarmcal.categories
DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
)
ki18n_install(po)
if (BUILD_QCH)
ecm_install_qch_export(
TARGETS KF5AlarmCalendar_QCH
FILE KF5AlarmCalendarQchTargets.cmake
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
COMPONENT Devel
)
set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF5AlarmCalendarQchTargets.cmake\")")
endif()
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
{
"version": 3,
"configurePresets": [
{
"name": "dev",
"displayName": "Build as debug",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
},
"installDir": "$env{KF5}"
},
{
"name": "dev-qt6",
"displayName": "Build against qt6",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-qt6",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"BUILD_WITH_QT6": "ON",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
},
"installDir": "$env{KF6}"
},
{
"name": "dev-disable-deprecated",
"displayName": "Build as without deprecated methods",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-disable-deprecated",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"CMAKE_CXX_FLAGS_INIT": "-DQT_DISABLE_DEPRECATED_BEFORE=0x060000 -DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x060000"
},
"installDir": "$env{KF5}"
},
{
"name": "asan",
"displayName": "Build with Asan support.",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-asan",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"ECM_ENABLE_SANITIZERS" : "'address;undefined'",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
},
"installDir": "$env{KF5}"
},
{
"name": "pch",
"displayName": "Build with PCH support.",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-pch",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"COMPILE_WITH_CMAKE_PCH_SUPPORT": "ON",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
},
"installDir": "$env{KF5}"
},
{
"name": "dev-clang",
"displayName": "dev-clang",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-clang",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
},
"environment": {
"CXX": "clang++",
"CCACHE_DISABLE": "ON"
},
"installDir": "$env{KF5}"
},
{
"name": "unity",
"displayName": "Build with CMake unity support.",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-unity",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"USE_UNITY_CMAKE_SUPPORT": "ON",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
},
"installDir": "$env{KF5}"
},
{
"name": "release",
"displayName": "Build as release mode.",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-release",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
},
"installDir": "$env{KF5}"
},
{
"name": "profile",
"displayName": "profile",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-profile",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
},
"installDir": "$env{KF5}"
},
{
"name": "clazy",
"displayName": "clazy",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-clazy",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
},
"environment": {
"CXX": "clazy",
"CCACHE_DISABLE": "ON"
},
"installDir": "$env{KF5}"
}
],
"buildPresets": [
{
"name": "dev",
"configurePreset": "dev"
},
{
"name": "dev-qt6",
"configurePreset": "dev-qt6"
},
{
"name": "dev-disable-deprecated",
"configurePreset": "dev-disable-deprecated"
},
{
"name": "pch",
"configurePreset": "pch"
},
{
"name": "release",
"configurePreset": "release"
},
{
"name": "dev-clang",
"configurePreset": "dev-clang"
},
{
"name": "asan",
"configurePreset": "asan"
},
{
"name": "unity",
"configurePreset": "unity"
},
{
"name": "clazy",
"configurePreset": "clazy",
"environment": {
"CLAZY_CHECKS" : "level0,level1,detaching-member,ifndef-define-typo,isempty-vs-count,qrequiredresult-candidates,reserve-candidates,signal-with-return-value,unneeded-cast,function-args-by-ref,function-args-by-value,returning-void-expression,no-ctor-missing-parent-argument,isempty-vs-count,qhash-with-char-pointer-key,raw-environment-function,qproperty-type-mismatch,old-style-connect,qstring-allocations,container-inside-loop,heap-allocated-small-trivial-type,inefficient-qlist,qstring-varargs,level2,detaching-member,heap-allocated-small-trivial-type,isempty-vs-count,qstring-varargs,qvariant-template-instantiation,raw-environment-function,reserve-candidates,signal-with-return-value,thread-with-slots,no-ctor-missing-parent-argument,no-missing-typeinfo",
"CCACHE_DISABLE" : "ON"
}
}
],
"testPresets": [
{
"name": "dev",
"configurePreset": "dev",
"output": {"outputOnFailure": true},
"execution": {"noTestsAction": "error", "stopOnFailure": false}
},
{
"name": "asan",
"configurePreset": "asan",
"output": {"outputOnFailure": true},
"execution": {"noTestsAction": "error", "stopOnFailure": true}
}
]
}
# SPDX-FileCopyrightText: 2021-2022 Laurent Montel <montel@kde.org>
# SPDX-License-Identifier: BSD-3-Clause
KAlarmCal coding style
======================
KAlarmCal code should adhere to the following stylistic rules.
SPACING
- No tabs.
- Indent with 4 spaces.
- No spaces inside round or square brackets.
- No space between a function name and the bracket following.
- Place '*' and '&' immediately after the type in declarations, followed by a
space, e.g. "const QString& from", "char* str".
- Normally two spaces on each side of "&&" and "||" in "if"/"while"/"for"
statements.
- Indent "case" within "switch" statements.
BRACES
- Opening brace on a new line.
- No braces are used when only a single statement follows 'if', 'for' etc.
SPLITTING LINES
- There is in general no need to split lines less than 120 characters. Beyond
that length, it's at the coder's discretion.
- Conditional statements occupying line lengths less than 120 characters may be
split for clarity.
- Long "for" statements should be split before each clause at least.
- If a function call or declaration has to be split over more than one line,
indent to after the opening bracket if possible.
- If splitting lines containing expressions, always split BEFORE an operator
("+", "-", "&&" etc.) so that the operator starts the next continuation line.
- In split conditional expressions, position the leading "&&" or "||" before
its enclosing bracket, so that the following expression aligns after the
opening bracket.
NAMING
- Classes, enums, functions and variable names are in camel case (i.e.
separate multiple words by upper-casing each word after the first). Only
use underscores for special purposes.
- Classes and enum names start with an upper case letter.
- Function and variable names start with a lower case letter.
- Enum values are either all upper case with words separated by underscores, or
camel case starting with an upper case letter.
- Constants are all upper case, with words separated by underscores.
- Class member variable names start with "m" followed by a upper case letter.
EXAMPLE
Animal ZooCage::releaseAnimal(const QString& name, Species species,
int arrivalNumber) const
{
if (!name.isEmpty()
&& (arrivalNumber > mMinimumSpeciesCount && arrivalNumber < mMaximumSpeciesCount)
|| !arrivalNumber)
{
mLastReleased = Animal(species, name, arrivalNumber);
return mAnimals[name][arrivalNumber];
}
if (name.isEmpty() || mUnclassifiedAnimals.contains(name))
return mUnclassifiedAnimalTypes[species];
return Animal();
}
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
find_dependency(KF5Akonadi "@AKONADI_LIB_VERSION@")
find_dependency(KF5IdentityManagement "@IDENTITYMANAGER_LIB_VERSION@")
find_dependency(KF5Holidays "@KF5_MIN_VERSION@")
find_dependency(KF5CalendarCore "@KF5_MIN_VERSION@")
include("${CMAKE_CURRENT_LIST_DIR}/KF5AlarmCalendarTargets.cmake")
Copyright (c) <year> <owner>. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Creative Commons Legal Code
CC0 1.0 Universal CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES
NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE
AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION
ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE USE
OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER, AND DISCLAIMS
LIABILITY FOR DAMAGES RESULTING FROM THE USE OF THIS DOCUMENT OR THE INFORMATION
OR WORKS PROVIDED HEREUNDER.
Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer exclusive
Copyright and Related Rights (defined below) upon the creator and subsequent
owner(s) (each and all, an "owner") of an original work of authorship and/or
a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work for the
purpose of contributing to a commons of creative, cultural and scientific
works ("Commons") that the public can reliably and without fear of later claims
of infringement build upon, modify, incorporate in other works, reuse and
redistribute as freely as possible in any form whatsoever and for any purposes,
including without limitation commercial purposes. These owners may contribute
to the Commons to promote the ideal of a free culture and the further production
of creative, cultural and scientific works, or to gain reputation or greater
distribution for their Work in part through the use and efforts of others.
For these and/or other purposes and motivations, and without any expectation
of additional consideration or compensation, the person associating CC0 with
a Work (the "Affirmer"), to the extent that he or she is an owner of Copyright
and Related Rights in the Work, voluntarily elects to apply CC0 to the Work
and publicly distribute the Work under its terms, with knowledge of his or
her Copyright and Related Rights in the Work and the meaning and intended
legal effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be protected
by copyright and related or neighboring rights ("Copyright and Related Rights").
Copyright and Related Rights include, but are not limited to, the following:
i. the right to reproduce, adapt, distribute, perform, display, communicate,
and translate a Work;
ii. moral rights retained by the original author(s) and/or performer(s);
iii. publicity and privacy rights pertaining to a person's image or likeness
depicted in a Work;
iv. rights protecting against unfair competition in regards to a Work, subject
to the limitations in paragraph 4(a), below;
v. rights protecting the extraction, dissemination, use and reuse of data
in a Work;
vi. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal protection
of databases, and under any national implementation thereof, including any
amended or successor version of such directive); and
vii. other similar, equivalent or corresponding rights throughout the world
based on applicable law or treaty, and any national implementations thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention of,
applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and
unconditionally waives, abandons, and surrenders all of Affirmer's Copyright
and Related Rights and associated claims and causes of action, whether now
known or unknown (including existing as well as future claims and causes of
action), in the Work (i) in all territories worldwide, (ii) for the maximum
duration provided by applicable law or treaty (including future time extensions),
(iii) in any current or future medium and for any number of copies, and (iv)
for any purpose whatsoever, including without limitation commercial, advertising
or promotional purposes (the "Waiver"). Affirmer makes the Waiver for the
benefit of each member of the public at large and to the detriment of Affirmer's
heirs and successors, fully intending that such Waiver shall not be subject
to revocation, rescission, cancellation, termination, or any other legal or
equitable action to disrupt the quiet enjoyment of the Work by the public
as contemplated by Affirmer's express Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason be
judged legally invalid or ineffective under applicable law, then the Waiver
shall be preserved to the maximum extent permitted taking into account Affirmer's
express Statement of Purpose. In addition, to the extent the Waiver is so
judged Affirmer hereby grants to each affected person a royalty-free, non
transferable, non sublicensable, non exclusive, irrevocable and unconditional
license to exercise Affirmer's Copyright and Related Rights in the Work (i)
in all territories worldwide, (ii) for the maximum duration provided by applicable
law or treaty (including future time extensions), (iii) in any current or
future medium and for any number of copies, and (iv) for any purpose whatsoever,
including without limitation commercial, advertising or promotional purposes
(the "License"). The License shall be deemed effective as of the date CC0
was applied by Affirmer to the Work. Should any part of the License for any
reason be judged legally invalid or ineffective under applicable law, such
partial invalidity or ineffectiveness shall not invalidate the remainder of
the License, and in such case Affirmer hereby affirms that he or she will
not (i) exercise any of his or her remaining Copyright and Related Rights
in the Work or (ii) assert any associated claims and causes of action with
respect to the Work, in either case contrary to Affirmer's express Statement
of Purpose.
4. Limitations and Disclaimers.
a. No trademark or patent rights held by Affirmer are waived, abandoned, surrendered,
licensed or otherwise affected by this document.
b. Affirmer offers the Work as-is and makes no representations or warranties
of any kind concerning the Work, express, implied, statutory or otherwise,
including without limitation warranties of title, merchantability, fitness
for a particular purpose, non infringement, or the absence of latent or other
defects, accuracy, or the present or absence of errors, whether or not discoverable,
all to the greatest extent permissible under applicable law.
c. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without limitation
any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims
responsibility for obtaining any necessary consents, permissions or other
rights required for any use of the Work.
d. Affirmer understands and acknowledges that Creative Commons is not a party
to this document and has no duty or obligation with respect to this CC0 or
use of the Work.
This diff is collapsed.
See Mainpage.dox for more information.
maintainer: djarvie
description: The KAlarm client library
tier: 3
type: functional
platforms:
- name: All
portingAid: false
deprecated: false
release: false
libraries:
- qmake: KAlarmCal
cmake: "KF5::AlarmCalendar"
cmakename: KF5AlarmCalendar
group: kdepim
public_lib: true
SPDX-FileCopyrightText: none
SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2021-2022 Laurent Montel <montel@kde.org>
# SPDX-License-Identifier: CC0-1.0
# Suppression file for ASAN/LSAN
leak:libspeechd
leak:getdelim
leak:g_malloc
leak:libfontconfig
leak:libdbus
leak:QEasingCurve::
leak:QtSharedPointer::ExternalRefCountData::getAndRef
leak:QArrayData::allocate
leak:QObject::QObject
leak:QObjectPrivate::addConnection
leak:QObjectPrivate::connectImpl
leak:QPropertyAnimation::QPropertyAnimation
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: none
add_definitions(-DTRANSLATION_DOMAIN=\"libkalarmcal5-serializer\")
add_library(akonadi_serializer_kalarm MODULE)
target_sources(akonadi_serializer_kalarm PRIVATE
akonadi_serializer_kalarm.cpp
kaeventformatter.cpp
akonadi_serializer_kalarm.h