view src/core/session.cc @ 318:3b355fa948c7

config: use TOML instead of INI unfortunately, INI is not enough, and causes some paths including semicolons to break with our current storage of the library folders. so, I decided to switch to TOML which does support real arrays...
author Paper <paper@paper.us.eu.org>
date Wed, 12 Jun 2024 05:25:41 -0400
parents 34347fd2a2de
children d928ec7b6a0d
line wrap: on
line source

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

#include <QElapsedTimer>
#include <QStatusBar>

#include "semver/semver.hpp"

#include <atomic>

Session session;

Session::Session() {
	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();
}