summaryrefslogtreecommitdiffstats
path: root/kalarm/alarmtext.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
commit7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch)
tree8474f9b444b2756228600050f07a7ff25de532b2 /kalarm/alarmtext.cpp
parentf587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff)
downloadtdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz
tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kalarm/alarmtext.cpp')
-rw-r--r--kalarm/alarmtext.cpp72
1 files changed, 36 insertions, 36 deletions
diff --git a/kalarm/alarmtext.cpp b/kalarm/alarmtext.cpp
index 2162f62a4..460517118 100644
--- a/kalarm/alarmtext.cpp
+++ b/kalarm/alarmtext.cpp
@@ -19,7 +19,7 @@
*/
#include "kalarm.h"
-#include <qstringlist.h>
+#include <tqstringlist.h>
#include <klocale.h>
#include "alarmevent.h"
@@ -27,29 +27,29 @@
#include "alarmtext.h"
-QString AlarmText::mFromPrefix;
-QString AlarmText::mToPrefix;
-QString AlarmText::mCcPrefix;
-QString AlarmText::mDatePrefix;
-QString AlarmText::mSubjectPrefix;
-QString AlarmText::mFromPrefixEn = QString::fromLatin1("From:");
-QString AlarmText::mToPrefixEn = QString::fromLatin1("To:");
-QString AlarmText::mCcPrefixEn = QString::fromLatin1("Cc:");
-QString AlarmText::mDatePrefixEn = QString::fromLatin1("Date:");
-QString AlarmText::mSubjectPrefixEn = QString::fromLatin1("Subject:");
+TQString AlarmText::mFromPrefix;
+TQString AlarmText::mToPrefix;
+TQString AlarmText::mCcPrefix;
+TQString AlarmText::mDatePrefix;
+TQString AlarmText::mSubjectPrefix;
+TQString AlarmText::mFromPrefixEn = TQString::fromLatin1("From:");
+TQString AlarmText::mToPrefixEn = TQString::fromLatin1("To:");
+TQString AlarmText::mCcPrefixEn = TQString::fromLatin1("Cc:");
+TQString AlarmText::mDatePrefixEn = TQString::fromLatin1("Date:");
+TQString AlarmText::mSubjectPrefixEn = TQString::fromLatin1("Subject:");
-void AlarmText::setText(const QString& text)
+void AlarmText::setText(const TQString& text)
{
mBody = text;
- mIsScript = text.startsWith(QString::fromLatin1("#!"));
+ mIsScript = text.startsWith(TQString::fromLatin1("#!"));
mIsEmail = false;
- mTo = mFrom = mCc = mTime = mSubject = QString::null;
+ mTo = mFrom = mCc = mTime = mSubject = TQString::null;
mKMailSerialNum = 0;
}
-void AlarmText::setEmail(const QString& to, const QString& from, const QString& cc, const QString& time,
- const QString& subject, const QString& body, unsigned long kmailSerialNumber)
+void AlarmText::setEmail(const TQString& to, const TQString& from, const TQString& cc, const TQString& time,
+ const TQString& subject, const TQString& body, unsigned long kmailSerialNumber)
{
mIsScript = false;
mIsEmail = true;
@@ -65,13 +65,13 @@ void AlarmText::setEmail(const QString& to, const QString& from, const QString&
/******************************************************************************
* Return the text for a text message alarm, in display format.
*/
-QString AlarmText::displayText() const
+TQString AlarmText::displayText() const
{
if (mIsEmail)
{
// Format the email into a text alarm
setUpTranslations();
- QString text;
+ TQString text;
text = mFromPrefix + '\t' + mFrom + '\n';
text += mToPrefix + '\t' + mTo + '\n';
if (!mCc.isEmpty())
@@ -104,9 +104,9 @@ bool AlarmText::isEmpty() const
/******************************************************************************
* Check whether a text is an email.
*/
-bool AlarmText::checkIfEmail(const QString& text)
+bool AlarmText::checkIfEmail(const TQString& text)
{
- QStringList lines = QStringList::split('\n', text);
+ TQStringList lines = TQStringList::split('\n', text);
return emailHeaderCount(lines);
}
@@ -114,7 +114,7 @@ bool AlarmText::checkIfEmail(const QString& text)
* Check whether a text is an email.
* Reply = number of email header lines, or 0 if not an email.
*/
-int AlarmText::emailHeaderCount(const QStringList& lines)
+int AlarmText::emailHeaderCount(const TQStringList& lines)
{
setUpTranslations();
int maxn = lines.count();
@@ -136,17 +136,17 @@ int AlarmText::emailHeaderCount(const QStringList& lines)
/******************************************************************************
* Check whether a text is an email, and if so return its headers or optionally
* only its subject line.
-* Reply = headers/subject line, or QString::null if not the text of an email.
+* Reply = headers/subject line, or TQString::null if not the text of an email.
*/
-QString AlarmText::emailHeaders(const QString& text, bool subjectOnly)
+TQString AlarmText::emailHeaders(const TQString& text, bool subjectOnly)
{
- QStringList lines = QStringList::split('\n', text);
+ TQStringList lines = TQStringList::split('\n', text);
int n = emailHeaderCount(lines);
if (!n)
- return QString::null;
+ return TQString::null;
if (subjectOnly)
return lines[n-1].mid(mSubjectPrefix.length()).stripWhiteSpace();
- QString h = lines[0];
+ TQString h = lines[0];
for (int i = 1; i < n; ++i)
{
h += '\n';
@@ -161,9 +161,9 @@ QString AlarmText::emailHeaders(const QString& text, bool subjectOnly)
* untranslated email prefixes.
* 'email' is set to indicate whether it is an email text.
*/
-QString AlarmText::fromCalendarText(const QString& text, bool& email)
+TQString AlarmText::fromCalendarText(const TQString& text, bool& email)
{
- QStringList lines = QStringList::split('\n', text);
+ TQStringList lines = TQStringList::split('\n', text);
int maxn = lines.count();
if (maxn >= 4
&& lines[0].startsWith(mFromPrefixEn)
@@ -177,7 +177,7 @@ QString AlarmText::fromCalendarText(const QString& text, bool& email)
&& lines[n+1].startsWith(mSubjectPrefixEn))
{
setUpTranslations();
- QString dispText;
+ TQString dispText;
dispText = mFromPrefix + lines[0].mid(mFromPrefixEn.length()) + '\n';
dispText += mToPrefix + lines[1].mid(mToPrefixEn.length()) + '\n';
if (n == 3)
@@ -200,10 +200,10 @@ QString AlarmText::fromCalendarText(const QString& text, bool& email)
* Return the text for a text message alarm, in alarm calendar format.
* (The prefix strings are untranslated in the calendar.)
*/
-QString AlarmText::toCalendarText(const QString& text)
+TQString AlarmText::toCalendarText(const TQString& text)
{
setUpTranslations();
- QStringList lines = QStringList::split('\n', text);
+ TQStringList lines = TQStringList::split('\n', text);
int maxn = lines.count();
if (maxn >= 4
&& lines[0].startsWith(mFromPrefix)
@@ -217,7 +217,7 @@ QString AlarmText::toCalendarText(const QString& text)
&& lines[n+1].startsWith(mSubjectPrefix))
{
// Format the email into a text alarm
- QString calText;
+ TQString calText;
calText = mFromPrefixEn + lines[0].mid(mFromPrefix.length()) + '\n';
calText += mToPrefixEn + lines[1].mid(mToPrefix.length()) + '\n';
if (n == 3)
@@ -255,13 +255,13 @@ void AlarmText::setUpTranslations()
* If 'truncated' is non-null, it will be set true if the text returned has been
* truncated, other than to strip a trailing newline.
*/
-QString AlarmText::summary(const KAEvent& event, int maxLines, bool* truncated)
+TQString AlarmText::summary(const KAEvent& event, int maxLines, bool* truncated)
{
- QString text = (event.action() == KAEvent::EMAIL) ? event.emailSubject() : event.cleanText();
+ TQString text = (event.action() == KAEvent::EMAIL) ? event.emailSubject() : event.cleanText();
if (event.action() == KAEvent::MESSAGE)
{
// If the message is the text of an email, return its headers or just subject line
- QString subject = emailHeaders(text, (maxLines <= 1));
+ TQString subject = emailHeaders(text, (maxLines <= 1));
if (!subject.isNull())
{
if (truncated)
@@ -284,5 +284,5 @@ QString AlarmText::summary(const KAEvent& event, int maxLines, bool* truncated)
return text.left(newline); // text ends in newline
if (truncated)
*truncated = true;
- return text.left(newline + (maxLines <= 1 ? 0 : 1)) + QString::fromLatin1("...");
+ return text.left(newline + (maxLines <= 1 ? 0 : 1)) + TQString::fromLatin1("...");
}