Commit c8998432 authored by David Jarvie's avatar David Jarvie

Change variable names from dcop...

parent 58014676
...@@ -563,7 +563,7 @@ bool KAlarmApp::quitIf(int exitCode, bool force) ...@@ -563,7 +563,7 @@ bool KAlarmApp::quitIf(int exitCode, bool force)
if (checkSystemTray()) if (checkSystemTray())
return false; return false;
} }
if (!mDcopQueue.isEmpty() || !mCommandProcesses.isEmpty()) if (!mActionQueue.isEmpty() || !mCommandProcesses.isEmpty())
{ {
// Don't quit yet if there are outstanding actions on the execution queue // Don't quit yet if there are outstanding actions on the execution queue
mPendingQuit = true; mPendingQuit = true;
...@@ -743,12 +743,12 @@ void KAlarmApp::checkNextDueAlarm() ...@@ -743,12 +743,12 @@ void KAlarmApp::checkNextDueAlarm()
*/ */
void KAlarmApp::queueAlarmId(const QString& id) void KAlarmApp::queueAlarmId(const QString& id)
{ {
for (int i = 0, end = mDcopQueue.count(); i < end; ++i) for (int i = 0, end = mActionQueue.count(); i < end; ++i)
{ {
if (mDcopQueue[i].function == EVENT_HANDLE && mDcopQueue[i].eventId == id) if (mActionQueue[i].function == EVENT_HANDLE && mActionQueue[i].eventId == id)
return; // the alarm is already queued return; // the alarm is already queued
} }
mDcopQueue.enqueue(DcopQEntry(EVENT_HANDLE, id)); mActionQueue.enqueue(ActionQEntry(EVENT_HANDLE, id));
} }
/****************************************************************************** /******************************************************************************
...@@ -804,9 +804,9 @@ void KAlarmApp::processQueue() ...@@ -804,9 +804,9 @@ void KAlarmApp::processQueue()
} }
// Process queued events // Process queued events
while (!mDcopQueue.isEmpty()) while (!mActionQueue.isEmpty())
{ {
DcopQEntry& entry = mDcopQueue.head(); ActionQEntry& entry = mActionQueue.head();
if (entry.eventId.isEmpty()) if (entry.eventId.isEmpty())
{ {
// It's a new alarm // It's a new alarm
...@@ -824,7 +824,7 @@ void KAlarmApp::processQueue() ...@@ -824,7 +824,7 @@ void KAlarmApp::processQueue()
} }
else else
handleEvent(entry.eventId, entry.function); handleEvent(entry.eventId, entry.function);
mDcopQueue.dequeue(); mActionQueue.dequeue();
} }
// Purge the default archived alarms resource if it's time to do so // Purge the default archived alarms resource if it's time to do so
...@@ -862,7 +862,7 @@ void KAlarmApp::atLoginEventAdded(const KAEvent& event) ...@@ -862,7 +862,7 @@ void KAlarmApp::atLoginEventAdded(const KAEvent& event)
{ {
if (mAlarmsEnabled) if (mAlarmsEnabled)
{ {
mDcopQueue.enqueue(DcopQEntry(EVENT_HANDLE, ev.id())); mActionQueue.enqueue(ActionQEntry(EVENT_HANDLE, ev.id()));
if (mInitialised) if (mInitialised)
QTimer::singleShot(0, this, SLOT(processQueue())); QTimer::singleShot(0, this, SLOT(processQueue()));
} }
...@@ -1205,7 +1205,7 @@ bool KAlarmApp::scheduleEvent(KAEvent::SubAction action, const QString& text, co ...@@ -1205,7 +1205,7 @@ bool KAlarmApp::scheduleEvent(KAEvent::SubAction action, const QString& text, co
// Alarm is due for display already. // Alarm is due for display already.
// First execute it once without adding it to the calendar file. // First execute it once without adding it to the calendar file.
if (!mInitialised) if (!mInitialised)
mDcopQueue.enqueue(DcopQEntry(event, EVENT_TRIGGER)); mActionQueue.enqueue(ActionQEntry(event, EVENT_TRIGGER));
else else
execAlarm(event, event.firstAlarm(), false); execAlarm(event, event.firstAlarm(), false);
// If it's a recurring alarm, reschedule it for its next occurrence // If it's a recurring alarm, reschedule it for its next occurrence
...@@ -1216,7 +1216,7 @@ bool KAlarmApp::scheduleEvent(KAEvent::SubAction action, const QString& text, co ...@@ -1216,7 +1216,7 @@ bool KAlarmApp::scheduleEvent(KAEvent::SubAction action, const QString& text, co
} }
// Queue the alarm for insertion into the calendar file // Queue the alarm for insertion into the calendar file
mDcopQueue.enqueue(DcopQEntry(event)); mActionQueue.enqueue(ActionQEntry(event));
if (mInitialised) if (mInitialised)
QTimer::singleShot(0, this, SLOT(processQueue())); QTimer::singleShot(0, this, SLOT(processQueue()));
return true; return true;
...@@ -1230,7 +1230,7 @@ bool KAlarmApp::scheduleEvent(KAEvent::SubAction action, const QString& text, co ...@@ -1230,7 +1230,7 @@ bool KAlarmApp::scheduleEvent(KAEvent::SubAction action, const QString& text, co
bool KAlarmApp::dbusHandleEvent(const QString& eventID, EventFunc function) bool KAlarmApp::dbusHandleEvent(const QString& eventID, EventFunc function)
{ {
kDebug() << eventID; kDebug() << eventID;
mDcopQueue.append(DcopQEntry(function, eventID)); mActionQueue.append(ActionQEntry(function, eventID));
if (mInitialised) if (mInitialised)
QTimer::singleShot(0, this, SLOT(processQueue())); QTimer::singleShot(0, this, SLOT(processQueue()));
return true; return true;
......
/* /*
* kalarmapp.h - the KAlarm application object * kalarmapp.h - the KAlarm application object
* Program: kalarm * Program: kalarm
* Copyright © 2001-2011 by David Jarvie <djarvie@kde.org> * Copyright © 2001-2012 by David Jarvie <djarvie@kde.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -169,11 +169,11 @@ class KAlarmApp : public KUniqueApplication ...@@ -169,11 +169,11 @@ class KAlarmApp : public KUniqueApplication
QStringList tempFiles; QStringList tempFiles;
int flags; int flags;
}; };
struct DcopQEntry struct ActionQEntry
{ {
DcopQEntry(EventFunc f, const QString& id) : function(f), eventId(id) { } ActionQEntry(EventFunc f, const QString& id) : function(f), eventId(id) { }
DcopQEntry(const KAEvent& e, EventFunc f = EVENT_HANDLE) : function(f), event(e) { } ActionQEntry(const KAEvent& e, EventFunc f = EVENT_HANDLE) : function(f), event(e) { }
DcopQEntry() { } ActionQEntry() { }
EventFunc function; EventFunc function;
QString eventId; QString eventId;
KAEvent event; KAEvent event;
...@@ -186,11 +186,14 @@ class KAlarmApp : public KUniqueApplication ...@@ -186,11 +186,14 @@ class KAlarmApp : public KUniqueApplication
void queueAlarmId(const QString& id); void queueAlarmId(const QString& id);
bool dbusHandleEvent(const QString& eventID, EventFunc); bool dbusHandleEvent(const QString& eventID, EventFunc);
bool handleEvent(const QString& eventID, EventFunc); bool handleEvent(const QString& eventID, EventFunc);
int rescheduleAlarm(KAEvent&, const KAAlarm&, bool updateCalAndDisplay, const KDateTime& nextDt = KDateTime()); int rescheduleAlarm(KAEvent&, const KAAlarm&, bool updateCalAndDisplay,
const KDateTime& nextDt = KDateTime());
bool cancelAlarm(KAEvent&, KAAlarm::Type, bool updateCalAndDisplay); bool cancelAlarm(KAEvent&, KAAlarm::Type, bool updateCalAndDisplay);
bool cancelReminderAndDeferral(KAEvent&); bool cancelReminderAndDeferral(KAEvent&);
ShellProcess* doShellCommand(const QString& command, const KAEvent&, const KAAlarm*, int flags = 0, const QObject* receiver = 0, const char* slot = 0); ShellProcess* doShellCommand(const QString& command, const KAEvent&, const KAAlarm*,
QString composeXTermCommand(const QString& command, const KAEvent&, const KAAlarm*, int flags, QString& tempScriptFile) const; int flags = 0, const QObject* receiver = 0, const char* slot = 0);
QString composeXTermCommand(const QString& command, const KAEvent&, const KAAlarm*,
int flags, QString& tempScriptFile) const;
QString createTempScriptFile(const QString& command, bool insertShell, const KAEvent&, const KAAlarm&) const; QString createTempScriptFile(const QString& command, bool insertShell, const KAEvent&, const KAAlarm&) const;
void commandErrorMsg(const ShellProcess*, const KAEvent&, const KAAlarm*, int flags = 0); void commandErrorMsg(const ShellProcess*, const KAEvent&, const KAAlarm*, int flags = 0);
void purge(int daysToKeep); void purge(int daysToKeep);
...@@ -209,12 +212,12 @@ class KAlarmApp : public KUniqueApplication ...@@ -209,12 +212,12 @@ class KAlarmApp : public KUniqueApplication
int mArchivedPurgeDays; // how long to keep archived alarms, 0 = don't keep, -1 = keep indefinitely int mArchivedPurgeDays; // how long to keep archived alarms, 0 = don't keep, -1 = keep indefinitely
int mPurgeDaysQueued; // >= 0 to purge the archive calendar from KAlarmApp::processLoop() int mPurgeDaysQueued; // >= 0 to purge the archive calendar from KAlarmApp::processLoop()
QList<ProcData*> mCommandProcesses; // currently active command alarm processes QList<ProcData*> mCommandProcesses; // currently active command alarm processes
QQueue<DcopQEntry> mDcopQueue; // DCOP command queue QQueue<ActionQEntry> mActionQueue; // queued commands and actions
mutable OrgKdeKSpeechInterface* mKSpeech;// KSpeech D-Bus interface object mutable OrgKdeKSpeechInterface* mKSpeech;// KSpeech D-Bus interface object
int mPendingQuitCode; // exit code for a pending quit int mPendingQuitCode; // exit code for a pending quit
bool mPendingQuit; // quit once the DCOP command and shell command queues have been processed bool mPendingQuit; // quit once the DCOP command and shell command queues have been processed
bool mCancelRtcWake; // cancel RTC wake on quitting bool mCancelRtcWake; // cancel RTC wake on quitting
bool mProcessingQueue; // a mDcopQueue entry is currently being processed bool mProcessingQueue; // a mActionQueue entry is currently being processed
bool mNoSystemTray; // no system tray exists bool mNoSystemTray; // no system tray exists
bool mSessionClosingDown; // session manager is closing the application bool mSessionClosingDown; // session manager is closing the application
bool mOldShowInSystemTray; // showing in system tray was selected bool mOldShowInSystemTray; // showing in system tray was selected
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment