mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
* Moved implementation of the methods to the `cpp` file. * Added `DebugCount::Flag(s)` and `DebugCount::configure(name, flags)`. * Moved from `QMap` to `std::map` (order is important here). * Used `QStringBuilder` for concatenations. * Used `QLocale` for formatting (adds separators). * Added `DebugCount::Flag::DataSize` for data sizes in bytes (and fixed language to English). * Used `DataSize` for image sizes (maybe this should be moved somewhere else?). * Added copy button to popup. * Fixed Image usage reporting being eight times too large (could be another PR, but honestly it's four characters).
38 lines
815 B
C++
38 lines
815 B
C++
#pragma once
|
|
|
|
#include "common/FlagsEnum.hpp"
|
|
|
|
#include <QString>
|
|
|
|
namespace chatterino {
|
|
|
|
class DebugCount
|
|
{
|
|
public:
|
|
enum class Flag : uint16_t {
|
|
None = 0,
|
|
/// The value is a data size in bytes
|
|
DataSize = 1 << 0,
|
|
};
|
|
using Flags = FlagsEnum<Flag>;
|
|
|
|
static void configure(const QString &name, Flags flags);
|
|
|
|
static void set(const QString &name, const int64_t &amount);
|
|
|
|
static void increase(const QString &name, const int64_t &amount);
|
|
static void increase(const QString &name)
|
|
{
|
|
DebugCount::increase(name, 1);
|
|
}
|
|
|
|
static void decrease(const QString &name, const int64_t &amount);
|
|
static void decrease(const QString &name)
|
|
{
|
|
DebugCount::decrease(name, 1);
|
|
}
|
|
|
|
static QString getDebugText();
|
|
};
|
|
|
|
} // namespace chatterino
|