Commit 513ebb12 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to use UNITY build see...

Allow to use UNITY build see https://cmake.org/cmake/help/latest/prop_tgt/UNITY_BUILD.html (Reduce compile time. Need cmake 3.16.0)
parent 48012733
Pipeline #44128 failed with stage
in 11 minutes and 2 seconds
......@@ -93,6 +93,18 @@ add_definitions(-DQT_NO_FOREACH)
add_definitions(-DQT_NO_KEYWORDS)
option(KDEPIM_RUN_AKONADI_TEST "Enable autotest based on Akonadi." TRUE)
# Not supported yet
#option(USE_UNIFY_CMAKE_SUPPORT "Use UNIFY cmake support (speedup compile time)" FALSE)
#set(COMPILE_WITH_CMAKE_SUPPORT false)
#if (USE_UNIFY_CMAKE_SUPPORT)
# if(${CMAKE_VERSION} VERSION_LESS "3.16.0")
# message(STATUS "CMAKE version is less than 3.16.0 . We can't use cmake unify build support")
# else()
# set(COMPILE_WITH_CMAKE_SUPPORT true)
# endif()
#endif()
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054E00)
set(CMAKE_CXX_STANDARD 14)
......
......@@ -232,6 +232,9 @@ qt5_add_dbus_interfaces(libmailcommon_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/dbusinter
)
add_library(KF5MailCommon ${libmailcommon_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(KF5MailCommon PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(KF5MailCommon BASE_NAME mailcommon)
......
......@@ -18,7 +18,7 @@ using namespace MailCommon;
static const struct {
SearchRule::Function id;
const char *displayName;
} NumericFunctions[] = {
} NumericDoubleFunctions[] = {
{ SearchRule::FuncEquals, I18N_NOOP("is equal to") },
{ SearchRule::FuncNotEqual, I18N_NOOP("is not equal to") },
{ SearchRule::FuncIsGreater, I18N_NOOP("is greater than") },
......@@ -26,8 +26,8 @@ static const struct {
{ SearchRule::FuncIsLess, I18N_NOOP("is less than") },
{ SearchRule::FuncIsGreaterOrEqual, I18N_NOOP("is greater than or equal to") }
};
static const int NumericFunctionCount
= sizeof(NumericFunctions) / sizeof(*NumericFunctions);
static const int NumericDoubleFunctionCount
= sizeof(NumericDoubleFunctions) / sizeof(*NumericDoubleFunctions);
QWidget *NumericDoubleRuleWidgetHandler::createFunctionWidget(
int number, QStackedWidget *functionStack, const QObject *receiver, bool /*isBalooSearch*/) const
......@@ -39,7 +39,7 @@ QWidget *NumericDoubleRuleWidgetHandler::createFunctionWidget(
auto funcCombo = new QComboBox(functionStack);
funcCombo->setMinimumWidth(50);
funcCombo->setObjectName(QStringLiteral("numericDoubleRuleFuncCombo"));
for (int i = 0; i < NumericFunctionCount; ++i) {
for (int i = 0; i < NumericDoubleFunctionCount; ++i) {
funcCombo->addItem(i18n(NumericFunctions[i].displayName));
}
funcCombo->adjustSize();
......@@ -177,7 +177,7 @@ bool NumericDoubleRuleWidgetHandler::setRule(QStackedWidget *functionStack, QSta
// set the function
const SearchRule::Function func = rule->function();
int funcIndex = 0;
for (; funcIndex < NumericFunctionCount; ++funcIndex) {
for (; funcIndex < NumericDoubleFunctionCount; ++funcIndex) {
if (func == NumericFunctions[funcIndex].id) {
break;
}
......@@ -187,7 +187,7 @@ bool NumericDoubleRuleWidgetHandler::setRule(QStackedWidget *functionStack, QSta
if (funcCombo) {
funcCombo->blockSignals(true);
if (funcIndex < NumericFunctionCount) {
if (funcIndex < NumericDoubleFunctionCount) {
funcCombo->setCurrentIndex(funcIndex);
} else {
funcCombo->setCurrentIndex(0);
......
......@@ -15,7 +15,7 @@
#include <KLocalizedString>
#include <KSharedConfig>
namespace {
static const char myConfigGroupName[] = "SnippetCustomFileAttachmentNameDialog";
static const char mySnippetCustomFileAttachmentNameDialogGroupName[] = "SnippetCustomFileAttachmentNameDialog";
}
using namespace MailCommon;
SnippetCustomFileAttachmentNameDialog::SnippetCustomFileAttachmentNameDialog(QWidget *parent)
......@@ -49,7 +49,7 @@ SnippetCustomFileAttachmentNameDialog::~SnippetCustomFileAttachmentNameDialog()
void SnippetCustomFileAttachmentNameDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openConfig(), myConfigGroupName);
KConfigGroup group(KSharedConfig::openConfig(), mySnippetCustomFileAttachmentNameDialogGroupName);
const QSize size = group.readEntry("Size", QSize(500, 150));
if (size.isValid()) {
......@@ -59,7 +59,7 @@ void SnippetCustomFileAttachmentNameDialog::readConfig()
void SnippetCustomFileAttachmentNameDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openConfig(), myConfigGroupName);
KConfigGroup group(KSharedConfig::openConfig(), mySnippetCustomFileAttachmentNameDialogGroupName);
group.writeEntry("Size", size());
}
......
......@@ -13,7 +13,7 @@
#include <QPushButton>
#include <QVBoxLayout>
namespace {
static const char myConfigGroupName[] = "SnippetSelectAttachmentDialog";
static const char mySnippetSelectAttachmentDialogGroupName[] = "SnippetSelectAttachmentDialog";
}
using namespace MailCommon;
SnippetSelectAttachmentDialog::SnippetSelectAttachmentDialog(QWidget *parent)
......@@ -57,13 +57,13 @@ QStringList SnippetSelectAttachmentDialog::attachments() const
void SnippetSelectAttachmentDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openConfig(), myConfigGroupName);
KConfigGroup group(KSharedConfig::openConfig(), mySnippetSelectAttachmentDialogGroupName);
group.writeEntry("Size", size());
}
void SnippetSelectAttachmentDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openConfig(), myConfigGroupName);
KConfigGroup group(KSharedConfig::openConfig(), mySnippetSelectAttachmentDialogGroupName);
const QSize sizeDialog = group.readEntry("Size", QSize(300, 350));
if (sizeDialog.isValid()) {
resize(sizeDialog);
......
Markdown is supported
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