Directory: | ./ |
---|---|
File: | src/client/selection_source_p.h |
Date: | 2024-01-22 17:25:27 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 10 | 10 | 100.0% |
Branches: | 3 | 6 | 50.0% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org> | ||
3 | SPDX-FileCopyrightText: 2021 Francesco Sorrentino <francesco.sorr@gmail.com> | ||
4 | |||
5 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only | ||
6 | */ | ||
7 | #pragma once | ||
8 | |||
9 | #include <QObject> | ||
10 | |||
11 | namespace Wrapland::Client | ||
12 | { | ||
13 | |||
14 | template<typename PrivateSource, typename WlSource> | ||
15 | 2 | void send_callback(void* data, WlSource* dataSource, char const* mimeType, int32_t fd) | |
16 | { | ||
17 | 2 | auto d = reinterpret_cast<PrivateSource*>(data); | |
18 |
1/2✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
|
2 | Q_ASSERT(d->source == dataSource); |
19 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2 | Q_EMIT d->q->sendDataRequested(QString::fromUtf8(mimeType), fd); |
20 | 2 | } | |
21 | |||
22 | template<typename PrivateSource, typename WlSource> | ||
23 | 24 | void cancelled_callback(void* data, WlSource* dataSource) | |
24 | { | ||
25 | 24 | auto d = reinterpret_cast<PrivateSource*>(data); | |
26 |
1/2✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
|
24 | Q_ASSERT(d->source == dataSource); |
27 | 24 | Q_EMIT d->q->cancelled(); | |
28 | 24 | } | |
29 | |||
30 | } | ||
31 |