fix share error peony-extensions

(cherry picked from commit b5828d179b1a2bb7f82a9c71837fc48e4d905e3b)
This commit is contained in:
peijiankang 2023-06-06 16:49:22 +08:00 committed by openeuler-sync-bot
parent a9a7617893
commit d73acd5d54
3 changed files with 168 additions and 14 deletions

View File

@ -0,0 +1,28 @@
From e9870402136ad75706de96effc40745dc8ab0a41 Mon Sep 17 00:00:00 2001
From: peijiankang <peijiankang@kylinos.cn>
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

View File

@ -0,0 +1,130 @@
From 5b815653a800a278e8733d1d4edbfb89cb6e03b9 Mon Sep 17 00:00:00 2001
From: peijiankang <peijiankang@kylinos.cn>
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 <QDebug>
+#include <QMessageBox>
+#include <QProcess>
#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 @@
<translation>Komentář:</translation>
</message>
</context>
+<context>
+ <name>SwitchButton</name>
+ <message>
+ <location filename="../SwitchButton/switchbutton.cpp" line="221"/>
+ <source>infomation</source>
+ <translation>Informace o připomenutí</translation>
+ </message>
+ <message>
+ <location filename="../SwitchButton/switchbutton.cpp" line="221"/>
+ <source>user no group usershares, please log off and try agagin</source>
+ <translation>Tento uživatel není ve skupině usershares a musí se odhlásit a zkusit sdílet znovu</translation>
+ </message>
+</context>
</TS>
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 @@
<translation>Yorum yap:</translation>
</message>
</context>
+<context>
+ <name>SwitchButton</name>
+ <message>
+ <location filename="../SwitchButton/switchbutton.cpp" line="221"/>
+ <source>infomation</source>
+ <translation>Hatırlatma Bilgisi</translation>
+ </message>
+ <message>
+ <location filename="../SwitchButton/switchbutton.cpp" line="221"/>
+ <source>user no group usershares, please log off and try agagin</source>
+ <translation>Bu kullanıcı usershares kullanıcı grubunda değil ve çıkıp tekrar paylaşmaya çalışmalı</translation>
+ </message>
+</context>
</TS>
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 @@
<translation>注释:</translation>
</message>
</context>
+<context>
+ <name>SwitchButton</name>
+ <message>
+ <location filename="../SwitchButton/switchbutton.cpp" line="221"/>
+ <source>infomation</source>
+ <translation>提示信息</translation>
+ </message>
+ <message>
+ <location filename="../SwitchButton/switchbutton.cpp" line="221"/>
+ <source>user no group usershares, please log off and try agagin</source>
+ <translation>此用户不在usershares用户组中需要注销后重新尝试共享功能</translation>
+ </message>
+</context>
</TS>
--
2.33.0

View File

@ -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 <peijiankang@kylinos.cn> - 3.10.0-4
- fix share error of peony-extensions
* Wed Feb 08 2023 peijiankang <peijiankang@kylinos.cn> - 3.10.0-3
- sync packaging format