mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-05 13:26:14 +02:00
Pass whether or not previous session crashed to the UserActivityLogger.
This commit is contained in:
parent
6b3a4eb327
commit
550738776c
6 changed files with 13 additions and 9 deletions
|
@ -369,7 +369,7 @@ bool setupEssentials(int& argc, char** argv) {
|
|||
|
||||
Setting::preInit();
|
||||
|
||||
CrashHandler::checkForAndHandleCrash();
|
||||
bool previousSessionCrashed = CrashHandler::checkForAndHandleCrash();
|
||||
CrashHandler::writeRunningMarkerFiler();
|
||||
qAddPostRoutine(CrashHandler::deleteRunningMarkerFile);
|
||||
|
||||
|
@ -431,7 +431,7 @@ bool setupEssentials(int& argc, char** argv) {
|
|||
DependencyManager::set<InterfaceParentFinder>();
|
||||
DependencyManager::set<EntityTreeRenderer>(true, qApp, qApp);
|
||||
DependencyManager::set<CompositorHelper>();
|
||||
return true;
|
||||
return previousSessionCrashed;
|
||||
}
|
||||
|
||||
// FIXME move to header, or better yet, design some kind of UI manager
|
||||
|
@ -455,7 +455,7 @@ Q_GUI_EXPORT void qt_gl_set_global_share_context(QOpenGLContext *context);
|
|||
Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) :
|
||||
QApplication(argc, argv),
|
||||
_window(new MainWindow(desktop())),
|
||||
_dependencyManagerIsSetup(setupEssentials(argc, argv)),
|
||||
_previousSessionCrashed(setupEssentials(argc, argv)),
|
||||
_undoStackScriptingInterface(&_undoStack),
|
||||
_frameCount(0),
|
||||
_fps(60.0f),
|
||||
|
@ -642,7 +642,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) :
|
|||
accountManager.setIsAgent(true);
|
||||
accountManager.setAuthURL(NetworkingConstants::METAVERSE_SERVER_URL);
|
||||
|
||||
UserActivityLogger::getInstance().launch(applicationVersion());
|
||||
UserActivityLogger::getInstance().launch(applicationVersion(), _previousSessionCrashed);
|
||||
|
||||
// once the event loop has started, check and signal for an access token
|
||||
QMetaObject::invokeMethod(&accountManager, "checkAndSignalForAccessToken", Qt::QueuedConnection);
|
||||
|
|
|
@ -376,7 +376,7 @@ private:
|
|||
|
||||
MainWindow* _window;
|
||||
|
||||
bool _dependencyManagerIsSetup;
|
||||
bool _previousSessionCrashed;
|
||||
|
||||
OffscreenGLCanvas* _offscreenContext { nullptr };
|
||||
DisplayPluginPointer _displayPlugin;
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
static const QString RUNNING_MARKER_FILENAME = "Interface.running";
|
||||
|
||||
void CrashHandler::checkForAndHandleCrash() {
|
||||
bool CrashHandler::checkForAndHandleCrash() {
|
||||
QFile runningMarkerFile(runningMarkerFilePath());
|
||||
if (runningMarkerFile.exists()) {
|
||||
QSettings::setDefaultFormat(QSettings::IniFormat);
|
||||
|
@ -42,7 +42,9 @@ void CrashHandler::checkForAndHandleCrash() {
|
|||
handleCrash(action);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
CrashHandler::Action CrashHandler::promptUserForAction() {
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
class CrashHandler {
|
||||
|
||||
public:
|
||||
static void checkForAndHandleCrash();
|
||||
static bool checkForAndHandleCrash();
|
||||
|
||||
static void writeRunningMarkerFiler();
|
||||
static void deleteRunningMarkerFile();
|
||||
|
|
|
@ -78,11 +78,13 @@ void UserActivityLogger::requestError(QNetworkReply& errorReply) {
|
|||
qCDebug(networking) << errorReply.error() << "-" << errorReply.errorString();
|
||||
}
|
||||
|
||||
void UserActivityLogger::launch(QString applicationVersion) {
|
||||
void UserActivityLogger::launch(QString applicationVersion, bool previousSessionCrashed) {
|
||||
const QString ACTION_NAME = "launch";
|
||||
QJsonObject actionDetails;
|
||||
QString VERSION_KEY = "version";
|
||||
QString CRASH_KEY = "previousSessionCrashed";
|
||||
actionDetails.insert(VERSION_KEY, applicationVersion);
|
||||
actionDetails.insert(CRASH_KEY, previousSessionCrashed);
|
||||
|
||||
logAction(ACTION_NAME, actionDetails);
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ public slots:
|
|||
void disable(bool disable);
|
||||
void logAction(QString action, QJsonObject details = QJsonObject(), JSONCallbackParameters params = JSONCallbackParameters());
|
||||
|
||||
void launch(QString applicationVersion);
|
||||
void launch(QString applicationVersion, bool previousSessionCrashed);
|
||||
|
||||
void changedDisplayName(QString displayName);
|
||||
void changedModel(QString typeOfModel, QString modelURL);
|
||||
|
|
Loading…
Reference in a new issue