Changeset View
Changeset View
Standalone View
Standalone View
src/matrix-sticker-pack.cpp
| /* | /* | ||||
| * This file is part of kazv. | * This file is part of kazv. | ||||
| * SPDX-FileCopyrightText: 2020-2023 tusooa <tusooa@kazv.moe> | * SPDX-FileCopyrightText: 2020-2023 tusooa <tusooa@kazv.moe> | ||||
| * SPDX-License-Identifier: AGPL-3.0-or-later | * SPDX-License-Identifier: AGPL-3.0-or-later | ||||
| */ | */ | ||||
| #include <kazv-defs.hpp> | #include <kazv-defs.hpp> | ||||
| #include <cursorutil.hpp> | #include <cursorutil.hpp> | ||||
| #include "helper.hpp" | |||||
| #include "matrix-sticker.hpp" | #include "matrix-sticker.hpp" | ||||
| #include "matrix-event.hpp" | #include "matrix-event.hpp" | ||||
| #include "matrix-sticker-pack.hpp" | #include "matrix-sticker-pack.hpp" | ||||
| using namespace Qt::Literals::StringLiterals; | using namespace Qt::Literals::StringLiterals; | ||||
| using namespace Kazv; | using namespace Kazv; | ||||
| MatrixStickerPack::MatrixStickerPack(lager::reader<MatrixStickerPackSource> source, QObject *parent) | MatrixStickerPack::MatrixStickerPack(lager::reader<MatrixStickerPackSource> source, QObject *parent) | ||||
| Show All 14 Lines | , m_images(m_event.xform( | ||||
| return json::array({it.key(), it.value()}); | return json::array({it.key(), it.value()}); | ||||
| } | } | ||||
| ); | ); | ||||
| return array; | return array; | ||||
| } else { | } else { | ||||
| return json::array(); | return json::array(); | ||||
| } | } | ||||
| }))) | }))) | ||||
| , LAGER_QT(packName)(m_event.xform(eventContent | jsonAtOr("/pack/display_name"_json_pointer, std::string()) | strToQt)) | |||||
| { | { | ||||
| initCountCursor(m_images.map([](const JsonWrap &images) -> int { | initCountCursor(m_images.map([](const JsonWrap &images) -> int { | ||||
| return images.get().size(); | return images.get().size(); | ||||
| })); | })); | ||||
| } | } | ||||
| MatrixStickerPack::~MatrixStickerPack() = default; | MatrixStickerPack::~MatrixStickerPack() = default; | ||||
| ▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines | |||||