Mercurial > minori
view include/core/session.h @ 68:2417121d894e
*: normalize usage of layouts
before, I used them two ways, once was by setting the layout later
by using setLayout(QWidget), and the other was just using the constructor.
I find the constructor to be easier to read, so I chose that one.
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Mon, 02 Oct 2023 21:33:25 -0400 |
parents | 75c804f713b2 |
children | c69230dc2b5d |
line wrap: on
line source
#ifndef __core__session_h #define __core__session_h #include "core/config.h" #include <QElapsedTimer> struct Session { public: Config config; 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(); } private: int requests = 0; QElapsedTimer timer; }; extern Session session; #endif // __core__session_h