view src/core/session.cc @ 369:47c9f8502269

*: clang-format all the things I've edited the formatting a bit. Now pointer asterisks (and reference ampersands) are on the variable instead of the type, as well as having newlines for function braces (but nothing else)
author Paper <paper@tflc.us>
date Fri, 25 Jul 2025 10:16:02 -0400
parents d928ec7b6a0d
children
line wrap: on
line source

#include "core/session.h"
#include "core/config.h"
#include "core/strings.h"
#include "gui/locale.h"
#include "gui/window.h"

#include <QElapsedTimer>
#include <QStatusBar>

#include "semver/semver.hpp"

#include <atomic>

Session session;

Session::Session() : gen(Time::GetSystemTime())
{
	timer_.start();
}

void Session::SetMainWindow(MainWindow *window)
{
	disconnect();
	window_ = window;
	connect(this, &Session::StatusBarChange, window_, &MainWindow::SetStatusMessage);
}

void Session::SetStatusBar(const std::string &message)
{
	emit StatusBarChange(message);
}

void Session::IncrementRequests()
{
	requests_++;
};

unsigned int Session::GetRequests()
{
	return requests_;
};

int Session::uptime()
{
	return timer_.elapsed();
}