swift
Loading...
Searching...
No Matches
datalink.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) 2017 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
7
8#include "misc/promise.h"
9#include "misc/variant.h"
10
12{
13 void CDataLinkConnectionWatcher::setStatus(bool status)
14 {
15 if (status != m_connected)
16 {
17 m_connected = status;
18 if (m_connected)
19 {
20 emit connected();
21 }
22 else
23 {
24 emit disconnected();
25 }
26 }
27 }
28
29 IDataLink::~IDataLink() = default;
30
31 IDataLink::IDataLink() { qRegisterMetaType<CPromise<CVariant>>(); }
32
34 {
35 const QMetaObject *meta = object->parent()->metaObject();
36 const char *info = meta->classInfo(meta->indexOfClassInfo("SharedStateChannel")).value();
37 const QString name = object->parent()->objectName();
38 return name.isEmpty() ? QString(info) : (info % QLatin1Char(':') % name);
39 }
40} // namespace swift::misc::shared_state
Utilities for sharing state between multiple objects.
Definition application.h:48
const char * value() const const
QMetaClassInfo classInfo(int index) const const
int indexOfClassInfo(const char *name) const const
bool isEmpty() const const