Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: x11-libs/libfm-qt/files/, x11-libs/libfm-qt/
Date: Sat, 25 May 2019 21:13:22
Message-Id: 1558818784.a6bdca64f370f8d3421d8fc5d65feb9a6d121598.asturm@gentoo
1 commit: a6bdca64f370f8d3421d8fc5d65feb9a6d121598
2 Author: Jimi Huotari <chiitoo <AT> gentoo <DOT> org>
3 AuthorDate: Sat May 25 20:50:21 2019 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sat May 25 21:13:04 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a6bdca64
7
8 x11-libs/libfm-qt: patch issue with phantom desktop files
9
10 On some machines (slow enough?), visible desktop entries such as
11 'trash' would cause related temporary no longer existing files
12 being displayed on the desktop as well.
13
14 - https://github.com/lxqt/pcmanfm-qt/issues/944
15 - https://github.com/lxqt/libfm-qt/commit/f944be7d
16
17 Package-Manager: Portage-2.3.66, Repoman-2.3.12
18 Signed-off-by: Jimi Huotari <chiitoo <AT> gentoo.org>
19 Closes: https://github.com/gentoo/gentoo/pull/12108
20 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
21
22 .../libfm-qt-0.14.1-phantom-desktop-files.patch | 109 +++++++++++++++++++++
23 x11-libs/libfm-qt/libfm-qt-0.14.1-r2.ebuild | 41 ++++++++
24 2 files changed, 150 insertions(+)
25
26 diff --git a/x11-libs/libfm-qt/files/libfm-qt-0.14.1-phantom-desktop-files.patch b/x11-libs/libfm-qt/files/libfm-qt-0.14.1-phantom-desktop-files.patch
27 new file mode 100644
28 index 00000000000..b9edab299cd
29 --- /dev/null
30 +++ b/x11-libs/libfm-qt/files/libfm-qt-0.14.1-phantom-desktop-files.patch
31 @@ -0,0 +1,109 @@
32 +From f944be7d2447d5c579a57fb5519ee5e2dece5871 Mon Sep 17 00:00:00 2001
33 +From: Tsu Jan <tsujan2000@×××××.com>
34 +Date: Sun, 21 Apr 2019 14:11:14 +0430
35 +Subject: [PATCH] Don't ignore creation-deletion sequences
36 +
37 +Fixes https://github.com/lxqt/pcmanfm-qt/issues/944
38 +
39 +Previously, if a file was in addition queue and then it came into the deletion queue, its addition and deletion were both ignored. That was wrong and could result in showing nonexistent files because addition can also happen in directory list job before being processed by file info job.
40 +
41 +Also process accumulated changes only after finishing the current info job and don't clear all deletion paths after processing them (because, logically, only those paths that can be deleted should be removed).
42 +---
43 + src/core/folder.cpp | 60 +++++++++++++++++++++++----------------------
44 + 1 file changed, 31 insertions(+), 29 deletions(-)
45 +
46 +diff --git a/src/core/folder.cpp b/src/core/folder.cpp
47 +index 6c2b27d..2385a8b 100644
48 +--- a/src/core/folder.cpp
49 ++++ b/src/core/folder.cpp
50 +@@ -228,16 +228,6 @@ void Folder::onFileInfoFinished() {
51 + return;
52 + }
53 +
54 +- // process the changes accumulated during this info job
55 +- if(filesystem_info_pending // means a pending change; see "onFileSystemInfoFinished()"
56 +- || !paths_to_update.empty() || !paths_to_add.empty() || !paths_to_del.empty()) {
57 +- QTimer::singleShot(0, this, &Folder::processPendingChanges);
58 +- }
59 +- // there's no pending change at the moment; let the next one be processed
60 +- else {
61 +- has_idle_update_handler = false;
62 +- }
63 +-
64 + FileInfoList files_to_add;
65 + FileInfoList files_to_delete;
66 + std::vector<FileInfoPair> files_to_update;
67 +@@ -271,6 +261,16 @@ void Folder::onFileInfoFinished() {
68 + Q_EMIT filesChanged(files_to_update);
69 + }
70 + Q_EMIT contentChanged();
71 ++
72 ++ // process the changes accumulated during this info job
73 ++ if(filesystem_info_pending // means a pending change; see "onFileSystemInfoFinished()"
74 ++ || !paths_to_update.empty() || !paths_to_add.empty() || !paths_to_del.empty()) {
75 ++ QTimer::singleShot(0, this, &Folder::processPendingChanges);
76 ++ }
77 ++ // there's no pending change at the moment; let the next one be processed
78 ++ else {
79 ++ has_idle_update_handler = false;
80 ++ }
81 + }
82 +
83 + void Folder::processPendingChanges() {
84 +@@ -314,21 +314,24 @@ void Folder::processPendingChanges() {
85 + }
86 +
87 + // process deletion
88 +- if(!paths_to_del.empty()) {
89 +- FileInfoList deleted_files;
90 +- for(const auto &path: paths_to_del) {
91 +- auto name = path.baseName();
92 +- auto it = files_.find(name.get());
93 +- if(it != files_.end()) {
94 +- deleted_files.push_back(it->second);
95 +- files_.erase(it);
96 +- }
97 ++ FileInfoList deleted_files;
98 ++ auto path_it = paths_to_del.begin();
99 ++ while(path_it != paths_to_del.end()) {
100 ++ const auto& path = *path_it;
101 ++ auto name = path.baseName();
102 ++ auto it = files_.find(name.get());
103 ++ if(it != files_.end()) {
104 ++ deleted_files.push_back(it->second);
105 ++ files_.erase(it);
106 ++ path_it = paths_to_del.erase(path_it);
107 + }
108 +- if(!deleted_files.empty()) {
109 +- Q_EMIT filesRemoved(deleted_files);
110 +- Q_EMIT contentChanged();
111 ++ else {
112 ++ ++path_it;
113 + }
114 +- paths_to_del.clear();
115 ++ }
116 ++ if(!deleted_files.empty()) {
117 ++ Q_EMIT filesRemoved(deleted_files);
118 ++ Q_EMIT contentChanged();
119 + }
120 +
121 + if(pending_change_notify) {
122 +@@ -404,13 +407,12 @@ void Folder::eventFileDeleted(const FilePath& path) {
123 + bool deleted = true;
124 + // qDebug() << "delete " << path.baseName().get();
125 + // G_LOCK(lists);
126 +- if(std::find(paths_to_add.cbegin(), paths_to_add.cend(), path) != paths_to_add.cend()) {
127 +- // if the file was going to be added, just remove it from the addition queue
128 +- paths_to_add.erase(std::remove(paths_to_add.begin(), paths_to_add.end(), path), paths_to_add.cend());
129 +- }
130 +- else if(std::find(paths_to_del.cbegin(), paths_to_del.cend(), path) == paths_to_del.cend()) {
131 ++ /* WARNING: If the file is in the addition queue, we shouldn not remove it from that queue
132 ++ and ignore its deletion because it may have been added by the directory list job, in
133 ++ which case, ignoring an addition-deletion sequence would result in a nonexistent file. */
134 ++ if(std::find(paths_to_del.cbegin(), paths_to_del.cend(), path) == paths_to_del.cend()) {
135 + paths_to_del.push_back(path);
136 +- // the update queue should be cancelled for a file that is going to be deleted
137 ++ // the update queue can be cancelled for a file that is going to be deleted
138 + paths_to_update.erase(std::remove(paths_to_update.begin(), paths_to_update.end(), path), paths_to_update.cend());
139 + }
140 + else {
141
142 diff --git a/x11-libs/libfm-qt/libfm-qt-0.14.1-r2.ebuild b/x11-libs/libfm-qt/libfm-qt-0.14.1-r2.ebuild
143 new file mode 100644
144 index 00000000000..54bea008481
145 --- /dev/null
146 +++ b/x11-libs/libfm-qt/libfm-qt-0.14.1-r2.ebuild
147 @@ -0,0 +1,41 @@
148 +# Copyright 1999-2019 Gentoo Authors
149 +# Distributed under the terms of the GNU General Public License v2
150 +
151 +EAPI=7
152 +
153 +inherit cmake-utils
154 +
155 +DESCRIPTION="Qt port of libfm, a library providing components to build desktop file managers"
156 +HOMEPAGE="https://lxqt.org/"
157 +
158 +if [[ "${PV}" == "9999" ]]; then
159 + inherit git-r3
160 + EGIT_REPO_URI="https://github.com/lxqt/${PN}.git"
161 +else
162 + SRC_URI="https://downloads.lxqt.org/downloads/${PN}/${PV}/${P}.tar.xz"
163 + KEYWORDS="~amd64 ~arm ~arm64 ~x86"
164 +fi
165 +
166 +LICENSE="GPL-2+ LGPL-2.1+"
167 +SLOT="0/5"
168 +
169 +BDEPEND="
170 + dev-qt/linguist-tools:5
171 + >=dev-util/lxqt-build-tools-0.6.0
172 + virtual/pkgconfig
173 +"
174 +DEPEND="
175 + dev-libs/glib:2
176 + dev-qt/qtcore:5
177 + dev-qt/qtgui:5
178 + dev-qt/qtwidgets:5
179 + dev-qt/qtx11extras:5
180 + >=lxde-base/menu-cache-1.1.0
181 + media-libs/libexif:=
182 + x11-libs/libxcb:=
183 +"
184 +RDEPEND="${DEPEND}
185 + !lxqt-base/lxqt-l10n
186 +"
187 +
188 +PATCHES="${FILESDIR}/${PN}-0.14.1-phantom-desktop-files.patch"