From 42749538a71fb2834c4542f7e32b40e60dd8f10c Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Fri, 22 Dec 2017 14:10:29 +0100 Subject: [PATCH] Add helper method for creating a UUID Fix QString formatter --- src/util/helpers.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/util/helpers.hpp b/src/util/helpers.hpp index 3e495ae1..b708728b 100644 --- a/src/util/helpers.hpp +++ b/src/util/helpers.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include namespace chatterino { @@ -10,6 +11,12 @@ auto fS(Args &&... args) -> decltype(fmt::format(std::forward(args)...)) return fmt::format(std::forward(args)...); } +static QString CreateUUID() +{ + auto uuid = QUuid::createUuid(); + return uuid.toString(); +} + } // namespace chatterino namespace fmt { @@ -17,7 +24,7 @@ namespace fmt { // format_arg for QString inline void format_arg(BasicFormatter &f, const char *&, const QString &v) { - f.writer().write("\"{}\"", v.toStdString()); + f.writer().write("{}", v.toStdString()); } } // namespace fmt