Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Optimisation submission for qt6 adaptation #419

Open
wants to merge 1 commit into
base: develop/qt6.8
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions deepin-devicemanager/src/DeviceManager/DeviceGpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ bool DeviceGpu::setHwinfoInfo(const QMap<QString, QString> &mapInfo)
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QStringList items = allStr.split(":", QString::SkipEmptyParts);
#else
QStringList items = allStr.split(":");
QStringList items = allStr.split(":", Qt::SkipEmptyParts);
#endif
if (items.size() != 2)
continue;
Expand Down Expand Up @@ -205,7 +205,7 @@ bool DeviceGpu::setHwinfoInfo(const QMap<QString, QString> &mapInfo)
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QStringList items = item.split(":", QString::SkipEmptyParts);
#else
QStringList items = item.split(":");
QStringList items = item.split(":", Qt::SkipEmptyParts);
#endif
if (items.size() != 2)
continue;
Expand Down
2 changes: 1 addition & 1 deletion deepin-devicemanager/src/DeviceManager/DeviceInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ const QString DeviceBaseInfo::getDriverVersion()
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QStringList item = out.split(":", QString::SkipEmptyParts);
#else
QStringList item = out.split(":");
QStringList item = out.split(":", Qt::SkipEmptyParts);
#endif
if (!item.isEmpty() && "version" == item[0].trimmed()) {
return item[1].trimmed();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void DriverBackupThread::run()
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QList<QString> lines = QString(outArry).split('\n', QString::SkipEmptyParts);
#else
QList<QString> lines = QString(outArry).split('\n');
QList<QString> lines = QString(outArry).split('\n', Qt::SkipEmptyParts);
#endif
for (const QString &line : qAsConst(lines)) {
if (line.contains("无法解析域名")) {
Expand Down
14 changes: 7 additions & 7 deletions deepin-devicemanager/src/GenerateDevice/CmdTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,8 @@ void CmdTool::getMulHwinfoInfo(const QString &info)
QStringList auths = sAinfo.split("\n\n", QString::SkipEmptyParts);
QStringList remos = sRinfo.split("\n\n", QString::SkipEmptyParts);
#else
QStringList auths = sAinfo.split("\n\n");
QStringList remos = sRinfo.split("\n\n");
QStringList auths = sAinfo.split("\n\n", Qt::SkipEmptyParts);
QStringList remos = sRinfo.split("\n\n", Qt::SkipEmptyParts);
#endif
QStringList resItems = items + auths + remos;

Expand Down Expand Up @@ -889,7 +889,7 @@ void CmdTool::loadNvidiaSettingInfo(const QString &key, const QString &debugfile
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QStringList gpuNumList = firstStr.split(' ', QString::SkipEmptyParts);
#else
QStringList gpuNumList = firstStr.split(' ');
QStringList gpuNumList = firstStr.split(' ', Qt::SkipEmptyParts);
#endif
if (gpuNumList.size() != 2)
continue;
Expand All @@ -914,7 +914,7 @@ void CmdTool::loadNvidiaSettingInfo(const QString &key, const QString &debugfile
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QStringList strList = memoryItem.split(' ', QString::SkipEmptyParts);
#else
QStringList strList = memoryItem.split(' ');
QStringList strList = memoryItem.split(' ', Qt::SkipEmptyParts);
#endif
curBusIdStr = strList.size() == 2 ? strList[1] : "null";
}
Expand All @@ -926,7 +926,7 @@ void CmdTool::loadNvidiaSettingInfo(const QString &key, const QString &debugfile
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QStringList strList = memoryItem.split(':', QString::SkipEmptyParts);
#else
QStringList strList = memoryItem.split(' ');
QStringList strList = memoryItem.split(' ', Qt::SkipEmptyParts);
#endif
if (strList.size() != 2) {
break;
Expand All @@ -936,7 +936,7 @@ void CmdTool::loadNvidiaSettingInfo(const QString &key, const QString &debugfile
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QStringList memorySizeList = strList[1].split(' ', QString::SkipEmptyParts);
#else
QStringList memorySizeList = strList[1].split(' ');
QStringList memorySizeList = strList[1].split(' ', Qt::SkipEmptyParts);
#endif
if (memorySizeList.size() == 2) {
bool isOk = false;
Expand Down Expand Up @@ -1473,7 +1473,7 @@ void CmdTool::getMapInfoFromBluetoothCtl(QMap<QString, QString> &mapInfo, const
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QStringList valueStrList = valueStr.split("(", QString::SkipEmptyParts);
#else
QStringList valueStrList = valueStr.split("(");
QStringList valueStrList = valueStr.split("(", Qt::SkipEmptyParts);
#endif
if (valueStrList.size() == 2)
valueStr = valueStrList[0].trimmed() + ":(" + valueStrList[1];
Expand Down
2 changes: 1 addition & 1 deletion deepin-devicemanager/src/GenerateDevice/HWGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ void HWGenerator::getBluetoothInfoFromCatWifiInfo()
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QStringList strList = item.split(':', QString::SkipEmptyParts);
#else
QStringList strList = item.split(':');
QStringList strList = item.split(':', Qt::SkipEmptyParts);
#endif
if (strList.size() == 2)
wifiInfo[strList[0] ] = strList[1];
Expand Down
2 changes: 1 addition & 1 deletion deepin-devicemanager/src/GenerateDevice/KLUGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void KLUGenerator::getNetworkInfoFromCatWifiInfo()
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QStringList strList = item.split(':', QString::SkipEmptyParts);
#else
QStringList strList = item.split(':');
QStringList strList = item.split(':', Qt::SkipEmptyParts);
#endif
if (strList.size() == 2)
wifiInfo[strList[0] ] = strList[1];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ QStringList PanguVGenerator::getNetworkInfoFromifconfig()
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QStringList line = list.at(i).split(" ", QString::SkipEmptyParts);
#else
QStringList line = list.at(i).split(" ");
QStringList line = list.at(i).split(" ", Qt::SkipEmptyParts);
#endif
{
if(line.size() < 2)
Expand Down
7 changes: 2 additions & 5 deletions deepin-devicemanager/src/Page/PageBoardInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,8 @@ void PageBoardInfo::loadDeviceInfo(const QList<DeviceBaseInfo *> &devices, const

// 比较页面可显示的最大行数与主板信息,取小值
int maxRow = this->height() / ROW_HEIGHT - 3;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
int limitSize = std::min(static_cast<int>(lst.size()), maxRow);
#else
int limitSize = std::min(lst.size(), static_cast<qsizetype>(maxRow));
#endif
// 需要确保两个参数的类型一致 qsizetype 是在 Qt 6 中存在的无符号整数类型
int limitSize = std::min(static_cast<qsizetype>(lst.size()), static_cast<qsizetype>(maxRow));
if (mp_Content)
mp_Content->setLimitRow(limitSize);

Expand Down
2 changes: 1 addition & 1 deletion deepin-devicemanager/src/Page/PageDriverManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ void PageDriverManager::getDebBackupInfo(DriverInfo *info)
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QStringList tmpsl = tmps.split('_', QString::SkipEmptyParts);
#else
QStringList tmpsl = tmps.split('_');
QStringList tmpsl = tmps.split('_', Qt::SkipEmptyParts);
#endif
info->m_DebBackupVersion = tmpsl.first();
info->m_BackupFileName = fileInfo.absoluteFilePath();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QStringList pathList = path.split("/", QString::SkipEmptyParts);
#else
QStringList pathList = path.split("/");
QStringList pathList = path.split("/", Qt::SkipEmptyParts);

Check warning on line 44 in deepin-devicemanager/src/WakeupControl/DBusWakeupInterface.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Local variable 'pathList' shadows outer variable
#endif
if (pathList.size() < 3)
return false;
Expand Down
Loading