Commit fadd0017 authored by David Jarvie's avatar David Jarvie

QList -> QVector, rename KAEvent::Action -> SubAction

parent 00c9b5ad
......@@ -1308,7 +1308,7 @@ AkonadiModel::Result AkonadiModel::addEvent(KAEvent* event, KAlarm::CalEvent::Ty
* Reply = true if item creation has been scheduled for all events,
* false if at least one item creation failed to be scheduled.
*/
bool AkonadiModel::addEvents(const QList<KAEvent*>& events, Collection& collection)
bool AkonadiModel::addEvents(const KAEvent::List& events, Collection& collection)
{
bool ok = true;
for (int i = 0, count = events.count(); i < count; ++i)
......
......@@ -149,7 +149,7 @@ class AkonadiModel : public Akonadi::EntityTreeModel
#endif
bool addEvent(KAEvent&, Akonadi::Collection&);
bool addEvents(const QList<KAEvent*>&, Akonadi::Collection&);
bool addEvents(const KAEvent::List&, Akonadi::Collection&);
bool updateEvent(KAEvent& event);
bool updateEvent(Akonadi::Item::Id oldId, KAEvent& newEvent);
bool deleteEvent(const KAEvent& event);
......
......@@ -766,7 +766,10 @@ void AlarmCalendar::updateEventInternal(const KAEvent& event, const Collection&
mEventMap.erase(it);
for (ResourceMap::Iterator rit = mResourceMap.begin(); rit != mResourceMap.end(); ++rit)
{
rit.value().removeAll(storedEvent);
KAEvent::List& events = rit.value();
int i = events.indexOf(storedEvent);
if (i >= 0)
events.remove(i);
if (mEarliestAlarm[rit.key()] == storedEvent)
findEarliestAlarm(Collection(rit.key()));
}
......@@ -1334,7 +1337,10 @@ bool AlarmCalendar::addEvent(KAEvent* event, QWidget* promptParent, bool useEven
{
// Adding to mCalendar failed, so undo AlarmCalendar::addEvent()
mEventMap.remove(event->id());
mResourceMap[key].removeAll(event);
KAEvent::List& events = mResourceMap[key];
int i = events.indexOf(event);
if (i >= 0)
events.remove(i);
if (mEarliestAlarm[key] == event)
findEarliestAlarm(key);
}
......@@ -1662,7 +1668,10 @@ KAlarm::CalEvent::Type AlarmCalendar::deleteEventInternal(const QString& eventID
#else
AlarmResource* key = AlarmResources::instance()->resource(kcalEvent);
#endif
mResourceMap[key].removeAll(ev);
KAEvent::List& events = mResourceMap[key];
int i = events.indexOf(ev);
if (i >= 0)
events.remove(i);
delete ev;
if (mEarliestAlarm[key] == ev)
#ifdef USE_AKONADI
......
......@@ -248,9 +248,9 @@ BirthdayDlg::BirthdayDlg(QWidget* parent)
/******************************************************************************
* Return a list of events for birthdays chosen.
*/
QList<KAEvent> BirthdayDlg::events() const
QVector<KAEvent> BirthdayDlg::events() const
{
QList<KAEvent> list;
QVector<KAEvent> list;
QModelIndexList indexes = mListView->selectionModel()->selectedRows();
int count = indexes.count();
if (!count)
......@@ -277,8 +277,7 @@ QList<KAEvent> BirthdayDlg::events() const
int fadeSecs;
float volume = mSoundPicker->volume(fadeVolume, fadeSecs);
event.setAudioFile(mSoundPicker->file().prettyUrl(), volume, fadeVolume, fadeSecs);
QList<int> months;
months.append(date.month());
QVector<int> months(1, date.month());
event.setRecurAnnualByDate(1, months, 0, KARecurrence::defaultFeb29Type(), -1, QDate());
event.setRepetition(mSubRepetition->repetition());
event.setNextOccurrence(todayStart);
......
/*
* birthdaydlg.h - dialog to pick birthdays from address book
* Program: kalarm
* Copyright © 2002-2005,2007-2009 by David Jarvie <djarvie@kde.org>
* Copyright © 2002-2005,2007-2011 by David Jarvie <djarvie@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -24,7 +24,7 @@
#include <kdialog.h>
#include <klineedit.h>
#include <QList>
#include <QVector>
class QFocusEvent;
class QTreeView;
......@@ -44,7 +44,7 @@ class BirthdayDlg : public KDialog
Q_OBJECT
public:
explicit BirthdayDlg(QWidget* parent = 0);
QList<KAEvent> events() const;
QVector<KAEvent> events() const;
protected slots:
virtual void slotOk();
......
......@@ -237,13 +237,13 @@ KAEvent::Private::Private()
{ }
KAEvent::KAEvent(const KDateTime& dt, const QString& message, const QColor& bg, const QColor& fg, const QFont& f,
Action action, int lateCancel, int flags, bool changesPending)
SubAction action, int lateCancel, int flags, bool changesPending)
: d(new Private(dt, message, bg, fg, f, action, lateCancel, flags, changesPending))
{
}
KAEvent::Private::Private(const KDateTime& dt, const QString& message, const QColor& bg, const QColor& fg, const QFont& f,
Action action, int lateCancel, int flags, bool changesPending)
SubAction action, int lateCancel, int flags, bool changesPending)
: mRecurrence(0)
{
set(dt, message, bg, fg, f, action, lateCancel, flags, changesPending);
......@@ -834,9 +834,9 @@ void KAEvent::Private::set(const Event* event)
* Reply = next main date/time.
*/
#ifdef USE_AKONADI
DateTime KAEvent::readDateTime(const ConstEventPtr& event, bool dateOnly, DateTime& start)
DateTime KAEvent::Private::readDateTime(const ConstEventPtr& event, bool dateOnly, DateTime& start)
#else
DateTime KAEvent::readDateTime(const Event* event, bool dateOnly, DateTime& start)
DateTime KAEvent::Private::readDateTime(const Event* event, bool dateOnly, DateTime& start)
#endif
{
start = event->dtStart();
......@@ -877,9 +877,9 @@ DateTime KAEvent::readDateTime(const Event* event, bool dateOnly, DateTime& star
* Reply = map of alarm data, indexed by KAAlarm::Type
*/
#ifdef USE_AKONADI
void KAEvent::readAlarms(const ConstEventPtr& event, void* almap, bool cmdDisplay)
void KAEvent::Private::readAlarms(const ConstEventPtr& event, void* almap, bool cmdDisplay)
#else
void KAEvent::readAlarms(const Event* event, void* almap, bool cmdDisplay)
void KAEvent::Private::readAlarms(const Event* event, void* almap, bool cmdDisplay)
#endif
{
AlarmMap* alarmMap = (AlarmMap*)almap;
......@@ -920,9 +920,9 @@ void KAEvent::readAlarms(const Event* event, void* almap, bool cmdDisplay)
* Reply = alarm ID (sequence number)
*/
#ifdef USE_AKONADI
void KAEvent::readAlarm(const ConstAlarmPtr& alarm, AlarmData& data, bool audioMain, bool cmdDisplay)
void KAEvent::Private::readAlarm(const ConstAlarmPtr& alarm, AlarmData& data, bool audioMain, bool cmdDisplay)
#else
void KAEvent::readAlarm(const Alarm* alarm, AlarmData& data, bool audioMain, bool cmdDisplay)
void KAEvent::Private::readAlarm(const Alarm* alarm, AlarmData& data, bool audioMain, bool cmdDisplay)
#endif
{
// Parse the next alarm's text
......@@ -1105,7 +1105,7 @@ void KAEvent::readAlarm(const Alarm* alarm, AlarmData& data, bool audioMain, boo
* Initialise the instance with the specified parameters.
*/
void KAEvent::Private::set(const KDateTime& dateTime, const QString& text, const QColor& bg, const QColor& fg,
const QFont& font, Action action, int lateCancel, int flags, bool changesPending)
const QFont& font, SubAction action, int lateCancel, int flags, bool changesPending)
{
clearRecur();
mStartDateTime = dateTime;
......@@ -3674,7 +3674,7 @@ bool KAEvent::setRecurWeekly(int freq, const QBitArray& days, int count, const Q
* end = end date (invalid to use 'count' instead).
* Reply = false if no recurrence was set up.
*/
bool KAEvent::setRecurMonthlyByDate(int freq, const QList<int>& days, int count, const QDate& end)
bool KAEvent::setRecurMonthlyByDate(int freq, const QVector<int>& days, int count, const QDate& end)
{
bool success = d->setRecur(RecurrenceRule::rMonthly, freq, count, end);
if (success)
......@@ -3698,7 +3698,7 @@ bool KAEvent::setRecurMonthlyByDate(int freq, const QList<int>& days, int count,
* end = end date (invalid to use 'count' instead).
* Reply = false if no recurrence was set up.
*/
bool KAEvent::setRecurMonthlyByPos(int freq, const QList<MonthPos>& posns, int count, const QDate& end)
bool KAEvent::setRecurMonthlyByPos(int freq, const QVector<MonthPos>& posns, int count, const QDate& end)
{
bool success = d->setRecur(RecurrenceRule::rMonthly, freq, count, end);
if (success)
......@@ -3724,7 +3724,7 @@ bool KAEvent::setRecurMonthlyByPos(int freq, const QList<MonthPos>& posns, int c
* end = end date (invalid to use 'count' instead).
* Reply = false if no recurrence was set up.
*/
bool KAEvent::setRecurAnnualByDate(int freq, const QList<int>& months, int day, KARecurrence::Feb29Type feb29, int count, const QDate& end)
bool KAEvent::setRecurAnnualByDate(int freq, const QVector<int>& months, int day, KARecurrence::Feb29Type feb29, int count, const QDate& end)
{
bool success = d->setRecur(RecurrenceRule::rYearly, freq, count, end, feb29);
if (success)
......@@ -3751,7 +3751,7 @@ bool KAEvent::setRecurAnnualByDate(int freq, const QList<int>& months, int day,
* end = end date (invalid to use 'count' instead).
* Reply = false if no recurrence was set up.
*/
bool KAEvent::setRecurAnnualByPos(int freq, const QList<MonthPos>& posns, const QList<int>& months, int count, const QDate& end)
bool KAEvent::setRecurAnnualByPos(int freq, const QVector<MonthPos>& posns, const QVector<int>& months, int count, const QDate& end)
{
bool success = d->setRecur(RecurrenceRule::rYearly, freq, count, end);
if (success)
......@@ -4186,7 +4186,7 @@ bool KAEvent::convertKCalEvents(CalendarLocal& calendar, int calendarVersion, bo
// Parse and order the alarms to know which one's date/time to use
AlarmMap alarmMap;
readAlarms(event, &alarmMap);
Private::readAlarms(event, &alarmMap);
AlarmMap::ConstIterator it = alarmMap.constBegin();
if (it != alarmMap.constEnd())
{
......@@ -4467,7 +4467,7 @@ bool KAEvent::convertKCalEvents(CalendarLocal& calendar, int calendarVersion, bo
* It's a KAlarm pre-1.9.10 calendar file.
* Convert simple repetitions without a recurrence, to a recurrence.
*/
if (convertRepetition(event))
if (Private::convertRepetition(event))
converted = true;
}
......@@ -4477,7 +4477,7 @@ bool KAEvent::convertKCalEvents(CalendarLocal& calendar, int calendarVersion, bo
* It's a KAlarm pre-2.2.9 or KAlarm 2.3 series pre-2.3.2 calendar file.
* Set the time in the calendar for all date-only alarms to 00:00.
*/
if (convertStartOfDay(event))
if (Private::convertStartOfDay(event))
converted = true;
}
......@@ -4607,9 +4607,9 @@ bool KAEvent::convertKCalEvents(CalendarLocal& calendar, int calendarVersion, bo
* Reply = true if the event was updated.
*/
#ifdef USE_AKONADI
bool KAEvent::convertStartOfDay(const Event::Ptr& event)
bool KAEvent::Private::convertStartOfDay(const Event::Ptr& event)
#else
bool KAEvent::convertStartOfDay(Event* event)
bool KAEvent::Private::convertStartOfDay(Event* event)
#endif
{
bool changed = false;
......@@ -4712,9 +4712,9 @@ bool KAEvent::convertStartOfDay(Event* event)
* Reply = true if any conversions were done.
*/
#ifdef USE_AKONADI
bool KAEvent::convertRepetition(const Event::Ptr& event)
bool KAEvent::Private::convertRepetition(const Event::Ptr& event)
#else
bool KAEvent::convertRepetition(Event* event)
bool KAEvent::Private::convertRepetition(Event* event)
#endif
{
Alarm::List alarms = event->alarms();
......@@ -4763,7 +4763,7 @@ bool KAEvent::convertRepetition(Event* event)
/******************************************************************************
* Return a list of pointers to KAEvent objects.
*/
KAEvent::List KAEvent::ptrList(QList<KAEvent>& objList)
KAEvent::List KAEvent::ptrList(QVector<KAEvent>& objList)
{
KAEvent::List ptrs;
for (int i = 0, count = objList.count(); i < count; ++i)
......@@ -5017,7 +5017,7 @@ void KAAlarmEventBase::baseDumpDebug() const
#ifdef USE_AKONADI
EmailAddressList& EmailAddressList::operator=(const Person::List& addresses)
#else
EmailAddressList& EmailAddressList::operator=(const QList<Person>& addresses)
EmailAddressList& EmailAddressList::operator=(const QVector<Person>& addresses)
#endif
{
clear();
......
......@@ -42,7 +42,7 @@
#include <QBitArray>
#include <QColor>
#include <QFont>
#include <QList>
#include <QVector>
#include <QMetaType>
namespace KHolidays { class HolidayRegion; }
......@@ -61,7 +61,7 @@ typedef KCalCore::Person EmailAddress;
class KALARM_CAL_EXPORT EmailAddressList : public KCalCore::Person::List
#else
typedef KCal::Person EmailAddress;
class KALARM_CAL_EXPORT EmailAddressList : public QList<KCal::Person>
class KALARM_CAL_EXPORT EmailAddressList : public QVector<KCal::Person>
#endif
{
public:
......@@ -70,9 +70,9 @@ class KALARM_CAL_EXPORT EmailAddressList : public QList<KCal::Person>
EmailAddressList(const KCalCore::Person::List& list) { operator=(list); }
EmailAddressList& operator=(const KCalCore::Person::List&);
#else
EmailAddressList() : QList<KCal::Person>() { }
EmailAddressList(const QList<KCal::Person>& list) { operator=(list); }
EmailAddressList& operator=(const QList<KCal::Person>&);
EmailAddressList() : QVector<KCal::Person>() { }
EmailAddressList(const QVector<KCal::Person>& list) { operator=(list); }
EmailAddressList& operator=(const QVector<KCal::Person>&);
#endif
operator QStringList() const;
QString join(const QString& separator) const;
......@@ -219,7 +219,7 @@ class KALARM_CAL_EXPORT KAAlarm : public KAAlarmEventBase
class KALARM_CAL_EXPORT KAEvent
{
public:
typedef QList<KAEvent*> List;
typedef QVector<KAEvent*> List;
enum // Flags for use in D-Bus calls, etc.
{
BEEP = 0x02, // sound audible beep when alarm is displayed
......@@ -258,7 +258,7 @@ class KALARM_CAL_EXPORT KAEvent
ACT_DISPLAY_COMMAND = ACT_DISPLAY | ACT_COMMAND, // the alarm displays command output
ACT_ALL = ACT_DISPLAY | ACT_COMMAND | ACT_EMAIL | ACT_AUDIO // all types mask
};
enum Action
enum SubAction
{
MESSAGE = KAAlarmEventBase::T_MESSAGE,
FILE = KAAlarmEventBase::T_FILE,
......@@ -318,7 +318,7 @@ class KALARM_CAL_EXPORT KAEvent
KAEvent();
KAEvent(const KDateTime&, const QString& message, const QColor& bg, const QColor& fg,
const QFont& f, Action, int lateCancel, int flags, bool changesPending = false);
const QFont& f, SubAction, int lateCancel, int flags, bool changesPending = false);
#ifdef USE_AKONADI
// explicit KAEvent(const QSharedPointer<const KCalCore::Event>&);
explicit KAEvent(const KCalCore::ConstEventPtr&);
......@@ -327,7 +327,7 @@ class KALARM_CAL_EXPORT KAEvent
explicit KAEvent(const KCal::Event*);
void set(const KCal::Event* e) { d->set(e); }
#endif
void set(const KDateTime& dt, const QString& message, const QColor& bg, const QColor& fg, const QFont& f, Action act, int lateCancel, int flags, bool changesPending = false)
void set(const KDateTime& dt, const QString& message, const QColor& bg, const QColor& fg, const QFont& f, SubAction act, int lateCancel, int flags, bool changesPending = false)
{ d->set(dt, message, bg, fg, f, act, lateCancel, flags, changesPending); }
void setEmail(uint from, const EmailAddressList&, const QString& subject, const QStringList& attachments);
#ifndef USE_AKONADI
......@@ -429,7 +429,7 @@ class KALARM_CAL_EXPORT KAEvent
bool updateKCalEvent(KCal::Event* e, UidAction u) const
{ return d->updateKCalEvent(e, u); }
#endif
Action actionSubType() const { return (Action)d->mActionType; }
SubAction actionSubType() const { return (SubAction)d->mActionType; }
Actions actionTypes() const;
const QString& id() const { return d->mEventID; }
#ifdef USE_AKONADI
......@@ -523,10 +523,10 @@ class KALARM_CAL_EXPORT KAEvent
bool setRecurMinutely(int freq, int count, const KDateTime& end);
bool setRecurDaily(int freq, const QBitArray& days, int count, const QDate& end);
bool setRecurWeekly(int freq, const QBitArray& days, int count, const QDate& end);
bool setRecurMonthlyByDate(int freq, const QList<int>& days, int count, const QDate& end);
bool setRecurMonthlyByPos(int freq, const QList<MonthPos>& pos, int count, const QDate& end);
bool setRecurAnnualByDate(int freq, const QList<int>& months, int day, KARecurrence::Feb29Type, int count, const QDate& end);
bool setRecurAnnualByPos(int freq, const QList<MonthPos>& pos, const QList<int>& months, int count, const QDate& end);
bool setRecurMonthlyByDate(int freq, const QVector<int>& days, int count, const QDate& end);
bool setRecurMonthlyByPos(int freq, const QVector<MonthPos>& pos, int count, const QDate& end);
bool setRecurAnnualByDate(int freq, const QVector<int>& months, int day, KARecurrence::Feb29Type, int count, const QDate& end);
bool setRecurAnnualByPos(int freq, const QVector<MonthPos>& pos, const QVector<int>& months, int count, const QDate& end);
// static QValueList<MonthPos> convRecurPos(const QValueList<KCal::RecurrenceRule::WDayPos>&);
#ifdef KDE_NO_DEBUG_OUTPUT
void dumpDebug() const { }
......@@ -539,7 +539,7 @@ class KALARM_CAL_EXPORT KAEvent
#ifdef USE_AKONADI
static bool convertKCalEvents(const KCalCore::Calendar::Ptr&, int calendarVersion, bool adjustSummerTime);
// static bool convertRepetitions(KCalCore::MemoryCalendar&);
static List ptrList(QList<KAEvent>&);
static List ptrList(QVector<KAEvent>&);
#else
static bool convertKCalEvents(KCal::CalendarLocal&, int calendarVersion, bool adjustSummerTime);
// static bool convertRepetitions(KCal::CalendarLocal&);
......@@ -552,20 +552,6 @@ class KALARM_CAL_EXPORT KAEvent
static void setWorkTime(const QBitArray& days, const QTime& start, const QTime& end);
private:
#ifdef USE_AKONADI
static bool convertRepetition(const KCalCore::Event::Ptr&);
static bool convertStartOfDay(const KCalCore::Event::Ptr&);
static DateTime readDateTime(const KCalCore::ConstEventPtr&, bool dateOnly, DateTime& start);
static void readAlarms(const KCalCore::ConstEventPtr&, void* alarmMap, bool cmdDisplay = false);
static void readAlarm(const KCalCore::ConstAlarmPtr&, AlarmData&, bool audioMain, bool cmdDisplay = false);
#else
static bool convertRepetition(KCal::Event*);
static bool convertStartOfDay(KCal::Event*);
static DateTime readDateTime(const KCal::Event*, bool dateOnly, DateTime& start);
static void readAlarms(const KCal::Event*, void* alarmMap, bool cmdDisplay = false);
static void readAlarm(const KCal::Alarm*, AlarmData&, bool audioMain, bool cmdDisplay = false);
#endif
class Private : public KAAlarmEventBase, public QSharedData
{
public:
......@@ -583,7 +569,7 @@ class KALARM_CAL_EXPORT KAEvent
Private();
Private(const KDateTime&, const QString& message, const QColor& bg, const QColor& fg,
const QFont& f, Action, int lateCancel, int flags, bool changesPending = false);
const QFont& f, SubAction, int lateCancel, int flags, bool changesPending = false);
#ifdef USE_AKONADI
explicit Private(const KCalCore::ConstEventPtr&);
#else
......@@ -597,7 +583,7 @@ class KALARM_CAL_EXPORT KAEvent
#else
void set(const KCal::Event*);
#endif
void set(const KDateTime&, const QString& message, const QColor& bg, const QColor& fg, const QFont&, Action, int lateCancel, int flags, bool changesPending = false);
void set(const KDateTime&, const QString& message, const QColor& bg, const QColor& fg, const QFont&, SubAction, int lateCancel, int flags, bool changesPending = false);
void setAudioFile(const QString& filename, float volume, float fadeVolume, int fadeSeconds, bool allowEmptyFile);
OccurType setNextOccurrence(const KDateTime& preDateTime);
void setFirstRecurrence();
......@@ -655,6 +641,20 @@ class KALARM_CAL_EXPORT KAEvent
#else
void dumpDebug() const;
#endif
#ifdef USE_AKONADI
static bool convertRepetition(const KCalCore::Event::Ptr&);
static bool convertStartOfDay(const KCalCore::Event::Ptr&);
static DateTime readDateTime(const KCalCore::ConstEventPtr&, bool dateOnly, DateTime& start);
static void readAlarms(const KCalCore::ConstEventPtr&, void* alarmMap, bool cmdDisplay = false);
static void readAlarm(const KCalCore::ConstAlarmPtr&, AlarmData&, bool audioMain, bool cmdDisplay = false);
#else
static bool convertRepetition(KCal::Event*);
static bool convertStartOfDay(KCal::Event*);
static DateTime readDateTime(const KCal::Event*, bool dateOnly, DateTime& start);
static void readAlarms(const KCal::Event*, void* alarmMap, bool cmdDisplay = false);
static void readAlarm(const KCal::Alarm*, AlarmData&, bool audioMain, bool cmdDisplay = false);
#endif
private:
void copy(const Private&);
bool mayOccurDailyDuringWork(const KDateTime&) const;
......
......@@ -51,7 +51,7 @@ class CommandOptions
QString eventId() const { return mEventId; }
QString templateName() const { return mTemplateName; }
EditAlarmDlg::Type editType() const { return mEditType; }
KAEvent::Action editAction() const { return mEditAction; }
KAEvent::SubAction editAction() const { return mEditAction; }
QString text() const { return mText; }
KDateTime alarmTime() const { return mAlarmTime; }
KARecurrence* recurrence() const { return mRecurrence; }
......@@ -91,7 +91,7 @@ class CommandOptions
QString mEventId; // TRIGGER_EVENT, CANCEL_EVENT, EDIT: event ID
QString mTemplateName; // EDIT_NEW_PRESET: template name
EditAlarmDlg::Type mEditType; // NEW, EDIT_NEW_*: alarm edit type
KAEvent::Action mEditAction; // NEW: alarm edit sub-type
KAEvent::SubAction mEditAction; // NEW: alarm edit sub-type
bool mEditActionSet; // NEW: mEditAction is valid
QString mText; // NEW: alarm text
KDateTime mAlarmTime; // NEW: alarm time
......
/*
* dbushandler.cpp - handler for D-Bus calls by other applications
* Program: kalarm
* Copyright © 2002-2010 by David Jarvie <djarvie@kde.org>
* Copyright © 2002-2011 by David Jarvie <djarvie@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -276,7 +276,7 @@ bool DBusHandler::scheduleMessage(const QString& message, const KDateTime& start
const Duration& subRepeatDuration, int subRepeatCount)
{
unsigned kaEventFlags = convertStartFlags(start, flags);
KAEvent::Action action = (kaEventFlags & KAEvent::DISPLAY_COMMAND) ? KAEvent::COMMAND : KAEvent::MESSAGE;
KAEvent::SubAction action = (kaEventFlags & KAEvent::DISPLAY_COMMAND) ? KAEvent::COMMAND : KAEvent::MESSAGE;
QColor bg = convertBgColour(bgColor);
if (!bg.isValid())
return false;
......
......@@ -140,7 +140,7 @@ EditAlarmDlg* EditAlarmDlg::create(bool Template, const KAEvent* event, bool new
* = false to edit/create an alarm.
* event != to initialise the dialog to show the specified event's data.
*/
EditAlarmDlg::EditAlarmDlg(bool Template, KAEvent::Action action, QWidget* parent, GetResourceType getResource)
EditAlarmDlg::EditAlarmDlg(bool Template, KAEvent::SubAction action, QWidget* parent, GetResourceType getResource)
: KDialog(parent),
mAlarmType(action),
mMainPageShown(false),
......@@ -553,7 +553,7 @@ void EditAlarmDlg::initValues(const KAEvent* event)
}
}
KAEvent::Action action = event->actionSubType();
KAEvent::SubAction action = event->actionSubType();
AlarmText altext;
if (event->commandScript())
altext.setScript(event->cleanText());
......
/*
* editdlg.h - dialog to create or modify an alarm or alarm template
* Program: kalarm
* Copyright © 2001-2010 by David Jarvie <djarvie@kde.org>
* Copyright © 2001-2011 by David Jarvie <djarvie@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -84,7 +84,7 @@ class EditAlarmDlg : public KDialog
void setTime(const DateTime&); // must be called first to set date-only value
void setRecurrence(const KARecurrence&, int subRepeatInterval, int subRepeatCount);
void setRepeatAtLogin();
virtual void setAction(KAEvent::Action, const AlarmText& = AlarmText()) = 0;
virtual void setAction(KAEvent::SubAction, const AlarmText& = AlarmText()) = 0;
void setLateCancel(int minutes);
void setShowInKOrganizer(bool);
......@@ -93,7 +93,7 @@ class EditAlarmDlg : public KDialog
static QString i18n_chk_ShowInKOrganizer(); // text of 'Show in KOrganizer' checkbox
protected:
EditAlarmDlg(bool Template, KAEvent::Action, QWidget* parent = 0,
EditAlarmDlg(bool Template, KAEvent::SubAction, QWidget* parent = 0,
GetResourceType = RES_PROMPT);
EditAlarmDlg(bool Template, const KAEvent*, bool newAlarm, QWidget* parent = 0,
GetResourceType = RES_PROMPT, bool readOnly = false);
......@@ -154,7 +154,7 @@ class EditAlarmDlg : public KDialog
void showOptions(bool more);
protected:
KAEvent::Action mAlarmType; // actual alarm type
KAEvent::SubAction mAlarmType; // actual alarm type
private:
KTabWidget* mTabs; // the tabs in the dialog
StackedScrollGroup* mTabScrollGroup;
......
......@@ -386,7 +386,7 @@ void EditDisplayAlarmDlg::setColours(const QColor& fgColour, const QColor& bgCol
/******************************************************************************
* Set the dialog's action and the action's text.
*/
void EditDisplayAlarmDlg::setAction(KAEvent::Action action, const AlarmText& alarmText)
void EditDisplayAlarmDlg::setAction(KAEvent::SubAction action, const AlarmText& alarmText)
{
QString text = alarmText.displayText();
switch (action)
......@@ -541,7 +541,7 @@ bool EditDisplayAlarmDlg::type_stateChanged() const
*/
void EditDisplayAlarmDlg::type_setEvent(KAEvent& event, const KDateTime& dt, const QString& text, int lateCancel, bool trial)
{
KAEvent::Action type;
KAEvent::SubAction type;
switch (mTypeCombo->currentIndex())
{
case tFILE: type = KAEvent::FILE; break;
......@@ -853,7 +853,7 @@ void EditCommandAlarmDlg::type_showOptions(bool more)
/******************************************************************************
* Set the dialog's action and the action's text.
*/
void EditCommandAlarmDlg::setAction(KAEvent::Action action, const AlarmText& alarmText)
void EditCommandAlarmDlg::setAction(KAEvent::SubAction action, const AlarmText& alarmText)
{
Q_UNUSED(action);
Q_ASSERT(action == KAEvent::COMMAND);
......@@ -1185,7 +1185,7 @@ void EditEmailAlarmDlg::attachmentEnable()
/******************************************************************************
* Set the dialog's action and the action's text.
*/
void EditEmailAlarmDlg::setAction(KAEvent::Action action, const AlarmText& alarmText)
void EditEmailAlarmDlg::setAction(KAEvent::SubAction action, const AlarmText& alarmText)
{
Q_UNUSED(action);
Q_ASSERT(action == KAEvent::EMAIL);
......@@ -1523,7 +1523,7 @@ void EditAudioAlarmDlg::setAudio(const QString& file, float volume)
/******************************************************************************
* Set the dialog's action and the action's text.
*/
void EditAudioAlarmDlg::setAction(KAEvent::Action action, const AlarmText& alarmText)
void EditAudioAlarmDlg::setAction(KAEvent::SubAction action, const AlarmText& alarmText)
{
Q_UNUSED(action);
Q_ASSERT(action == KAEvent::AUDIO);
......
......@@ -59,7 +59,7 @@ class EditDisplayAlarmDlg : public EditAlarmDlg
// Methods to initialise values in the New Alarm dialogue.
// N.B. setTime() must be called first to set the date-only characteristic,
// followed by setRecurrence().
virtual void setAction(KAEvent::Action, const AlarmText& = AlarmText());
virtual void setAction(KAEvent::SubAction, const AlarmText& = AlarmText());
void setBgColour(const QColor&);
void setFgColour(const QColor&);
void setConfirmAck(bool);
......@@ -150,7 +150,7 @@ class EditCommandAlarmDlg : public EditAlarmDlg
// Methods to initialise values in the New Alarm dialogue.
// N.B. setTime() must be called first to set the date-only characteristic,
// followed by setRecurrence().
virtual void setAction(KAEvent::Action, const AlarmText& = AlarmText());
virtual void setAction(KAEvent::SubAction, const AlarmText& = AlarmText());
static QString i18n_chk_EnterScript(); // text of 'Enter a script' checkbox
static QString i18n_radio_ExecInTermWindow(); // text of 'Execute in terminal window' radio button
......@@ -202,7 +202,7 @@ class EditEmailAlarmDlg : public EditAlarmDlg
// Methods to initialise values in the New Alarm dialogue.
// N.B. setTime() must be called first to set the date-only characteristic,
// followed by setRecurrence().
virtual void setAction(KAEvent::Action, const AlarmText& = AlarmText());
virtual void setAction(KAEvent::SubAction, const AlarmText& = AlarmText());
void setEmailFields(uint fromID, const EmailAddressList&, const QString& subject,
const QStringList& attachments);
void setBcc(bool);
......@@ -266,7 +266,7 @@ class EditAudioAlarmDlg : public EditAlarmDlg
// Methods to initialise values in the New Alarm dialogue.
// N.B. setTime() must be called first to set the date-only characteristic,
// followed by setRecurrence().
virtual void setAction(KAEvent::Action, const AlarmText& = AlarmText());
virtual void setAction(KAEvent::SubAction, const AlarmText& = AlarmText());
void setAudio(const QString& file, float volume = -1);
protected:
......
......@@ -146,13 +146,13 @@ kDebug(0)<<"SelectedEvent() count="<<list.count();
* Return the selected events.
*/
#ifdef USE_AKONADI
QList<KAEvent> EventListView::selectedEvents() const
QVector<KAEvent> EventListView::selectedEvents() const
#else
KAEvent::List EventListView::selectedEvents() const
#endif
{
#ifdef USE_AKONADI
QList<KAEvent> elist;
QVector<KAEvent> elist;
#else
KAEvent::List elist;
#endif
......
......@@ -56,7 +56,7 @@ class EventListView : public QTreeView
QModelIndex selectedIndex() const;
#ifdef USE_AKONADI
KAEvent selectedEvent() const;
QList<KAEvent> selectedEvents() const;
QVector<KAEvent> selectedEvents() const;
#else
KAEvent* selectedEvent() const;
KAEvent::List selectedEvents() const;
......
......@@ -273,7 +273,7 @@ UpdateStatus addEvent(KAEvent& event, AlarmResource* calendar, QWidget* msgParen
* Save them in the calendar file and add them to every main window instance.
* The events are updated with their actual event IDs.
*/
UpdateStatus addEvents(QList<KAEvent>& events, QWidget* msgParent, bool allowKOrgUpdate, bool showKOrgErr)
UpdateStatus addEvents(QVector<KAEvent>& events, QWidget* msgParent, bool allowKOrgUpdate, bool showKOrgErr)
{