view include/core/session.h @ 232:ff0061e75f0f

theme: add OS detection with glib
author Paper <mrpapersonic@gmail.com>
date Sat, 13 Jan 2024 11:06:16 -0500
parents 53211cb1e7f5
children 4d461ef7d424
line wrap: on
line source

#ifndef __core__session_h
#define __core__session_h

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

#include "semver/semver.hpp"

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{0, 1, 0, semver::prerelease::alpha, 1};

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

extern Session session;

#endif // __core__session_h