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