Commit 2fa2eb28 authored by David Jarvie's avatar David Jarvie
Browse files

Bug 446749: Perform command line actions if KAlarm is already running

Command line actions including --list, --edit, --triggerEvent
were not performed if KAlarm was already running.

This is a partial fix for bug 446749.
parent 3965ef11
Pipeline #110059 passed with stage
in 1 minute and 34 seconds
......@@ -2,6 +2,7 @@ KAlarm Change Log
=== Version 3.3.4 (KDE Applications 21.12.1) --- 14 December 2021 ===
* Treat empty read-only, or non-existent, calendar files as loaded.
* Ensure KAlarm command line actions are performed if KAlarm is already running [KDE Bug 446749]
=== Version 3.3.3 (KDE Applications 21.12) --- 7 November 2021 ===
* Show numbers in localised form.
......
......@@ -449,7 +449,7 @@ int KAlarmApp::activateInstance(const QStringList& args, const QString& workingD
{
// Display or delete the event with the specified event ID
auto action = static_cast<QueuedAction>(int((command == CommandOptions::TRIGGER_EVENT) ? QueuedAction::Trigger : QueuedAction::Cancel)
| int(QueuedAction::Exit));
| int(QueuedAction::Exit));
// Open the calendar, don't start processing execution queue yet,
// and wait for the calendar resources to be populated.
if (!initCheck(true))
......@@ -463,7 +463,7 @@ int KAlarmApp::activateInstance(const QStringList& args, const QString& workingD
if (options->resourceId().isEmpty())
action = static_cast<QueuedAction>((int)action | int(QueuedAction::FindId));
mActionQueue.enqueue(ActionQEntry(action, EventId(options->eventId()), options->resourceId()));
startProcessQueue(); // start processing the execution queue
startProcessQueue(true); // start processing the execution queue
dontRedisplay = true;
}
break;
......@@ -480,7 +480,7 @@ int KAlarmApp::activateInstance(const QStringList& args, const QString& workingD
{
const auto action = static_cast<QueuedAction>(int(QueuedAction::List) | int(QueuedAction::Exit));
mActionQueue.enqueue(ActionQEntry(action, EventId()));
startProcessQueue(); // start processing the execution queue
startProcessQueue(true); // start processing the execution queue
dontRedisplay = true;
}
break;
......@@ -499,7 +499,7 @@ int KAlarmApp::activateInstance(const QStringList& args, const QString& workingD
// resources have not been created yet, the numeric
// resource ID can't yet be looked up.
mActionQueue.enqueue(ActionQEntry(QueuedAction::Edit, EventId(options->eventId()), options->resourceId()));
startProcessQueue(); // start processing the execution queue
startProcessQueue(true); // start processing the execution queue
dontRedisplay = true;
}
break;
......@@ -957,9 +957,9 @@ void KAlarmApp::queueAlarmId(const KAEvent& event)
/******************************************************************************
* Start processing the execution queue.
*/
void KAlarmApp::startProcessQueue()
void KAlarmApp::startProcessQueue(bool evenIfStarted)
{
if (!mInitialised)
if (!mInitialised || evenIfStarted)
{
qCDebug(KALARM_LOG) << "KAlarmApp::startProcessQueue";
mInitialised = true;
......
......@@ -225,7 +225,7 @@ private:
void showRestoredWindows();
void createOnlyMainWindow();
bool checkSystemTray();
void startProcessQueue();
void startProcessQueue(bool evenIfStarted = false);
void setResourcesTimeout();
void checkWritableCalendar();
void checkArchivedCalendar();
......
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