Mercurial > minori
comparison include/core/session.h @ 369:47c9f8502269
*: clang-format all the things
I've edited the formatting a bit. Now pointer asterisks (and reference
ampersands) are on the variable instead of the type, as well as having
newlines for function braces (but nothing else)
| author | Paper <paper@tflc.us> |
|---|---|
| date | Fri, 25 Jul 2025 10:16:02 -0400 |
| parents | 1faa72660932 |
| children | ea3a74ed2ef9 |
comparison
equal
deleted
inserted
replaced
| 368:6d37a998cf91 | 369:47c9f8502269 |
|---|---|
| 1 #ifndef MINORI_CORE_SESSION_H_ | 1 #ifndef MINORI_CORE_SESSION_H_ |
| 2 #define MINORI_CORE_SESSION_H_ | 2 #define MINORI_CORE_SESSION_H_ |
| 3 | 3 |
| 4 #include "core/config.h" | |
| 4 #include "core/time.h" | 5 #include "core/time.h" |
| 5 #include "core/config.h" | |
| 6 #include "gui/locale.h" | 6 #include "gui/locale.h" |
| 7 | 7 |
| 8 #include <QElapsedTimer> | |
| 8 #include <QObject> | 9 #include <QObject> |
| 9 #include <QElapsedTimer> | |
| 10 | 10 |
| 11 #include "semver/semver.hpp" | 11 #include "semver/semver.hpp" |
| 12 | 12 |
| 13 #include <atomic> | 13 #include <atomic> |
| 14 #include <random> | |
| 14 #include <string> | 15 #include <string> |
| 15 #include <random> | 16 #include <cstdint> |
| 16 | 17 |
| 17 class MainWindow; | 18 class MainWindow; |
| 18 | 19 |
| 19 struct Session : public QObject { | 20 struct Session : public QObject { |
| 20 Q_OBJECT | 21 Q_OBJECT |
| 21 | 22 |
| 22 public: | 23 public: |
| 23 Session(); | 24 Session(); |
| 24 | 25 |
| 25 void SetMainWindow(MainWindow* window); | 26 void SetMainWindow(MainWindow *window); |
| 26 | 27 |
| 27 void SetStatusBar(const std::string& message); | 28 void SetStatusBar(const std::string &message); |
| 28 | 29 |
| 29 /* we literally *cannot* be lying to the user by doing this */ | 30 /* we literally *cannot* be lying to the user by doing this */ |
| 30 void IncrementRequests(); | 31 void IncrementRequests(); |
| 31 unsigned int GetRequests(); | 32 std::uint32_t GetRequests(); |
| 32 int uptime(); | 33 int uptime(); |
| 33 | 34 |
| 34 Config config; | 35 Config config; |
| 35 | 36 |
| 36 std::mt19937 gen; | 37 std::mt19937 gen; |
| 37 | 38 |
| 38 static constexpr semver::version version{ | 39 static constexpr semver::version version{ |
| 39 MINORI_VERSION_MAJOR, | 40 MINORI_VERSION_MAJOR, |
| 40 MINORI_VERSION_MINOR, | 41 MINORI_VERSION_MINOR, |
| 41 MINORI_VERSION_PATCH, | 42 MINORI_VERSION_PATCH, |
| 42 }; | 43 }; |
| 43 | 44 |
| 44 signals: | 45 signals: |
| 45 void StatusBarChange(const std::string& message); | 46 void StatusBarChange(const std::string &message); |
| 46 | 47 |
| 47 private: | 48 private: |
| 48 /* IncrementRequests() gets called by different threads */ | 49 /* IncrementRequests() gets called by different threads */ |
| 49 std::atomic<unsigned int> requests_ = 0; | 50 std::atomic<std::uint32_t> requests_ = 0; |
| 50 QElapsedTimer timer_; | 51 QElapsedTimer timer_; |
| 51 MainWindow* window_; | 52 MainWindow *window_; |
| 52 }; | 53 }; |
| 53 | 54 |
| 54 extern Session session; | 55 extern Session session; |
| 55 | 56 |
| 56 #endif // MINORI_CORE_SESSION_H_ | 57 #endif // MINORI_CORE_SESSION_H_ |
