Commit 63fbc9bf authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Don't crash if we get into a weird state

Make sure we always quit when the application window is destroyed.

BUG: 385637
parent be4e1e4c
......@@ -233,6 +233,7 @@ void DiscoverMainWindow::integrateObject(QObject* object)
}
object->installEventFilter(this);
connect(object, &QObject::destroyed, qGuiApp, &QCoreApplication::quit);
}
bool DiscoverMainWindow::eventFilter(QObject * object, QEvent * event)
......
......@@ -122,6 +122,9 @@ int main(int argc, char** argv)
mainWindow = new DiscoverMainWindow(s_decodeCompactMode->value(parser->value(QStringLiteral("compact")), DiscoverMainWindow::Full));
QObject::connect(&app, &QCoreApplication::aboutToQuit, mainWindow, &DiscoverMainWindow::deleteLater);
QObject::connect(service, &KDBusService::activateRequested, mainWindow, [mainWindow](const QStringList &arguments, const QString &/*workingDirectory*/){
if (!mainWindow->rootObject())
QCoreApplication::instance()->quit();
mainWindow->rootObject()->raise();
if (arguments.isEmpty())
return;
......
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