121 Star 0 Fork 6

src-openEuler/scap-workbench

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Use-QT-provided-macro-function-to-version-check-depr.patch 2.48 KB
一键复制 编辑 原始数据 按行查看 历史
chen-jan 提交于 2022-02-16 08:34 . update to 1.2.1
From 806be588a70349b1705a687d38b90bfa6702d010 Mon Sep 17 00:00:00 2001
From: Carlos Matos <cmatos@redhat.com>
Date: Fri, 29 May 2020 13:59:32 -0400
Subject: [PATCH] Use QT provided macro function to version check - deprecation
errors
---
src/SaveAsRPMDialog.cpp | 7 ++++++-
src/TailoringWindow.cpp | 14 ++++++++++++--
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/src/SaveAsRPMDialog.cpp b/src/SaveAsRPMDialog.cpp
index 611d15f..854396b 100644
--- a/src/SaveAsRPMDialog.cpp
+++ b/src/SaveAsRPMDialog.cpp
@@ -86,7 +86,12 @@ void SaveAsRPMDialog::slotFinished(int result)
closure.remove(mScanningSession->getOpenedFilePath());
QList<QString> closureOrdered;
closureOrdered.append(mScanningSession->getOpenedFilePath());
- closureOrdered.append(closure.toList());
+ #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
+ closureOrdered.append(closure.values());
+ #else
+ // support older versions where deprecation warning is not fatal
+ closureOrdered.append(closure.toList());
+ #endif
const QDir cwd = ScanningSession::getCommonAncestorDirectory(closure);
diff --git a/src/TailoringWindow.cpp b/src/TailoringWindow.cpp
index ceced3e..e4081cf 100644
--- a/src/TailoringWindow.cpp
+++ b/src/TailoringWindow.cpp
@@ -645,7 +645,12 @@ QString TailoringWindow::getQSettingsKey() const
void TailoringWindow::deserializeCollapsedItems()
{
const QStringList list = mQSettings->value(getQSettingsKey()).toStringList();
- mCollapsedItemIds = QSet<QString>::fromList(list);
+ #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
+ mCollapsedItemIds = QSet<QString>(list.begin(), list.end());
+ #else
+ // support older versions where deprecation warning is not fatal
+ mCollapsedItemIds = QSet<QString>::fromList(list);
+ #endif
}
void TailoringWindow::serializeCollapsedItems()
@@ -657,7 +662,12 @@ void TailoringWindow::serializeCollapsedItems()
}
else
{
- mQSettings->setValue(getQSettingsKey(), QVariant(mCollapsedItemIds.toList()));
+ #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
+ mQSettings->setValue(getQSettingsKey(), QVariant(mCollapsedItemIds.values()));
+ #else
+ // support older versions where deprecation warning is not fatal
+ mQSettings->setValue(getQSettingsKey(), QVariant(mCollapsedItemIds.toList()));
+ #endif
mQSettings->setValue(getQSettingsKey() + "_lastUsed", QVariant(QDateTime::currentDateTime()));
}
}
--
2.30.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/scap-workbench.git
git@gitee.com:src-openeuler/scap-workbench.git
src-openeuler
scap-workbench
scap-workbench
master

搜索帮助