Verified Commit 862be9cc authored by Fushan Wen's avatar Fushan Wen 💬
Browse files

calendar: remove unused `CalendarData`

parent 0159a28b
Pipeline #178560 passed with stage
in 12 minutes and 22 seconds
......@@ -3,7 +3,6 @@ add_library(calendarplugin SHARED)
target_sources(calendarplugin PRIVATE
calendarplugin.cpp
calendar.cpp
calendardata.cpp
daysmodel.cpp
eventdatadecorator.cpp
eventpluginsmanager.cpp
......
/*
SPDX-FileCopyrightText: 2013 Mark Gaiser <markg85@gmail.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "calendardata.h"
CalendarData::CalendarData(QObject *parent)
: QObject(parent)
, m_types(Holiday | Event | Todo | Journal)
{
// m_etmCalendar = new ETMCalendar();
// m_etmCalendar->setParent(this); //TODO: hit sergio
// EntityTreeModel *model = m_etmCalendar->entityTreeModel();
// model->setCollectionFetchStrategy(EntityTreeModel::InvisibleCollectionFetch);
// m_itemList = new EntityMimeTypeFilterModel(this);
// m_itemList->setSourceModel(model);
// CalendarRoleProxyModel *roleModel = new CalendarRoleProxyModel(this);
// roleModel->setSourceModel(m_itemList);
// m_filteredList = new DateTimeRangeFilterModel(this);
// m_filteredList->setSourceModel(roleModel);
// updateTypes();
}
QDate CalendarData::startDate() const
{
return m_startDate;
}
void CalendarData::setStartDate(const QDate &dateTime)
{
if (m_startDate == dateTime) {
return;
}
m_startDate = dateTime;
// m_filteredList->setStartDate(m_startDate);
Q_EMIT startDateChanged();
}
QDate CalendarData::endDate() const
{
return m_endDate;
}
void CalendarData::setEndDate(const QDate &dateTime)
{
if (m_endDate == dateTime) {
return;
}
m_endDate = dateTime;
// m_filteredList->setEndDate(m_endDate);
Q_EMIT endDateChanged();
}
int CalendarData::types() const
{
return m_types;
}
QString CalendarData::errorMessage() const
{
return QString();
}
bool CalendarData::loading() const
{
return false;
}
/*
SPDX-FileCopyrightText: 2013 Mark Gaiser <markg85@gmail.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef CALENDARDATA_H
#define CALENDARDATA_H
#include <QDate>
#include <QFlags>
#include <QObject>
class QAbstractItemModel;
class CalendarData : public QObject
{
Q_OBJECT
Q_PROPERTY(QDate startDate READ startDate WRITE setStartDate NOTIFY startDateChanged)
Q_PROPERTY(QDate endDate READ endDate WRITE setEndDate NOTIFY endDateChanged)
// Q_PROPERTY(int types READ types WRITE setTypes NOTIFY typesChanged)
Q_PROPERTY(QString errorMessage READ errorMessage NOTIFY errorMessageChanged)
Q_PROPERTY(bool loading READ loading NOTIFY loadingChanged)
// Q_PROPERTY(QAbstractItemModel* model READ model CONSTANT)
public:
enum Type {
Holiday = 1,
Event = 2,
Todo = 4,
Journal = 8,
};
Q_ENUM(Type)
Q_DECLARE_FLAGS(Types, Type)
explicit CalendarData(QObject *parent = nullptr);
Q_SIGNALS:
void startDateChanged();
void endDateChanged();
void typesChanged();
void errorMessageChanged();
void loadingChanged();
private:
QDate startDate() const;
void setStartDate(const QDate &dateTime);
QDate endDate() const;
void setEndDate(const QDate &dateTime);
int types() const;
// void setTypes(int types);
QString errorMessage() const;
bool loading() const;
// QAbstractItemModel* model() const;
// void updateTypes();
QDate m_startDate;
QDate m_endDate;
Types m_types;
// Akonadi::ETMCalendar *m_etmCalendar;
// Akonadi::EntityMimeTypeFilterModel *m_itemList;
// DateTimeRangeFilterModel *m_filteredList;
};
#endif // CALENDARDATA_H
......@@ -6,7 +6,6 @@
#include "calendarplugin.h"
#include "calendar.h"
#include "calendardata.h"
#include "eventdatadecorator.h"
#include "eventpluginsmanager.h"
......@@ -25,7 +24,6 @@ static QObject *event_plugins_manager_provider(QQmlEngine *engine, QJSEngine *sc
void CalendarPlugin::registerTypes(const char *uri)
{
Q_ASSERT(uri == QByteArray("org.kde.plasma.workspace.calendar"));
qmlRegisterType<CalendarData>(uri, 2, 0, "CalendarData");
qmlRegisterType<Calendar>(uri, 2, 0, "Calendar");
qmlRegisterAnonymousType<QAbstractItemModel>(uri, 1);
qmlRegisterAnonymousType<QAbstractListModel>(uri, 1);
......
Supports Markdown
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