From e4478fd0fdaa8b2a27f840c7ad236de7f9a91b10 Mon Sep 17 00:00:00 2001 From: Evgenii Zheltonozhskii Date: Fri, 26 Oct 2018 21:45:52 +0300 Subject: [PATCH] Reformat --- .../SourceFiles/codegen/numbers/generator.cpp | 6 ++-- .../SourceFiles/codegen/style/generator.cpp | 28 +++++++++++-------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/Telegram/SourceFiles/codegen/numbers/generator.cpp b/Telegram/SourceFiles/codegen/numbers/generator.cpp index 97ef8f370..2214897be 100644 --- a/Telegram/SourceFiles/codegen/numbers/generator.cpp +++ b/Telegram/SourceFiles/codegen/numbers/generator.cpp @@ -50,12 +50,12 @@ bool Generator::writeSource() { source_->stream() << R"code(const std::map> RulesMap = { )code"; for (auto rule = rules_.data.cbegin(), e = rules_.data.cend(); rule != e; ++rule) { - auto k =rule.key(); + auto k = rule.key(); source_->stream() << "{\"" << k << "\",{"; - for (auto &c: rule.key()) { + for (auto &c : rule.key()) { source_->stream() << c.toLatin1() << ","; } - source_->stream()<< "}},\n"; + source_->stream() << "}},\n"; } source_->stream() << "\ };"; diff --git a/Telegram/SourceFiles/codegen/style/generator.cpp b/Telegram/SourceFiles/codegen/style/generator.cpp index e5e5afe95..7356dd88b 100644 --- a/Telegram/SourceFiles/codegen/style/generator.cpp +++ b/Telegram/SourceFiles/codegen/style/generator.cpp @@ -238,13 +238,17 @@ bool Generator::writeSource() { source_->pushNamespace().newline(); source_->stream() << R"code(bool inited = false; -class Module_)code" << baseName_<< R"code( : public style::internal::ModuleBase { +class Module_)code" << baseName_ + << R"code( : public style::internal::ModuleBase { public: - Module_)code" << baseName_ << R"code(() { style::internal::registerModule(this); } - ~Module_)code" << baseName_ << R"code(() { style::internal::unregisterModule(this); } + Module_)code" << baseName_ + << R"code(() { style::internal::registerModule(this); } + ~Module_)code" << baseName_ + << R"code(() { style::internal::unregisterModule(this); } void start() override { - style::internal::init_)code" << baseName_ << R"code((); + style::internal::init_)code" + << baseName_ << R"code((); } void stop() override { } @@ -480,7 +484,8 @@ public: } auto index = (indexInPalette++); - header_->stream() << "\tinline const color &get_" << name << "() const { return _colors[" << index << "]; };\n"; + header_->stream() << "\tinline const color &get_" << name << "() const { return _colors[" << index + << "]; };\n"; return true; })) return false; @@ -827,12 +832,12 @@ qint32 palette::Checksum() { source_->newline().pushNamespace().newline(); - source_->stream() << R"code(const std::map PaletteMap = { + source_->stream() << R"code(const std::map PaletteMap = { )code"; - for (auto &ind : paletteIndices_) { - source_->stream() << "{\"" << ind.first << "\"," << ind.second << "},\n"; - } - source_->stream() << "\ + for (auto &ind : paletteIndices_) { + source_->stream() << "{\"" << ind.first << "\"," << ind.second << "},\n"; + } + source_->stream() << "\ \n\ };"; @@ -931,7 +936,8 @@ int indexOfColor(color c) { QList data() { auto result = QList(); - result.reserve()code" << count //TODO(Randl) + result.reserve()code" + << count // TODO(Randl) << R"code(); )code" << dataRows << R"code(