/***************************************************************************
- * Copyright (C) 2005-2018 by the Quassel Project *
+ * Copyright (C) 2005-2020 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
#include <QDebug>
-#include "logmessage.h"
-
// This handler is called by Windows in a different thread when a console event happens
// FIXME: When the console window is closed, the application is supposedly terminated as soon as
// this handler returns. We may want to block and wait for the main thread so set some
// condition variable once shutdown is complete...
static BOOL WINAPI consoleCtrlHandler(DWORD ctrlType)
{
- switch (ctrlType) {
- case CTRL_C_EVENT: // Ctrl+C
- case CTRL_CLOSE_EVENT: // Closing the console window
- WindowsSignalWatcher::signalHandler(SIGTERM);
- return TRUE;
- default:
- return FALSE;
- }
+ switch (ctrlType) {
+ case CTRL_C_EVENT: // Ctrl+C
+ case CTRL_CLOSE_EVENT: // Closing the console window
+ WindowsSignalWatcher::signalHandler(SIGTERM);
+ return TRUE;
+ default:
+ return FALSE;
+ }
}
-WindowsSignalWatcher::WindowsSignalWatcher(QObject *parent)
+WindowsSignalWatcher::WindowsSignalWatcher(QObject* parent)
: AbstractSignalWatcher{parent}
, Singleton<WindowsSignalWatcher>{this}
{
void WindowsSignalWatcher::signalHandler(int signal)
{
- quInfo() << "Caught signal" << signal;
+ qInfo() << "Caught signal" << signal;
switch (signal) {
case SIGINT: