view include/core/session.h @ 230:2f5a9247e501

torrents: implement download button erg
author Paper <paper@paper.us.eu.org>
date Sat, 13 Jan 2024 09:42:02 -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