Fixed KAlarm building warnings. Minor style patch up. Fixed possible error in treating deferred evens (see kalarm/alarmevent.cpp:1739).

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/21/head
Michele Calgaro 9 years ago
parent 74a91e1315
commit c036d97d35

@ -373,7 +373,7 @@ bool AlarmCalendar::reload()
*/ */
bool AlarmCalendar::saveCal(const TQString& newFile) bool AlarmCalendar::saveCal(const TQString& newFile)
{ {
if (!mCalendar || !mOpen && newFile.isNull()) if (!mCalendar || (!mOpen && newFile.isNull()))
return false; return false;
kdDebug(5950) << "AlarmCalendar::saveCal(\"" << newFile << "\", " << mType << ")\n"; kdDebug(5950) << "AlarmCalendar::saveCal(\"" << newFile << "\", " << mType << ")\n";
@ -638,7 +638,7 @@ void AlarmCalendar::setPurgeDays(int days)
mPurgeDays = days; mPurgeDays = days;
if (mPurgeDays <= 0) if (mPurgeDays <= 0)
StartOfDayTimer::disconnect(this); StartOfDayTimer::disconnect(this);
if (oldDays < 0 || days >= 0 && days < oldDays) if (oldDays < 0 || (days >= 0 && days < oldDays))
{ {
// Alarms are now being kept for less long, so purge them // Alarms are now being kept for less long, so purge them
if (open()) if (open())

@ -977,8 +977,8 @@ Event* KAEvent::event() const
*/ */
bool KAEvent::updateKCalEvent(Event& ev, bool checkUid, bool original, bool cancelCancelledDefer) const bool KAEvent::updateKCalEvent(Event& ev, bool checkUid, bool original, bool cancelCancelledDefer) const
{ {
if (checkUid && !mEventID.isEmpty() && mEventID != ev.uid() if ((checkUid && !mEventID.isEmpty() && mEventID != ev.uid())
|| !mAlarmCount && (!original || !mMainExpired)) || (!mAlarmCount && (!original || !mMainExpired)))
return false; return false;
checkRecur(); // ensure recurrence/repetition data is consistent checkRecur(); // ensure recurrence/repetition data is consistent
@ -1089,7 +1089,7 @@ bool KAEvent::updateKCalEvent(Event& ev, bool checkUid, bool original, bool canc
} }
// Add subsidiary alarms // Add subsidiary alarms
if (mRepeatAtLogin || mArchiveRepeatAtLogin && original) if (mRepeatAtLogin || (mArchiveRepeatAtLogin && original))
{ {
DateTime dtl; DateTime dtl;
if (mArchiveRepeatAtLogin) if (mArchiveRepeatAtLogin)
@ -1107,7 +1107,7 @@ bool KAEvent::updateKCalEvent(Event& ev, bool checkUid, bool original, bool canc
ancillaryType = 1; ancillaryType = 1;
} }
} }
if (mReminderMinutes || mArchiveReminderMinutes && original) if (mReminderMinutes || (mArchiveReminderMinutes && original))
{ {
int minutes = mReminderMinutes ? mReminderMinutes : mArchiveReminderMinutes; int minutes = mReminderMinutes ? mReminderMinutes : mArchiveReminderMinutes;
initKCalAlarm(ev, -minutes * 60, TQStringList(mReminderOnceOnly ? REMINDER_ONCE_TYPE : REMINDER_TYPE)); initKCalAlarm(ev, -minutes * 60, TQStringList(mReminderOnceOnly ? REMINDER_ONCE_TYPE : REMINDER_TYPE));
@ -1117,7 +1117,7 @@ bool KAEvent::updateKCalEvent(Event& ev, bool checkUid, bool original, bool canc
ancillaryType = 2; ancillaryType = 2;
} }
} }
if (mDeferral > 0 || mDeferral == CANCEL_DEFERRAL && !cancelCancelledDefer) if (mDeferral > 0 || (mDeferral == CANCEL_DEFERRAL && !cancelCancelledDefer))
{ {
DateTime nextDateTime = mNextMainDateTime; DateTime nextDateTime = mNextMainDateTime;
if (mMainExpired) if (mMainExpired)
@ -1736,7 +1736,7 @@ bool KAEvent::setDisplaying(const KAEvent& event, KAAlarm::Type alarmType, const
setUid(DISPLAYING); setUid(DISPLAYING);
mDisplaying = true; mDisplaying = true;
mDisplayingTime = (alarmType == KAAlarm::AT_LOGIN_ALARM) ? repeatAtLoginTime : al.dateTime(); mDisplayingTime = (alarmType == KAAlarm::AT_LOGIN_ALARM) ? repeatAtLoginTime : al.dateTime();
switch (al.type()) switch (al.subType())
{ {
case KAAlarm::AT_LOGIN__ALARM: mDisplayingFlags = REPEAT_AT_LOGIN; break; case KAAlarm::AT_LOGIN__ALARM: mDisplayingFlags = REPEAT_AT_LOGIN; break;
case KAAlarm::REMINDER__ALARM: mDisplayingFlags = REMINDER; break; case KAAlarm::REMINDER__ALARM: mDisplayingFlags = REMINDER; break;

@ -61,32 +61,32 @@ class KAAlarmEventBase
TQString message() const { return (mActionType == T_MESSAGE || mActionType == T_EMAIL) ? mText : TQString(); } TQString message() const { return (mActionType == T_MESSAGE || mActionType == T_EMAIL) ? mText : TQString(); }
TQString fileName() const { return (mActionType == T_FILE) ? mText : TQString(); } TQString fileName() const { return (mActionType == T_FILE) ? mText : TQString(); }
TQString command() const { return (mActionType == T_COMMAND) ? mText : TQString(); } TQString command() const { return (mActionType == T_COMMAND) ? mText : TQString(); }
uint emailFromId() const { return mEmailFromIdentity; } uint emailFromId() const { return mEmailFromIdentity; }
const EmailAddressList& emailAddresses() const { return mEmailAddresses; } const EmailAddressList& emailAddresses() const { return mEmailAddresses; }
TQString emailAddresses(const TQString& sep) const { return mEmailAddresses.join(sep); } TQString emailAddresses(const TQString& sep) const { return mEmailAddresses.join(sep); }
const TQString& emailSubject() const { return mEmailSubject; } const TQString& emailSubject() const { return mEmailSubject; }
const TQStringList& emailAttachments() const { return mEmailAttachments; } const TQStringList& emailAttachments() const { return mEmailAttachments; }
TQString emailAttachments(const TQString& sep) const { return mEmailAttachments.join(sep); } TQString emailAttachments(const TQString& sep) const { return mEmailAttachments.join(sep); }
bool emailBcc() const { return mEmailBcc; } bool emailBcc() const { return mEmailBcc; }
const TQColor& bgColour() const { return mBgColour; } const TQColor& bgColour() const { return mBgColour; }
const TQColor& fgColour() const { return mFgColour; } const TQColor& fgColour() const { return mFgColour; }
bool defaultFont() const { return mDefaultFont; } bool defaultFont() const { return mDefaultFont; }
const TQFont& font() const; const TQFont& font() const;
int lateCancel() const { return mLateCancel; } int lateCancel() const { return mLateCancel; }
bool autoClose() const { return mAutoClose; } bool autoClose() const { return mAutoClose; }
bool commandScript() const { return mCommandScript; } bool commandScript() const { return mCommandScript; }
bool confirmAck() const { return mConfirmAck; } bool confirmAck() const { return mConfirmAck; }
bool repeatAtLogin() const { return mRepeatAtLogin; } bool repeatAtLogin() const { return mRepeatAtLogin; }
int repeatCount() const { return mRepeatCount; } int repeatCount() const { return mRepeatCount; }
int repeatInterval() const { return mRepeatInterval; } int repeatInterval() const { return mRepeatInterval; }
bool displaying() const { return mDisplaying; } bool displaying() const { return mDisplaying; }
bool beep() const { return mBeep; } bool beep() const { return mBeep; }
bool speak() const { return (mActionType == T_MESSAGE) && mSpeak; } bool speak() const { return (mActionType == T_MESSAGE) && mSpeak; }
int flags() const; int flags() const;
#ifdef NDEBUG #ifdef NDEBUG
void dumpDebug() const { } void dumpDebug() const { }
#else #else
void dumpDebug() const; void dumpDebug() const;
#endif #endif
protected: protected:
@ -99,16 +99,16 @@ class KAAlarmEventBase
void copy(const KAAlarmEventBase&); void copy(const KAAlarmEventBase&);
void set(int flags); void set(int flags);
TQString mEventID; // UID: KCal::Event unique ID TQString mEventID; // UID: KCal::Event unique ID
TQString mText; // message text, file URL, command, email body [or audio file for KAAlarm] TQString mText; // message text, file URL, command, email body [or audio file for KAAlarm]
DateTime mNextMainDateTime; // next time to display the alarm, excluding repetitions DateTime mNextMainDateTime; // next time to display the alarm, excluding repetitions
TQColor mBgColour; // background colour of alarm message TQColor mBgColour; // background colour of alarm message
TQColor mFgColour; // foreground colour of alarm message, or invalid for default TQColor mFgColour; // foreground colour of alarm message, or invalid for default
TQFont mFont; // font of alarm message (ignored if mDefaultFont true) TQFont mFont; // font of alarm message (ignored if mDefaultFont true)
uint mEmailFromIdentity;// KMail identity for email 'From' field, or empty uint mEmailFromIdentity;// KMail identity for email 'From' field, or empty
EmailAddressList mEmailAddresses; // ATTENDEE: addresses to send email to EmailAddressList mEmailAddresses; // ATTENDEE: addresses to send email to
TQString mEmailSubject; // SUMMARY: subject line of email TQString mEmailSubject; // SUMMARY: subject line of email
TQStringList mEmailAttachments; // ATTACH: email attachment file names TQStringList mEmailAttachments; // ATTACH: email attachment file names
float mSoundVolume; // volume for sound file, or < 0 for unspecified float mSoundVolume; // volume for sound file, or < 0 for unspecified
float mFadeVolume; // initial volume for sound file, or < 0 for no fade float mFadeVolume; // initial volume for sound file, or < 0 for no fade
int mFadeSeconds; // fade time for sound file, or 0 if none int mFadeSeconds; // fade time for sound file, or 0 if none
@ -194,13 +194,13 @@ class KAAlarm : public KAAlarmEventBase
bool valid() const { return mType != INVALID__ALARM; } bool valid() const { return mType != INVALID__ALARM; }
Type type() const { return static_cast<Type>(mType & ~TIMED_DEFERRAL_FLAG); } Type type() const { return static_cast<Type>(mType & ~TIMED_DEFERRAL_FLAG); }
SubType subType() const { return mType; } SubType subType() const { return mType; }
const TQString& eventID() const { return mEventID; } const TQString& eventID() const { return mEventID; }
DateTime dateTime(bool withRepeats = false) const DateTime dateTime(bool withRepeats = false) const
{ return (withRepeats && mNextRepeat && mRepeatInterval) { return (withRepeats && mNextRepeat && mRepeatInterval)
? mNextMainDateTime.addSecs(mNextRepeat * mRepeatInterval * 60) : mNextMainDateTime; } ? mNextMainDateTime.addSecs(mNextRepeat * mRepeatInterval * 60) : mNextMainDateTime; }
TQDate date() const { return mNextMainDateTime.date(); } TQDate date() const { return mNextMainDateTime.date(); }
TQTime time() const { return mNextMainDateTime.time(); } TQTime time() const { return mNextMainDateTime.time(); }
TQString audioFile() const { return (mActionType == T_AUDIO) && !mBeep ? mText : TQString(); } TQString audioFile() const { return (mActionType == T_AUDIO) && !mBeep ? mText : TQString(); }
float soundVolume() const { return (mActionType == T_AUDIO) && !mBeep && !mText.isEmpty() ? mSoundVolume : -1; } float soundVolume() const { return (mActionType == T_AUDIO) && !mBeep && !mText.isEmpty() ? mSoundVolume : -1; }
float fadeVolume() const { return (mActionType == T_AUDIO) && mSoundVolume >= 0 && mFadeSeconds && !mBeep && !mText.isEmpty() ? mFadeVolume : -1; } float fadeVolume() const { return (mActionType == T_AUDIO) && mSoundVolume >= 0 && mFadeSeconds && !mBeep && !mText.isEmpty() ? mFadeVolume : -1; }
int fadeSeconds() const { return (mActionType == T_AUDIO) && mSoundVolume >= 0 && mFadeVolume >= 0 && !mBeep && !mText.isEmpty() ? mFadeSeconds : 0; } int fadeSeconds() const { return (mActionType == T_AUDIO) && mSoundVolume >= 0 && mFadeVolume >= 0 && !mBeep && !mText.isEmpty() ? mFadeSeconds : 0; }
@ -324,10 +324,10 @@ class KAEvent : public KAAlarmEventBase
void setActions(const TQString& pre, const TQString& post) { mPreAction = pre; mPostAction = post; mUpdated = true; } void setActions(const TQString& pre, const TQString& post) { mPreAction = pre; mPostAction = post; mUpdated = true; }
OccurType setNextOccurrence(const TQDateTime& preDateTime); OccurType setNextOccurrence(const TQDateTime& preDateTime);
void setFirstRecurrence(); void setFirstRecurrence();
void setEventID(const TQString& id) { mEventID = id; mUpdated = true; } void setEventID(const TQString& id) { mEventID = id; mUpdated = true; }
void setDate(const TQDate& d) { mNextMainDateTime.set(d); mUpdated = true; } void setDate(const TQDate& d) { mNextMainDateTime.set(d); mUpdated = true; }
void setTime(const TQDateTime& dt) { mNextMainDateTime.set(dt); mUpdated = true; } void setTime(const TQDateTime& dt) { mNextMainDateTime.set(dt); mUpdated = true; }
void setSaveDateTime(const TQDateTime& dt) { mSaveDateTime = dt; mUpdated = true; } void setSaveDateTime(const TQDateTime& dt) { mSaveDateTime = dt; mUpdated = true; }
void setLateCancel(int lc) { mLateCancel = lc; mUpdated = true; } void setLateCancel(int lc) { mLateCancel = lc; mUpdated = true; }
void setAutoClose(bool ac) { mAutoClose = ac; mUpdated = true; } void setAutoClose(bool ac) { mAutoClose = ac; mUpdated = true; }
void setRepeatAtLogin(bool rl) { mRepeatAtLogin = rl; mUpdated = true; } void setRepeatAtLogin(bool rl) { mRepeatAtLogin = rl; mUpdated = true; }
@ -350,7 +350,7 @@ class KAEvent : public KAAlarmEventBase
KCal::Event* event() const; // convert to new Event KCal::Event* event() const; // convert to new Event
bool isTemplate() const { return !mTemplateName.isEmpty(); } bool isTemplate() const { return !mTemplateName.isEmpty(); }
const TQString& templateName() const { return mTemplateName; } const TQString& templateName() const { return mTemplateName; }
bool usingDefaultTime() const { return mTemplateAfterTime == 0; } bool usingDefaultTime() const { return mTemplateAfterTime == 0; }
int templateAfterTime() const { return mTemplateAfterTime; } int templateAfterTime() const { return mTemplateAfterTime; }
KAAlarm alarm(KAAlarm::Type) const; KAAlarm alarm(KAAlarm::Type) const;
@ -361,15 +361,15 @@ class KAEvent : public KAAlarmEventBase
bool updateKCalEvent(KCal::Event&, bool checkUid = true, bool original = false, bool cancelCancelledDefer = false) const; bool updateKCalEvent(KCal::Event&, bool checkUid = true, bool original = false, bool cancelCancelledDefer = false) const;
Action action() const { return (Action)mActionType; } Action action() const { return (Action)mActionType; }
bool displayAction() const { return mActionType == T_MESSAGE || mActionType == T_FILE; } bool displayAction() const { return mActionType == T_MESSAGE || mActionType == T_FILE; }
const TQString& id() const { return mEventID; } const TQString& id() const { return mEventID; }
bool valid() const { return mAlarmCount && (mAlarmCount != 1 || !mRepeatAtLogin); } bool valid() const { return mAlarmCount && (mAlarmCount != 1 || !mRepeatAtLogin); }
int alarmCount() const { return mAlarmCount; } int alarmCount() const { return mAlarmCount; }
const DateTime& startDateTime() const { return mStartDateTime; } const DateTime& startDateTime() const { return mStartDateTime; }
DateTime mainDateTime(bool withRepeats = false) const DateTime mainDateTime(bool withRepeats = false) const
{ return (withRepeats && mNextRepeat && mRepeatInterval) { return (withRepeats && mNextRepeat && mRepeatInterval)
? mNextMainDateTime.addSecs(mNextRepeat * mRepeatInterval * 60) : mNextMainDateTime; } ? mNextMainDateTime.addSecs(mNextRepeat * mRepeatInterval * 60) : mNextMainDateTime; }
TQDate mainDate() const { return mNextMainDateTime.date(); } TQDate mainDate() const { return mNextMainDateTime.date(); }
TQTime mainTime() const { return mNextMainDateTime.time(); } TQTime mainTime() const { return mNextMainDateTime.time(); }
DateTime mainEndRepeatTime() const { return (mRepeatCount > 0 && mRepeatInterval) DateTime mainEndRepeatTime() const { return (mRepeatCount > 0 && mRepeatInterval)
? mNextMainDateTime.addSecs(mRepeatCount * mRepeatInterval * 60) : mNextMainDateTime; } ? mNextMainDateTime.addSecs(mRepeatCount * mRepeatInterval * 60) : mNextMainDateTime; }
int reminder() const { return mReminderMinutes; } int reminder() const { return mReminderMinutes; }
@ -380,25 +380,25 @@ class KAEvent : public KAAlarmEventBase
DateTime deferralLimit(DeferLimitType* = 0) const; DateTime deferralLimit(DeferLimitType* = 0) const;
int deferDefaultMinutes() const { return mDeferDefaultMinutes; } int deferDefaultMinutes() const { return mDeferDefaultMinutes; }
DateTime displayDateTime() const; DateTime displayDateTime() const;
const TQString& messageFileOrCommand() const { return mText; } const TQString& messageFileOrCommand() const { return mText; }
TQString logFile() const { return mLogFile; } TQString logFile() const { return mLogFile; }
bool commandXterm() const { return mCommandXterm; } bool commandXterm() const { return mCommandXterm; }
unsigned long kmailSerialNumber() const { return mKMailSerialNumber; } unsigned long kmailSerialNumber() const { return mKMailSerialNumber; }
bool copyToKOrganizer() const { return mCopyToKOrganizer; } bool copyToKOrganizer() const { return mCopyToKOrganizer; }
const TQString& audioFile() const { return mAudioFile; } const TQString& audioFile() const { return mAudioFile; }
float soundVolume() const { return !mAudioFile.isEmpty() ? mSoundVolume : -1; } float soundVolume() const { return !mAudioFile.isEmpty() ? mSoundVolume : -1; }
float fadeVolume() const { return !mAudioFile.isEmpty() && mSoundVolume >= 0 && mFadeSeconds ? mFadeVolume : -1; } float fadeVolume() const { return !mAudioFile.isEmpty() && mSoundVolume >= 0 && mFadeSeconds ? mFadeVolume : -1; }
int fadeSeconds() const { return !mAudioFile.isEmpty() && mSoundVolume >= 0 && mFadeVolume >= 0 ? mFadeSeconds : 0; } int fadeSeconds() const { return !mAudioFile.isEmpty() && mSoundVolume >= 0 && mFadeVolume >= 0 ? mFadeSeconds : 0; }
bool repeatSound() const { return mRepeatSound && !mAudioFile.isEmpty(); } bool repeatSound() const { return mRepeatSound && !mAudioFile.isEmpty(); }
const TQString& preAction() const { return mPreAction; } const TQString& preAction() const { return mPreAction; }
const TQString& postAction() const { return mPostAction; } const TQString& postAction() const { return mPostAction; }
bool recurs() const { return checkRecur() != KARecurrence::NO_RECUR; } bool recurs() const { return checkRecur() != KARecurrence::NO_RECUR; }
KARecurrence::Type recurType() const { return checkRecur(); } KARecurrence::Type recurType() const { return checkRecur(); }
KARecurrence* recurrence() const { return mRecurrence; } KARecurrence* recurrence() const { return mRecurrence; }
int recurInterval() const; // recurrence period in units of the recurrence period type (minutes, days, etc) int recurInterval() const; // recurrence period in units of the recurrence period type (minutes, days, etc)
int longestRecurrenceInterval() const { return mRecurrence ? mRecurrence->longestInterval() : 0; } int longestRecurrenceInterval() const { return mRecurrence ? mRecurrence->longestInterval() : 0; }
TQString recurrenceText(bool brief = false) const; TQString recurrenceText(bool brief = false) const;
TQString repetitionText(bool brief = false) const; TQString repetitionText(bool brief = false) const;
bool occursAfter(const TQDateTime& preDateTime, bool includeRepetitions) const; bool occursAfter(const TQDateTime& preDateTime, bool includeRepetitions) const;
OccurType nextOccurrence(const TQDateTime& preDateTime, DateTime& result, OccurOption = IGNORE_REPETITION) const; OccurType nextOccurrence(const TQDateTime& preDateTime, DateTime& result, OccurOption = IGNORE_REPETITION) const;
OccurType previousOccurrence(const TQDateTime& afterDateTime, DateTime& result, bool includeRepetitions = false) const; OccurType previousOccurrence(const TQDateTime& afterDateTime, DateTime& result, bool includeRepetitions = false) const;
@ -408,10 +408,10 @@ class KAEvent : public KAAlarmEventBase
bool enabled() const { return mEnabled; } bool enabled() const { return mEnabled; }
bool updated() const { return mUpdated; } bool updated() const { return mUpdated; }
bool mainExpired() const { return mMainExpired; } bool mainExpired() const { return mMainExpired; }
bool expired() const { return mDisplaying && mMainExpired || uidStatus(mEventID) == EXPIRED; } bool expired() const { return (mDisplaying && mMainExpired) || uidStatus(mEventID) == EXPIRED; }
Status uidStatus() const { return uidStatus(mEventID); } Status uidStatus() const { return uidStatus(mEventID); }
static Status uidStatus(const TQString& uid); static Status uidStatus(const TQString& uid);
static TQString uid(const TQString& id, Status); static TQString uid(const TQString& id, Status);
static KAEvent findTemplateName(AlarmCalendar&, const TQString& name); static KAEvent findTemplateName(AlarmCalendar&, const TQString& name);
struct MonthPos struct MonthPos
@ -437,7 +437,7 @@ class KAEvent : public KAAlarmEventBase
void dumpDebug() const; void dumpDebug() const;
#endif #endif
static int calVersion(); static int calVersion();
static TQString calVersionString(); static TQString calVersionString();
static bool adjustStartOfDay(const KCal::Event::List&); static bool adjustStartOfDay(const KCal::Event::List&);
static void convertKCalEvents(KCal::Calendar&, int version, bool adjustSummerTime); static void convertKCalEvents(KCal::Calendar&, int version, bool adjustSummerTime);
static void convertRepetitions(KCal::CalendarLocal&); static void convertRepetitions(KCal::CalendarLocal&);
@ -467,13 +467,13 @@ class KAEvent : public KAAlarmEventBase
inline void set_reminder(int minutes); inline void set_reminder(int minutes);
inline void set_archiveReminder(); inline void set_archiveReminder();
TQString mTemplateName; // alarm template's name, or null if normal event TQString mTemplateName; // alarm template's name, or null if normal event
TQString mAudioFile; // ATTACH: audio file to play TQString mAudioFile; // ATTACH: audio file to play
TQString mPreAction; // command to execute before alarm is displayed TQString mPreAction; // command to execute before alarm is displayed
TQString mPostAction; // command to execute after alarm window is closed TQString mPostAction; // command to execute after alarm window is closed
DateTime mStartDateTime; // DTSTART and DTEND: start and end time for event DateTime mStartDateTime; // DTSTART and DTEND: start and end time for event
TQDateTime mSaveDateTime; // CREATED: date event was created, or saved in expired calendar TQDateTime mSaveDateTime; // CREATED: date event was created, or saved in expired calendar
TQDateTime mAtLoginDateTime; // repeat-at-login time TQDateTime mAtLoginDateTime; // repeat-at-login time
DateTime mDeferralTime; // extra time to trigger alarm (if alarm or reminder deferred) DateTime mDeferralTime; // extra time to trigger alarm (if alarm or reminder deferred)
DateTime mDisplayingTime; // date/time shown in the alarm currently being displayed DateTime mDisplayingTime; // date/time shown in the alarm currently being displayed
int mDisplayingFlags; // type of alarm which is currently being displayed int mDisplayingFlags; // type of alarm which is currently being displayed
@ -486,7 +486,7 @@ class KAEvent : public KAAlarmEventBase
DeferType mDeferral; // whether the alarm is an extra deferred/deferred-reminder alarm DeferType mDeferral; // whether the alarm is an extra deferred/deferred-reminder alarm
unsigned long mKMailSerialNumber;// if email text, message's KMail serial number unsigned long mKMailSerialNumber;// if email text, message's KMail serial number
int mTemplateAfterTime;// time not specified: use n minutes after default time, or -1 (applies to templates only) int mTemplateAfterTime;// time not specified: use n minutes after default time, or -1 (applies to templates only)
TQString mLogFile; // alarm output is to be logged to this URL TQString mLogFile; // alarm output is to be logged to this URL
bool mCommandXterm; // command alarm is to be executed in a terminal window bool mCommandXterm; // command alarm is to be executed in a terminal window
bool mCopyToKOrganizer; // KOrganizer should hold a copy of the event bool mCopyToKOrganizer; // KOrganizer should hold a copy of the event
bool mReminderOnceOnly; // the reminder is output only for the first recurrence bool mReminderOnceOnly; // the reminder is output only for the first recurrence

@ -466,7 +466,7 @@ void AlarmTimeWidget::slotTimer()
{ {
// The current date has reached or has passed the maximum date // The current date has reached or has passed the maximum date
if (now.date() > mMaxDateTime.date() if (now.date() > mMaxDateTime.date()
|| !mAnyTime && now.time() > mTimeEdit->maxTime()) || (!mAnyTime && now.time() > mTimeEdit->maxTime()))
{ {
mPastMax = true; mPastMax = true;
emit pastMax(); emit pastMax();

@ -1052,8 +1052,8 @@ bool EditAlarmDlg::stateChanged() const
{ {
if (mSavedTemplateName != mTemplateName->text() if (mSavedTemplateName != mTemplateName->text()
|| mSavedTemplateTimeType != mTemplateTimeGroup->selected() || mSavedTemplateTimeType != mTemplateTimeGroup->selected()
|| mTemplateUseTime->isOn() && mSavedTemplateTime != mTemplateTime->time() || (mTemplateUseTime->isOn() && mSavedTemplateTime != mTemplateTime->time())
|| mTemplateUseTimeAfter->isOn() && mSavedTemplateAfterTime != mTemplateTimeAfter->value()) || (mTemplateUseTimeAfter->isOn() && mSavedTemplateAfterTime != mTemplateTimeAfter->value()))
return true; return true;
} }
else else
@ -1061,7 +1061,7 @@ bool EditAlarmDlg::stateChanged() const
return true; return true;
if (mSavedTypeRadio != mActionGroup->selected() if (mSavedTypeRadio != mActionGroup->selected()
|| mSavedLateCancel != mLateCancel->minutes() || mSavedLateCancel != mLateCancel->minutes()
|| mShowInKorganizer && mSavedShowInKorganizer != mShowInKorganizer->isChecked() || (mShowInKorganizer && mSavedShowInKorganizer != mShowInKorganizer->isChecked())
|| textFileCommandMessage != mSavedTextFileCommandMessage || textFileCommandMessage != mSavedTextFileCommandMessage
|| mSavedRecurrenceType != mRecurrenceEdit->repeatType()) || mSavedRecurrenceType != mRecurrenceEdit->repeatType())
return true; return true;
@ -1114,7 +1114,7 @@ bool EditAlarmDlg::stateChanged() const
TQStringList emailAttach; TQStringList emailAttach;
for (int i = 0; i < mEmailAttachList->count(); ++i) for (int i = 0; i < mEmailAttachList->count(); ++i)
emailAttach += mEmailAttachList->text(i); emailAttach += mEmailAttachList->text(i);
if (mEmailFromList && mSavedEmailFrom != mEmailFromList->currentIdentityName() if ((mEmailFromList && mSavedEmailFrom != mEmailFromList->currentIdentityName())
|| mSavedEmailTo != mEmailToEdit->text() || mSavedEmailTo != mEmailToEdit->text()
|| mSavedEmailSubject != mEmailSubjectEdit->text() || mSavedEmailSubject != mEmailSubjectEdit->text()
|| mSavedEmailAttach != emailAttach || mSavedEmailAttach != emailAttach
@ -1214,8 +1214,8 @@ void EditAlarmDlg::setEvent(KAEvent& event, const TQString& text, bool trial)
mRecurrenceEdit->updateEvent(event, !mTemplate); mRecurrenceEdit->updateEvent(event, !mTemplate);
TQDateTime now = TQDateTime::currentDateTime(); TQDateTime now = TQDateTime::currentDateTime();
bool dateOnly = mAlarmDateTime.isDateOnly(); bool dateOnly = mAlarmDateTime.isDateOnly();
if (dateOnly && mAlarmDateTime.date() < now.date() if ((dateOnly && mAlarmDateTime.date() < now.date())
|| !dateOnly && mAlarmDateTime.rawDateTime() < now) || (!dateOnly && mAlarmDateTime.rawDateTime() < now))
{ {
// A timed recurrence has an entered start date which has // A timed recurrence has an entered start date which has
// already expired, so we must adjust the next repetition. // already expired, so we must adjust the next repetition.
@ -1390,16 +1390,16 @@ void EditAlarmDlg::slotOk()
} }
TQDateTime now = TQDateTime::currentDateTime(); TQDateTime now = TQDateTime::currentDateTime();
if (mAlarmDateTime.date() < now.date() if (mAlarmDateTime.date() < now.date()
|| mAlarmDateTime.date() == now.date() || (mAlarmDateTime.date() == now.date()
&& !mAlarmDateTime.isDateOnly() && mAlarmDateTime.time() < now.time()) && !mAlarmDateTime.isDateOnly() && mAlarmDateTime.time() < now.time()))
{ {
// A timed recurrence has an entered start date which // A timed recurrence has an entered start date which
// has already expired, so we must adjust it. // has already expired, so we must adjust it.
KAEvent event; KAEvent event;
getEvent(event); // this may adjust mAlarmDateTime getEvent(event); // this may adjust mAlarmDateTime
if (( mAlarmDateTime.date() < now.date() if (( mAlarmDateTime.date() < now.date()
|| mAlarmDateTime.date() == now.date() || (mAlarmDateTime.date() == now.date()
&& !mAlarmDateTime.isDateOnly() && mAlarmDateTime.time() < now.time()) && !mAlarmDateTime.isDateOnly() && mAlarmDateTime.time() < now.time()))
&& event.nextOccurrence(now, mAlarmDateTime, KAEvent::ALLOW_FOR_REPETITION) == KAEvent::NO_OCCURRENCE) && event.nextOccurrence(now, mAlarmDateTime, KAEvent::ALLOW_FOR_REPETITION) == KAEvent::NO_OCCURRENCE)
{ {
KMessageBox::sorry(this, i18n("Recurrence has already expired")); KMessageBox::sorry(this, i18n("Recurrence has already expired"));
@ -1449,7 +1449,7 @@ void EditAlarmDlg::slotOk()
return; return;
} }
if (recurEvent.repeatInterval() % 1440 if (recurEvent.repeatInterval() % 1440
&& (mTemplate && mTemplateAnyTime->isOn() || !mTemplate && mAlarmDateTime.isDateOnly())) && ((mTemplate && mTemplateAnyTime->isOn()) || (!mTemplate && mAlarmDateTime.isDateOnly())))
{ {
KMessageBox::sorry(this, i18n("For a repetition within the recurrence, its period must be in units of days or weeks for a date-only alarm")); KMessageBox::sorry(this, i18n("For a repetition within the recurrence, its period must be in units of days or weeks for a date-only alarm"));
mRecurrenceEdit->activateSubRepetition(); // display the alarm repetition dialog again mRecurrenceEdit->activateSubRepetition(); // display the alarm repetition dialog again

@ -71,25 +71,25 @@ class EditAlarmDlg : public KDialogBase
static CheckBox* createConfirmAckCheckbox(TQWidget* parent, const char* name = 0); static CheckBox* createConfirmAckCheckbox(TQWidget* parent, const char* name = 0);
static TQString i18n_ConfirmAck(); // plain text of 'Confirm acknowledgement' checkbox static TQString i18n_ConfirmAck(); // plain text of 'Confirm acknowledgement' checkbox
static TQString i18n_k_ConfirmAck(); // text of 'Confirm acknowledgement' checkbox, with 'k' shortcut static TQString i18n_k_ConfirmAck(); // text of 'Confirm acknowledgement' checkbox, with 'k' shortcut
static TQString i18n_SpecialActions(); // plain text of 'Special Actions...' button static TQString i18n_SpecialActions(); // plain text of 'Special Actions...' button
static TQString i18n_ShowInKOrganizer(); // plain text of 'Show in KOrganizer' checkbox static TQString i18n_ShowInKOrganizer(); // plain text of 'Show in KOrganizer' checkbox
static TQString i18n_g_ShowInKOrganizer(); // text of 'Show in KOrganizer' checkbox, with 'G' shortcut static TQString i18n_g_ShowInKOrganizer(); // text of 'Show in KOrganizer' checkbox, with 'G' shortcut
static TQString i18n_EnterScript(); // plain text of 'Enter a script' checkbox static TQString i18n_EnterScript(); // plain text of 'Enter a script' checkbox
static TQString i18n_p_EnterScript(); // text of 'Enter a script' checkbox, with 'P' shortcut static TQString i18n_p_EnterScript(); // text of 'Enter a script' checkbox, with 'P' shortcut
static TQString i18n_ExecInTermWindow(); // plain text of 'Execute in terminal window' checkbox static TQString i18n_ExecInTermWindow(); // plain text of 'Execute in terminal window' checkbox
static TQString i18n_w_ExecInTermWindow(); // text of 'Execute in terminal window' radio button, with 'W' shortcut static TQString i18n_w_ExecInTermWindow(); // text of 'Execute in terminal window' radio button, with 'W' shortcut
static TQString i18n_u_ExecInTermWindow(); // text of 'Execute in terminal window' radio button, with 'U' shortcut static TQString i18n_u_ExecInTermWindow(); // text of 'Execute in terminal window' radio button, with 'U' shortcut
static TQString i18n_g_LogToFile(); // text of 'Log to file' radio button, with 'G' shortcut static TQString i18n_g_LogToFile(); // text of 'Log to file' radio button, with 'G' shortcut
static TQString i18n_CopyEmailToSelf(); // plain text of 'Copy email to self' checkbox static TQString i18n_CopyEmailToSelf(); // plain text of 'Copy email to self' checkbox
static TQString i18n_e_CopyEmailToSelf(); // text of 'Copy email to self' checkbox, with 'E' shortcut static TQString i18n_e_CopyEmailToSelf(); // text of 'Copy email to self' checkbox, with 'E' shortcut
static TQString i18n_s_CopyEmailToSelf(); // text of 'Copy email to self' checkbox, with 'S' shortcut static TQString i18n_s_CopyEmailToSelf(); // text of 'Copy email to self' checkbox, with 'S' shortcut
static TQString i18n_EmailFrom(); // plain text of 'From:' (email address) static TQString i18n_EmailFrom(); // plain text of 'From:' (email address)
static TQString i18n_f_EmailFrom(); // text of 'From:' (email address), with 'F' shortcut static TQString i18n_f_EmailFrom(); // text of 'From:' (email address), with 'F' shortcut
static TQString i18n_EmailTo(); // plain text of 'To:' (email addressee) static TQString i18n_EmailTo(); // plain text of 'To:' (email addressee)
static TQString i18n_EmailSubject(); // plain text of 'Subject:' (email) static TQString i18n_EmailSubject(); // plain text of 'Subject:' (email)
static TQString i18n_j_EmailSubject(); // text of 'Subject:' (email), with 'J' shortcut static TQString i18n_j_EmailSubject(); // text of 'Subject:' (email), with 'J' shortcut
protected: protected:
virtual void resizeEvent(TQResizeEvent*); virtual void resizeEvent(TQResizeEvent*);
@ -132,7 +132,7 @@ class EditAlarmDlg : public KDialogBase
void saveState(const KAEvent*); void saveState(const KAEvent*);
bool stateChanged() const; bool stateChanged() const;
TQTabWidget* mTabs; // the tabs in the dialog TQTabWidget* mTabs; // the tabs in the dialog
int mMainPageIndex; int mMainPageIndex;
int mRecurPageIndex; int mRecurPageIndex;
bool mMainPageShown; // true once the main tab has been displayed bool mMainPageShown; // true once the main tab has been displayed
@ -144,10 +144,10 @@ class EditAlarmDlg : public KDialogBase
RadioButton* mCommandRadio; RadioButton* mCommandRadio;
PickAlarmFileRadio* mFileRadio; PickAlarmFileRadio* mFileRadio;
RadioButton* mEmailRadio; RadioButton* mEmailRadio;
TQWidgetStack* mAlarmTypeStack; TQWidgetStack* mAlarmTypeStack;
// Templates // Templates
TQLineEdit* mTemplateName; TQLineEdit* mTemplateName;
ButtonGroup* mTemplateTimeGroup; ButtonGroup* mTemplateTimeGroup;
RadioButton* mTemplateDefaultTime; // no alarm time is specified RadioButton* mTemplateDefaultTime; // no alarm time is specified
RadioButton* mTemplateUseTimeAfter;// alarm time is specified as an offset from current RadioButton* mTemplateUseTimeAfter;// alarm time is specified as an offset from current
@ -157,14 +157,14 @@ class EditAlarmDlg : public KDialogBase
TimeEdit* mTemplateTime; // the alarm time which is specified TimeEdit* mTemplateTime; // the alarm time which is specified
// Display alarm options widgets // Display alarm options widgets
TQFrame* mDisplayAlarmsFrame; TQFrame* mDisplayAlarmsFrame;
TQHBox* mFileBox; TQHBox* mFileBox;
TQHBox* mFilePadding; TQHBox* mFilePadding;
SoundPicker* mSoundPicker; SoundPicker* mSoundPicker;
CheckBox* mConfirmAck; CheckBox* mConfirmAck;
FontColourButton* mFontColourButton; // for text display option FontColourButton* mFontColourButton; // for text display option
ColourCombo* mBgColourButton; // for file display option ColourCombo* mBgColourButton; // for file display option
TQHBox* mBgColourBox; TQHBox* mBgColourBox;
SpecialActionsButton* mSpecialActionsButton; SpecialActionsButton* mSpecialActionsButton;
Reminder* mReminder; Reminder* mReminder;
bool mReminderDeferral; bool mReminderDeferral;
@ -173,32 +173,32 @@ class EditAlarmDlg : public KDialogBase
TextEdit* mTextMessageEdit; // text message edit box TextEdit* mTextMessageEdit; // text message edit box
// Text file alarm widgets // Text file alarm widgets
LineEdit* mFileMessageEdit; // text file URL edit box LineEdit* mFileMessageEdit; // text file URL edit box
TQPushButton* mFileBrowseButton; // text file browse button TQPushButton* mFileBrowseButton; // text file browse button
TQString mFileDefaultDir; // default directory for browse button TQString mFileDefaultDir; // default directory for browse button
// Command alarm widgets // Command alarm widgets
TQFrame* mCommandFrame; TQFrame* mCommandFrame;
CheckBox* mCmdTypeScript; // entering a script CheckBox* mCmdTypeScript; // entering a script
LineEdit* mCmdCommandEdit; // command line edit box LineEdit* mCmdCommandEdit; // command line edit box
TextEdit* mCmdScriptEdit; // script edit box TextEdit* mCmdScriptEdit; // script edit box
ButtonGroup* mCmdOutputGroup; // what to do with command output ButtonGroup* mCmdOutputGroup; // what to do with command output
LineEdit* mCmdLogFileEdit; // log file URL edit box LineEdit* mCmdLogFileEdit; // log file URL edit box
TQWidget* mCmdPadding; TQWidget* mCmdPadding;
// Email alarm widgets // Email alarm widgets
TQFrame* mEmailFrame; TQFrame* mEmailFrame;
EmailIdCombo* mEmailFromList; EmailIdCombo* mEmailFromList;
LineEdit* mEmailToEdit; LineEdit* mEmailToEdit;
TQPushButton* mEmailAddressButton; // email open address book button TQPushButton* mEmailAddressButton; // email open address book button
TQLineEdit* mEmailSubjectEdit; TQLineEdit* mEmailSubjectEdit;
TextEdit* mEmailMessageEdit; // email body edit box TextEdit* mEmailMessageEdit; // email body edit box
TQComboBox* mEmailAttachList; TQComboBox* mEmailAttachList;
TQPushButton* mEmailAddAttachButton; TQPushButton* mEmailAddAttachButton;
TQPushButton* mEmailRemoveButton; TQPushButton* mEmailRemoveButton;
CheckBox* mEmailBcc; CheckBox* mEmailBcc;
TQString mAttachDefaultDir; TQString mAttachDefaultDir;
TQGroupBox* mDeferGroup; TQGroupBox* mDeferGroup;
TQLabel* mDeferTimeLabel; TQLabel* mDeferTimeLabel;
TQPushButton* mDeferChangeButton; TQPushButton* mDeferChangeButton;
AlarmTimeWidget* mTimeWidget; AlarmTimeWidget* mTimeWidget;
LateCancelSelector* mLateCancel; LateCancelSelector* mLateCancel;
@ -206,11 +206,11 @@ class EditAlarmDlg : public KDialogBase
RecurrenceEdit* mRecurrenceEdit; RecurrenceEdit* mRecurrenceEdit;
TQString mAlarmMessage; // message text/file name/command/email message TQString mAlarmMessage; // message text/file name/command/email message
DateTime mAlarmDateTime; DateTime mAlarmDateTime;
DateTime mDeferDateTime; DateTime mDeferDateTime;
EmailAddressList mEmailAddresses; // list of addresses to send email to EmailAddressList mEmailAddresses; // list of addresses to send email to
TQStringList mEmailAttachments; // list of email attachment file names TQStringList mEmailAttachments; // list of email attachment file names
unsigned long mKMailSerialNumber; // if email text, message's KMail serial number, else 0 unsigned long mKMailSerialNumber; // if email text, message's KMail serial number, else 0
int mDeferGroupHeight; // height added by deferred time widget int mDeferGroupHeight; // height added by deferred time widget
int mDesktop; // desktop to display the dialog in int mDesktop; // desktop to display the dialog in
@ -223,34 +223,34 @@ class EditAlarmDlg : public KDialogBase
// Initial state of all controls // Initial state of all controls
KAEvent* mSavedEvent; KAEvent* mSavedEvent;
TQString mSavedTemplateName; // mTemplateName value TQString mSavedTemplateName; // mTemplateName value
TQButton* mSavedTemplateTimeType; // selected button in mTemplateTimeGroup TQButton* mSavedTemplateTimeType; // selected button in mTemplateTimeGroup
TQTime mSavedTemplateTime; // mTemplateTime value TQTime mSavedTemplateTime; // mTemplateTime value
int mSavedTemplateAfterTime; // mTemplateAfterTime value int mSavedTemplateAfterTime; // mTemplateAfterTime value
TQButton* mSavedTypeRadio; // mMessageRadio, etc TQButton* mSavedTypeRadio; // mMessageRadio, etc
SoundPicker::Type mSavedSoundType; // mSoundPicker sound type SoundPicker::Type mSavedSoundType; // mSoundPicker sound type
bool mSavedRepeatSound; // mSoundPicker repeat status bool mSavedRepeatSound; // mSoundPicker repeat status
TQString mSavedSoundFile; // mSoundPicker sound file TQString mSavedSoundFile; // mSoundPicker sound file
float mSavedSoundVolume; // mSoundPicker volume float mSavedSoundVolume; // mSoundPicker volume
float mSavedSoundFadeVolume;// mSoundPicker fade volume float mSavedSoundFadeVolume;// mSoundPicker fade volume
int mSavedSoundFadeSeconds;// mSoundPicker fade time int mSavedSoundFadeSeconds;// mSoundPicker fade time
bool mSavedConfirmAck; // mConfirmAck status bool mSavedConfirmAck; // mConfirmAck status
TQFont mSavedFont; // mFontColourButton font TQFont mSavedFont; // mFontColourButton font
TQColor mSavedBgColour; // mFontColourButton background colour TQColor mSavedBgColour; // mFontColourButton background colour
TQColor mSavedFgColour; // mFontColourButton foreground colour TQColor mSavedFgColour; // mFontColourButton foreground colour
TQString mSavedPreAction; // mSpecialActionsButton pre-alarm action TQString mSavedPreAction; // mSpecialActionsButton pre-alarm action
TQString mSavedPostAction; // mSpecialActionsButton post-alarm action TQString mSavedPostAction; // mSpecialActionsButton post-alarm action
int mSavedReminder; // mReminder value int mSavedReminder; // mReminder value
bool mSavedOnceOnly; // mReminder once-only status bool mSavedOnceOnly; // mReminder once-only status
TQString mSavedTextFileCommandMessage; // mTextMessageEdit/mFileMessageEdit/mCmdCommandEdit/mEmailMessageEdit value TQString mSavedTextFileCommandMessage; // mTextMessageEdit/mFileMessageEdit/mCmdCommandEdit/mEmailMessageEdit value
TQString mSavedEmailFrom; // mEmailFromList current value TQString mSavedEmailFrom; // mEmailFromList current value
TQString mSavedEmailTo; // mEmailToEdit value TQString mSavedEmailTo; // mEmailToEdit value
TQString mSavedEmailSubject; // mEmailSubjectEdit value TQString mSavedEmailSubject; // mEmailSubjectEdit value
TQStringList mSavedEmailAttach; // mEmailAttachList values TQStringList mSavedEmailAttach; // mEmailAttachList values
bool mSavedEmailBcc; // mEmailBcc status bool mSavedEmailBcc; // mEmailBcc status
bool mSavedCmdScript; // mCmdTypeScript status bool mSavedCmdScript; // mCmdTypeScript status
TQButton* mSavedCmdOutputRadio; // selected button in mCmdOutputGroup TQButton* mSavedCmdOutputRadio; // selected button in mCmdOutputGroup
TQString mSavedCmdLogFile; // mCmdLogFileEdit value TQString mSavedCmdLogFile; // mCmdLogFileEdit value
DateTime mSavedDateTime; // mTimeWidget value DateTime mSavedDateTime; // mTimeWidget value
int mSavedRecurrenceType; // RecurrenceEdit::RepeatType value int mSavedRecurrenceType; // RecurrenceEdit::RepeatType value
int mSavedLateCancel; // mLateCancel value int mSavedLateCancel; // mLateCancel value

@ -459,7 +459,7 @@ TQString EventListWhatsThisBase::text(const TQPoint& pt)
TQPoint viewportPt = mListView->viewport()->mapFrom(mListView, pt); TQPoint viewportPt = mListView->viewport()->mapFrom(mListView, pt);
TQRect frame = mListView->header()->frameGeometry(); TQRect frame = mListView->header()->frameGeometry();
if (frame.contains(pt) if (frame.contains(pt)
|| mListView->itemAt(TQPoint(mListView->itemMargin(), viewportPt.y())) && frame.contains(TQPoint(pt.x(), frame.y()))) || (mListView->itemAt(TQPoint(mListView->itemMargin(), viewportPt.y())) && frame.contains(TQPoint(pt.x(), frame.y()))))
column = mListView->header()->sectionAt(pt.x()); column = mListView->header()->sectionAt(pt.x());
return mListView->whatsThisText(column); return mListView->whatsThisText(column);
} }

@ -298,8 +298,8 @@ void Find::findNext(bool forward, bool sort, bool checkEnd, bool fromCurrent)
last = true; // we've wrapped round and reached the starting alarm again last = true; // we've wrapped round and reached the starting alarm again
fromCurrent = false; fromCurrent = false;
bool live = !event.expired(); bool live = !event.expired();
if (live && !(mOptions & FIND_LIVE) if ((live && !(mOptions & FIND_LIVE))
|| !live && !(mOptions & FIND_EXPIRED)) || (!live && !(mOptions & FIND_EXPIRED)))
continue; // we're not searching this type of alarm continue; // we're not searching this type of alarm
switch (event.action()) switch (event.action())
{ {

@ -61,10 +61,10 @@
namespace namespace
{ {
bool resetDaemonQueued = false; bool resetDaemonQueued = false;
TQCString korganizerName = "korganizer"; TQCString korganizerName = "korganizer";
TQString korgStartError; TQString korgStartError;
#define KORG_DCOP_OBJECT "KOrganizerIface" #define KORG_DCOP_OBJECT "KOrganizerIface"
const char* KORG_DCOP_WINDOW = "KOrganizer MainWindow"; //const char* KORG_DCOP_WINDOW = "KOrganizer MainWindow"; // not used
const char* KMAIL_DCOP_WINDOW = "kmail-mainwindow#1"; const char* KMAIL_DCOP_WINDOW = "kmail-mainwindow#1";
bool sendToKOrganizer(const KAEvent&); bool sendToKOrganizer(const KAEvent&);

@ -229,7 +229,7 @@ bool KAlarmApp::restoreSession()
// Try to display the system tray icon if it is configured to be autostarted, // Try to display the system tray icon if it is configured to be autostarted,
// or if we're in run-in-system-tray mode. // or if we're in run-in-system-tray mode.
if (Preferences::autostartTrayIcon() if (Preferences::autostartTrayIcon()
|| MainWindow::count() && wantRunInSystemTray()) || (MainWindow::count() && wantRunInSystemTray()))
{ {
displayTrayIcon(true, trayParent); displayTrayIcon(true, trayParent);
// Occasionally for no obvious reason, the main main window is // Occasionally for no obvious reason, the main main window is
@ -786,7 +786,7 @@ void KAlarmApp::quitIf(int exitCode, bool force)
return; return;
int mwcount = MainWindow::count(); int mwcount = MainWindow::count();
MainWindow* mw = mwcount ? MainWindow::firstWindow() : 0; MainWindow* mw = mwcount ? MainWindow::firstWindow() : 0;
if (mwcount > 1 || mwcount && (!mw->isHidden() || !mw->isTrayParent())) if (mwcount > 1 || (mwcount && (!mw->isHidden() || !mw->isTrayParent())))
return; return;
// There are no windows left except perhaps a main window which is a hidden tray icon parent // There are no windows left except perhaps a main window which is a hidden tray icon parent
if (mTrayWindow) if (mTrayWindow)
@ -1328,7 +1328,7 @@ bool KAlarmApp::handleEvent(const TQString& eventID, EventFunc function)
if (now >= limit) if (now >= limit)
{ {
if (type == KAEvent::LAST_RECURRENCE if (type == KAEvent::LAST_RECURRENCE
|| type == KAEvent::FIRST_OR_ONLY_OCCURRENCE && !event.recurs()) || (type == KAEvent::FIRST_OR_ONLY_OCCURRENCE && !event.recurs()))
cancel = true; // last occurrence (and there are no repetitions) cancel = true; // last occurrence (and there are no repetitions)
else else
late = true; late = true;
@ -1360,7 +1360,7 @@ bool KAlarmApp::handleEvent(const TQString& eventID, EventFunc function)
if (next.dateTime().secsTo(now) > maxlate) if (next.dateTime().secsTo(now) > maxlate)
{ {
if (type == KAEvent::LAST_RECURRENCE if (type == KAEvent::LAST_RECURRENCE
|| type == KAEvent::FIRST_OR_ONLY_OCCURRENCE && !event.recurs()) || (type == KAEvent::FIRST_OR_ONLY_OCCURRENCE && !event.recurs()))
cancel = true; // last occurrence (and there are no repetitions) cancel = true; // last occurrence (and there are no repetitions)
else else
late = true; late = true;
@ -1621,7 +1621,7 @@ void* KAlarmApp::execAlarm(KAEvent& event, const KAAlarm& alarm, bool reschedule
if (!event.enabled()) if (!event.enabled())
delete win; // event is disabled - close its window delete win; // event is disabled - close its window
else if (!win else if (!win
|| !win->hasDefer() && !alarm.repeatAtLogin() || (!win->hasDefer() && !alarm.repeatAtLogin())
|| replaceReminder) || replaceReminder)
{ {
// Either there isn't already a message for this event, // Either there isn't already a message for this event,

@ -153,8 +153,8 @@ bool ADCalendar::eventHandled(const KCal::Event* event, const TQValueList<TQDate
if (alarmtimes[i].isValid() if (alarmtimes[i].isValid()
&& (i >= oldCount // is it an additional alarm? && (i >= oldCount // is it an additional alarm?
|| !it.data().alarmTimes[i].isValid() // or has it just become due? || !it.data().alarmTimes[i].isValid() // or has it just become due?
|| it.data().alarmTimes[i].isValid() // or has it changed? || (it.data().alarmTimes[i].isValid() // or has it changed?
&& alarmtimes[i] != it.data().alarmTimes[i])) && alarmtimes[i] != it.data().alarmTimes[i])))
return false; // this alarm has changed return false; // this alarm has changed
} }
return true; return true;

@ -449,7 +449,7 @@ void AlarmDaemon::checkAlarms(ADCalendar* cal)
} }
} }
if (!dt.isValid() || dt > now if (!dt.isValid() || dt > now
|| dt1.isValid() && dt1 > dt) // already tested dt1 <= now || (dt1.isValid() && dt1 > dt)) // already tested dt1 <= now
dt = dt1; dt = dt1;
} }
alarmtimes.append(dt); alarmtimes.append(dt);

@ -110,8 +110,8 @@ bool KARecurrence::init(RecurrenceRule::PeriodType recurType, int freq, int coun
if (count < -1) if (count < -1)
return false; return false;
bool dateOnly = start.isDateOnly(); bool dateOnly = start.isDateOnly();
if (!count && (!dateOnly && !end.isValid() if (!count && ((!dateOnly && !end.isValid())
|| dateOnly && !end.date().isValid())) || (dateOnly && !end.date().isValid())))
return false; return false;
switch (recurType) switch (recurType)
{ {
@ -134,8 +134,8 @@ bool KARecurrence::init(RecurrenceRule::PeriodType recurType, int freq, int coun
else else
setEndDateTime(end); setEndDateTime(end);
TQDateTime startdt = start.dateTime(); TQDateTime startdt = start.dateTime();
if (recurType == RecurrenceRule::rYearly if ((recurType == RecurrenceRule::rYearly
&& feb29Type == FEB29_FEB28 || feb29Type == FEB29_MAR1) && feb29Type == FEB29_FEB28) || feb29Type == FEB29_MAR1)
{ {
int year = startdt.date().year(); int year = startdt.date().year();
if (!TQDate::leapYear(year) if (!TQDate::leapYear(year)
@ -257,7 +257,7 @@ void KARecurrence::fix()
{ {
// This is the second rule. // This is the second rule.
// Ensure that it can be combined with the first one. // Ensure that it can be combined with the first one.
if (day == days[0] || day == -1 && days[0] == 60 if (day == days[0] || (day == -1 && days[0] == 60)
|| rrule->frequency() != rrules[0]->frequency() || rrule->frequency() != rrules[0]->frequency()
|| rrule->startDt() != rrules[0]->startDt()) || rrule->startDt() != rrules[0]->startDt())
break; break;

@ -62,11 +62,11 @@ class KARecurrence : public KCal::Recurrence
{ return init(t, freq, count, f29, start, end); } { return init(t, freq, count, f29, start, end); }
void fix(); void fix();
void writeRecurrence(KCal::Recurrence&) const; void writeRecurrence(KCal::Recurrence&) const;
TQDateTime endDateTime() const; TQDateTime endDateTime() const;
TQDate endDate() const; TQDate endDate() const;
bool recursOn(const TQDate&) const; bool recursOn(const TQDate&) const;
TQDateTime getNextDateTime(const TQDateTime& preDateTime) const; TQDateTime getNextDateTime(const TQDateTime& preDateTime) const;
TQDateTime getPreviousDateTime(const TQDateTime& afterDateTime) const; TQDateTime getPreviousDateTime(const TQDateTime& afterDateTime) const;
int longestInterval() const; int longestInterval() const;
Type type() const; Type type() const;
static Type type(const KCal::RecurrenceRule*); static Type type(const KCal::RecurrenceRule*);

@ -73,7 +73,7 @@ class DateTime
/** Returns true if the date is null and, if it is a date-time value, the time is also null. */ /** Returns true if the date is null and, if it is a date-time value, the time is also null. */
bool isNull() const { return mDateTime.date().isNull() && (mDateOnly || mDateTime.time().isNull()); } bool isNull() const { return mDateTime.date().isNull() && (mDateOnly || mDateTime.time().isNull()); }
/** Returns true if the date is valid and, if it is a date-time value, the time is also valid. */ /** Returns true if the date is valid and, if it is a date-time value, the time is also valid. */
bool isValid() const { return mDateTime.date().isValid() && (mDateOnly || mTimeValid && mDateTime.time().isValid()); } bool isValid() const { return mDateTime.date().isValid() && (mDateOnly || (mTimeValid && mDateTime.time().isValid())); }
/** Returns true if it is date-only value. */ /** Returns true if it is date-only value. */
bool isDateOnly() const { return mDateOnly; } bool isDateOnly() const { return mDateOnly; }
/** Sets the value to be either date-only or date-time. /** Sets the value to be either date-only or date-time.
@ -209,8 +209,8 @@ class DateTime
private: private:
static TQTime mStartOfDay; static TQTime mStartOfDay;
TQDateTime mDateTime; TQDateTime mDateTime;
bool mDateOnly; bool mDateOnly;
bool mTimeValid; // whether the time is potentially valid - applicable only if mDateOnly false bool mTimeValid; // whether the time is potentially valid - applicable only if mDateOnly false
}; };
/** Returns true if the two values are equal. */ /** Returns true if the two values are equal. */

@ -99,8 +99,8 @@ void LineEdit::dragEnterEvent(TQDragEnterEvent* e)
e->accept(false); // don't accept "text/calendar" objects e->accept(false); // don't accept "text/calendar" objects
e->accept(TQTextDrag::canDecode(e) e->accept(TQTextDrag::canDecode(e)
|| KURLDrag::canDecode(e) || KURLDrag::canDecode(e)
|| mType != Url && KPIM::MailListDrag::canDecode(e) || (mType != Url && KPIM::MailListDrag::canDecode(e))
|| mType == Emails && KVCardDrag::canDecode(e)); || (mType == Emails && KVCardDrag::canDecode(e)));
} }
void LineEdit::dropEvent(TQDropEvent* e) void LineEdit::dropEvent(TQDropEvent* e)

@ -86,8 +86,8 @@ void ShellProcess::slotExited(TDEProcess* proc)
{ {
// Some shells report if the command couldn't be found, or is not executable // Some shells report if the command couldn't be found, or is not executable
int status = proc->exitStatus(); int status = proc->exitStatus();
if (mShellName == "bash" && (status == 126 || status == 127) if ((mShellName == "bash" && (status == 126 || status == 127))
|| mShellName == "ksh" && status == 127) || (mShellName == "ksh" && status == 127))
{ {
kdWarning(5950) << "ShellProcess::slotExited(" << mCommand << ") " << mShellName << ": not found or not executable\n"; kdWarning(5950) << "ShellProcess::slotExited(" << mCommand << ") " << mShellName << ": not found or not executable\n";
mStatus = NOT_FOUND; mStatus = NOT_FOUND;

@ -77,8 +77,7 @@ bool TimeEdit::isValid() const
void TimeEdit::setValid(bool valid) void TimeEdit::setValid(bool valid)
{ {
bool oldValid = mSpinBox->isValid(); bool oldValid = mSpinBox->isValid();
if (valid && !oldValid if ((valid && !oldValid) || (!valid && oldValid))
|| !valid && oldValid)
{ {
mSpinBox->setValid(valid); mSpinBox->setValid(valid);
if (mAmPm) if (mAmPm)

@ -207,7 +207,7 @@ void TimePeriod::setMinutes(int mins, bool dateOnly, TimePeriod::Units defaultUn
else if (item > mMaxUnitShown) else if (item > mMaxUnitShown)
item = mMaxUnitShown; item = mMaxUnitShown;
mUnitsCombo->setCurrentItem(item - mDateOnlyOffset); mUnitsCombo->setCurrentItem(item - mDateOnlyOffset);
if (dateOnly && !mDateOnlyOffset || !dateOnly && mDateOnlyOffset) if ((dateOnly && !mDateOnlyOffset) || (!dateOnly && mDateOnlyOffset))
item = setDateOnly(mins, dateOnly, false); item = setDateOnly(mins, dateOnly, false);
} }
showHourMin(item == HOURS_MINUTES && !mNoHourMinute); showHourMin(item == HOURS_MINUTES && !mNoHourMinute);

@ -453,8 +453,8 @@ void RecurrenceEdit::periodClicked(int id)
void RecurrenceEdit::slotAnyTimeToggled(bool on) void RecurrenceEdit::slotAnyTimeToggled(bool on)
{ {
TQButton* button = mRuleButtonGroup->selected(); TQButton* button = mRuleButtonGroup->selected();
mEndTimeEdit->setEnabled(button == mAtLoginButton && !on mEndTimeEdit->setEnabled((button == mAtLoginButton && !on)
|| button == mSubDailyButton && mEndDateButton->isChecked()); || (button == mSubDailyButton && mEndDateButton->isChecked()));
} }
/****************************************************************************** /******************************************************************************
@ -465,7 +465,7 @@ void RecurrenceEdit::rangeTypeClicked()
bool endDate = mEndDateButton->isOn(); bool endDate = mEndDateButton->isOn();
mEndDateEdit->setEnabled(endDate); mEndDateEdit->setEnabled(endDate);
mEndTimeEdit->setEnabled(endDate mEndTimeEdit->setEnabled(endDate
&& (mAtLoginButton->isOn() && !mEndAnyTimeCheckBox->isChecked() && ((mAtLoginButton->isOn() && !mEndAnyTimeCheckBox->isChecked())
|| mSubDailyButton->isOn())); || mSubDailyButton->isOn()));
bool repeatCount = mRepeatCountButton->isOn(); bool repeatCount = mRepeatCountButton->isOn();
mRepeatCountEntry->setEnabled(repeatCount); mRepeatCountEntry->setEnabled(repeatCount);
@ -1090,7 +1090,7 @@ bool RecurrenceEdit::stateChanged() const
{ {
if (mSavedRuleButton != mRuleButtonGroup->selected() if (mSavedRuleButton != mRuleButtonGroup->selected()
|| mSavedRangeButton != mRangeButtonGroup->selected() || mSavedRangeButton != mRangeButtonGroup->selected()
|| mRule && mRule->stateChanged()) || (mRule && mRule->stateChanged()))
return true; return true;
if (mSavedRangeButton == mRepeatCountButton if (mSavedRangeButton == mRepeatCountButton
&& mSavedRecurCount != mRepeatCountEntry->value()) && mSavedRecurCount != mRepeatCountEntry->value())

@ -70,7 +70,7 @@ class RecurrenceEdit : public TQFrame
void set(const KAEvent&, bool keepDuration); void set(const KAEvent&, bool keepDuration);
/** Write recurrence settings into an event */ /** Write recurrence settings into an event */
void updateEvent(KAEvent&, bool adjustStart); void updateEvent(KAEvent&, bool adjustStart);
TQWidget* checkData(const TQDateTime& startDateTime, TQString& errorMessage) const; TQWidget* checkData(const TQDateTime& startDateTime, TQString& errorMessage) const;
RepeatType repeatType() const { return mRuleButtonType; } RepeatType repeatType() const { return mRuleButtonType; }
bool isTimedRepeatType() const { return mRuleButtonType >= SUBDAILY; } bool isTimedRepeatType() const { return mRuleButtonType >= SUBDAILY; }
int subRepeatCount(int* subRepeatInterval = 0) const; int subRepeatCount(int* subRepeatInterval = 0) const;
@ -125,7 +125,7 @@ class RecurrenceEdit : public TQFrame
void saveState(); void saveState();
// Main rule box and choices // Main rule box and choices
TQWidgetStack* mRuleStack; TQWidgetStack* mRuleStack;
Rule* mRule; // current rule widget, or 0 if NoRule Rule* mRule; // current rule widget, or 0 if NoRule
NoRule* mNoRule; NoRule* mNoRule;
SubDailyRule* mSubDailyRule; SubDailyRule* mSubDailyRule;
@ -160,32 +160,32 @@ class RecurrenceEdit : public TQFrame
RadioButton* mNoEndDateButton; RadioButton* mNoEndDateButton;
RadioButton* mRepeatCountButton; RadioButton* mRepeatCountButton;
SpinBox* mRepeatCountEntry; SpinBox* mRepeatCountEntry;
TQLabel* mRepeatCountLabel; TQLabel* mRepeatCountLabel;
RadioButton* mEndDateButton; RadioButton* mEndDateButton;
DateEdit* mEndDateEdit; DateEdit* mEndDateEdit;
TimeEdit* mEndTimeEdit; TimeEdit* mEndTimeEdit;
CheckBox* mEndAnyTimeCheckBox; CheckBox* mEndAnyTimeCheckBox;
// Exceptions // Exceptions
TQGroupBox* mExceptionGroup; TQGroupBox* mExceptionGroup;
TQListBox* mExceptionDateList; TQListBox* mExceptionDateList;
DateEdit* mExceptionDateEdit; DateEdit* mExceptionDateEdit;
TQPushButton* mChangeExceptionButton; TQPushButton* mChangeExceptionButton;
TQPushButton* mDeleteExceptionButton; TQPushButton* mDeleteExceptionButton;
TQValueList<TQDate> mExceptionDates; TQValueList<TQDate> mExceptionDates;
// Current start date and time // Current start date and time
TQDateTime mCurrStartDateTime; TQDateTime mCurrStartDateTime;
RepetitionButton* mSubRepetition; RepetitionButton* mSubRepetition;
bool mNoEmitTypeChanged; // suppress typeChanged() signal bool mNoEmitTypeChanged; // suppress typeChanged() signal
bool mReadOnly; bool mReadOnly;
// Initial state of non-rule controls // Initial state of non-rule controls
TQButton* mSavedRuleButton; // which rule button was selected TQButton* mSavedRuleButton; // which rule button was selected
TQButton* mSavedRangeButton; // which range button was selected TQButton* mSavedRangeButton; // which range button was selected
int mSavedRecurCount; // recurrence repeat count int mSavedRecurCount; // recurrence repeat count
DateTime mSavedEndDateTime; // end date/time DateTime mSavedEndDateTime; // end date/time
TQValueList<TQDate> mSavedExceptionDates; // exception dates TQValueList<TQDate> mSavedExceptionDates; // exception dates
int mSavedRepeatInterval; // sub-repetition interval (via mSubRepetition button) int mSavedRepeatInterval; // sub-repetition interval (via mSubRepetition button)
int mSavedRepeatCount; // sub-repetition count (via mSubRepetition button) int mSavedRepeatCount; // sub-repetition count (via mSubRepetition button)
}; };

@ -41,7 +41,7 @@ class NoRule : public TQFrame
public: public:
NoRule(TQWidget* parent, const char* name = 0) : TQFrame(parent, name) NoRule(TQWidget* parent, const char* name = 0) : TQFrame(parent, name)
{ setFrameStyle(TQFrame::NoFrame); } { setFrameStyle(TQFrame::NoFrame); }
virtual int frequency() const { return 0; } virtual int frequency() const { return 0; }
}; };
class Rule : public NoRule class Rule : public NoRule
@ -51,22 +51,22 @@ class Rule : public NoRule
public: public:
Rule(const TQString& freqText, const TQString& freqWhatsThis, bool time, bool readOnly, Rule(const TQString& freqText, const TQString& freqWhatsThis, bool time, bool readOnly,
TQWidget* parent, const char* name = 0); TQWidget* parent, const char* name = 0);
int frequency() const; int frequency() const;
void setFrequency(int); void setFrequency(int);
virtual void setFrequencyFocus() { mSpinBox->setFocus(); } virtual void setFrequencyFocus() { mSpinBox->setFocus(); }
TQVBoxLayout* layout() const { return mLayout; } TQVBoxLayout* layout() const { return mLayout; }
virtual TQWidget* validate(TQString&) { return 0; } virtual TQWidget* validate(TQString&) { return 0; }
virtual void saveState(); virtual void saveState();
virtual bool stateChanged() const; virtual bool stateChanged() const;
signals: signals:
void frequencyChanged(); void frequencyChanged();
private: private:
TQWidget* mSpinBox; TQWidget* mSpinBox;
SpinBox* mIntSpinBox; SpinBox* mIntSpinBox;
TimeSpinBox* mTimeSpinBox; TimeSpinBox* mTimeSpinBox;
TQVBoxLayout* mLayout; TQVBoxLayout* mLayout;
// Saved state of all controls // Saved state of all controls
int mSavedFrequency; // frequency for the selected rule int mSavedFrequency; // frequency for the selected rule
}; };
// Subdaily rule choices // Subdaily rule choices
@ -87,14 +87,14 @@ class DayWeekRule : public Rule
DayWeekRule(const TQString& freqText, const TQString& freqWhatsThis, const TQString& daysWhatsThis, DayWeekRule(const TQString& freqText, const TQString& freqWhatsThis, const TQString& daysWhatsThis,
bool readOnly, TQWidget* parent, const char* name = 0); bool readOnly, TQWidget* parent, const char* name = 0);
TQBitArray days() const; TQBitArray days() const;
void setDays(bool); void setDays(bool);
void setDays(const TQBitArray& days); void setDays(const TQBitArray& days);
void setDay(int dayOfWeek); void setDay(int dayOfWeek);
virtual TQWidget* validate(TQString& errorMessage); virtual TQWidget* validate(TQString& errorMessage);
virtual void saveState(); virtual void saveState();
virtual bool stateChanged() const; virtual bool stateChanged() const;
private: private:
CheckBox* mDayBox[7]; CheckBox* mDayBox[7];
// Saved state of all controls // Saved state of all controls
TQBitArray mSavedDays; // ticked days for weekly rule TQBitArray mSavedDays; // ticked days for weekly rule
}; };
@ -176,26 +176,26 @@ class YearlyRule : public MonthYearRule
public: public:
YearlyRule(bool readOnly, TQWidget* parent, const char* name = 0); YearlyRule(bool readOnly, TQWidget* parent, const char* name = 0);
TQValueList<int> months() const; TQValueList<int> months() const;
void setMonths(const TQValueList<int>& months); void setMonths(const TQValueList<int>& months);
void setDefaultValues(int dayOfMonth, int dayOfWeek, int month); void setDefaultValues(int dayOfMonth, int dayOfWeek, int month);
KARecurrence::Feb29Type feb29Type() const; KARecurrence::Feb29Type feb29Type() const;
void setFeb29Type(KARecurrence::Feb29Type); void setFeb29Type(KARecurrence::Feb29Type);
virtual TQWidget* validate(TQString& errorMessage); virtual TQWidget* validate(TQString& errorMessage);
virtual void saveState(); virtual void saveState();
virtual bool stateChanged() const; virtual bool stateChanged() const;
protected: protected:
virtual void daySelected(int day); virtual void daySelected(int day);
protected slots: protected slots:
virtual void clicked(int id); virtual void clicked(int id);
private slots: private slots:
void enableFeb29(); void enableFeb29();
private: private:
CheckBox* mMonthBox[12]; CheckBox* mMonthBox[12];
TQLabel* mFeb29Label; TQLabel* mFeb29Label;
ComboBox* mFeb29Combo; ComboBox* mFeb29Combo;
// Saved state of all controls // Saved state of all controls
TQValueList<int> mSavedMonths; // ticked months for yearly rule TQValueList<int> mSavedMonths; // ticked months for yearly rule
int mSavedFeb29Type; // February 29th recurrence type int mSavedFeb29Type; // February 29th recurrence type
}; };
#endif // RECURRENCEEDITPRIVATE_H #endif // RECURRENCEEDITPRIVATE_H

@ -95,7 +95,7 @@ TrayWindow::TrayWindow(MainWindow* parent, const char* name)
// Replace the default handler for the Quit context menu item // Replace the default handler for the Quit context menu item
const char* quitName = KStdAction::name(KStdAction::Quit); const char* quitName = KStdAction::name(KStdAction::Quit);
actcol->remove(actcol->action(quitName)); actcol->remove(actcol->action(quitName));
actcol->accel()->remove(quitName); actcol->tdeaccel()->remove(quitName);
KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT(slotQuit()), actcol); KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT(slotQuit()), actcol);
// Set icon to correspond with the alarms enabled menu status // Set icon to correspond with the alarms enabled menu status

Loading…
Cancel
Save