summaryrefslogtreecommitdiffstats
path: root/kalarm/alarmevent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kalarm/alarmevent.cpp')
-rw-r--r--kalarm/alarmevent.cpp146
1 files changed, 73 insertions, 73 deletions
diff --git a/kalarm/alarmevent.cpp b/kalarm/alarmevent.cpp
index d39567938..c5e487caa 100644
--- a/kalarm/alarmevent.cpp
+++ b/kalarm/alarmevent.cpp
@@ -44,7 +44,7 @@ const TQCString APPNAME("KALARM");
// KAlarm version which first used the current calendar/event format.
// If this changes, KAEvent::convertKCalEvents() must be changed correspondingly.
// The string version is the KAlarm version string used in the calendar file.
-TQString KAEvent::calVersionString() { return TQString::fromLatin1("1.5.0"); }
+TQString KAEvent::calVersionString() { return TQString::tqfromLatin1("1.5.0"); }
int KAEvent::calVersion() { return KAlarm::Version(1,5,0); }
// Custom calendar properties.
@@ -54,16 +54,16 @@ static const TQCString NEXT_RECUR_PROPERTY("NEXTRECUR"); // X-KDE-KALARM-NEX
static const TQCString REPEAT_PROPERTY("REPEAT"); // X-KDE-KALARM-REPEAT property
// - General alarm properties
static const TQCString TYPE_PROPERTY("TYPE"); // X-KDE-KALARM-TYPE property
-static const TQString FILE_TYPE = TQString::fromLatin1("FILE");
-static const TQString AT_LOGIN_TYPE = TQString::fromLatin1("LOGIN");
-static const TQString REMINDER_TYPE = TQString::fromLatin1("REMINDER");
-static const TQString REMINDER_ONCE_TYPE = TQString::fromLatin1("REMINDER_ONCE");
-static const TQString ARCHIVE_REMINDER_ONCE_TYPE = TQString::fromLatin1("ONCE");
-static const TQString TIME_DEFERRAL_TYPE = TQString::fromLatin1("DEFERRAL");
-static const TQString DATE_DEFERRAL_TYPE = TQString::fromLatin1("DATE_DEFERRAL");
-static const TQString DISPLAYING_TYPE = TQString::fromLatin1("DISPLAYING"); // used only in displaying calendar
-static const TQString PRE_ACTION_TYPE = TQString::fromLatin1("PRE");
-static const TQString POST_ACTION_TYPE = TQString::fromLatin1("POST");
+static const TQString FILE_TYPE = TQString::tqfromLatin1("FILE");
+static const TQString AT_LOGIN_TYPE = TQString::tqfromLatin1("LOGIN");
+static const TQString REMINDER_TYPE = TQString::tqfromLatin1("REMINDER");
+static const TQString REMINDER_ONCE_TYPE = TQString::tqfromLatin1("REMINDER_ONCE");
+static const TQString ARCHIVE_REMINDER_ONCE_TYPE = TQString::tqfromLatin1("ONCE");
+static const TQString TIME_DEFERRAL_TYPE = TQString::tqfromLatin1("DEFERRAL");
+static const TQString DATE_DEFERRAL_TYPE = TQString::tqfromLatin1("DATE_DEFERRAL");
+static const TQString DISPLAYING_TYPE = TQString::tqfromLatin1("DISPLAYING"); // used only in displaying calendar
+static const TQString PRE_ACTION_TYPE = TQString::tqfromLatin1("PRE");
+static const TQString POST_ACTION_TYPE = TQString::tqfromLatin1("POST");
static const TQCString NEXT_REPEAT_PROPERTY("NEXTREPEAT"); // X-KDE-KALARM-NEXTREPEAT property
// - Display alarm properties
static const TQCString FONT_COLOUR_PROPERTY("FONTCOLOR"); // X-KDE-KALARM-FONTCOLOR property
@@ -74,27 +74,27 @@ static const TQCString VOLUME_PROPERTY("VOLUME"); // X-KDE-KALARM-VOL
static const TQCString SPEAK_PROPERTY("SPEAK"); // X-KDE-KALARM-SPEAK property
// Event categories
-static const TQString DATE_ONLY_CATEGORY = TQString::fromLatin1("DATE");
-static const TQString EMAIL_BCC_CATEGORY = TQString::fromLatin1("BCC");
-static const TQString CONFIRM_ACK_CATEGORY = TQString::fromLatin1("ACKCONF");
-static const TQString LATE_CANCEL_CATEGORY = TQString::fromLatin1("LATECANCEL;");
-static const TQString AUTO_CLOSE_CATEGORY = TQString::fromLatin1("LATECLOSE;");
-static const TQString TEMPL_AFTER_TIME_CATEGORY = TQString::fromLatin1("TMPLAFTTIME;");
-static const TQString KMAIL_SERNUM_CATEGORY = TQString::fromLatin1("KMAIL:");
-static const TQString KORGANIZER_CATEGORY = TQString::fromLatin1("KORG");
-static const TQString DEFER_CATEGORY = TQString::fromLatin1("DEFER;");
-static const TQString ARCHIVE_CATEGORY = TQString::fromLatin1("SAVE");
-static const TQString ARCHIVE_CATEGORIES = TQString::fromLatin1("SAVE:");
-static const TQString LOG_CATEGORY = TQString::fromLatin1("LOG:");
-static const TQString xtermURL = TQString::fromLatin1("xterm:");
+static const TQString DATE_ONLY_CATEGORY = TQString::tqfromLatin1("DATE");
+static const TQString EMAIL_BCC_CATEGORY = TQString::tqfromLatin1("BCC");
+static const TQString CONFIRM_ACK_CATEGORY = TQString::tqfromLatin1("ACKCONF");
+static const TQString LATE_CANCEL_CATEGORY = TQString::tqfromLatin1("LATECANCEL;");
+static const TQString AUTO_CLOSE_CATEGORY = TQString::tqfromLatin1("LATECLOSE;");
+static const TQString TEMPL_AFTER_TIME_CATEGORY = TQString::tqfromLatin1("TMPLAFTTIME;");
+static const TQString KMAIL_SERNUM_CATEGORY = TQString::tqfromLatin1("KMAIL:");
+static const TQString KORGANIZER_CATEGORY = TQString::tqfromLatin1("KORG");
+static const TQString DEFER_CATEGORY = TQString::tqfromLatin1("DEFER;");
+static const TQString ARCHIVE_CATEGORY = TQString::tqfromLatin1("SAVE");
+static const TQString ARCHIVE_CATEGORIES = TQString::tqfromLatin1("SAVE:");
+static const TQString LOG_CATEGORY = TQString::tqfromLatin1("LOG:");
+static const TQString xtermURL = TQString::tqfromLatin1("xterm:");
// Event status strings
-static const TQString DISABLED_STATUS = TQString::fromLatin1("DISABLED");
+static const TQString DISABLED_STATUS = TQString::tqfromLatin1("DISABLED");
-static const TQString EXPIRED_UID = TQString::fromLatin1("-exp-");
-static const TQString DISPLAYING_UID = TQString::fromLatin1("-disp-");
-static const TQString TEMPLATE_UID = TQString::fromLatin1("-tmpl-");
-static const TQString KORGANIZER_UID = TQString::fromLatin1("-korg-");
+static const TQString EXPIRED_UID = TQString::tqfromLatin1("-exp-");
+static const TQString DISPLAYING_UID = TQString::tqfromLatin1("-disp-");
+static const TQString TEMPLATE_UID = TQString::tqfromLatin1("-tmpl-");
+static const TQString KORGANIZER_UID = TQString::tqfromLatin1("-korg-");
struct AlarmData
{
@@ -334,7 +334,7 @@ void KAEvent::set(const Event& event)
}
mNextMainDateTime = readDateTime(event, dateOnly, mStartDateTime);
mSaveDateTime = event.created();
- if (uidStatus() == TEMPLATE)
+ if (uidtqStatus() == TEMPLATE)
mTemplateName = event.summary();
if (event.statusStr() == DISABLED_STATUS)
mEnabled = false;
@@ -885,38 +885,38 @@ DateTime KAEvent::displayDateTime() const
/******************************************************************************
* Convert a unique ID to indicate that the event is in a specified calendar file.
*/
-TQString KAEvent::uid(const TQString& id, Status status)
+TQString KAEvent::uid(const TQString& id, tqStatus status)
{
TQString result = id;
- Status oldStatus;
+ tqStatus oldtqStatus;
int i, len;
if ((i = result.find(EXPIRED_UID)) > 0)
{
- oldStatus = EXPIRED;
+ oldtqStatus = EXPIRED;
len = EXPIRED_UID.length();
}
else if ((i = result.find(DISPLAYING_UID)) > 0)
{
- oldStatus = DISPLAYING;
+ oldtqStatus = DISPLAYING;
len = DISPLAYING_UID.length();
}
else if ((i = result.find(TEMPLATE_UID)) > 0)
{
- oldStatus = TEMPLATE;
+ oldtqStatus = TEMPLATE;
len = TEMPLATE_UID.length();
}
else if ((i = result.find(KORGANIZER_UID)) > 0)
{
- oldStatus = KORGANIZER;
+ oldtqStatus = KORGANIZER;
len = KORGANIZER_UID.length();
}
else
{
- oldStatus = ACTIVE;
+ oldtqStatus = ACTIVE;
i = result.findRev('-');
len = 1;
}
- if (status != oldStatus && i > 0)
+ if (status != oldtqStatus && i > 0)
{
TQString part;
switch (status)
@@ -935,7 +935,7 @@ TQString KAEvent::uid(const TQString& id, Status status)
/******************************************************************************
* Get the calendar type for a unique ID.
*/
-KAEvent::Status KAEvent::uidStatus(const TQString& uid)
+KAEvent::tqStatus KAEvent::uidtqStatus(const TQString& uid)
{
if (uid.find(EXPIRED_UID) > 0)
return EXPIRED;
@@ -1000,7 +1000,7 @@ bool KAEvent::updateKCalEvent(Event& ev, bool checkUid, bool original, bool canc
if (mEmailBcc)
cats.append(EMAIL_BCC_CATEGORY);
if (mKMailSerialNumber)
- cats.append(TQString("%1%2").arg(KMAIL_SERNUM_CATEGORY).arg(mKMailSerialNumber));
+ cats.append(TQString("%1%2").tqarg(KMAIL_SERNUM_CATEGORY).tqarg(mKMailSerialNumber));
if (mCopyToKOrganizer)
cats.append(KORGANIZER_CATEGORY);
if (mCommandXterm)
@@ -1008,11 +1008,11 @@ bool KAEvent::updateKCalEvent(Event& ev, bool checkUid, bool original, bool canc
else if (!mLogFile.isEmpty())
cats.append(LOG_CATEGORY + mLogFile);
if (mLateCancel)
- cats.append(TQString("%1%2").arg(mAutoClose ? AUTO_CLOSE_CATEGORY : LATE_CANCEL_CATEGORY).arg(mLateCancel));
+ cats.append(TQString("%1%2").tqarg(mAutoClose ? AUTO_CLOSE_CATEGORY : LATE_CANCEL_CATEGORY).tqarg(mLateCancel));
if (mDeferDefaultMinutes)
- cats.append(TQString("%1%2").arg(DEFER_CATEGORY).arg(mDeferDefaultMinutes));
+ cats.append(TQString("%1%2").tqarg(DEFER_CATEGORY).tqarg(mDeferDefaultMinutes));
if (!mTemplateName.isEmpty() && mTemplateAfterTime >= 0)
- cats.append(TQString("%1%2").arg(TEMPL_AFTER_TIME_CATEGORY).arg(mTemplateAfterTime));
+ cats.append(TQString("%1%2").tqarg(TEMPL_AFTER_TIME_CATEGORY).tqarg(mTemplateAfterTime));
if (mArchive && !original)
{
TQStringList params;
@@ -1032,21 +1032,21 @@ bool KAEvent::updateKCalEvent(Event& ev, bool checkUid, bool original, bool canc
unit = 'H';
count /= 60;
}
- params += TQString("%1%2").arg(count).arg(unit);
+ params += TQString("%1%2").tqarg(count).tqarg(unit);
}
if (mArchiveRepeatAtLogin)
params += AT_LOGIN_TYPE;
if (params.count() > 0)
{
TQString cat = ARCHIVE_CATEGORIES;
- cat += params.join(TQString::fromLatin1(";"));
+ cat += params.join(TQString::tqfromLatin1(";"));
cats.append(cat);
}
else
cats.append(ARCHIVE_CATEGORY);
}
ev.setCategories(cats);
- ev.setCustomStatus(mEnabled ? TQString() : DISABLED_STATUS);
+ ev.setCustomtqStatus(mEnabled ? TQString() : DISABLED_STATUS);
ev.setRevision(mRevision);
ev.clearAlarms();
@@ -1084,7 +1084,7 @@ bool KAEvent::updateKCalEvent(Event& ev, bool checkUid, bool original, bool canc
{
// Alarm repetition is normally held in the main alarm, but since
// the main alarm has expired, store in a custom property.
- TQString param = TQString("%1:%2").arg(mRepeatInterval).arg(mRepeatCount);
+ TQString param = TQString("%1:%2").tqarg(mRepeatInterval).tqarg(mRepeatCount);
ev.setCustomProperty(APPNAME, REPEAT_PROPERTY, param);
}
@@ -1097,9 +1097,9 @@ bool KAEvent::updateKCalEvent(Event& ev, bool checkUid, bool original, bool canc
else if (mAtLoginDateTime.isValid())
dtl = mAtLoginDateTime;
else if (mStartDateTime.isDateOnly())
- dtl = TQDate::currentDate().addDays(-1);
+ dtl = TQDate::tqcurrentDate().addDays(-1);
else
- dtl = TQDateTime::currentDateTime();
+ dtl = TQDateTime::tqcurrentDateTime();
initKCalAlarm(ev, dtl, AT_LOGIN_TYPE);
if (!ancillaryType && dtl.isValid())
{
@@ -1243,7 +1243,7 @@ Alarm* KAEvent::initKCalAlarm(Event& event, int startOffsetSecs, const TQStringL
case KAAlarm::AUDIO_ALARM:
alarm->setAudioAlarm(mAudioFile); // empty for a beep or for speaking
if (mSpeak)
- alarm->setCustomProperty(APPNAME, SPEAK_PROPERTY, TQString::fromLatin1("Y"));
+ alarm->setCustomProperty(APPNAME, SPEAK_PROPERTY, TQString::tqfromLatin1("Y"));
if (mRepeatSound)
{
alarm->setRepeatCount(-1);
@@ -1251,9 +1251,9 @@ Alarm* KAEvent::initKCalAlarm(Event& event, int startOffsetSecs, const TQStringL
}
if (!mAudioFile.isEmpty() && mSoundVolume >= 0)
alarm->setCustomProperty(APPNAME, VOLUME_PROPERTY,
- TQString::fromLatin1("%1;%2;%3").arg(TQString::number(mSoundVolume, 'f', 2))
- .arg(TQString::number(mFadeVolume, 'f', 2))
- .arg(mFadeSeconds));
+ TQString::tqfromLatin1("%1;%2;%3").tqarg(TQString::number(mSoundVolume, 'f', 2))
+ .tqarg(TQString::number(mFadeVolume, 'f', 2))
+ .tqarg(mFadeSeconds));
break;
case KAAlarm::PRE_ACTION_ALARM:
setProcedureAlarm(alarm, mPreAction);
@@ -1277,9 +1277,9 @@ Alarm* KAEvent::initKCalAlarm(Event& event, int startOffsetSecs, const TQStringL
case T_MESSAGE:
alarm->setDisplayAlarm(AlarmText::toCalendarText(mText));
alarm->setCustomProperty(APPNAME, FONT_COLOUR_PROPERTY,
- TQString::fromLatin1("%1;%2;%3").arg(mBgColour.name())
- .arg(mFgColour.name())
- .arg(mDefaultFont ? TQString() : mFont.toString()));
+ TQString::tqfromLatin1("%1;%2;%3").tqarg(mBgColour.name())
+ .tqarg(mFgColour.name())
+ .tqarg(mDefaultFont ? TQString() : mFont.toString()));
break;
case T_COMMAND:
if (mCommandScript)
@@ -1601,7 +1601,7 @@ bool KAEvent::defer(const DateTime& dateTime, bool reminder, bool adjustRecurren
set_deferral(NORMAL_DEFERRAL);
if (adjustRecurrence)
{
- TQDateTime now = TQDateTime::currentDateTime();
+ TQDateTime now = TQDateTime::tqcurrentDateTime();
if (mainEndRepeatTime() < now)
{
// The last repetition (if any) of the current recurrence has already passed.
@@ -1641,7 +1641,7 @@ void KAEvent::cancelDefer()
// Set the deferral time to be the same as the next recurrence/repetition.
// This prevents an immediate retriggering of the alarm.
if (mMainExpired
- || nextOccurrence(TQDateTime::currentDateTime(), mDeferralTime, RETURN_REPETITION) == NO_OCCURRENCE)
+ || nextOccurrence(TQDateTime::tqcurrentDateTime(), mDeferralTime, RETURN_REPETITION) == NO_OCCURRENCE)
{
// The main alarm has expired, so simply delete the deferral
mDeferralTime = DateTime();
@@ -1678,7 +1678,7 @@ DateTime KAEvent::deferralLimit(KAEvent::DeferLimitType* limitType) const
// It's a repeated alarm. Don't allow it to be deferred past its
// next occurrence or repetition.
DateTime reminderTime;
- TQDateTime now = TQDateTime::currentDateTime();
+ TQDateTime now = TQDateTime::tqcurrentDateTime();
OccurType type = nextOccurrence(now, endTime, RETURN_REPETITION);
if (type & OCCURRENCE_REPEAT)
ltype = LIMIT_REPETITION;
@@ -1695,7 +1695,7 @@ DateTime KAEvent::deferralLimit(KAEvent::DeferLimitType* limitType) const
ltype = LIMIT_RECURRENCE;
}
else if ((mReminderMinutes || mDeferral == REMINDER_DEFERRAL || mArchiveReminderMinutes)
- && TQDateTime::currentDateTime() < mNextMainDateTime.dateTime())
+ && TQDateTime::tqcurrentDateTime() < mNextMainDateTime.dateTime())
{
// It's an reminder alarm. Don't allow it to be deferred past its main alarm time.
endTime = mNextMainDateTime;
@@ -2093,7 +2093,7 @@ TQString KAEvent::recurrenceText(bool brief) const
else
{
TQString mins;
- return i18n("Hours and Minutes", "%1H %2M").arg(TQString::number(frequency/60)).arg(mins.sprintf("%02d", frequency%60));
+ return i18n("Hours and Minutes", "%1H %2M").tqarg(TQString::number(frequency/60)).tqarg(mins.sprintf("%02d", frequency%60));
}
case RecurrenceRule::rDaily:
return i18n("1 Day", "%n Days", frequency);
@@ -2125,7 +2125,7 @@ TQString KAEvent::repetitionText(bool brief) const
if (mRepeatInterval % 60 == 0)
return i18n("1 Hour", "%n Hours", mRepeatInterval/60);
TQString mins;
- return i18n("Hours and Minutes", "%1H %2M").arg(TQString::number(mRepeatInterval/60)).arg(mins.sprintf("%02d", mRepeatInterval%60));
+ return i18n("Hours and Minutes", "%1H %2M").tqarg(TQString::number(mRepeatInterval/60)).tqarg(mins.sprintf("%02d", mRepeatInterval%60));
}
if (mRepeatInterval % (7*1440))
return i18n("1 Day", "%n Days", mRepeatInterval/1440);
@@ -2633,21 +2633,21 @@ void KAEvent::convertKCalEvents(KCal::Calendar& calendar, int version, bool adju
static const TQChar LATE_CANCEL_CODE = 'C';
static const TQChar AT_LOGIN_CODE = 'L'; // subsidiary alarm at every login
static const TQChar DEFERRAL_CODE = 'D'; // extra deferred alarm
- static const TQString TEXT_PREFIX = TQString::fromLatin1("TEXT:");
- static const TQString FILE_PREFIX = TQString::fromLatin1("FILE:");
- static const TQString COMMAND_PREFIX = TQString::fromLatin1("CMD:");
+ static const TQString TEXT_PREFIX = TQString::tqfromLatin1("TEXT:");
+ static const TQString FILE_PREFIX = TQString::tqfromLatin1("FILE:");
+ static const TQString COMMAND_PREFIX = TQString::tqfromLatin1("CMD:");
// KAlarm pre-0.9.2 codes held in the event's CATEGORY property
- static const TQString BEEP_CATEGORY = TQString::fromLatin1("BEEP");
+ static const TQString BEEP_CATEGORY = TQString::tqfromLatin1("BEEP");
// KAlarm pre-1.1.1 LATECANCEL category with no parameter
- static const TQString LATE_CANCEL_CAT = TQString::fromLatin1("LATECANCEL");
+ static const TQString LATE_CANCEL_CAT = TQString::tqfromLatin1("LATECANCEL");
// KAlarm pre-1.3.0 TMPLDEFTIME category with no parameter
- static const TQString TEMPL_DEF_TIME_CAT = TQString::fromLatin1("TMPLDEFTIME");
+ static const TQString TEMPL_DEF_TIME_CAT = TQString::tqfromLatin1("TMPLDEFTIME");
// KAlarm pre-1.3.1 XTERM category
- static const TQString EXEC_IN_XTERM_CAT = TQString::fromLatin1("XTERM");
+ static const TQString EXEC_IN_XTERM_CAT = TQString::tqfromLatin1("XTERM");
// KAlarm pre-1.4.22 properties
static const TQCString KMAIL_ID_PROPERTY("KMAILID"); // X-KDE-KALARM-KMAILID property
@@ -2818,7 +2818,7 @@ void KAEvent::convertKCalEvents(KCal::Calendar& calendar, int version, bool adju
* X-KDE-KALARM-FONTCOLOUR property.
* Convert BEEP category into an audio alarm with no audio file.
*/
- if (uidStatus(event->uid()) == EXPIRED)
+ if (uidtqStatus(event->uid()) == EXPIRED)
event->setCreated(event->dtEnd());
TQDateTime start = event->dtStart();
if (event->doesFloat())
@@ -2844,7 +2844,7 @@ void KAEvent::convertKCalEvents(KCal::Calendar& calendar, int version, bool adju
Alarm* alarm = *alit;
if (alarm->type() == Alarm::Display)
alarm->setCustomProperty(APPNAME, FONT_COLOUR_PROPERTY,
- TQString::fromLatin1("%1;;").arg(cats[0]));
+ TQString::tqfromLatin1("%1;;").tqarg(cats[0]));
}
cats.remove(cats.begin());
}
@@ -2918,7 +2918,7 @@ void KAEvent::convertKCalEvents(KCal::Calendar& calendar, int version, bool adju
while ((it = cats.find(TEMPL_DEF_TIME_CAT)) != cats.end())
{
cats.remove(it);
- cats.append(TQString("%1%2").arg(TEMPL_AFTER_TIME_CATEGORY).arg(0));
+ cats.append(TQString("%1%2").tqarg(TEMPL_AFTER_TIME_CATEGORY).tqarg(0));
}
}
@@ -2937,7 +2937,7 @@ void KAEvent::convertKCalEvents(KCal::Calendar& calendar, int version, bool adju
}
if (addLateCancel)
- cats.append(TQString("%1%2").arg(LATE_CANCEL_CATEGORY).arg(1));
+ cats.append(TQString("%1%2").tqarg(LATE_CANCEL_CATEGORY).tqarg(1));
event->setCategories(cats);