From c89984327726d8fffa8c44e9b92d03677934e2ee Mon Sep 17 00:00:00 2001 From: David Jarvie Date: Thu, 10 May 2012 21:15:04 +0100 Subject: [PATCH] Change variable names from dcop... --- kalarmapp.cpp | 22 +++++++++++----------- kalarmapp.h | 49 ++++++++++++++++++++++++++----------------------- 2 files changed, 37 insertions(+), 34 deletions(-) diff --git a/kalarmapp.cpp b/kalarmapp.cpp index 517a58e8..5fccda59 100644 --- a/kalarmapp.cpp +++ b/kalarmapp.cpp @@ -563,7 +563,7 @@ bool KAlarmApp::quitIf(int exitCode, bool force) if (checkSystemTray()) 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 mPendingQuit = true; @@ -743,12 +743,12 @@ void KAlarmApp::checkNextDueAlarm() */ 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 } - mDcopQueue.enqueue(DcopQEntry(EVENT_HANDLE, id)); + mActionQueue.enqueue(ActionQEntry(EVENT_HANDLE, id)); } /****************************************************************************** @@ -804,9 +804,9 @@ void KAlarmApp::processQueue() } // Process queued events - while (!mDcopQueue.isEmpty()) + while (!mActionQueue.isEmpty()) { - DcopQEntry& entry = mDcopQueue.head(); + ActionQEntry& entry = mActionQueue.head(); if (entry.eventId.isEmpty()) { // It's a new alarm @@ -824,7 +824,7 @@ void KAlarmApp::processQueue() } else handleEvent(entry.eventId, entry.function); - mDcopQueue.dequeue(); + mActionQueue.dequeue(); } // Purge the default archived alarms resource if it's time to do so @@ -862,7 +862,7 @@ void KAlarmApp::atLoginEventAdded(const KAEvent& event) { if (mAlarmsEnabled) { - mDcopQueue.enqueue(DcopQEntry(EVENT_HANDLE, ev.id())); + mActionQueue.enqueue(ActionQEntry(EVENT_HANDLE, ev.id())); if (mInitialised) QTimer::singleShot(0, this, SLOT(processQueue())); } @@ -1205,7 +1205,7 @@ bool KAlarmApp::scheduleEvent(KAEvent::SubAction action, const QString& text, co // Alarm is due for display already. // First execute it once without adding it to the calendar file. if (!mInitialised) - mDcopQueue.enqueue(DcopQEntry(event, EVENT_TRIGGER)); + mActionQueue.enqueue(ActionQEntry(event, EVENT_TRIGGER)); else execAlarm(event, event.firstAlarm(), false); // 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 } // Queue the alarm for insertion into the calendar file - mDcopQueue.enqueue(DcopQEntry(event)); + mActionQueue.enqueue(ActionQEntry(event)); if (mInitialised) QTimer::singleShot(0, this, SLOT(processQueue())); return true; @@ -1230,7 +1230,7 @@ bool KAlarmApp::scheduleEvent(KAEvent::SubAction action, const QString& text, co bool KAlarmApp::dbusHandleEvent(const QString& eventID, EventFunc function) { kDebug() << eventID; - mDcopQueue.append(DcopQEntry(function, eventID)); + mActionQueue.append(ActionQEntry(function, eventID)); if (mInitialised) QTimer::singleShot(0, this, SLOT(processQueue())); return true; diff --git a/kalarmapp.h b/kalarmapp.h index 200baecd..a2c3bd5f 100644 --- a/kalarmapp.h +++ b/kalarmapp.h @@ -1,7 +1,7 @@ /* * kalarmapp.h - the KAlarm application object * Program: kalarm - * Copyright © 2001-2011 by David Jarvie + * Copyright © 2001-2012 by David Jarvie * * 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 @@ -155,25 +155,25 @@ class KAlarmApp : public KUniqueApplication ~ProcData(); enum { PRE_ACTION = 0x01, POST_ACTION = 0x02, RESCHEDULE = 0x04, ALLOW_DEFER = 0x08, TEMP_FILE = 0x10, EXEC_IN_XTERM = 0x20, DISP_OUTPUT = 0x40 }; - bool preAction() const { return flags & PRE_ACTION; } - bool postAction() const { return flags & POST_ACTION; } - bool reschedule() const { return flags & RESCHEDULE; } - bool allowDefer() const { return flags & ALLOW_DEFER; } - bool tempFile() const { return flags & TEMP_FILE; } - bool execInXterm() const { return flags & EXEC_IN_XTERM; } - bool dispOutput() const { return flags & DISP_OUTPUT; } - ShellProcess* process; - KAEvent* event; - KAAlarm* alarm; - QPointer messageBoxParent; - QStringList tempFiles; - int flags; + bool preAction() const { return flags & PRE_ACTION; } + bool postAction() const { return flags & POST_ACTION; } + bool reschedule() const { return flags & RESCHEDULE; } + bool allowDefer() const { return flags & ALLOW_DEFER; } + bool tempFile() const { return flags & TEMP_FILE; } + bool execInXterm() const { return flags & EXEC_IN_XTERM; } + bool dispOutput() const { return flags & DISP_OUTPUT; } + ShellProcess* process; + KAEvent* event; + KAAlarm* alarm; + QPointer messageBoxParent; + QStringList tempFiles; + int flags; }; - struct DcopQEntry + struct ActionQEntry { - DcopQEntry(EventFunc f, const QString& id) : function(f), eventId(id) { } - DcopQEntry(const KAEvent& e, EventFunc f = EVENT_HANDLE) : function(f), event(e) { } - DcopQEntry() { } + ActionQEntry(EventFunc f, const QString& id) : function(f), eventId(id) { } + ActionQEntry(const KAEvent& e, EventFunc f = EVENT_HANDLE) : function(f), event(e) { } + ActionQEntry() { } EventFunc function; QString eventId; KAEvent event; @@ -186,11 +186,14 @@ class KAlarmApp : public KUniqueApplication void queueAlarmId(const QString& id); bool dbusHandleEvent(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 cancelReminderAndDeferral(KAEvent&); - ShellProcess* doShellCommand(const QString& command, const KAEvent&, const KAAlarm*, 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; + ShellProcess* doShellCommand(const QString& command, const KAEvent&, const KAAlarm*, + 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; void commandErrorMsg(const ShellProcess*, const KAEvent&, const KAAlarm*, int flags = 0); void purge(int daysToKeep); @@ -209,12 +212,12 @@ class KAlarmApp : public KUniqueApplication 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() QList mCommandProcesses; // currently active command alarm processes - QQueue mDcopQueue; // DCOP command queue + QQueue mActionQueue; // queued commands and actions mutable OrgKdeKSpeechInterface* mKSpeech;// KSpeech D-Bus interface object int mPendingQuitCode; // exit code for a pending quit bool mPendingQuit; // quit once the DCOP command and shell command queues have been processed 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 mSessionClosingDown; // session manager is closing the application bool mOldShowInSystemTray; // showing in system tray was selected -- GitLab