From 545ce93634ed5789317334368aaf9e29049dcbd9 Mon Sep 17 00:00:00 2001 From: Philipp Spitzer Date: Tue, 20 Mar 2012 22:24:04 +0000 Subject: [PATCH] Deleted calendar.h and calendar.cpp as they are not used. --- src/alarm/calendar.cpp | 139 ----------------------------------------- src/alarm/calendar.h | 48 -------------- 2 files changed, 187 deletions(-) delete mode 100644 src/alarm/calendar.cpp delete mode 100644 src/alarm/calendar.h diff --git a/src/alarm/calendar.cpp b/src/alarm/calendar.cpp deleted file mode 100644 index 4e0e1a8..0000000 --- a/src/alarm/calendar.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (C) 2010 Ixonos Plc. - * Copyright (C) 2011 Philipp Spitzer, gregor herrmann - * - * This file is part of ConfClerk. - * - * ConfClerk is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 2 of the License, or (at your option) - * any later version. - * - * ConfClerk is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * ConfClerk. If not, see . - */ -#include "calendar.h" -#include -#include - -#include -#include -#include -#include - -Calendar::Calendar(): -m_pMultiCalendar(0), -m_pCalendar(0) -{ - m_pMultiCalendar = CMulticalendar::MCInstance(); - - if(m_pMultiCalendar != NULL) - m_pCalendar = m_pMultiCalendar->getSynchronizedCalendar(); - -} - -Calendar::~Calendar() -{ - delete m_pCalendar; - delete m_pMultiCalendar; -} - -int Calendar::addCalendarEvent(QString summary, QString description, QString location, uint dateStart, uint dateEnd, int eventId) -{ - int errorCode = 0; - - if(m_pMultiCalendar == NULL) - return 0; - - if(m_pCalendar == NULL) - return 0; - - // create event - CEvent event(summary.toStdString(), description.toStdString(), location.toStdString(), dateStart, dateEnd); - - // create alarm - CAlarm alarm; - alarm.setTrigger(dateStart - 15 * 60); - alarm.setRepeat(1); - alarm.setDuration(3); - alarm.setAction(0); - alarm.setAttach(QString::number(eventId).toLocal8Bit().data()); - - // add alarm to event - event.setAlarm(&alarm); - - // register event into calendar - m_pMultiCalendar->addEvent(&event,m_pCalendar->getCalendarId(),errorCode); - - return errorCode; -} - -void Calendar::deleteCalendarEvent(uint dateStart, uint dateEnd, int eventId) -{ - int errorCode = 0; - - vector< CComponent * > components; - - // get all events - components = m_pMultiCalendar->getComponents(m_pCalendar->getCalendarId(), 1, dateStart, dateEnd, errorCode); - - for (vector::iterator it = components.begin();it!=components.end(); ++it) - { - // get alarm properties - if( (*it)->getAlarmProperties() == true) - { - CAlarm * pAlarm = (*it)->getAlarm(); - - bool converted = false; - int tempId = QVariant(pAlarm->getAttach().data()).toInt(&converted); - - // check event id - if(converted == true) - if(tempId == eventId) - { - //delete event - m_pCalendar->deleteComponent((*it)->getId(),errorCode); - break; - } - } - } -} - -bool Calendar::hasCalendarEvent(int eventId) -{ - bool ret = false; - int errorCode = 0; - - vector< CEvent * > events; - - // get all events - events = m_pCalendar->getEvents(errorCode); - - if(events.size() > 0) - { - for (vector::iterator it = events.begin(); it!=events.end(); ++it) - { - // get alarm properties - if( (*it)->getAlarmProperties() == true) - { - CAlarm * pAlarm = (*it)->getAlarm(); - - bool converted = false; - int tempId = QVariant(pAlarm->getAttach().data()).toInt(&converted); - - // check event id - if(converted == true) - if(tempId == eventId) - { - ret = true; - break; - } - } - } - } -} diff --git a/src/alarm/calendar.h b/src/alarm/calendar.h deleted file mode 100644 index 0183055..0000000 --- a/src/alarm/calendar.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2010 Ixonos Plc. - * Copyright (C) 2011 Philipp Spitzer, gregor herrmann - * - * This file is part of ConfClerk. - * - * ConfClerk is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 2 of the License, or (at your option) - * any later version. - * - * ConfClerk is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * ConfClerk. If not, see . - */ -#ifndef CALENDAR_H -#define CALENDAR_H - -#include -#include - -class CMulticalendar; -class CCalendar; - -class Calendar : public QObject -{ - Q_OBJECT - public: - Calendar(); - ~Calendar(); - int addCalendarEvent(QString summary, QString description, QString location, uint dateStart, uint dateEnd, int eventId); - void deleteCalendarEvent(uint dateStart, uint dateEnd, int eventId); - bool hasCalendarEvent(int eventId); - - CMulticalendar * m_pMultiCalendar; - CCalendar * m_pCalendar; -// signals: -// void alarmAdded(int aEventId); -// void addAlarmFailed(int aEventId); -// void alarmDeleted(int aEventId); -// void deleteAlarmFailed(int aEventId); -}; - -#endif /* CALENDAR_H */ -- 2.39.5