Merge PR #40: Update to the libnymea-networkmanager adjustments and skip SIGSEGV handling
This commit is contained in:
commit
2ac10a4bde
@ -52,10 +52,6 @@ static void catchUnixSignals(const std::vector<int>& quitSignals, const std::vec
|
|||||||
case SIGHUP:
|
case SIGHUP:
|
||||||
qCDebug(dcApplication()) << "Cought SIGHUP quit signal...";
|
qCDebug(dcApplication()) << "Cought SIGHUP quit signal...";
|
||||||
break;
|
break;
|
||||||
case SIGSEGV: {
|
|
||||||
qCCritical(dcApplication()) << "Cought SIGSEGV signal. Segmentation fault!";
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
qCDebug(dcApplication()) << "Cought unhandled signal" << sig;
|
qCDebug(dcApplication()) << "Cought unhandled signal" << sig;
|
||||||
break;
|
break;
|
||||||
@ -87,5 +83,5 @@ static void catchUnixSignals(const std::vector<int>& quitSignals, const std::vec
|
|||||||
Application::Application(int &argc, char **argv) :
|
Application::Application(int &argc, char **argv) :
|
||||||
QCoreApplication(argc, argv)
|
QCoreApplication(argc, argv)
|
||||||
{
|
{
|
||||||
catchUnixSignals({SIGQUIT, SIGINT, SIGTERM, SIGHUP, SIGSEGV});
|
catchUnixSignals({SIGQUIT, SIGINT, SIGTERM, SIGHUP});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -131,8 +131,8 @@ Core::Core(QObject *parent) :
|
|||||||
|
|
||||||
m_bluetoothServer = new BluetoothServer(m_networkManager);
|
m_bluetoothServer = new BluetoothServer(m_networkManager);
|
||||||
|
|
||||||
connect(m_bluetoothServer, &BluetoothServer::runningChanged, this, &Core::onBluetoothServerRunningChanged);
|
connect(m_bluetoothServer, &BluetoothServer::runningChanged, this, &Core::onBluetoothServerRunningChanged, Qt::QueuedConnection);
|
||||||
connect(m_bluetoothServer, &BluetoothServer::connectedChanged, this, &Core::onBluetoothServerConnectedChanged);
|
connect(m_bluetoothServer, &BluetoothServer::connectedChanged, this, &Core::onBluetoothServerConnectedChanged, Qt::QueuedConnection);
|
||||||
|
|
||||||
m_nymeaService = new NymeadService(false, this);
|
m_nymeaService = new NymeadService(false, this);
|
||||||
connect(m_nymeaService, &NymeadService::availableChanged, this, &Core::onNymeaServiceAvailableChanged);
|
connect(m_nymeaService, &NymeadService::availableChanged, this, &Core::onNymeaServiceAvailableChanged);
|
||||||
@ -192,9 +192,13 @@ void Core::evaluateNetworkManagerState(NetworkManager::NetworkManagerState state
|
|||||||
case NetworkManager::NetworkManagerStateAsleep:
|
case NetworkManager::NetworkManagerStateAsleep:
|
||||||
case NetworkManager::NetworkManagerStateDisconnected:
|
case NetworkManager::NetworkManagerStateDisconnected:
|
||||||
case NetworkManager::NetworkManagerStateConnectedLocal:
|
case NetworkManager::NetworkManagerStateConnectedLocal:
|
||||||
// Everything else is not connected, start the service
|
if (m_networkManager->available()) {
|
||||||
qCDebug(dcApplication()) << "Start the bluetooth service because of \"offline\" mode.";
|
// Everything else is not connected, start the service
|
||||||
startService();
|
qCDebug(dcApplication()) << "Start the bluetooth service because of \"offline\" mode.";
|
||||||
|
startService();
|
||||||
|
} else {
|
||||||
|
qCDebug(dcApplication()) << "Not starting the service yet because the networkmanager is not available.";
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
qCDebug(dcApplication()) << "Ignoring" << state;
|
qCDebug(dcApplication()) << "Ignoring" << state;
|
||||||
@ -288,7 +292,6 @@ void Core::onBluetoothServerConnectedChanged(bool connected)
|
|||||||
|
|
||||||
if (!connected) {
|
if (!connected) {
|
||||||
m_advertisingTimer->stop();
|
m_advertisingTimer->stop();
|
||||||
m_bluetoothServer->stop();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user