Commit 044131d2 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Remove mailcommon dependancy

parent 69a9ed9a
......@@ -59,9 +59,8 @@ set(QT_REQUIRED_VERSION "5.6.0")
option(KDEPIM_ENTERPRISE_BUILD "Enable features specific to the enterprise branch, which are normally disabled. Also, it disables many components not needed for Kontact such as the Kolab client." FALSE)
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test UiTools)
find_package(Qt5X11Extras NO_MODULE)
set(MAILCOMMON_LIB_VERSION_LIB "5.4.40")
set(KDEPIM_APPS_LIB_VERSION_LIB "5.4.40")
set(PIMCOMMON_LIB_VERSION_LIB "5.4.48")
set(PIMCOMMON_LIB_VERSION_LIB "5.4.50")
set(LIBKDEPIM_LIB_VERSION_LIB "5.4.46")
set(LIBINCIDENCEEDITOR_LIB_VERSION_LIB "5.4.40")
set(CALENDARSUPPORT_LIB_VERSION_LIB "5.4.40")
......@@ -101,7 +100,6 @@ find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiNotes ${AKONADINOTES_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5KdepimDBusInterfaces ${KDEPIM_APPS_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5MailCommon ${MAILCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5LibkdepimAkonadi ${LIBKDEPIM_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5IncidenceEditor ${LIBINCIDENCEEDITOR_LIB_VERSION_LIB} CONFIG REQUIRED)
......
......@@ -237,7 +237,7 @@ generate_export_header(korganizerprivate BASE_NAME korganizerprivate)
target_link_libraries(korganizerprivate
PUBLIC
KF5::PimCommon
KF5::PimCommonAkonadi
PRIVATE
KF5::CalendarSupport
KF5::EventViews
......@@ -259,7 +259,7 @@ target_link_libraries(korganizerprivate
KF5::KCMUtils
KF5::NewStuff
KF5::Ldap
KF5::MailCommon
KF5::AkonadiWidgets
)
target_include_directories(korganizerprivate PUBLIC
......
......@@ -39,9 +39,9 @@
#include <QVBoxLayout>
#include <KConfigGroup>
#include <MailCommon/CollectionAnnotationsAttribute>
#include <MailCommon/CollectionTypeUtil>
#include <MailCommon/IncidencesForWidget>
#include <PimCommonAkonadi/CollectionAnnotationsAttribute>
#include <PimCommonAkonadi/CollectionTypeUtil>
#include <PimCommonAkonadi/IncidencesForWidget>
using namespace Akonadi;
using namespace CalendarSupport;
......@@ -105,20 +105,20 @@ void CollectionGeneralPage::init(const Akonadi::Collection &collection)
hbox->addStretch();
if ((collection.parentCollection() != Akonadi::Collection::root()) && PimCommon::Util::isImapResource(collection.resource())) {
const MailCommon::CollectionAnnotationsAttribute *annotationAttribute =
collection.attribute<MailCommon::CollectionAnnotationsAttribute>();
const PimCommon::CollectionAnnotationsAttribute *annotationAttribute =
collection.attribute<PimCommon::CollectionAnnotationsAttribute>();
const QMap<QByteArray, QByteArray> annotations =
(annotationAttribute ?
annotationAttribute->annotations() :
QMap<QByteArray, QByteArray>());
MailCommon::CollectionTypeUtil collectionUtil;
const MailCommon::CollectionTypeUtil::IncidencesFor incidencesFor =
collectionUtil.incidencesForFromString(QLatin1String(annotations.value(MailCommon::CollectionTypeUtil::kolabIncidencesFor())));
PimCommon::CollectionTypeUtil collectionUtil;
const PimCommon::CollectionTypeUtil::IncidencesFor incidencesFor =
collectionUtil.incidencesForFromString(QLatin1String(annotations.value(PimCommon::CollectionTypeUtil::kolabIncidencesFor())));
hbox = new QHBoxLayout();
topLayout->addItem(hbox);
mIncidencesForComboBox = new MailCommon::IncidencesForWidget(this);
mIncidencesForComboBox = new PimCommon::IncidencesForWidget(this);
hbox->addWidget(mIncidencesForComboBox);
mIncidencesForComboBox->setCurrentIndex(incidencesFor);
......@@ -183,20 +183,20 @@ void CollectionGeneralPage::save(Collection &collection)
} else if (collection.hasAttribute<EntityDisplayAttribute>()) {
collection.attribute<EntityDisplayAttribute>()->setIconName(QString());
}
MailCommon::CollectionAnnotationsAttribute *annotationsAttribute =
collection.attribute<MailCommon::CollectionAnnotationsAttribute>(Collection::AddIfMissing);
PimCommon::CollectionAnnotationsAttribute *annotationsAttribute =
collection.attribute<PimCommon::CollectionAnnotationsAttribute>(Collection::AddIfMissing);
QMap<QByteArray, QByteArray> annotations = annotationsAttribute->annotations();
MailCommon::CollectionTypeUtil collectionUtil;
PimCommon::CollectionTypeUtil collectionUtil;
if (mIncidencesForComboBox && mIncidencesForComboBox->isEnabled()) {
annotations[ MailCommon::CollectionTypeUtil::kolabIncidencesFor() ] =
annotations[ PimCommon::CollectionTypeUtil::kolabIncidencesFor() ] =
collectionUtil.incidencesForToString(
static_cast<MailCommon::CollectionTypeUtil::IncidencesFor>(mIncidencesForComboBox->currentIndex())).toLatin1();
static_cast<PimCommon::CollectionTypeUtil::IncidencesFor>(mIncidencesForComboBox->currentIndex())).toLatin1();
}
if (annotations.isEmpty()) {
collection.removeAttribute<MailCommon::CollectionAnnotationsAttribute>();
collection.removeAttribute<PimCommon::CollectionAnnotationsAttribute>();
} else {
annotationsAttribute->setAnnotations(annotations);
}
......
......@@ -22,13 +22,13 @@
#include "korganizerprivate_export.h"
#include <CollectionPropertiesPage>
#include <AkonadiWidgets/CollectionPropertiesPage>
class QLineEdit;
class KIconButton;
class QCheckBox;
namespace MailCommon
namespace PimCommon
{
class IncidencesForWidget;
}
......@@ -52,7 +52,7 @@ private:
QLineEdit *mNameEdit;
QCheckBox *mIconCheckBox;
KIconButton *mIconButton;
MailCommon::IncidencesForWidget *mIncidencesForComboBox;
PimCommon::IncidencesForWidget *mIncidencesForComboBox;
};
AKONADI_COLLECTION_PROPERTIES_PAGE_FACTORY(CollectionGeneralPageFactory, CollectionGeneralPage)
......
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