summaryrefslogtreecommitdiffstats
path: root/kalarm/kalarmd
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/kalarmd
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/kalarmd')
-rw-r--r--kalarm/kalarmd/adcalendar.cpp28
-rw-r--r--kalarm/kalarmd/adcalendar.h40
-rw-r--r--kalarm/kalarmd/adconfigdata.cpp46
-rw-r--r--kalarm/kalarmd/adconfigdata.h6
-rw-r--r--kalarm/kalarmd/alarmdaemon.cpp102
-rw-r--r--kalarm/kalarmd/alarmdaemon.h30
-rw-r--r--kalarm/kalarmd/alarmdaemoniface.h14
-rw-r--r--kalarm/kalarmd/alarmguiiface.h4
-rw-r--r--kalarm/kalarmd/clientinfo.cpp22
-rw-r--r--kalarm/kalarmd/clientinfo.h34
10 files changed, 163 insertions, 163 deletions
diff --git a/kalarm/kalarmd/adcalendar.cpp b/kalarm/kalarmd/adcalendar.cpp
index 8af97cc0b..1f325be48 100644
--- a/kalarm/kalarmd/adcalendar.cpp
+++ b/kalarm/kalarmd/adcalendar.cpp
@@ -21,7 +21,7 @@
#include <unistd.h>
#include <assert.h>
-#include <qfile.h>
+#include <tqfile.h>
#include <ktempfile.h>
#include <kio/job.h>
@@ -30,14 +30,14 @@
#include "adcalendar.moc"
-QValueList<ADCalendar*> ADCalendar::mCalendars;
+TQValueList<ADCalendar*> ADCalendar::mCalendars;
ADCalendar::EventsMap ADCalendar::mEventsHandled;
ADCalendar::EventsMap ADCalendar::mEventsPending;
-QStringList ADCalendar::mCalendarUrls; // never delete or reorder anything in this list!
+TQStringList ADCalendar::mCalendarUrls; // never delete or reorder anything in this list!
-ADCalendar::ADCalendar(const QString& url, const QCString& appname)
- : KCal::CalendarLocal(QString::fromLatin1("UTC")),
+ADCalendar::ADCalendar(const TQString& url, const TQCString& appname)
+ : KCal::CalendarLocal(TQString::fromLatin1("UTC")),
mUrlString(url),
mAppName(appname),
mLoaded(false),
@@ -96,7 +96,7 @@ bool ADCalendar::loadFile(bool reset)
KURL dest;
dest.setPath(mTempFileName);
KIO::FileCopyJob* job = KIO::file_copy(url, dest, -1, true);
- connect(job, SIGNAL(result(KIO::Job*)), SLOT(slotDownloadJobResult(KIO::Job*)));
+ connect(job, TQT_SIGNAL(result(KIO::Job*)), TQT_SLOT(slotDownloadJobResult(KIO::Job*)));
}
return true;
}
@@ -114,12 +114,12 @@ void ADCalendar::slotDownloadJobResult(KIO::Job *job)
kdDebug(5900) << "--- Downloaded to " << mTempFileName << endl;
loadLocalFile(mTempFileName);
}
- unlink(QFile::encodeName(mTempFileName));
- mTempFileName = QString::null;
+ unlink(TQFile::encodeName(mTempFileName));
+ mTempFileName = TQString::null;
emit loaded(this, mLoaded);
}
-void ADCalendar::loadLocalFile(const QString& filename)
+void ADCalendar::loadLocalFile(const TQString& filename)
{
mLoaded = load(filename);
if (!mLoaded)
@@ -140,7 +140,7 @@ bool ADCalendar::setLoadedConnected()
* Check whether all the alarms for the event with the given ID have already
* been handled.
*/
-bool ADCalendar::eventHandled(const KCal::Event* event, const QValueList<QDateTime>& alarmtimes)
+bool ADCalendar::eventHandled(const KCal::Event* event, const TQValueList<TQDateTime>& alarmtimes)
{
EventsMap::ConstIterator it = mEventsHandled.find(EventKey(event->uid(), mUrlIndex));
if (it == mEventsHandled.end())
@@ -164,7 +164,7 @@ bool ADCalendar::eventHandled(const KCal::Event* event, const QValueList<QDateTi
* Remember that the event with the given ID has been handled.
* It must already be in the pending list.
*/
-void ADCalendar::setEventHandled(const QString& eventID)
+void ADCalendar::setEventHandled(const TQString& eventID)
{
kdDebug(5900) << "ADCalendar::setEventHandled(" << eventID << ")\n";
EventKey key(eventID, mUrlIndex);
@@ -182,7 +182,7 @@ void ADCalendar::setEventHandled(const QString& eventID)
* Remember that the specified alarms for the event with the given ID have been
* notified to KAlarm, but no reply has come back yet.
*/
-void ADCalendar::setEventPending(const KCal::Event* event, const QValueList<QDateTime>& alarmtimes)
+void ADCalendar::setEventPending(const KCal::Event* event, const TQValueList<TQDateTime>& alarmtimes)
{
if (event)
{
@@ -195,7 +195,7 @@ void ADCalendar::setEventPending(const KCal::Event* event, const QValueList<QDat
/******************************************************************************
* Add a specified entry to the events pending or handled list.
*/
-void ADCalendar::setEventInMap(EventsMap& map, const EventKey& key, const QValueList<QDateTime>& alarmtimes, int sequence)
+void ADCalendar::setEventInMap(EventsMap& map, const EventKey& key, const TQValueList<TQDateTime>& alarmtimes, int sequence)
{
EventsMap::Iterator it = map.find(key);
if (it != map.end())
@@ -239,7 +239,7 @@ void ADCalendar::clearEventMap(EventsMap& map, bool nonexistentOnly)
/******************************************************************************
* Look up the calendar with the specified full calendar URL.
*/
-ADCalendar* ADCalendar::getCalendar(const QString& calendarURL)
+ADCalendar* ADCalendar::getCalendar(const TQString& calendarURL)
{
if (!calendarURL.isEmpty())
{
diff --git a/kalarm/kalarmd/adcalendar.h b/kalarm/kalarmd/adcalendar.h
index 656070bef..67e2fac92 100644
--- a/kalarm/kalarmd/adcalendar.h
+++ b/kalarm/kalarmd/adcalendar.h
@@ -31,12 +31,12 @@ class ADCalendar : public KCal::CalendarLocal
{
Q_OBJECT
public:
- typedef QValueList<ADCalendar*>::ConstIterator ConstIterator;
+ typedef TQValueList<ADCalendar*>::ConstIterator ConstIterator;
~ADCalendar();
- const QString& urlString() const { return mUrlString; }
- const QCString& appName() const { return mAppName; }
+ const TQString& urlString() const { return mUrlString; }
+ const TQCString& appName() const { return mAppName; }
void setEnabled(bool enabled) { mEnabled = enabled; }
bool enabled() const { return mEnabled && !unregistered(); }
@@ -47,10 +47,10 @@ class ADCalendar : public KCal::CalendarLocal
void setUnregistered(bool u) { mUnregistered = u; }
bool unregistered() const { return mUnregistered; }
- void setEventPending(const KCal::Event*, const QValueList<QDateTime>&);
- void setEventHandled(const QString& eventID);
+ void setEventPending(const KCal::Event*, const TQValueList<TQDateTime>&);
+ void setEventHandled(const TQString& eventID);
void clearEventsHandled(bool nonexistentOnly = false);
- bool eventHandled(const KCal::Event*, const QValueList<QDateTime>&);
+ bool eventHandled(const KCal::Event*, const TQValueList<TQDateTime>&);
bool loadFile(bool reset);
bool setLoadedConnected(); // check status of mLoadedConnected and set it to true
@@ -60,7 +60,7 @@ class ADCalendar : public KCal::CalendarLocal
static ConstIterator begin() { return mCalendars.begin(); }
static ConstIterator end() { return mCalendars.end(); }
- static ADCalendar* getCalendar(const QString& calendarURL);
+ static ADCalendar* getCalendar(const TQString& calendarURL);
signals:
void loaded(ADCalendar*, bool success);
@@ -68,7 +68,7 @@ class ADCalendar : public KCal::CalendarLocal
protected:
// Only ClientInfo can construct ADCalendar objects
friend class ClientInfo;
- ADCalendar(const QString& url, const QCString& appname);
+ ADCalendar(const TQString& url, const TQCString& appname);
private slots:
void slotDownloadJobResult(KIO::Job*);
@@ -77,39 +77,39 @@ class ADCalendar : public KCal::CalendarLocal
struct EventKey
{
EventKey() : calendarIndex(-1) { }
- EventKey(const QString& id, int cal) : eventID(id), calendarIndex(cal) { }
+ EventKey(const TQString& id, int cal) : eventID(id), calendarIndex(cal) { }
bool operator<(const EventKey& k) const
{ return (calendarIndex == k.calendarIndex)
? (eventID < k.eventID) : (calendarIndex < k.calendarIndex);
}
- QString eventID;
+ TQString eventID;
int calendarIndex;
};
struct EventItem
{
EventItem() : eventSequence(0) { }
- EventItem(int seqno, const QValueList<QDateTime>& alarmtimes)
+ EventItem(int seqno, const TQValueList<TQDateTime>& alarmtimes)
: eventSequence(seqno), alarmTimes(alarmtimes) {}
int eventSequence;
- QValueList<QDateTime> alarmTimes;
+ TQValueList<TQDateTime> alarmTimes;
};
- typedef QMap<EventKey, EventItem> EventsMap; // calendar/event ID, event sequence num
+ typedef TQMap<EventKey, EventItem> EventsMap; // calendar/event ID, event sequence num
static EventsMap mEventsHandled; // IDs of already triggered events which have been processed by KAlarm
static EventsMap mEventsPending; // IDs of already triggered events not yet processed by KAlarm
- static QStringList mCalendarUrls; // URLs of all calendars ever opened
- static QValueList<ADCalendar*> mCalendars; // list of all constructed calendars
+ static TQStringList mCalendarUrls; // URLs of all calendars ever opened
+ static TQValueList<ADCalendar*> mCalendars; // list of all constructed calendars
ADCalendar(const ADCalendar&); // prohibit copying
ADCalendar& operator=(const ADCalendar&); // prohibit copying
- void loadLocalFile(const QString& filename);
+ void loadLocalFile(const TQString& filename);
void clearEventMap(EventsMap&, bool nonexistentOnly);
- void setEventInMap(EventsMap&, const EventKey&, const QValueList<QDateTime>& alarmtimes, int sequence);
+ void setEventInMap(EventsMap&, const EventKey&, const TQValueList<TQDateTime>& alarmtimes, int sequence);
- QString mUrlString; // calendar file URL
- QCString mAppName; // name of application owning this calendar
- QString mTempFileName; // temporary file used if currently downloading, else null
+ TQString mUrlString; // calendar file URL
+ TQCString mAppName; // name of application owning this calendar
+ TQString mTempFileName; // temporary file used if currently downloading, else null
int mUrlIndex; // unique index to URL in mCalendarUrls
bool mLoaded; // true if calendar file is currently loaded
bool mLoadedConnected; // true if the loaded() signal has been connected to AlarmDaemon
diff --git a/kalarm/kalarmd/adconfigdata.cpp b/kalarm/kalarmd/adconfigdata.cpp
index 11dc6bf67..c8c5dd355 100644
--- a/kalarm/kalarmd/adconfigdata.cpp
+++ b/kalarm/kalarmd/adconfigdata.cpp
@@ -20,8 +20,8 @@
#include "kalarmd.h"
-#include <qregexp.h>
-#include <qstringlist.h>
+#include <tqregexp.h>
+#include <tqstringlist.h>
#include <kconfig.h>
#include <kstandarddirs.h>
@@ -31,13 +31,13 @@
#include "adconfigdata.h"
// Config file key strings
-const QString CLIENT_GROUP(QString::fromLatin1("Client "));
-const QRegExp CLIENT_GROUP_SEARCH("^Client ");
+const TQString CLIENT_GROUP(TQString::fromLatin1("Client "));
+const TQRegExp CLIENT_GROUP_SEARCH("^Client ");
// Client data file key strings
-const QString CALENDAR_KEY(QString::fromLatin1("Calendar"));
-const QString TITLE_KEY(QString::fromLatin1("Title"));
-const QString DCOP_OBJECT_KEY(QString::fromLatin1("DCOP object"));
-const QString START_CLIENT_KEY(QString::fromLatin1("Start"));
+const TQString CALENDAR_KEY(TQString::fromLatin1("Calendar"));
+const TQString TITLE_KEY(TQString::fromLatin1("Title"));
+const TQString DCOP_OBJECT_KEY(TQString::fromLatin1("DCOP object"));
+const TQString START_CLIENT_KEY(TQString::fromLatin1("Start"));
/******************************************************************************
@@ -49,17 +49,17 @@ void ADConfigData::readConfig()
kdDebug(5900) << "ADConfigData::readConfig()" << endl;
ClientInfo::clear();
KConfig* config = KGlobal::config();
- QStringList clients = config->groupList().grep(CLIENT_GROUP_SEARCH);
- for (QStringList::Iterator cl = clients.begin(); cl != clients.end(); ++cl)
+ TQStringList clients = config->groupList().grep(CLIENT_GROUP_SEARCH);
+ for (TQStringList::Iterator cl = clients.begin(); cl != clients.end(); ++cl)
{
// Read this client's configuration
config->setGroup(*cl);
- QString client = *cl;
+ TQString client = *cl;
client.remove(CLIENT_GROUP_SEARCH);
- QString title = config->readEntry(TITLE_KEY, client); // read app title (default = app name)
- QCString dcopObject = config->readEntry(DCOP_OBJECT_KEY).local8Bit();
+ TQString title = config->readEntry(TITLE_KEY, client); // read app title (default = app name)
+ TQCString dcopObject = config->readEntry(DCOP_OBJECT_KEY).local8Bit();
bool startClient = config->readBoolEntry(START_CLIENT_KEY, false);
- QString calendar = config->readPathEntry(CALENDAR_KEY);
+ TQString calendar = config->readPathEntry(CALENDAR_KEY);
// Verify the configuration
bool ok = false;
@@ -99,12 +99,12 @@ void ADConfigData::readConfig()
/******************************************************************************
* Write a client application's details to the config file.
*/
-void ADConfigData::writeClient(const QCString& appName, const ClientInfo* cinfo)
+void ADConfigData::writeClient(const TQCString& appName, const ClientInfo* cinfo)
{
KConfig* config = KGlobal::config();
- config->setGroup(CLIENT_GROUP + QString::fromLocal8Bit(appName));
+ config->setGroup(CLIENT_GROUP + TQString::fromLocal8Bit(appName));
config->writeEntry(TITLE_KEY, cinfo->title());
- config->writeEntry(DCOP_OBJECT_KEY, QString::fromLocal8Bit(cinfo->dcopObject()));
+ config->writeEntry(DCOP_OBJECT_KEY, TQString::fromLocal8Bit(cinfo->dcopObject()));
config->writeEntry(START_CLIENT_KEY, cinfo->startClient());
config->writePathEntry(CALENDAR_KEY, cinfo->calendar()->urlString());
config->sync();
@@ -113,20 +113,20 @@ void ADConfigData::writeClient(const QCString& appName, const ClientInfo* cinfo)
/******************************************************************************
* Remove a client application's details from the config file.
*/
-void ADConfigData::removeClient(const QCString& appName)
+void ADConfigData::removeClient(const TQCString& appName)
{
KConfig* config = KGlobal::config();
- config->deleteGroup(CLIENT_GROUP + QString::fromLocal8Bit(appName));
+ config->deleteGroup(CLIENT_GROUP + TQString::fromLocal8Bit(appName));
config->sync();
}
/******************************************************************************
* Set the calendar file URL for a specified application.
*/
-void ADConfigData::setCalendar(const QCString& appName, ADCalendar* cal)
+void ADConfigData::setCalendar(const TQCString& appName, ADCalendar* cal)
{
KConfig* config = KGlobal::config();
- config->setGroup(CLIENT_GROUP + QString::fromLocal8Bit(appName));
+ config->setGroup(CLIENT_GROUP + TQString::fromLocal8Bit(appName));
config->writePathEntry(CALENDAR_KEY, cal->urlString());
config->sync();
}
@@ -139,8 +139,8 @@ void ADConfigData::enableAutoStart(bool on)
kdDebug(5900) << "ADConfigData::enableAutoStart(" << on << ")\n";
KConfig* config = KGlobal::config();
config->reparseConfiguration();
- config->setGroup(QString::fromLatin1(DAEMON_AUTOSTART_SECTION));
- config->writeEntry(QString::fromLatin1(DAEMON_AUTOSTART_KEY), on);
+ config->setGroup(TQString::fromLatin1(DAEMON_AUTOSTART_SECTION));
+ config->writeEntry(TQString::fromLatin1(DAEMON_AUTOSTART_KEY), on);
config->sync();
}
diff --git a/kalarm/kalarmd/adconfigdata.h b/kalarm/kalarmd/adconfigdata.h
index 2c841fdff..4b7dddbe1 100644
--- a/kalarm/kalarmd/adconfigdata.h
+++ b/kalarm/kalarmd/adconfigdata.h
@@ -32,9 +32,9 @@ class ADConfigData
{
public:
static void readConfig();
- static void writeClient(const QCString& appName, const ClientInfo*);
- static void removeClient(const QCString& appName);
- static void setCalendar(const QCString& appName, ADCalendar*);
+ static void writeClient(const TQCString& appName, const ClientInfo*);
+ static void removeClient(const TQCString& appName);
+ static void setCalendar(const TQCString& appName, ADCalendar*);
static void enableAutoStart(bool);
};
diff --git a/kalarm/kalarmd/alarmdaemon.cpp b/kalarm/kalarmd/alarmdaemon.cpp
index 576678574..d8bcf83a2 100644
--- a/kalarm/kalarmd/alarmdaemon.cpp
+++ b/kalarm/kalarmd/alarmdaemon.cpp
@@ -24,9 +24,9 @@
#include <unistd.h>
#include <stdlib.h>
-#include <qtimer.h>
-#include <qfile.h>
-#include <qdatetime.h>
+#include <tqtimer.h>
+#include <tqfile.h>
+#include <tqdatetime.h>
#include <kapplication.h>
#include <kstandarddirs.h>
@@ -54,13 +54,13 @@ static const int KALARM_AUTOSTART_TIMEOUT = 30;
static const int SECS_PER_DAY = 3600 * 24;
// KAlarm config file keys
-static const QString START_OF_DAY(QString::fromLatin1("StartOfDay"));
-static const QString AUTOSTART_TRAY(QString::fromLatin1("AutostartTray"));
+static const TQString START_OF_DAY(TQString::fromLatin1("StartOfDay"));
+static const TQString AUTOSTART_TRAY(TQString::fromLatin1("AutostartTray"));
-AlarmDaemon::AlarmDaemon(bool autostart, QObject *parent, const char *name)
+AlarmDaemon::AlarmDaemon(bool autostart, TQObject *parent, const char *name)
: DCOPObject(name),
- QObject(parent, name),
+ TQObject(parent, name),
mAlarmTimer(0)
{
kdDebug(5900) << "AlarmDaemon::AlarmDaemon()" << endl;
@@ -84,12 +84,12 @@ AlarmDaemon::AlarmDaemon(bool autostart, QObject *parent, const char *name)
* itself and instead will simply open a new window.
*/
KConfig kaconfig(locate("config", "kalarmrc"));
- kaconfig.setGroup(QString::fromLatin1("General"));
+ kaconfig.setGroup(TQString::fromLatin1("General"));
autostart = kaconfig.readBoolEntry(AUTOSTART_TRAY, false);
if (autostart)
{
kdDebug(5900) << "AlarmDaemon::AlarmDaemon(): wait to autostart KAlarm\n";
- QTimer::singleShot(KALARM_AUTOSTART_TIMEOUT * 1000, this, SLOT(autostartKAlarm()));
+ TQTimer::singleShot(KALARM_AUTOSTART_TIMEOUT * 1000, this, TQT_SLOT(autostartKAlarm()));
}
}
if (!autostart)
@@ -118,9 +118,9 @@ void AlarmDaemon::autostartKAlarm()
return; // KAlarm has already registered with us
}
kdDebug(5900) << "AlarmDaemon::autostartKAlarm(): starting KAlarm\n";
- QStringList args;
- args << QString::fromLatin1("--tray");
- int ret = KApplication::kdeinitExec(QString::fromLatin1("kalarm"), args);
+ TQStringList args;
+ args << TQString::fromLatin1("--tray");
+ int ret = KApplication::kdeinitExec(TQString::fromLatin1("kalarm"), args);
if (ret)
kdError(5900) << "AlarmDaemon::autostartKAlarm(): error=" << ret << endl;
else
@@ -136,8 +136,8 @@ void AlarmDaemon::autostartKAlarm()
void AlarmDaemon::startMonitoring()
{
// Set up the alarm timer
- mAlarmTimer = new QTimer(this);
- connect(mAlarmTimer, SIGNAL(timeout()), SLOT(checkAlarmsSlot()));
+ mAlarmTimer = new TQTimer(this);
+ connect(mAlarmTimer, TQT_SIGNAL(timeout()), TQT_SLOT(checkAlarmsSlot()));
setTimerStatus();
// Start monitoring calendar files.
@@ -149,7 +149,7 @@ void AlarmDaemon::startMonitoring()
/******************************************************************************
* DCOP call to enable or disable monitoring of a calendar.
*/
-void AlarmDaemon::enableCal(const QString& urlString, bool enable)
+void AlarmDaemon::enableCal(const TQString& urlString, bool enable)
{
kdDebug(5900) << "AlarmDaemon::enableCal(" << urlString << ")" << endl;
ADCalendar* cal = ADCalendar::getCalendar(urlString);
@@ -163,7 +163,7 @@ void AlarmDaemon::enableCal(const QString& urlString, bool enable)
/******************************************************************************
* DCOP call to reload, and optionally reset, the specified calendar.
*/
-void AlarmDaemon::reloadCal(const QCString& appname, const QString& urlString, bool reset)
+void AlarmDaemon::reloadCal(const TQCString& appname, const TQString& urlString, bool reset)
{
kdDebug(5900) << "AlarmDaemon::reloadCal(" << urlString << ")" << endl;
ADCalendar* cal = ADCalendar::getCalendar(urlString);
@@ -185,7 +185,7 @@ void AlarmDaemon::reloadCal(ADCalendar* cal, bool reset)
{
cal->close();
if (!cal->setLoadedConnected())
- connect(cal, SIGNAL(loaded(ADCalendar*, bool)), SLOT(calendarLoaded(ADCalendar*, bool)));
+ connect(cal, TQT_SIGNAL(loaded(ADCalendar*, bool)), TQT_SLOT(calendarLoaded(ADCalendar*, bool)));
cal->loadFile(reset);
}
else if (reset)
@@ -205,9 +205,9 @@ void AlarmDaemon::calendarLoaded(ADCalendar* cal, bool success)
* DCOP call to notify the daemon that an event has been handled, and optionally
* to tell it to reload the calendar.
*/
-void AlarmDaemon::eventHandled(const QCString& appname, const QString& calendarUrl, const QString& eventID, bool reload)
+void AlarmDaemon::eventHandled(const TQCString& appname, const TQString& calendarUrl, const TQString& eventID, bool reload)
{
- QString urlString = expandURL(calendarUrl);
+ TQString urlString = expandURL(calendarUrl);
kdDebug(5900) << "AlarmDaemon::eventHandled(" << urlString << (reload ? "): reload" : ")") << endl;
ADCalendar* cal = ADCalendar::getCalendar(urlString);
if (!cal || cal->appName() != appname)
@@ -224,8 +224,8 @@ void AlarmDaemon::eventHandled(const QCString& appname, const QString& calendarU
* a hang if the daemon happens to send a notification to KAlarm at the
* same time as KAlarm calls this DCCOP method.
*/
-void AlarmDaemon::registerApp(const QCString& appName, const QString& appTitle,
- const QCString& dcopObject, const QString& calendarUrl,
+void AlarmDaemon::registerApp(const TQCString& appName, const TQString& appTitle,
+ const TQCString& dcopObject, const TQString& calendarUrl,
bool startClient)
{
kdDebug(5900) << "AlarmDaemon::registerApp(" << appName << ", " << appTitle << ", "
@@ -280,7 +280,7 @@ void AlarmDaemon::registerApp(const QCString& appName, const QString& appTitle,
* a hang if the daemon happens to send a notification to KAlarm at the
* same time as KAlarm calls this DCCOP method.
*/
-void AlarmDaemon::registerChange(const QCString& appName, bool startClient)
+void AlarmDaemon::registerChange(const TQCString& appName, bool startClient)
{
kdDebug(5900) << "AlarmDaemon::registerChange(" << appName << ", " << startClient << ")" << endl;
KAlarmd::RegisterResult result;
@@ -330,7 +330,7 @@ void AlarmDaemon::checkAlarmsSlot()
}
else if (--mAlarmTimerSyncCount <= 0)
{
- int interval = DAEMON_CHECK_INTERVAL + 1 - QTime::currentTime().second();
+ int interval = DAEMON_CHECK_INTERVAL + 1 - TQTime::currentTime().second();
if (interval < DAEMON_CHECK_INTERVAL - 1)
{
// Need to re-synch to 1 second past the minute
@@ -365,59 +365,59 @@ void AlarmDaemon::checkAlarms(ADCalendar* cal)
if (!cal->loaded() || !cal->enabled())
return;
- QDateTime now = QDateTime::currentDateTime();
+ TQDateTime now = TQDateTime::currentDateTime();
kdDebug(5901) << " To: " << now.toString() << endl;
- QValueList<KCal::Alarm*> alarms = cal->alarmsTo(now);
+ TQValueList<KCal::Alarm*> alarms = cal->alarmsTo(now);
if (!alarms.count())
return;
- QValueList<KCal::Event*> eventsDone;
- for (QValueList<KCal::Alarm*>::ConstIterator it = alarms.begin(); it != alarms.end(); ++it)
+ TQValueList<KCal::Event*> eventsDone;
+ for (TQValueList<KCal::Alarm*>::ConstIterator it = alarms.begin(); it != alarms.end(); ++it)
{
KCal::Event* event = dynamic_cast<KCal::Event*>((*it)->parent());
if (!event || eventsDone.find(event) != eventsDone.end())
continue; // either not an event, or the event has already been processed
eventsDone += event;
- const QString& eventID = event->uid();
+ const TQString& eventID = event->uid();
kdDebug(5901) << "AlarmDaemon::checkAlarms(): event " << eventID << endl;
// Check which of the alarms for this event are due.
// The times in 'alarmtimes' corresponding to due alarms are set.
// The times for non-due alarms are set invalid in 'alarmtimes'.
bool recurs = event->doesRecur();
- const QStringList cats = event->categories();
- bool floats = (cats.find(QString::fromLatin1("DATE")) != cats.end());
- QDateTime nextDateTime = event->dtStart();
+ const TQStringList cats = event->categories();
+ bool floats = (cats.find(TQString::fromLatin1("DATE")) != cats.end());
+ TQDateTime nextDateTime = event->dtStart();
if (recurs)
{
- QString prop = event->customProperty("KALARM", "NEXTRECUR");
+ TQString prop = event->customProperty("KALARM", "NEXTRECUR");
if (prop.length() >= 8)
{
// The next due recurrence time is specified
- QDate d(prop.left(4).toInt(), prop.mid(4,2).toInt(), prop.mid(6,2).toInt());
+ TQDate d(prop.left(4).toInt(), prop.mid(4,2).toInt(), prop.mid(6,2).toInt());
if (d.isValid())
{
if (floats && prop.length() == 8)
nextDateTime = d;
- else if (!floats && prop.length() == 15 && prop[8] == QChar('T'))
+ else if (!floats && prop.length() == 15 && prop[8] == TQChar('T'))
{
- QTime t(prop.mid(9,2).toInt(), prop.mid(11,2).toInt(), prop.mid(13,2).toInt());
+ TQTime t(prop.mid(9,2).toInt(), prop.mid(11,2).toInt(), prop.mid(13,2).toInt());
if (t.isValid())
- nextDateTime = QDateTime(d, t);
+ nextDateTime = TQDateTime(d, t);
}
}
}
}
if (floats)
nextDateTime.setTime(mStartOfDay);
- QValueList<QDateTime> alarmtimes;
+ TQValueList<TQDateTime> alarmtimes;
KCal::Alarm::List alarms = event->alarms();
for (KCal::Alarm::List::ConstIterator al = alarms.begin(); al != alarms.end(); ++al)
{
KCal::Alarm* alarm = *al;
- QDateTime dt;
+ TQDateTime dt;
if (alarm->enabled())
{
- QDateTime dt1;
+ TQDateTime dt1;
if (!alarm->hasTime())
{
// Find the latest recurrence for the alarm.
@@ -429,7 +429,7 @@ void AlarmDaemon::checkAlarms(ADCalendar* cal)
{
dt1 = nextDateTime.addSecs(floats ? (offset/SECS_PER_DAY)*SECS_PER_DAY : offset);
if (dt1 > now)
- dt1 = QDateTime();
+ dt1 = TQDateTime();
}
}
// Get latest due repetition, or the recurrence time if none
@@ -438,7 +438,7 @@ void AlarmDaemon::checkAlarms(ADCalendar* cal)
{
int snoozeSecs = alarm->snoozeTime() * 60;
int offset = alarm->repeatCount() * snoozeSecs;
- QDateTime lastRepetition = nextDateTime.addSecs(floats ? (offset/SECS_PER_DAY)*SECS_PER_DAY : offset);
+ TQDateTime lastRepetition = nextDateTime.addSecs(floats ? (offset/SECS_PER_DAY)*SECS_PER_DAY : offset);
if (lastRepetition <= now)
dt = lastRepetition;
else
@@ -466,11 +466,11 @@ void AlarmDaemon::checkAlarms(ADCalendar* cal)
* Send a DCOP message to KAlarm telling it that an alarm should now be handled.
* Reply = false if the event should be held pending until KAlarm can be started.
*/
-bool AlarmDaemon::notifyEvent(ADCalendar* calendar, const QString& eventID)
+bool AlarmDaemon::notifyEvent(ADCalendar* calendar, const TQString& eventID)
{
if (!calendar)
return true;
- QCString appname = calendar->appName();
+ TQCString appname = calendar->appName();
const ClientInfo* client = ClientInfo::get(appname);
if (!client)
{
@@ -478,7 +478,7 @@ bool AlarmDaemon::notifyEvent(ADCalendar* calendar, const QString& eventID)
return false;
}
kdDebug(5900) << "AlarmDaemon::notifyEvent(" << appname << ", " << eventID << "): notification type=" << client->startClient() << endl;
- QString id = QString::fromLatin1("ad:") + eventID; // prefix to indicate that the notification if from the daemon
+ TQString id = TQString::fromLatin1("ad:") + eventID; // prefix to indicate that the notification if from the daemon
// Check if the client application is running and ready to receive notification
bool registered = kapp->dcopClient()->isApplicationRegistered(static_cast<const char*>(appname));
@@ -504,7 +504,7 @@ bool AlarmDaemon::notifyEvent(ADCalendar* calendar, const QString& eventID)
// Start KAlarm, using the command line to specify the alarm
KProcess p;
- QString cmd = locate("exe", appname);
+ TQString cmd = locate("exe", appname);
if (cmd.isEmpty())
{
kdDebug(5900) << "AlarmDaemon::notifyEvent(): '" << appname << "' not found" << endl;
@@ -553,7 +553,7 @@ void AlarmDaemon::setTimerStatus()
{
// Timeout every minute.
// But first synchronise to one second after the minute boundary.
- int firstInterval = DAEMON_CHECK_INTERVAL + 1 - QTime::currentTime().second();
+ int firstInterval = DAEMON_CHECK_INTERVAL + 1 - TQTime::currentTime().second();
mAlarmTimer->start(1000 * firstInterval);
mAlarmTimerSyncing = (firstInterval != DAEMON_CHECK_INTERVAL);
kdDebug(5900) << "Started alarm timer" << endl;
@@ -574,7 +574,7 @@ void AlarmDaemon::notifyCalStatus(const ADCalendar* cal)
ClientInfo* client = ClientInfo::get(cal);
if (!client)
return;
- QCString appname = client->appName();
+ TQCString appname = client->appName();
if (kapp->dcopClient()->isApplicationRegistered(static_cast<const char*>(appname)))
{
KAlarmd::CalendarStatus change = cal->available() ? (cal->enabled() ? KAlarmd::CALENDAR_ENABLED : KAlarmd::CALENDAR_DISABLED)
@@ -595,8 +595,8 @@ void AlarmDaemon::notifyCalStatus(const ADCalendar* cal)
void AlarmDaemon::readKAlarmConfig()
{
KConfig config(locate("config", "kalarmrc"));
- config.setGroup(QString::fromLatin1("General"));
- QDateTime defTime(QDate(1900,1,1), QTime());
+ config.setGroup(TQString::fromLatin1("General"));
+ TQDateTime defTime(TQDate(1900,1,1), TQTime());
mStartOfDay = config.readDateTimeEntry(START_OF_DAY, &defTime).time();
kdDebug(5900) << "AlarmDaemon::readKAlarmConfig()" << endl;
}
@@ -606,9 +606,9 @@ void AlarmDaemon::readKAlarmConfig()
* (We must store full URLs in the calendar data since otherwise later calls to
* reload or remove calendars won't necessarily find a match.)
*/
-QString AlarmDaemon::expandURL(const QString& urlString)
+TQString AlarmDaemon::expandURL(const TQString& urlString)
{
if (urlString.isEmpty())
- return QString();
+ return TQString();
return KURL(urlString).url();
}
diff --git a/kalarm/kalarmd/alarmdaemon.h b/kalarm/kalarmd/alarmdaemon.h
index 6ab5d0f9a..54e7980a2 100644
--- a/kalarm/kalarmd/alarmdaemon.h
+++ b/kalarm/kalarmd/alarmdaemon.h
@@ -29,11 +29,11 @@
class ADCalendar;
-class AlarmDaemon : public QObject, virtual public AlarmDaemonIface
+class AlarmDaemon : public TQObject, virtual public AlarmDaemonIface
{
Q_OBJECT
public:
- AlarmDaemon(bool autostart, QObject* parent = 0, const char* name = 0);
+ AlarmDaemon(bool autostart, TQObject* parent = 0, const char* name = 0);
private slots:
//#ifdef AUTOSTART_KALARM
@@ -46,34 +46,34 @@ class AlarmDaemon : public QObject, virtual public AlarmDaemonIface
private:
// DCOP interface
void enableAutoStart(bool enable);
- void enableCalendar(const QString& urlString, bool enable)
+ void enableCalendar(const TQString& urlString, bool enable)
{ enableCal(expandURL(urlString), enable); }
- void reloadCalendar(const QCString& appname, const QString& urlString)
+ void reloadCalendar(const TQCString& appname, const TQString& urlString)
{ reloadCal(appname, expandURL(urlString), false); }
- void resetCalendar(const QCString& appname, const QString& urlString)
+ void resetCalendar(const TQCString& appname, const TQString& urlString)
{ reloadCal(appname, expandURL(urlString), true); }
- void registerApp(const QCString& appName, const QString& appTitle, const QCString& dcopObject,
- const QString& calendarUrl, bool startClient);
- void registerChange(const QCString& appName, bool startClient);
- void eventHandled(const QCString& appname, const QString& calendarURL, const QString& eventID, bool reload);
+ void registerApp(const TQCString& appName, const TQString& appTitle, const TQCString& dcopObject,
+ const TQString& calendarUrl, bool startClient);
+ void registerChange(const TQCString& appName, bool startClient);
+ void eventHandled(const TQCString& appname, const TQString& calendarURL, const TQString& eventID, bool reload);
void timeConfigChanged() { readKAlarmConfig(); }
void quit();
// Other methods
void readKAlarmConfig();
void startMonitoring();
- void enableCal(const QString& urlString, bool enable);
- void reloadCal(const QCString& appname, const QString& urlString, bool reset);
+ void enableCal(const TQString& urlString, bool enable);
+ void reloadCal(const TQCString& appname, const TQString& urlString, bool reset);
void reloadCal(ADCalendar*, bool reset);
void checkAlarms(ADCalendar*);
- bool notifyEvent(ADCalendar*, const QString& eventID);
+ bool notifyEvent(ADCalendar*, const TQString& eventID);
void notifyCalStatus(const ADCalendar*);
void setTimerStatus();
- static QString expandURL(const QString& urlString);
+ static TQString expandURL(const TQString& urlString);
- QTimer* mAlarmTimer;
+ TQTimer* mAlarmTimer;
int mAlarmTimerSyncCount; // countdown to re-synching the alarm timer
bool mAlarmTimerSyncing; // true while alarm timer interval < 1 minute
- QTime mStartOfDay; // start of day for date-only alarms
+ TQTime mStartOfDay; // start of day for date-only alarms
};
#endif // ALARMDAEMON_H
diff --git a/kalarm/kalarmd/alarmdaemoniface.h b/kalarm/kalarmd/alarmdaemoniface.h
index 708f5b281..75723ce60 100644
--- a/kalarm/kalarmd/alarmdaemoniface.h
+++ b/kalarm/kalarmd/alarmdaemoniface.h
@@ -31,13 +31,13 @@ class AlarmDaemonIface : virtual public DCOPObject
K_DCOP
k_dcop:
virtual ASYNC enableAutoStart(bool enable) = 0;
- virtual ASYNC enableCalendar(const QString& urlString, bool enable) = 0;
- virtual ASYNC reloadCalendar(const QCString& appname, const QString& urlString) = 0;
- virtual ASYNC resetCalendar(const QCString& appname, const QString& urlString) = 0;
- virtual ASYNC registerApp(const QCString& appName, const QString& appTitle, const QCString& dcopObject,
- const QString& calendarUrl, bool startClient) = 0;
- virtual ASYNC registerChange(const QCString& appName, bool startClient) = 0;
- virtual ASYNC eventHandled(const QCString& appname, const QString& calendarURL, const QString& eventID, bool reload) = 0;
+ virtual ASYNC enableCalendar(const TQString& urlString, bool enable) = 0;
+ virtual ASYNC reloadCalendar(const TQCString& appname, const TQString& urlString) = 0;
+ virtual ASYNC resetCalendar(const TQCString& appname, const TQString& urlString) = 0;
+ virtual ASYNC registerApp(const TQCString& appName, const TQString& appTitle, const TQCString& dcopObject,
+ const TQString& calendarUrl, bool startClient) = 0;
+ virtual ASYNC registerChange(const TQCString& appName, bool startClient) = 0;
+ virtual ASYNC eventHandled(const TQCString& appname, const TQString& calendarURL, const TQString& eventID, bool reload) = 0;
virtual ASYNC timeConfigChanged() = 0;
virtual ASYNC quit() = 0;
};
diff --git a/kalarm/kalarmd/alarmguiiface.h b/kalarm/kalarmd/alarmguiiface.h
index 7e98c831d..d221fd345 100644
--- a/kalarm/kalarmd/alarmguiiface.h
+++ b/kalarm/kalarmd/alarmguiiface.h
@@ -55,11 +55,11 @@ class AlarmGuiIface : virtual public DCOPObject
/** Called to notify a change in status of the calendar.
@param calendarStatus new calendar status. Value is of type CalendarStatus.
*/
- virtual ASYNC alarmDaemonUpdate(int calendarStatus, const QString& calendarURL) = 0;
+ virtual ASYNC alarmDaemonUpdate(int calendarStatus, const TQString& calendarURL) = 0;
/** Called to notify that an alarm is due.
*/
- virtual ASYNC handleEvent(const QString& calendarURL, const QString& eventID) = 0;
+ virtual ASYNC handleEvent(const TQString& calendarURL, const TQString& eventID) = 0;
/** Called to indicate success/failure of (re)register() call.
@param result success/failure code. Value is of type RegisterResult.
diff --git a/kalarm/kalarmd/clientinfo.cpp b/kalarm/kalarmd/clientinfo.cpp
index 21889082e..e8c5ea6c7 100644
--- a/kalarm/kalarmd/clientinfo.cpp
+++ b/kalarm/kalarmd/clientinfo.cpp
@@ -21,11 +21,11 @@
#include "adcalendar.h"
#include "clientinfo.h"
-QMap<QCString, ClientInfo*> ClientInfo::mClients;
+TQMap<TQCString, ClientInfo*> ClientInfo::mClients;
-ClientInfo::ClientInfo(const QCString& appName, const QString& title,
- const QCString& dcopObj, const QString& calendar, bool startClient)
+ClientInfo::ClientInfo(const TQCString& appName, const TQString& title,
+ const TQCString& dcopObj, const TQString& calendar, bool startClient)
: mAppName(appName),
mTitle(title),
mDcopObject(dcopObj),
@@ -35,8 +35,8 @@ ClientInfo::ClientInfo(const QCString& appName, const QString& title,
mClients[mAppName] = this;
}
-ClientInfo::ClientInfo(const QCString& appName, const QString& title,
- const QCString& dcopObj, ADCalendar* calendar, bool startClient)
+ClientInfo::ClientInfo(const TQCString& appName, const TQString& title,
+ const TQCString& dcopObj, ADCalendar* calendar, bool startClient)
: mAppName(appName),
mTitle(title),
mDcopObject(dcopObj),
@@ -55,7 +55,7 @@ ClientInfo::~ClientInfo()
/******************************************************************************
* Set a new calendar for the specified client application.
*/
-ADCalendar* ClientInfo::setCalendar(const QString& url)
+ADCalendar* ClientInfo::setCalendar(const TQString& url)
{
if (url != mCalendar->urlString())
{
@@ -68,11 +68,11 @@ ADCalendar* ClientInfo::setCalendar(const QString& url)
/******************************************************************************
* Return the ClientInfo object for the specified client application.
*/
-ClientInfo* ClientInfo::get(const QCString& appName)
+ClientInfo* ClientInfo::get(const TQCString& appName)
{
if (appName.isEmpty())
return 0;
- QMap<QCString, ClientInfo*>::ConstIterator it = mClients.find(appName);
+ TQMap<TQCString, ClientInfo*>::ConstIterator it = mClients.find(appName);
if (it == mClients.end())
return 0;
return it.data();
@@ -94,7 +94,7 @@ ClientInfo* ClientInfo::get(const ADCalendar* cal)
*/
void ClientInfo::clear()
{
- QMap<QCString, ClientInfo*>::Iterator it;
+ TQMap<TQCString, ClientInfo*>::Iterator it;
while ((it = mClients.begin()) != mClients.end())
delete it.data();
}
@@ -102,9 +102,9 @@ void ClientInfo::clear()
/******************************************************************************
* Delete the client with the specified name.
*/
-void ClientInfo::remove(const QCString& appName)
+void ClientInfo::remove(const TQCString& appName)
{
- QMap<QCString, ClientInfo*>::Iterator it = mClients.find(appName);
+ TQMap<TQCString, ClientInfo*>::Iterator it = mClients.find(appName);
if (it != mClients.end())
delete it.data();
}
diff --git a/kalarm/kalarmd/clientinfo.h b/kalarm/kalarmd/clientinfo.h
index fe6491d7e..d679669ec 100644
--- a/kalarm/kalarmd/clientinfo.h
+++ b/kalarm/kalarmd/clientinfo.h
@@ -22,9 +22,9 @@
#ifndef _CALCLIENT_H
#define _CALCLIENT_H
-#include <qcstring.h>
-#include <qstring.h>
-#include <qmap.h>
+#include <tqcstring.h>
+#include <tqstring.h>
+#include <tqmap.h>
class ADCalendar;
@@ -36,35 +36,35 @@ class ADCalendar;
class ClientInfo
{
public:
- typedef QMap<QCString, ClientInfo*>::ConstIterator ConstIterator;
+ typedef TQMap<TQCString, ClientInfo*>::ConstIterator ConstIterator;
- ClientInfo(const QCString &appName, const QString &title, const QCString &dcopObj,
- const QString& calendar, bool startClient);
- ClientInfo(const QCString &appName, const QString &title, const QCString &dcopObj,
+ ClientInfo(const TQCString &appName, const TQString &title, const TQCString &dcopObj,
+ const TQString& calendar, bool startClient);
+ ClientInfo(const TQCString &appName, const TQString &title, const TQCString &dcopObj,
ADCalendar* calendar, bool startClient);
~ClientInfo();
- ADCalendar* setCalendar(const QString& url);
+ ADCalendar* setCalendar(const TQString& url);
void detachCalendar() { mCalendar = 0; }
void setStartClient(bool start) { mStartClient = start; }
- QCString appName() const { return mAppName; }
- QString title() const { return mTitle; }
- QCString dcopObject() const { return mDcopObject; }
+ TQCString appName() const { return mAppName; }
+ TQString title() const { return mTitle; }
+ TQCString dcopObject() const { return mDcopObject; }
ADCalendar* calendar() const { return mCalendar; }
bool startClient() const { return mStartClient; }
static ConstIterator begin() { return mClients.begin(); }
static ConstIterator end() { return mClients.end(); }
- static ClientInfo* get(const QCString& appName);
+ static ClientInfo* get(const TQCString& appName);
static ClientInfo* get(const ADCalendar*);
- static void remove(const QCString& appName);
+ static void remove(const TQCString& appName);
static void clear();
private:
- static QMap<QCString, ClientInfo*> mClients; // list of all constructed clients
- QCString mAppName; // client's executable and DCOP name
- QString mTitle; // application title for display purposes
- QCString mDcopObject; // object to receive DCOP messages
+ static TQMap<TQCString, ClientInfo*> mClients; // list of all constructed clients
+ TQCString mAppName; // client's executable and DCOP name
+ TQString mTitle; // application title for display purposes
+ TQCString mDcopObject; // object to receive DCOP messages
ADCalendar* mCalendar; // this client's event calendar
bool mStartClient; // whether to notify events via command line if client app isn't running
};