Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions dcc-network/operation/dccnetwork.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2024 - 2027 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
#include "dccnetwork.h"
Expand Down Expand Up @@ -26,10 +26,6 @@ DccNetwork::DccNetwork(QObject *parent)
: QObject(parent)
, m_manager(nullptr)
{
qRegisterMetaType<QList<QVariantMap>>("NMVariantMapList");
qmlRegisterType<NetType>("org.deepin.dcc.network", 1, 0, "NetType");
qmlRegisterType<NetItemModel>("org.deepin.dcc.network", 1, 0, "NetItemModel");
qmlRegisterType<NetManager>("org.deepin.dcc.network", 1, 0, "NetManager");
QMetaObject::invokeMethod(this, "init", Qt::QueuedConnection);
}

Expand Down Expand Up @@ -202,6 +198,12 @@ void DccNetwork::init()
Q_EMIT rootChanged();
}
DCC_FACTORY_CLASS(DccNetwork)
DCC_FACTORY_INITIALIZED([]() {
qRegisterMetaType<QList<QVariantMap>>("NMVariantMapList");
qmlRegisterType<NetType>("org.deepin.dcc.network", 1, 0, "NetType");
qmlRegisterType<NetItemModel>("org.deepin.dcc.network", 1, 0, "NetItemModel");
qmlRegisterType<NetManager>("org.deepin.dcc.network", 1, 0, "NetManager");
})
} // namespace network
} // namespace dde

Expand Down
Loading