From d73acd5d5441291b1a925c3f55361da1d8fc5c9d Mon Sep 17 00:00:00 2001 From: peijiankang Date: Tue, 6 Jun 2023 16:49:22 +0800 Subject: [PATCH] fix share error peony-extensions (cherry picked from commit b5828d179b1a2bb7f82a9c71837fc48e4d905e3b) --- 0001-move-sambashare-to-usershares.patch | 28 ++++ ...add-share-information-of-peony-share.patch | 130 ++++++++++++++++++ peony-extensions.spec | 24 ++-- 3 files changed, 168 insertions(+), 14 deletions(-) create mode 100644 0001-move-sambashare-to-usershares.patch create mode 100644 0002-add-share-information-of-peony-share.patch diff --git a/0001-move-sambashare-to-usershares.patch b/0001-move-sambashare-to-usershares.patch new file mode 100644 index 0000000..6de355d --- /dev/null +++ b/0001-move-sambashare-to-usershares.patch @@ -0,0 +1,28 @@ +From e9870402136ad75706de96effc40745dc8ab0a41 Mon Sep 17 00:00:00 2001 +From: peijiankang +Date: Tue, 6 Jun 2023 15:06:10 +0800 +Subject: [PATCH 1/2] move sambashare to usershares + +--- + peony-share/peony-share.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/peony-share/peony-share.sh b/peony-share/peony-share.sh +index 431e747..1b181ed 100755 +--- a/peony-share/peony-share.sh ++++ b/peony-share/peony-share.sh +@@ -2,9 +2,9 @@ + + if [ "$#" -ge 1 ]; + then +- if [[ $(groups $1 | grep "sambashare") == "" ]]; ++ if [[ $(groups $1 | grep "usershares") == "" ]]; + then +- usermod -a -G sambashare "$1" ++ usermod -a -G usershares "$1" + fi + fi + +-- +2.33.0 + diff --git a/0002-add-share-information-of-peony-share.patch b/0002-add-share-information-of-peony-share.patch new file mode 100644 index 0000000..42da644 --- /dev/null +++ b/0002-add-share-information-of-peony-share.patch @@ -0,0 +1,130 @@ +From 5b815653a800a278e8733d1d4edbfb89cb6e03b9 Mon Sep 17 00:00:00 2001 +From: peijiankang +Date: Thu, 8 Jun 2023 09:34:56 +0800 +Subject: [PATCH] add share information of peony-share + +--- + peony-share/SwitchButton/switchbutton.cpp | 17 +++++++++++++++++ + peony-share/peony-share.pro | 2 ++ + .../translations/peony-share-extension_cs.ts | 13 +++++++++++++ + .../translations/peony-share-extension_tr.ts | 13 +++++++++++++ + .../translations/peony-share-extension_zh_CN.ts | 13 +++++++++++++ + 5 files changed, 58 insertions(+) + +diff --git a/peony-share/SwitchButton/switchbutton.cpp b/peony-share/SwitchButton/switchbutton.cpp +index d21970d..38bb00a 100644 +--- a/peony-share/SwitchButton/switchbutton.cpp ++++ b/peony-share/SwitchButton/switchbutton.cpp +@@ -20,6 +20,8 @@ + #include "switchbutton.h" + + #include ++#include ++#include + #define THEME_QT_SCHEMA "org.ukui.style" + #define THEME_GTK_SCHEMA "org.mate.interface" + #define TIMER_INTERVAL 5 //每隔5ms动画移动一次 +@@ -204,6 +206,21 @@ void SwitchButton::mousePressEvent(QMouseEvent *){ + mEndX = 0; + return ; + }else{ ++ QProcess tempProcess; ++ QString cmd = QString("groups"); ++ tempProcess.start(cmd); ++ tempProcess.waitForFinished(); ++ ++ QString result = tempProcess.readAllStandardOutput().data(); ++ tempProcess.close(); ++ bool bFail = false; ++ bFail= result.contains("usershares"); ++ ++ if(!bFail) ++ { ++ QMessageBox::information(this,tr("infomation"),tr("user no group usershares, please log off and try agagin")); ++ return; ++ } + checked = !checked; + Q_EMIT checkedChanged(checked); + +diff --git a/peony-share/peony-share.pro b/peony-share/peony-share.pro +index 9474deb..55f35a5 100644 +--- a/peony-share/peony-share.pro ++++ b/peony-share/peony-share.pro +@@ -27,6 +27,8 @@ TRANSLATIONS += translations/peony-share-extension_cs.ts \ + translations/peony-share-extension_tr.ts \ + translations/peony-share-extension_zh_CN.ts + ++system("lrelease-qt5 translations/*.ts") ++ + RESOURCES += resources.qrc + + target.path = $$[QT_INSTALL_LIBS]/peony-extensions +diff --git a/peony-share/translations/peony-share-extension_cs.ts b/peony-share/translations/peony-share-extension_cs.ts +index a2c1812..f4c69c1 100644 +--- a/peony-share/translations/peony-share-extension_cs.ts ++++ b/peony-share/translations/peony-share-extension_cs.ts +@@ -74,4 +74,17 @@ + Komentář: + + ++ ++ SwitchButton ++ ++ ++ infomation ++ Informace o připomenutí ++ ++ ++ ++ user no group usershares, please log off and try agagin ++ Tento uživatel není ve skupině usershares a musí se odhlásit a zkusit sdílet znovu ++ ++ + +diff --git a/peony-share/translations/peony-share-extension_tr.ts b/peony-share/translations/peony-share-extension_tr.ts +index 0c9c652..de95916 100644 +--- a/peony-share/translations/peony-share-extension_tr.ts ++++ b/peony-share/translations/peony-share-extension_tr.ts +@@ -74,4 +74,17 @@ + Yorum yap: + + ++ ++ SwitchButton ++ ++ ++ infomation ++ Hatırlatma Bilgisi ++ ++ ++ ++ user no group usershares, please log off and try agagin ++ Bu kullanıcı usershares kullanıcı grubunda değil ve çıkıp tekrar paylaşmaya çalışmalı ++ ++ + +diff --git a/peony-share/translations/peony-share-extension_zh_CN.ts b/peony-share/translations/peony-share-extension_zh_CN.ts +index 2b52463..0f64c7c 100644 +--- a/peony-share/translations/peony-share-extension_zh_CN.ts ++++ b/peony-share/translations/peony-share-extension_zh_CN.ts +@@ -74,4 +74,17 @@ + 注释: + + ++ ++ SwitchButton ++ ++ ++ infomation ++ 提示信息 ++ ++ ++ ++ user no group usershares, please log off and try agagin ++ 此用户不在usershares用户组中,需要注销后重新尝试共享功能 ++ ++ + +-- +2.33.0 + diff --git a/peony-extensions.spec b/peony-extensions.spec index a5cc2e0..a4ed2eb 100644 --- a/peony-extensions.spec +++ b/peony-extensions.spec @@ -1,10 +1,12 @@ Name: peony-extensions Version: 3.10.0 -Release: 3 +Release: 4 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 BuildRequires: cmake BuildRequires: pkgconf @@ -20,7 +22,7 @@ BuildRequires: libnotify-devel BuildRequires: ukui-interface Requires: parchives, peony-open-terminal, peony-extension-computer-view, peony-set-wallpaper, peony-send-to-device - +Requires: samba-usershares Recommends: peony-share, ukui-bluetooth, peony-device-rename @@ -104,6 +106,8 @@ to rename it use other tools like gparted. %prep %setup -q +%patch01 -p1 +%patch02 -p1 %build export PATH=%{_qt5_bindir}:$PATH @@ -123,18 +127,7 @@ popd rm -rf $RPM_BUILD_ROOT %post -#!/bin/bash -#DEBHELPER# - -if [ ! -d '/var/lib/samba/usershares' ];then - mkdir -p /var/lib/samba/usershare - groupadd sambashare &> /dev/null ||: - chown root:sambashare /var/lib/samba/usershare - chmod 0770 /var/lib/samba/usershare - chmod +t /var/lib/samba/usershare -fi - -%preun +systemctl enable smb &> /dev/null ||: %files %doc debian/control debian/copyright @@ -167,6 +160,9 @@ fi %{_libdir}/peony-extensions/libpeony-drive-rename.so %changelog +* Tue Jun 06 2023 peijiankang - 3.10.0-4 +- fix share error of peony-extensions + * Wed Feb 08 2023 peijiankang - 3.10.0-3 - sync packaging format -- Gitee