From e59ea47e98c22618f260a724938c0a55d62a91ed Mon Sep 17 00:00:00 2001
From: luoqing <luoqing@kylinsec.com.cn>
Date: Fri, 29 Mar 2024 16:11:36 +0800
Subject: [PATCH] fix(audio&network):Compatible for versions below 5.15
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

-  兼容qt5.15以下版本
---
 plugins/network/src/plugin/connection-itemwidget.cpp | 4 ++++
 plugins/network/src/tray/network-tray.cpp            | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/plugins/network/src/plugin/connection-itemwidget.cpp b/plugins/network/src/plugin/connection-itemwidget.cpp
index d1abea1..db4e708 100644
--- a/plugins/network/src/plugin/connection-itemwidget.cpp
+++ b/plugins/network/src/plugin/connection-itemwidget.cpp
@@ -523,8 +523,12 @@ void ConnectionItemWidget::activateWirelessNetwork()
 
 void ConnectionItemWidget::handleThemeChanged(Kiran::PaletteType paletteType)
 {
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
     QPixmap pixmap = m_connectionTypeIcon->pixmap(Qt::ReturnByValue);
     QImage image = pixmap.toImage();
+#else
+    QImage image = m_connectionTypeIcon->pixmap()->toImage();
+#endif
     image.invertPixels(QImage::InvertRgb);
     m_connectionTypeIcon->setPixmap(QPixmap::fromImage(image));
     m_editButton->setIcon(NetworkUtils::trayIconColorSwitch(":/kcp-network-images/details-info.svg"));
diff --git a/plugins/network/src/tray/network-tray.cpp b/plugins/network/src/tray/network-tray.cpp
index 015a157..e6d6831 100644
--- a/plugins/network/src/tray/network-tray.cpp
+++ b/plugins/network/src/tray/network-tray.cpp
@@ -757,7 +757,11 @@ void NetworkTray::initTcpSocket()
 {
     m_tcpClient = new QTcpSocket(this);
     connect(m_tcpClient, &QTcpSocket::connected, this, &NetworkTray::internetConnected);
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
     connect(m_tcpClient, &QAbstractSocket::errorOccurred, this, &NetworkTray::internetError);
+#else
+    connect(m_tcpClient, QOverload<QAbstractSocket::SocketError>::of(&QAbstractSocket::error),this, &NetworkTray::internetError);
+#endif
 }
 
 void NetworkTray::checkInternetConnectivity()
-- 
2.27.0

