Commit 7ac2fc22 authored by Volker Krause's avatar Volker Krause
Browse files

Allow to explicitly trigger a segfault in the dev mode page

Useful for testing crash handling.
parent 693c9b41
......@@ -55,5 +55,11 @@ Kirigami.ScrollablePage {
Layout.fillWidth: true
onClicked: DevelopmentModeController.enablePublicTransportLogging();
}
QQC2.Button {
text: "Crash"
Layout.fillWidth: true
onClicked: DevelopmentModeController.crash();
}
}
}
......@@ -23,6 +23,8 @@ using namespace KAndroidExtras;
#include <QtAndroid>
#endif
#include <csignal>
void DevelopmentModeController::enablePublicTransportLogging()
{
#ifdef Q_OS_ANDROID
......@@ -84,3 +86,8 @@ void DevelopmentModeController::clearOsmTileCache()
}
QDir(base + QLatin1String("/17")).removeRecursively();
}
void DevelopmentModeController::crash()
{
std::raise(SIGSEGV);
}
......@@ -19,6 +19,7 @@ public:
Q_INVOKABLE void importMapCSS(const QUrl &url);
Q_INVOKABLE void purgeMapCSS();
Q_INVOKABLE void clearOsmTileCache();
Q_INVOKABLE void crash();
};
Q_DECLARE_METATYPE(DevelopmentModeController)
......
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