repace some deprecated functions to recommended ones

Signed-off-by: 侯红勋 <houhongxun@kylinos.cn>
This commit is contained in:
侯红勋 2024-04-24 09:55:40 +08:00
parent 0cec992765
commit bda6e14c30
2 changed files with 63 additions and 1 deletions

View File

@ -0,0 +1,57 @@
From be8300414c7f15ce7dd1a0f7dafaacb76a835d48 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BE=AF=E7=BA=A2=E5=8B=8B?= <houhongxun@kylinos.cn>
Date: Wed, 24 Apr 2024 09:44:19 +0800
Subject: [PATCH] replace some deprecated member functions to recommended ones
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: 侯红勋 <houhongxun@kylinos.cn>
---
peony-bluetooth-plugin/bluetoothplugin.cpp | 2 +-
peony-share/SwitchButton/switchbutton.cpp | 2 +-
peony-share/share-properties-page-plugin.cpp | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/peony-bluetooth-plugin/bluetoothplugin.cpp b/peony-bluetooth-plugin/bluetoothplugin.cpp
index 10ab347..d05daaa 100644
--- a/peony-bluetooth-plugin/bluetoothplugin.cpp
+++ b/peony-bluetooth-plugin/bluetoothplugin.cpp
@@ -81,7 +81,7 @@ QList<QAction *> BluetoothPlugin::menuActions(Peony::MenuPluginInterface::Types
}
QProcess process;
- process.start("rfkill list");
+ process.start("rfkill", QStringList() << "list");
process.waitForFinished();
QByteArray output = process.readAllStandardOutput();
QString str_output = output;
diff --git a/peony-share/SwitchButton/switchbutton.cpp b/peony-share/SwitchButton/switchbutton.cpp
index 38bb00a..f064ded 100644
--- a/peony-share/SwitchButton/switchbutton.cpp
+++ b/peony-share/SwitchButton/switchbutton.cpp
@@ -208,7 +208,7 @@ void SwitchButton::mousePressEvent(QMouseEvent *){
}else{
QProcess tempProcess;
QString cmd = QString("groups");
- tempProcess.start(cmd);
+ tempProcess.start(cmd, QStringList());
tempProcess.waitForFinished();
QString result = tempProcess.readAllStandardOutput().data();
diff --git a/peony-share/share-properties-page-plugin.cpp b/peony-share/share-properties-page-plugin.cpp
index 69a20da..b6a37d8 100644
--- a/peony-share/share-properties-page-plugin.cpp
+++ b/peony-share/share-properties-page-plugin.cpp
@@ -76,7 +76,7 @@ bool SharePropertiesPagePlugin::supportUris(const QStringList &uris)
return false;
}
// don't share user's home directory file:///home/xxx/
- QStringList file = info->uri().split('/', QString::SkipEmptyParts);
+ QStringList file = info->uri().split('/', Qt::SkipEmptyParts);
if ((3 == file.size ()) && (file.at(1) == "home")) {
return false;
}
--
2.43.0

View File

@ -1,12 +1,13 @@
Name: peony-extensions
Version: 3.10.0
Release: 5
Release: 6
Summary: adds extended functionality to the Peony file manager.
License: GPLv3 and LGPLv3
URL: http://www.ukui.org
Source0: %{name}-%{version}.tar.gz
Patch01: 0001-move-sambashare-to-usershares.patch
Patch02: 0002-add-share-information-of-peony-share.patch
Patch03: 0001-replace-some-deprecated-member-functions-to-recommen.patch
BuildRequires: cmake
BuildRequires: pkgconf
@ -108,6 +109,7 @@ to rename it use other tools like gparted.
%setup -q
%patch01 -p1
%patch02 -p1
%patch03 -p1
%build
export PATH=%{_qt5_bindir}:$PATH
@ -160,6 +162,9 @@ systemctl enable smb &> /dev/null ||:
%{_libdir}/peony-extensions/libpeony-drive-rename.so
%changelog
* Wed Apr 24 2024 houhongxun <houhongxun@kylinos.cn> - 3.10.0-6
- replace some deprecated functions to recommended ones
* Sat Jun 17 2023 huayadong <huayadong@kylinos.cn> - 3.10.0-5
- remove Recommends: ukui-bluetooth