summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-07-29 06:28:04 (GMT)
committerMontel Laurent <montel@kde.org>2016-07-29 06:28:04 (GMT)
commit15ba41e0de92c6aacd1688c51f7efbbe07f74165 (patch)
treed4b02899eaccc532fce979c143ed0fd9d64f33e6
parent0fa85d80beed6164b37ea2511a3ce6cedc7edd01 (diff)
Adapt to new api
-rw-r--r--CMakeLists.txt4
-rw-r--r--autotests/conflictresolvertest.cpp4
-rw-r--r--autotests/conflictresolvertest.h2
-rw-r--r--autotests/testfreebusyganttproxymodel.cpp6
-rw-r--r--src/conflictresolver.cpp18
-rw-r--r--src/conflictresolver.h10
-rw-r--r--src/freebusyganttproxymodel.cpp2
-rw-r--r--src/incidenceattendee.cpp12
-rw-r--r--src/resourcemanagement.cpp4
-rw-r--r--src/resourcemanagement.h4
-rw-r--r--src/schedulingdialog.cpp6
-rw-r--r--src/schedulingdialog.h4
-rw-r--r--src/visualfreebusywidget.cpp2
-rw-r--r--src/visualfreebusywidget.h4
14 files changed, 41 insertions, 41 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 29c9170..ccf7c50 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,7 +19,7 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
-set(PIM_VERSION "5.3.40")
+set(PIM_VERSION "5.3.41")
set(INCIDENCEEDITOR_LIB_VERSION ${PIM_VERSION})
set(AKONADI_MIMELIB_VERSION "5.3.40")
@@ -30,7 +30,7 @@ set(KMAILTRANSPORT_LIB_VERSION "5.3.40")
set(KLDAP_LIB_VERSION "5.3.40")
set(CALENDARUTILS_LIB_VERSION "5.3.40")
set(KCALENDARCORE_LIB_VERSION "5.3.40")
-set(CALENDARSUPPORT_LIB_VERSION "5.3.40")
+set(CALENDARSUPPORT_LIB_VERSION "5.3.41")
set(LIBKDEPIM_LIB_VERSION "5.3.40")
set(EVENTVIEW_LIB_VERSION "5.3.40")
set(AKONADI_VERSION "5.3.40")
diff --git a/autotests/conflictresolvertest.cpp b/autotests/conflictresolvertest.cpp
index 9c05a2c..a320337 100644
--- a/autotests/conflictresolvertest.cpp
+++ b/autotests/conflictresolvertest.cpp
@@ -33,7 +33,7 @@ using namespace IncidenceEditorNG;
void ConflictResolverTest::insertAttendees()
{
- foreach (KPIM::FreeBusyItem::Ptr item, attendees) {
+ foreach (CalendarSupport::FreeBusyItem::Ptr item, attendees) {
resolver->insertAttendee(item);
}
}
@@ -42,7 +42,7 @@ void ConflictResolverTest::addAttendee(const QString &email, const KCalCore::Fre
KCalCore::Attendee::Role role)
{
QString name = QStringLiteral("attendee %1").arg(attendees.count());
- KPIM::FreeBusyItem::Ptr item(new KPIM::FreeBusyItem(KCalCore::Attendee::Ptr(
+ CalendarSupport::FreeBusyItem::Ptr item(new CalendarSupport::FreeBusyItem(KCalCore::Attendee::Ptr(
new KCalCore::Attendee(name, email, false,
KCalCore::Attendee::Accepted,
role)), 0));
diff --git a/autotests/conflictresolvertest.h b/autotests/conflictresolvertest.h
index 83f555b..dd2cfb2 100644
--- a/autotests/conflictresolvertest.h
+++ b/autotests/conflictresolvertest.h
@@ -52,7 +52,7 @@ private:
void insertAttendees();
void addAttendee(const QString &email, const KCalCore::FreeBusy::Ptr &fb,
KCalCore::Attendee::Role role = KCalCore::Attendee::ReqParticipant);
- QList<KPIM::FreeBusyItem::Ptr> attendees;
+ QList<CalendarSupport::FreeBusyItem::Ptr> attendees;
QWidget *parent;
IncidenceEditorNG::ConflictResolver *resolver;
KDateTime base, end;
diff --git a/autotests/testfreebusyganttproxymodel.cpp b/autotests/testfreebusyganttproxymodel.cpp
index fc3d96e..e37c962 100644
--- a/autotests/testfreebusyganttproxymodel.cpp
+++ b/autotests/testfreebusyganttproxymodel.cpp
@@ -34,7 +34,7 @@ using namespace IncidenceEditorNG;
void FreeBusyGanttProxyModelTest::testModelValidity()
{
- KPIM::FreeBusyItemModel *fbModel = new KPIM::FreeBusyItemModel();
+ CalendarSupport::FreeBusyItemModel *fbModel = new CalendarSupport::FreeBusyItemModel();
FreeBusyGanttProxyModel *ganttModel = new FreeBusyGanttProxyModel();
ganttModel->setSourceModel(fbModel);
ModelTest *modelTest = new ModelTest(ganttModel);
@@ -51,7 +51,7 @@ void FreeBusyGanttProxyModelTest::testModelValidity()
fb1->addPeriod(dt1, KCalCore::Duration(60 * 60));
fb1->addPeriod(dt2, KCalCore::Duration(60 * 60));
- KPIM::FreeBusyItem::Ptr item1(new KPIM::FreeBusyItem(a1, 0));
+ CalendarSupport::FreeBusyItem::Ptr item1(new CalendarSupport::FreeBusyItem(a1, 0));
item1->setFreeBusy(fb1);
const KDateTime dt3(QDate(2010, 8, 25), QTime(7, 0, 0), KDateTime::UTC);
@@ -62,7 +62,7 @@ void FreeBusyGanttProxyModelTest::testModelValidity()
fb2->addPeriod(dt3, KCalCore::Duration(60 * 60));
fb2->addPeriod(dt4, KCalCore::Duration(60 * 60));
- KPIM::FreeBusyItem::Ptr item2(new KPIM::FreeBusyItem(a2, 0));
+ CalendarSupport::FreeBusyItem::Ptr item2(new CalendarSupport::FreeBusyItem(a2, 0));
item2->setFreeBusy(fb2);
fbModel->addItem(item1);
diff --git a/src/conflictresolver.cpp b/src/conflictresolver.cpp
index 7c70102..8834a9a 100644
--- a/src/conflictresolver.cpp
+++ b/src/conflictresolver.cpp
@@ -32,7 +32,7 @@ using namespace IncidenceEditorNG;
ConflictResolver::ConflictResolver(QWidget *parentWidget, QObject *parent)
: QObject(parent),
- mFBModel(new KPIM::FreeBusyItemModel(this)),
+ mFBModel(new CalendarSupport::FreeBusyItemModel(this)),
mParentWidget(parentWidget),
mWeekdays(7),
mSlotResolutionSeconds(DEFAULT_RESOLUTION_SECONDS)
@@ -60,7 +60,7 @@ ConflictResolver::ConflictResolver(QWidget *parentWidget, QObject *parent)
<< KCalCore::Attendee::NonParticipant
<< KCalCore::Attendee::Chair;
- connect(mFBModel, &KPIM::FreeBusyItemModel::dataChanged, this, &ConflictResolver::freebusyDataChanged);
+ connect(mFBModel, &CalendarSupport::FreeBusyItemModel::dataChanged, this, &ConflictResolver::freebusyDataChanged);
connect(&mCalculateTimer, &QTimer::timeout, this, &ConflictResolver::findAllFreeSlots);
mCalculateTimer.setSingleShot(true);
@@ -69,11 +69,11 @@ ConflictResolver::ConflictResolver(QWidget *parentWidget, QObject *parent)
void ConflictResolver::insertAttendee(const KCalCore::Attendee::Ptr &attendee)
{
if (!mFBModel->containsAttendee(attendee)) {
- mFBModel->addItem(KPIM::FreeBusyItem::Ptr(new KPIM::FreeBusyItem(attendee, mParentWidget)));
+ mFBModel->addItem(CalendarSupport::FreeBusyItem::Ptr(new CalendarSupport::FreeBusyItem(attendee, mParentWidget)));
}
}
-void ConflictResolver::insertAttendee(const KPIM::FreeBusyItem::Ptr &freebusy)
+void ConflictResolver::insertAttendee(const CalendarSupport::FreeBusyItem::Ptr &freebusy)
{
if (!mFBModel->containsAttendee(freebusy->attendee())) {
mFBModel->addItem(freebusy);
@@ -151,12 +151,12 @@ int ConflictResolver::tryDate(KDateTime &tryFrom, KDateTime &tryTo)
for (int i = 0; i < mFBModel->rowCount(); ++i) {
QModelIndex index = mFBModel->index(i);
KCalCore::Attendee::Ptr attendee =
- mFBModel->data(index, KPIM::FreeBusyItemModel::AttendeeRole).value<KCalCore::Attendee::Ptr>();
+ mFBModel->data(index, CalendarSupport::FreeBusyItemModel::AttendeeRole).value<KCalCore::Attendee::Ptr>();
if (!matchesRoleConstraint(attendee)) {
continue;
}
KCalCore::FreeBusy::Ptr freebusy =
- mFBModel->data(index, KPIM::FreeBusyItemModel::FreeBusyRole).value<KCalCore::FreeBusy::Ptr>();
+ mFBModel->data(index, CalendarSupport::FreeBusyItemModel::FreeBusyRole).value<KCalCore::FreeBusy::Ptr>();
if (!tryDate(freebusy, tryFrom, tryTo)) {
++conflicts_count;
}
@@ -274,12 +274,12 @@ void ConflictResolver::findAllFreeSlots()
for (int i = 0; i < mFBModel->rowCount(); ++i) {
QModelIndex index = mFBModel->index(i);
KCalCore::Attendee::Ptr attendee =
- mFBModel->data(index, KPIM::FreeBusyItemModel::AttendeeRole).value<KCalCore::Attendee::Ptr>();
+ mFBModel->data(index, CalendarSupport::FreeBusyItemModel::AttendeeRole).value<KCalCore::Attendee::Ptr>();
if (!matchesRoleConstraint(attendee)) {
continue;
}
KCalCore::FreeBusy::Ptr freebusy =
- mFBModel->data(index, KPIM::FreeBusyItemModel::FreeBusyRole).value<KCalCore::FreeBusy::Ptr>();
+ mFBModel->data(index, CalendarSupport::FreeBusyItemModel::FreeBusyRole).value<KCalCore::FreeBusy::Ptr>();
if (freebusy) {
filteredFBItems << freebusy;
}
@@ -489,7 +489,7 @@ void ConflictResolver::setResolution(int seconds)
mSlotResolutionSeconds = seconds;
}
-KPIM::FreeBusyItemModel *ConflictResolver::model() const
+CalendarSupport::FreeBusyItemModel *ConflictResolver::model() const
{
return mFBModel;
}
diff --git a/src/conflictresolver.h b/src/conflictresolver.h
index 90f103c..d47f1c5 100644
--- a/src/conflictresolver.h
+++ b/src/conflictresolver.h
@@ -30,7 +30,7 @@
#include <QSet>
#include <QTimer>
-namespace KPIM
+namespace CalendarSupport
{
class FreeBusyItemModel;
}
@@ -62,7 +62,7 @@ public:
*/
void insertAttendee(const KCalCore::Attendee::Ptr &attendee);
- void insertAttendee(const KPIM::FreeBusyItem::Ptr &freebusy);
+ void insertAttendee(const CalendarSupport::FreeBusyItem::Ptr &freebusy);
/**
* Removes an attendee
* The attendee will no longer be considered when
@@ -114,9 +114,9 @@ public:
*/
bool findFreeSlot(const KCalCore::Period &dateTimeRange);
- QList<KPIM::FreeBusyItem::Ptr> freeBusyItems() const;
+ QList<CalendarSupport::FreeBusyItem::Ptr> freeBusyItems() const;
- KPIM::FreeBusyItemModel *model() const;
+ CalendarSupport::FreeBusyItemModel *model() const;
Q_SIGNALS:
/**
@@ -192,7 +192,7 @@ private:
// to prevent the process from being repeated many times
// after a series of quick parameter changes.
- KPIM::FreeBusyItemModel *mFBModel;
+ CalendarSupport::FreeBusyItemModel *mFBModel;
QWidget *mParentWidget;
QSet<KCalCore::Attendee::Role> mMandatoryRoles;
diff --git a/src/freebusyganttproxymodel.cpp b/src/freebusyganttproxymodel.cpp
index 5e6ce94..04ac2c8 100644
--- a/src/freebusyganttproxymodel.cpp
+++ b/src/freebusyganttproxymodel.cpp
@@ -58,7 +58,7 @@ QVariant FreeBusyGanttProxyModel::data(const QModelIndex &index, int role) const
// if the index is valid, then it corrsponds to a free busy period
KDateTime::Spec timeSpec = KSystemTimeZones::local();
KCalCore::FreeBusyPeriod period =
- sourceModel()->data(source_index, KPIM::FreeBusyItemModel::FreeBusyPeriodRole).
+ sourceModel()->data(source_index, CalendarSupport::FreeBusyItemModel::FreeBusyPeriodRole).
value<KCalCore::FreeBusyPeriod>();
switch (role) {
diff --git a/src/incidenceattendee.cpp b/src/incidenceattendee.cpp
index 31105fa..5a6e386 100644
--- a/src/incidenceattendee.cpp
+++ b/src/incidenceattendee.cpp
@@ -559,8 +559,8 @@ void IncidenceAttendee::slotFreeBusyAdded(const QModelIndex &parent, int first,
QAbstractItemModel *model = mConflictResolver->model();
for (int i = first; i <= last; ++i) {
QModelIndex index = model->index(i, 0, parent);
- const KCalCore::Attendee::Ptr &attendee = model->data(index, KPIM::FreeBusyItemModel::AttendeeRole).value<KCalCore::Attendee::Ptr>();
- const KCalCore::FreeBusy::Ptr &fb = model->data(index, KPIM::FreeBusyItemModel::FreeBusyRole).value<KCalCore::FreeBusy::Ptr>();
+ const KCalCore::Attendee::Ptr &attendee = model->data(index, CalendarSupport::FreeBusyItemModel::AttendeeRole).value<KCalCore::Attendee::Ptr>();
+ const KCalCore::FreeBusy::Ptr &fb = model->data(index, CalendarSupport::FreeBusyItemModel::FreeBusyRole).value<KCalCore::FreeBusy::Ptr>();
if (attendee) {
updateFBStatus(attendee, fb);
}
@@ -576,8 +576,8 @@ void IncidenceAttendee::slotFreeBusyChanged(const QModelIndex &topLeft, const QM
QAbstractItemModel *model = mConflictResolver->model();
for (int i = topLeft.row(); i <= bottomRight.row(); ++i) {
QModelIndex index = model->index(i, 0);
- const KCalCore::Attendee::Ptr &attendee = model->data(index, KPIM::FreeBusyItemModel::AttendeeRole).value<KCalCore::Attendee::Ptr>();
- const KCalCore::FreeBusy::Ptr &fb = model->data(index, KPIM::FreeBusyItemModel::FreeBusyRole).value<KCalCore::FreeBusy::Ptr>();
+ const KCalCore::Attendee::Ptr &attendee = model->data(index, CalendarSupport::FreeBusyItemModel::AttendeeRole).value<KCalCore::Attendee::Ptr>();
+ const KCalCore::FreeBusy::Ptr &fb = model->data(index, CalendarSupport::FreeBusyItemModel::FreeBusyRole).value<KCalCore::FreeBusy::Ptr>();
if (attendee) {
updateFBStatus(attendee, fb);
}
@@ -589,8 +589,8 @@ void IncidenceAttendee::updateFBStatus()
QAbstractItemModel *model = mConflictResolver->model();
for (int i = 0; i < model->rowCount(); ++i) {
QModelIndex index = model->index(i, 0);
- const KCalCore::Attendee::Ptr &attendee = model->data(index, KPIM::FreeBusyItemModel::AttendeeRole).value<KCalCore::Attendee::Ptr>();
- const KCalCore::FreeBusy::Ptr &fb = model->data(index, KPIM::FreeBusyItemModel::FreeBusyRole).value<KCalCore::FreeBusy::Ptr>();
+ const KCalCore::Attendee::Ptr &attendee = model->data(index, CalendarSupport::FreeBusyItemModel::AttendeeRole).value<KCalCore::Attendee::Ptr>();
+ const KCalCore::FreeBusy::Ptr &fb = model->data(index, CalendarSupport::FreeBusyItemModel::FreeBusyRole).value<KCalCore::FreeBusy::Ptr>();
if (attendee) {
updateFBStatus(attendee, fb);
}
diff --git a/src/resourcemanagement.cpp b/src/resourcemanagement.cpp
index ed023be..39eee0d 100644
--- a/src/resourcemanagement.cpp
+++ b/src/resourcemanagement.cpp
@@ -128,7 +128,7 @@ ResourceManagement::ResourceManagement(QWidget *parent)
mainLayout->addWidget(buttonBox);
- mModel = new KPIM::FreeBusyItemModel(this);
+ mModel = new CalendarSupport::FreeBusyItemModel(this);
mFreebusyCalendar.setModel(mModel);
mAgendaView = new EventViews::AgendaView(QDate(), QDate(), false, false);
@@ -238,7 +238,7 @@ void ResourceManagement::showDetails(const KLDAP::LdapObject &obj, const KLDAP::
QString name = QString::fromUtf8(obj.attributes().value(QStringLiteral("cn"))[0]);
QString email = QString::fromUtf8(obj.attributes().value(QStringLiteral("mail"))[0]);
KCalCore::Attendee::Ptr attendee(new KCalCore::Attendee(name, email));
- KPIM::FreeBusyItem::Ptr freebusy(new KPIM::FreeBusyItem(attendee, this));
+ CalendarSupport::FreeBusyItem::Ptr freebusy(new CalendarSupport::FreeBusyItem(attendee, this));
mModel->clear();
mModel->addItem(freebusy);
}
diff --git a/src/resourcemanagement.h b/src/resourcemanagement.h
index 70d0fa7..a10660e 100644
--- a/src/resourcemanagement.h
+++ b/src/resourcemanagement.h
@@ -89,8 +89,8 @@ private Q_SLOTS:
private:
void readConfig();
void writeConfig();
- KPIM::FreeBusyItemModel *mModel;
- KPIM::FreeBusyCalendar mFreebusyCalendar;
+ CalendarSupport::FreeBusyItemModel *mModel;
+ CalendarSupport::FreeBusyCalendar mFreebusyCalendar;
ResourceItem::Ptr mOwnerItem;
ResourceItem::Ptr mSelectedItem;
EventViews::ViewCalendar::Ptr mFbCalendar;
diff --git a/src/schedulingdialog.cpp b/src/schedulingdialog.cpp
index 48261de..93c66a1 100644
--- a/src/schedulingdialog.cpp
+++ b/src/schedulingdialog.cpp
@@ -35,7 +35,7 @@ using namespace IncidenceEditorNG;
SchedulingDialog::SchedulingDialog(const QDate &startDate, const QTime &startTime, int duration,
ConflictResolver *resolver, QWidget *parent)
- : QDialog(parent), mResolver(resolver), mPeriodModel(new KPIM::FreePeriodModel(this))
+ : QDialog(parent), mResolver(resolver), mPeriodModel(new CalendarSupport::FreePeriodModel(this))
{
QVBoxLayout *mainLayout = new QVBoxLayout(this);
QWidget *w = new QWidget(this);
@@ -70,7 +70,7 @@ SchedulingDialog::SchedulingDialog(const QDate &startDate, const QTime &startTim
connect(mWeekdayCombo, &KPIM::KWeekdayCheckCombo::checkedItemsChanged, this, &SchedulingDialog::slotWeekdaysChanged);
connect(mWeekdayCombo, &KPIM::KWeekdayCheckCombo::checkedItemsChanged, this, &SchedulingDialog::slotMandatoryRolesChanged);
- connect(mResolver, &ConflictResolver::freeSlotsAvailable, mPeriodModel, &KPIM::FreePeriodModel::slotNewFreePeriods);
+ connect(mResolver, &ConflictResolver::freeSlotsAvailable, mPeriodModel, &CalendarSupport::FreePeriodModel::slotNewFreePeriods);
connect(mMoveBeginTimeEdit, &KTimeComboBox::timeEdited, this, &SchedulingDialog::slotSetEndTimeLabel);
mTableView->setModel(mPeriodModel);
@@ -175,7 +175,7 @@ void SchedulingDialog::slotRowSelectionChanged(const QModelIndex &current,
mMoveApptGroupBox->hide();
return;
}
- KCalCore::Period period = current.data(KPIM::FreePeriodModel::PeriodRole).value<KCalCore::Period>();
+ KCalCore::Period period = current.data(CalendarSupport::FreePeriodModel::PeriodRole).value<KCalCore::Period>();
const QDate startDate = period.start().date();
const int dayOfWeek = startDate.dayOfWeek();
diff --git a/src/schedulingdialog.h b/src/schedulingdialog.h
index 34dbdc6..4520cb3 100644
--- a/src/schedulingdialog.h
+++ b/src/schedulingdialog.h
@@ -26,7 +26,7 @@
#include <QDialog>
#include <KDateTime>
-namespace KPIM
+namespace CalendarSupport
{
class FreePeriodModel;
}
@@ -74,7 +74,7 @@ private:
int mDuration; //!< In seconds
ConflictResolver *mResolver;
- KPIM::FreePeriodModel *mPeriodModel;
+ CalendarSupport::FreePeriodModel *mPeriodModel;
VisualFreeBusyWidget *mVisualWidget;
};
diff --git a/src/visualfreebusywidget.cpp b/src/visualfreebusywidget.cpp
index 445a80d..83e7f16 100644
--- a/src/visualfreebusywidget.cpp
+++ b/src/visualfreebusywidget.cpp
@@ -138,7 +138,7 @@ public:
}
-VisualFreeBusyWidget::VisualFreeBusyWidget(KPIM::FreeBusyItemModel *model, int spacing, QWidget *parent)
+VisualFreeBusyWidget::VisualFreeBusyWidget(CalendarSupport::FreeBusyItemModel *model, int spacing, QWidget *parent)
: QWidget(parent), mGanttGrid(0), mScaleCombo(0)
{
QVBoxLayout *topLayout = new QVBoxLayout(this);
diff --git a/src/visualfreebusywidget.h b/src/visualfreebusywidget.h
index ec42fc9..062ad0e 100644
--- a/src/visualfreebusywidget.h
+++ b/src/visualfreebusywidget.h
@@ -31,7 +31,7 @@ class DateTimeGrid;
class GraphicsView;
}
-namespace KPIM
+namespace CalendarSupport
{
class FreeBusyItemModel;
}
@@ -49,7 +49,7 @@ class VisualFreeBusyWidget : public QWidget
{
Q_OBJECT
public:
- explicit VisualFreeBusyWidget(KPIM::FreeBusyItemModel *model, int spacing = 8, QWidget *parent = Q_NULLPTR);
+ explicit VisualFreeBusyWidget(CalendarSupport::FreeBusyItemModel *model, int spacing = 8, QWidget *parent = Q_NULLPTR);
~VisualFreeBusyWidget();
public Q_SLOTS: