Fix wrong operators used

Signed-off-by: 侯红勋 <houhongxun@kylinos.cn>
This commit is contained in:
侯红勋 2024-05-20 17:11:15 +08:00
parent 436e57579e
commit e87bb3a0c3
2 changed files with 74 additions and 1 deletions

View File

@ -0,0 +1,68 @@
From 950e4d17e17680b1c3fe1d3181b76e54dd45e331 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BE=AF=E7=BA=A2=E5=8B=8B?= <houhongxun@kylinos.cn>
Date: Mon, 20 May 2024 17:08:17 +0800
Subject: [PATCH] peony: fix wrong operators used
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: 侯红勋 <houhongxun@kylinos.cn>
---
.../file-operation/file-untrash-operation.cpp | 10 +++++-----
.../tablet/src/UtilityFunction/fulllistview.cpp | 12 ++++++------
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/libpeony-qt/file-operation/file-untrash-operation.cpp b/libpeony-qt/file-operation/file-untrash-operation.cpp
index 139c75c..a81d2cf 100644
--- a/libpeony-qt/file-operation/file-untrash-operation.cpp
+++ b/libpeony-qt/file-operation/file-untrash-operation.cpp
@@ -100,11 +100,11 @@ const QString FileUntrashOperation::handleDuplicate(const QString &uri)
return newUri;
} else {
int pos = list.count() - 1;
- if (list.last() == "gz" |
- list.last() == "xz" |
- list.last() == "Z" |
- list.last() == "sit" |
- list.last() == "bz" |
+ if (list.last() == "gz" ||
+ list.last() == "xz" ||
+ list.last() == "Z" ||
+ list.last() == "sit" ||
+ list.last() == "bz" ||
list.last() == "bz2") {
pos--;
}
diff --git a/peony-qt-desktop/desktops/tablet/src/UtilityFunction/fulllistview.cpp b/peony-qt-desktop/desktops/tablet/src/UtilityFunction/fulllistview.cpp
index 9776b22..21587a9 100755
--- a/peony-qt-desktop/desktops/tablet/src/UtilityFunction/fulllistview.cpp
+++ b/peony-qt-desktop/desktops/tablet/src/UtilityFunction/fulllistview.cpp
@@ -228,9 +228,9 @@ void FullListView::mousePressEvent(QMouseEvent *event)
pressedpos = event->pos();
pressedGlobalPos = event->globalPos();
if(event->button() == Qt::LeftButton) {//左键
- if((this->indexAt(event->pos()).isValid())&&(pressedpos.x() % Style::AppListItemSizeWidth >= Style::AppLeftSpace &
- pressedpos.x() % Style::AppListItemSizeWidth <= Style::AppLeftSpace+ Style::AppListIconSize &
- pressedpos.y() % Style::AppListItemSizeHeight >= Style::AppTopSpace &
+ if((this->indexAt(event->pos()).isValid())&&(pressedpos.x() % Style::AppListItemSizeWidth >= Style::AppLeftSpace &&
+ pressedpos.x() % Style::AppListItemSizeWidth <= Style::AppLeftSpace+ Style::AppListIconSize &&
+ pressedpos.y() % Style::AppListItemSizeHeight >= Style::AppTopSpace &&
pressedpos.y() % Style::AppListItemSizeHeight <= Style::AppTopSpace+ Style::AppListIconSize))
{
@@ -252,9 +252,9 @@ void FullListView::mousePressEvent(QMouseEvent *event)
}
} else if(event->button() == Qt::RightButton) {//右键
- if((this->indexAt(event->pos()).isValid())&&(pressedpos.x() % Style::AppListItemSizeWidth >= Style::AppLeftSpace &
- pressedpos.x() % Style::AppListItemSizeWidth <= Style::AppLeftSpace+ Style::AppListIconSize &
- pressedpos.y() % Style::AppListItemSizeHeight >= Style::AppTopSpace &
+ if((this->indexAt(event->pos()).isValid())&&(pressedpos.x() % Style::AppListItemSizeWidth >= Style::AppLeftSpace &&
+ pressedpos.x() % Style::AppListItemSizeWidth <= Style::AppLeftSpace+ Style::AppListIconSize &&
+ pressedpos.y() % Style::AppListItemSizeHeight >= Style::AppTopSpace &&
pressedpos.y() % Style::AppListItemSizeHeight <= Style::AppTopSpace+ Style::AppListIconSize))
{
--
2.43.0

View File

@ -1,6 +1,6 @@
Name: peony
Version: 3.10.0
Release: 7
Release: 8
Summary: file Manager for the UKUI desktop
License: GPL-3.0-or-later and MIT and BSD-3-Clause
URL: http://www.ukui.org
@ -10,6 +10,7 @@ Patch02: 0001-peony-fix-segment-fault-when-rapidly-open-windows.patch
Patch03: 0001-peony-fix-a-problem-that-failed-to-switch-between-si.patch
Patch04: 0001-readd-function-to-set-file-executable-permission.patch
Patch05: 0001-Fix-inaccurate-translation-about-file-renamed-to-be-.patch
Patch06: 0001-peony-fix-wrong-operators-used.patch
BuildRequires: libudisks2-devel
BuildRequires: libnotify-devel
@ -87,6 +88,7 @@ Provides: libpeony
%patch 3 -p1
%patch 4 -p1
%patch 5 -p1
%patch 6 -p1
%build
%{qmake_qt5}
@ -143,6 +145,9 @@ rm -rf $RPM_BUILD_ROOT
%{_prefix}/%{_lib}/*.so
%changelog
* Mon May 20 2024 houhongxun <houhongxun@kylinos.cn> - 3.10.0-8
- fix wrong operators used
* Fri May 10 2024 houhongxun <houhongxun@kylinos.cn> - 3.10.0-7
- fix inaccurate translation about file renamed to be hidden