Skip to content
Merged
Show file tree
Hide file tree
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
17 changes: 9 additions & 8 deletions dcc-network/operation/dccnetwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
// SPDX-License-Identifier: GPL-3.0-or-later
#include "dccnetwork.h"

#include "dde-control-center/dccfactory.h"

Check warning on line 6 in dcc-network/operation/dccnetwork.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "dde-control-center/dccfactory.h" not found.
#include "netitemmodel.h"
#include "netmanager.h"

Check warning on line 8 in dcc-network/operation/dccnetwork.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "netmanager.h" not found.
#include "networkconst.h"

Check warning on line 9 in dcc-network/operation/dccnetwork.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "networkconst.h" not found.

#include <NetworkManagerQt/GenericTypes>

Check warning on line 11 in dcc-network/operation/dccnetwork.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <NetworkManagerQt/GenericTypes> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#include <QClipboard>
#include <QCoreApplication>
Expand Down Expand Up @@ -78,7 +79,7 @@
dns.append(addr.toIPv4Address());
} else if (addr.protocol() == QAbstractSocket::IPv6Protocol) {
// IPv6地址转换为128位表示(当前系统可能不支持,先跳过)
qWarning() << "IPv6 DNS not fully implemented in backend, DNS:" << dnsStr;
qCWarning(DNC()) << "IPv6 DNS not fully implemented in backend, DNS:" << dnsStr;
// 这里需要实现IPv6 DNS的完整支持
}
}
Expand All @@ -90,7 +91,7 @@
}
if (param.contains("ipv6")) {
QVariantMap ipv6Data = param.value("ipv6").toMap();

// 处理IPv6地址
if (ipv6Data.contains("address-data")) {
const QVariantList &addressData = ipv6Data.value("address-data").toList();
Expand All @@ -111,7 +112,7 @@
}
ipv6Data["addresses"] = QVariant::fromValue(ipv6AddressList);
}

// 处理IPv6 DNS
if (ipv6Data.contains("dns")) {
const QVariantList &dnsData = ipv6Data.value("dns").toList();
Expand All @@ -133,7 +134,7 @@
for (const QHostAddress &addr : ipv6DnsAddresses) {
ipv6DnsStrings.append(addr.toString());
}

// 使用字符串列表格式保存IPv6 DNS
ipv6Data["dns"] = ipv6DnsStrings;
ipv6Data["ignore-auto-dns"] = true;
Expand All @@ -143,13 +144,13 @@
ipv6Data.remove("dns");
ipv6Data.remove("ignore-auto-dns");
}

// 确保IPv6设置存在,即使没有DNS也要设置,以便被正确处理
if (ipv6Data.isEmpty()) {
ipv6Data["method"] = "auto"; // 至少设置一个值确保IPv6部分存在
ipv6Data["method"] = "auto"; // 至少设置一个值确保IPv6部分存在
}
}

tmpParam["ipv6"] = QVariant::fromValue(ipv6Data);
}
m_manager->exec(cmd, id, tmpParam);
Expand All @@ -170,7 +171,7 @@
if (!m_manager) {
return false;
}

return m_manager->netCheckAvailable();
}

Expand Down
1 change: 1 addition & 0 deletions dcc-network/qml/NetUtils.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.pragma library
// SPDX-FileCopyrightText: 2024 - 2027 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later
const VpnTypeEnum = Object.freeze({
Expand Down
4 changes: 2 additions & 2 deletions dss-network-plugin/networkmodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ QString NetworkPlugin::message(const QString &msgData)
QJsonDocument json = QJsonDocument::fromJson(msgData.toLatin1());
QJsonObject jsonObject = json.object();
if (!jsonObject.contains("data")) {
qWarning() << "msgData don't containt data" << msgData;
qCWarning(DNC()) << "msgData don't containt data" << msgData;
QJsonDocument jsonResult;
QJsonObject resultObject;
resultObject.insert("data", QString("msgData don't containt data %1").arg(msgData));
Expand All @@ -308,7 +308,7 @@ QString NetworkPlugin::message(const QString &msgData)
QDBusPendingCall reply = dbusInter.asyncCall("UpdateLanguage", locale);
reply.waitForFinished();
} else {
qWarning() << networkService << "don't start, wait for it start";
qCWarning(DNC()) << networkService << "don't start, wait for it start";
QDBusServiceWatcher *serviceWatcher = new QDBusServiceWatcher(this);
serviceWatcher->setConnection(QDBusConnection::systemBus());
serviceWatcher->addWatchedService(networkService);
Expand Down
2 changes: 0 additions & 2 deletions dss-network-plugin/notification/bubblemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,12 @@ void BubbleManager::CloseNotification(uint id)
if (bubble->entity()->replacesId() == str_id) {
bubble->close();
m_bubbleList.removeOne(bubble);
qDebug() << "CloseNotification : id" << str_id;
}
}

foreach (auto notify, m_oldEntities) {
if (notify->replacesId() == str_id) {
m_oldEntities.removeOne(notify);
qDebug() << "CloseNotification : id" << str_id;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ static QString getLocaleValue(const QString &filePath, const QStringList &keys,
{
QFile file(filePath);
if (!file.open(QFile::ReadOnly | QFile::Text)) {
qWarning() << "Failed to open locale file:" << filePath << "-" << file.errorString();
qCWarning(DSM) << "Failed to open locale file:" << filePath << "-" << file.errorString();
return QString();
}

Expand Down
5 changes: 2 additions & 3 deletions network-service-plugin/src/utils/constants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@ void dbusDebug(const QString &service, const QString &funName, const QDBusConnec
msg << service;
QDBusPendingReply<uint> reply = dbusConnection.asyncCall(msg);
if (reply.isError()) {
qWarning() << "API" << funName << "is called by" << service;
qWarning() << funName << "error:" << reply.error();
qCWarning(DSM) << "API" << funName << "is called by" << service << "error:" << reply.error();
return;
}
uint pid = reply.value();
QFile file(QString("/proc/%1/cmdline").arg(pid));
if (file.open(QFile::ReadOnly)) {
QByteArray cmd = file.readAll();
qWarning() << "API" << funName << "is called by" << service << "(" << cmd.split('\0').join(" ") << ")";
qCWarning(DSM) << "API" << funName << "is called by" << service << "(" << cmd.split('\0').join(" ") << ")";
}
}
} // namespace service
Expand Down
3 changes: 2 additions & 1 deletion src/dbus/proxychains.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later

#include "proxychains.h"
#include "networkconst.h"

Check warning on line 6 in src/dbus/proxychains.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "networkconst.h" not found.

/*
* Implementation of interface class __ProxyChains
Expand Down Expand Up @@ -112,7 +113,7 @@
return;
}

qWarning() << "On property changed,property not handle: " << propName;
qCWarning(DNC()) << "On property changed,property not handle: " << propName;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (typo): Improve log message wording and punctuation.

This log string is a bit unclear. Consider wording like "Property change not handled:" or "Unhandled property change:". Also, the comma is a full-width Chinese ; unless that’s intentional, use a standard ASCII comma for consistency with other logs.

Suggested change
qCWarning(DNC()) << "On property changed,property not handle: " << propName;
qCWarning(DNC()) << "Unhandled property change:" << propName;

return;
}

Expand Down
7 changes: 2 additions & 5 deletions src/networkcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
#include "wirelessdevice.h"
#include "connectivityhandler.h"

#include <DLog>

// const static QString networkService = "org.deepin.dde.Network1";
// const static QString networkPath = "/org/deepin/dde/Network1";
static QString localeName;
Expand All @@ -42,7 +40,6 @@ NetworkController::NetworkController()
, m_hotspotController(Q_NULLPTR)
, m_connectivityHandler(new ConnectivityHandler(this))
{
Dtk::Core::loggerInstance()->setDefaultCategory(DNC().categoryName());
retranslate(QLocale().name());

if (ConfigSetting::instance()->serviceFromNetworkManager()) {
Expand Down Expand Up @@ -152,9 +149,9 @@ void NetworkController::installTranslator(const QString &locale)
}
if (m_translator->load(QLocale(localeName), "dde-network-core", "_", "/usr/share/dde-network-core/translations")) {
QCoreApplication::installTranslator(m_translator);
qInfo() << "Loaded translation file for dde-network-core:" << m_translator->filePath();
qCInfo(DNC()) << "Loaded translation file for dde-network-core:" << m_translator->filePath();
} else {
qWarning() << "Failed to load translation file for dde-network-core";
qCWarning(DNC()) << "Failed to load translation file for dde-network-core";
m_translator->deleteLater();
m_translator = nullptr;
}
Expand Down