view include/core/session.h @ 286:53e3c015a973

anime: initial cross-service support currently the Kitsu and MAL services don't work when chosen in the GUI. This is because they haven't been implemented yet :)
author Paper <paper@paper.us.eu.org>
date Wed, 08 May 2024 16:44:27 -0400
parents 3ec7804abf17
children 9a88e1725fd2
line wrap: on
line source

#ifndef MINORI_CORE_SESSION_H_
#define MINORI_CORE_SESSION_H_

#include "core/config.h"
#include "gui/locale.h"
#include <QElapsedTimer>

#include "semver/semver.hpp"

class MainWindow;

struct Session {
public:
	Session() { timer.start(); }
	/* we literally *cannot* be lying to the user by doing this */
	void IncrementRequests() { requests++; };
	int GetRequests() { return requests; };
	int uptime() { return timer.elapsed(); }

	Config config;
	static constexpr semver::version version{PACKAGE_VERSION};

private:
	unsigned int requests = 0;
	QElapsedTimer timer;
};

extern Session session;

#endif // MINORI_CORE_SESSION_H_