public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: x11-libs/libfm-qt/files/, x11-libs/libfm-qt/
@ 2018-09-25 11:08 Jonathan Scruggs
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Scruggs @ 2018-09-25 11:08 UTC (permalink / raw
  To: gentoo-commits

commit:     011efb3aa9a23a72af733a3dd816ac4b1e13459a
Author:     Jonathan Scruggs <dracwyrm <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 25 11:06:32 2018 +0000
Commit:     Jonathan Scruggs <dracwyrm <AT> gentoo <DOT> org>
CommitDate: Tue Sep 25 11:06:32 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=011efb3a

x11-libs/libfm-qt: Add upstream patches to fix smb

Package-Manager: Portage-2.3.49, Repoman-2.3.10

 ...0.13.1-check-if-app-exists-before-opening.patch |  45 ++++
 ...t-0.13.1-correctly-handle-mountable-types.patch |  80 ++++++
 .../files/libfm-qt-0.13.1-fix-smb-error.patch      | 279 +++++++++++++++++++++
 x11-libs/libfm-qt/libfm-qt-0.13.1-r1.ebuild        |  50 ++++
 4 files changed, 454 insertions(+)

diff --git a/x11-libs/libfm-qt/files/libfm-qt-0.13.1-check-if-app-exists-before-opening.patch b/x11-libs/libfm-qt/files/libfm-qt-0.13.1-check-if-app-exists-before-opening.patch
new file mode 100644
index 00000000000..92b45be432f
--- /dev/null
+++ b/x11-libs/libfm-qt/files/libfm-qt-0.13.1-check-if-app-exists-before-opening.patch
@@ -0,0 +1,45 @@
+From 4923f860094787d14052e9dc416c9388ff1bb53b Mon Sep 17 00:00:00 2001
+From: Tsu Jan <tsujan2000@gmail.com>
+Date: Thu, 7 Jun 2018 06:10:37 +0430
+Subject: [PATCH] Check if the opening app exists before using it
+
+Also, show an error message if there's no app.
+---
+ src/core/basicfilelauncher.cpp | 17 ++++++++++++-----
+ 1 file changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/src/core/basicfilelauncher.cpp b/src/core/basicfilelauncher.cpp
+index 8390531..2c7f00e 100644
+--- a/src/core/basicfilelauncher.cpp
++++ b/src/core/basicfilelauncher.cpp
+@@ -256,18 +256,25 @@ FilePath BasicFileLauncher::handleShortcut(const FileInfoPtr& fileInfo, GAppLaun
+                 || strcmp(scheme.get(), "trash") == 0
+                 || strcmp(scheme.get(), "network") == 0
+                 || strcmp(scheme.get(), "computer") == 0) {
+-            return FilePath::fromUri(fileInfo->target().c_str());
++            return FilePath::fromUri(target.c_str());
+         }
+         else {
+             // ask gio to launch the default handler for the uri scheme
+-            GAppInfoPtr app{g_app_info_get_default_for_uri_scheme(scheme.get()), false};
+-            FilePathList uris{FilePath::fromUri(fileInfo->target().c_str())};
+-            launchWithApp(app.get(), uris, ctx);
++            if(GAppInfoPtr app{g_app_info_get_default_for_uri_scheme(scheme.get()), false}) {
++                FilePathList uris{FilePath::fromUri(target.c_str())};
++                launchWithApp(app.get(), uris, ctx);
++            }
++            else {
++                GErrorPtr err{G_IO_ERROR, G_IO_ERROR_FAILED,
++                              QObject::tr("No default application is set to launch '%1'")
++                              .arg(target.c_str())};
++                showError(nullptr, err);
++            }
+         }
+     }
+     else {
+         // see it as a local path
+-        return FilePath::fromLocalPath(fileInfo->target().c_str());
++        return FilePath::fromLocalPath(target.c_str());
+     }
+     return FilePath();
+ }

diff --git a/x11-libs/libfm-qt/files/libfm-qt-0.13.1-correctly-handle-mountable-types.patch b/x11-libs/libfm-qt/files/libfm-qt-0.13.1-correctly-handle-mountable-types.patch
new file mode 100644
index 00000000000..adaed387e27
--- /dev/null
+++ b/x11-libs/libfm-qt/files/libfm-qt-0.13.1-correctly-handle-mountable-types.patch
@@ -0,0 +1,80 @@
+From dc7a5753b934e323d4d8d13f3253cbe7ae55a111 Mon Sep 17 00:00:00 2001
+From: "Hong Jen Yee (PCMan)" <pcman.tw@gmail.com>
+Date: Sun, 10 Jun 2018 00:07:31 +0800
+Subject: [PATCH] Correctly handle mountable types.
+
+---
+ src/core/basicfilelauncher.cpp | 6 +++---
+ src/core/fileinfo.cpp          | 4 ++--
+ src/core/fileinfo.h            | 3 ++-
+ 3 files changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/src/core/basicfilelauncher.cpp b/src/core/basicfilelauncher.cpp
+index 0dc8208..0ae1177 100644
+--- a/src/core/basicfilelauncher.cpp
++++ b/src/core/basicfilelauncher.cpp
+@@ -30,11 +30,10 @@ bool BasicFileLauncher::launchFiles(const FileInfoList& fileInfos, GAppLaunchCon
+     // classify files according to different mimetypes
+     for(auto& fileInfo : fileInfos) {
+         /*
+-        qDebug("path: %s, type: %s, target: %s, isDir: %i, isDesktopEntry: %i",
++        qDebug("path: %s, type: %s, target: %s, isDir: %i, isShortcut: %i, isMountable: %i, isDesktopEntry: %i",
+                fileInfo->path().toString().get(), fileInfo->mimeType()->name(), fileInfo->target().c_str(),
+-               fileInfo->isDir(), fileInfo->isDesktopEntry());
++               fileInfo->isDir(), fileInfo->isShortcut(), fileInfo->isMountable(), fileInfo->isDesktopEntry());
+         */
+-
+         if(fileInfo->isMountable()) {
+             if(fileInfo->target().empty()) {
+                 // the mountable is not yet mounted so we have no target URI.
+@@ -269,6 +268,7 @@ FilePath BasicFileLauncher::handleShortcut(const FileInfoPtr& fileInfo, GAppLaun
+     // if we know the target is a dir, we are not going to open it using other apps
+     // for example: `network:///smb-root' is a shortcut targeting `smb:///' and it's also a dir
+     if(fileInfo->isDir()) {
++        qDebug("shortcut is dir: %s", target.c_str());
+         return FilePath::fromPathStr(target.c_str());
+     }
+ 
+diff --git a/src/core/fileinfo.cpp b/src/core/fileinfo.cpp
+index b19a751..5838fe5 100644
+--- a/src/core/fileinfo.cpp
++++ b/src/core/fileinfo.cpp
+@@ -118,7 +118,8 @@ void FileInfo::setFromGFileInfo(const GObjectPtr<GFileInfo>& inf, const FilePath
+         isDeletable_ = true;
+     }
+ 
+-    isShortcut_ = false;
++    isShortcut_ = (type == G_FILE_TYPE_SHORTCUT);
++    isMountable_ = (type == G_FILE_TYPE_MOUNTABLE);
+ 
+     /* special handling for symlinks */
+     if(g_file_info_get_is_symlink(inf.get())) {
+@@ -129,7 +130,6 @@ void FileInfo::setFromGFileInfo(const GObjectPtr<GFileInfo>& inf, const FilePath
+ 
+     switch(type) {
+     case G_FILE_TYPE_SHORTCUT:
+-        isShortcut_ = true;
+     /* Falls through. */
+     case G_FILE_TYPE_MOUNTABLE:
+         uri = g_file_info_get_attribute_string(inf.get(), G_FILE_ATTRIBUTE_STANDARD_TARGET_URI);
+diff --git a/src/core/fileinfo.h b/src/core/fileinfo.h
+index 8437d92..27f7508 100644
+--- a/src/core/fileinfo.h
++++ b/src/core/fileinfo.h
+@@ -150,7 +150,7 @@ class LIBFM_QT_API FileInfo {
+     }
+ 
+     bool isMountable() const {
+-        return mimeType_->isMountable();
++        return isMountable_;
+     }
+ 
+     bool isShortcut() const {
+@@ -238,6 +238,7 @@ class LIBFM_QT_API FileInfo {
+     std::string target_; /* target of shortcut or mountable. */
+ 
+     bool isShortcut_ : 1; /* TRUE if file is shortcut type */
++    bool isMountable_ : 1; /* TRUE if file is mountable type */
+     bool isAccessible_ : 1; /* TRUE if can be read by user */
+     bool isWritable_ : 1; /* TRUE if can be written to by user */
+     bool isDeletable_ : 1; /* TRUE if can be deleted by user */

diff --git a/x11-libs/libfm-qt/files/libfm-qt-0.13.1-fix-smb-error.patch b/x11-libs/libfm-qt/files/libfm-qt-0.13.1-fix-smb-error.patch
new file mode 100644
index 00000000000..12611650a76
--- /dev/null
+++ b/x11-libs/libfm-qt/files/libfm-qt-0.13.1-fix-smb-error.patch
@@ -0,0 +1,279 @@
+From 1a6fa2632388ffcc57ce723501a588c90b940f93 Mon Sep 17 00:00:00 2001
+From: "Hong Jen Yee (PCMan)" <pcman.tw@gmail.com>
+Date: Sat, 9 Jun 2018 21:04:19 +0800
+Subject: [PATCH] Fix failure to open smb:// caused by incorrect file info
+ handling.
+
+---
+ src/core/basicfilelauncher.cpp | 40 ++++++++++++++++++++++++-------
+ src/core/basicfilelauncher.h   |  2 +-
+ src/core/fileinfo.cpp          |  9 ++++---
+ src/core/fileinfojob.cpp       | 44 +++++++++++++++++++++-------------
+ src/core/fileinfojob.h         |  5 ++++
+ src/core/gioptrs.h             |  4 ++++
+ src/filelauncher.cpp           |  2 +-
+ src/filelauncher.h             |  2 +-
+ 8 files changed, 77 insertions(+), 31 deletions(-)
+
+diff --git a/src/core/basicfilelauncher.cpp b/src/core/basicfilelauncher.cpp
+index 2c7f00e..0dc8208 100644
+--- a/src/core/basicfilelauncher.cpp
++++ b/src/core/basicfilelauncher.cpp
+@@ -29,11 +29,13 @@ bool BasicFileLauncher::launchFiles(const FileInfoList& fileInfos, GAppLaunchCon
+     FilePathList pathsToLaunch;
+     // classify files according to different mimetypes
+     for(auto& fileInfo : fileInfos) {
+-        // qDebug("path: %s, target: %s", fileInfo->path().toString().get(), fileInfo->target().c_str());
+-        if(fileInfo->isDir()) {
+-            folderInfos.emplace_back(fileInfo);
+-        }
+-        else if(fileInfo->isMountable()) {
++        /*
++        qDebug("path: %s, type: %s, target: %s, isDir: %i, isDesktopEntry: %i",
++               fileInfo->path().toString().get(), fileInfo->mimeType()->name(), fileInfo->target().c_str(),
++               fileInfo->isDir(), fileInfo->isDesktopEntry());
++        */
++
++        if(fileInfo->isMountable()) {
+             if(fileInfo->target().empty()) {
+                 // the mountable is not yet mounted so we have no target URI.
+                 GErrorPtr err{G_IO_ERROR, G_IO_ERROR_NOT_MOUNTED,
+@@ -67,6 +69,9 @@ bool BasicFileLauncher::launchFiles(const FileInfoList& fileInfos, GAppLaunchCon
+                 pathsToLaunch.emplace_back(path);
+             }
+         }
++        else if(fileInfo->isDir()) {
++            folderInfos.emplace_back(fileInfo);
++        }
+         else {
+             auto& mimeType = fileInfo->mimeType();
+             mimeTypeToFiles[mimeType->name()].emplace_back(fileInfo);
+@@ -103,16 +108,27 @@ bool BasicFileLauncher::launchFiles(const FileInfoList& fileInfos, GAppLaunchCon
+ bool BasicFileLauncher::launchPaths(FilePathList paths, GAppLaunchContext* ctx) {
+     // FIXME: blocking with an event loop is not a good design :-(
+     QEventLoop eventLoop;
+-
+     auto job = new FileInfoJob{paths};
+     job->setAutoDelete(false);  // do not automatically delete the job since we want its results later.
+ 
+     GObjectPtr<GAppLaunchContext> ctxPtr{ctx};
++
++    // error handling (for example: handle path not mounted error)
++    QObject::connect(job, &FileInfoJob::error,
++            &eventLoop, [this, job, ctx](const GErrorPtr & err, Job::ErrorSeverity /* severity */ , Job::ErrorAction &act) {
++        auto path = job->currentPath();
++        if(showError(ctx, err, path, nullptr)) {
++            // the user handled the error and ask for retry
++            act = Job::ErrorAction::RETRY;
++        }
++    }, Qt::BlockingQueuedConnection);  // BlockingQueuedConnection is required here to pause the job and wait for user response
++
+     QObject::connect(job, &FileInfoJob::finished,
+             [&eventLoop]() {
+         // exit the event loop when the job is done
+         eventLoop.exit();
+     });
++
+     // run the job in another thread to not block the UI
+     job->runAsync();
+ 
+@@ -145,7 +161,7 @@ BasicFileLauncher::ExecAction BasicFileLauncher::askExecFile(const FileInfoPtr &
+     return ExecAction::DIRECT_EXEC;
+ }
+ 
+-bool BasicFileLauncher::showError(GAppLaunchContext* /* ctx */, GErrorPtr& /* err */, const FilePath& /* path */, const FileInfoPtr& /* info */) {
++bool BasicFileLauncher::showError(GAppLaunchContext* /* ctx */, const GErrorPtr & /* err */, const FilePath& /* path */, const FileInfoPtr& /* info */) {
+     return false;
+ }
+ 
+@@ -249,13 +265,21 @@ bool BasicFileLauncher::launchDesktopEntry(const char *desktopEntryName, const F
+ 
+ FilePath BasicFileLauncher::handleShortcut(const FileInfoPtr& fileInfo, GAppLaunchContext* ctx) {
+     auto target = fileInfo->target();
++
++    // if we know the target is a dir, we are not going to open it using other apps
++    // for example: `network:///smb-root' is a shortcut targeting `smb:///' and it's also a dir
++    if(fileInfo->isDir()) {
++        return FilePath::fromPathStr(target.c_str());
++    }
++
+     auto scheme = CStrPtr{g_uri_parse_scheme(target.c_str())};
+     if(scheme) {
+         // collect the uri schemes we support
+         if(strcmp(scheme.get(), "file") == 0
+                 || strcmp(scheme.get(), "trash") == 0
+                 || strcmp(scheme.get(), "network") == 0
+-                || strcmp(scheme.get(), "computer") == 0) {
++                || strcmp(scheme.get(), "computer") == 0
++                || strcmp(scheme.get(), "menu") == 0) {
+             return FilePath::fromUri(target.c_str());
+         }
+         else {
+diff --git a/src/core/basicfilelauncher.h b/src/core/basicfilelauncher.h
+index a28aa75..3b1545d 100644
+--- a/src/core/basicfilelauncher.h
++++ b/src/core/basicfilelauncher.h
+@@ -53,7 +53,7 @@ class LIBFM_QT_API BasicFileLauncher {
+ 
+     virtual bool openFolder(GAppLaunchContext* ctx, const FileInfoList& folderInfos, GErrorPtr& err);
+ 
+-    virtual bool showError(GAppLaunchContext* ctx, GErrorPtr& err, const FilePath& path = FilePath{}, const FileInfoPtr& info = FileInfoPtr{});
++    virtual bool showError(GAppLaunchContext* ctx, const GErrorPtr& err, const FilePath& path = FilePath{}, const FileInfoPtr& info = FileInfoPtr{});
+ 
+     virtual ExecAction askExecFile(const FileInfoPtr& file);
+ 
+diff --git a/src/core/fileinfo.cpp b/src/core/fileinfo.cpp
+index 8e86f8d..b19a751 100644
+--- a/src/core/fileinfo.cpp
++++ b/src/core/fileinfo.cpp
+@@ -36,10 +36,9 @@ void FileInfo::setFromGFileInfo(const GObjectPtr<GFileInfo>& inf, const FilePath
+     size_ = g_file_info_get_size(inf.get());
+ 
+     tmp = g_file_info_get_content_type(inf.get());
+-    if(!tmp) {
+-        tmp = "application/octet-stream";
++    if(tmp) {
++        mimeType_ = MimeType::fromName(tmp);
+     }
+-    mimeType_ = MimeType::fromName(tmp);
+ 
+     mode_ = g_file_info_get_attribute_uint32(inf.get(), G_FILE_ATTRIBUTE_UNIX_MODE);
+ 
+@@ -196,6 +195,10 @@ void FileInfo::setFromGFileInfo(const GObjectPtr<GFileInfo>& inf, const FilePath
+         }
+     }
+ 
++    if(!mimeType_) {
++        mimeType_ = MimeType::fromName("application/octet-stream");
++    }
++
+     /* if there is a custom folder icon, use it */
+     if(isNative() && type == G_FILE_TYPE_DIRECTORY) {
+         auto local_path = path().localPath();
+diff --git a/src/core/fileinfojob.cpp b/src/core/fileinfojob.cpp
+index 3c222af..7bf8bb3 100644
+--- a/src/core/fileinfojob.cpp
++++ b/src/core/fileinfojob.cpp
+@@ -13,31 +13,41 @@ FileInfoJob::FileInfoJob(FilePathList paths, FilePathList deletionPaths, FilePat
+ 
+ void FileInfoJob::exec() {
+     for(const auto& path: paths_) {
+-        if(!isCancelled()) {
++        if(isCancelled()) {
++            break;
++        }
++        currentPath_ = path;
++
++        bool retry;
++        do {
++            retry = false;
+             GErrorPtr err;
+             GFileInfoPtr inf{
+                 g_file_query_info(path.gfile().get(), defaultGFileInfoQueryAttribs,
+                                   G_FILE_QUERY_INFO_NONE, cancellable().get(), &err),
+                 false
+             };
+-            if(!inf) {
+-                continue;
++            if(inf) {
++                // Reuse the same dirPath object when the path remains the same (optimize for files in the same dir)
++                auto dirPath = commonDirPath_.isValid() ? commonDirPath_ : path.parent();
++                auto fileInfoPtr = std::make_shared<FileInfo>(inf, dirPath);
++
++                // FIXME: this is not elegant
++                if(cutFilesHashSet_
++                        && cutFilesHashSet_->count(path.hash())) {
++                    fileInfoPtr->bindCutFiles(cutFilesHashSet_);
++                }
++
++                results_.push_back(fileInfoPtr);
++                Q_EMIT gotInfo(path, results_.back());
+             }
+-
+-            // Reuse the same dirPath object when the path remains the same (optimize for files in the same dir)
+-            auto dirPath = commonDirPath_.isValid() ? commonDirPath_ : path.parent();
+-            FileInfo fileInfo(inf, dirPath);
+-
+-            if(cutFilesHashSet_
+-                    && cutFilesHashSet_->count(fileInfo.path().hash())) {
+-                fileInfo.bindCutFiles(cutFilesHashSet_);
++            else {
++                auto act = emitError(err);
++                if(act == Job::ErrorAction::RETRY) {
++                    retry = true;
++                }
+             }
+-
+-            auto fileInfoPtr = std::make_shared<const FileInfo>(fileInfo);
+-
+-            results_.push_back(fileInfoPtr);
+-            Q_EMIT gotInfo(path, fileInfoPtr);
+-        }
++        } while(retry && !isCancelled());
+     }
+ }
+ 
+diff --git a/src/core/fileinfojob.h b/src/core/fileinfojob.h
+index 53a03c5..d75e88f 100644
+--- a/src/core/fileinfojob.h
++++ b/src/core/fileinfojob.h
+@@ -27,6 +27,10 @@ class LIBFM_QT_API FileInfoJob : public Job {
+         return results_;
+     }
+ 
++    const FilePath& currentPath() const {
++        return currentPath_;
++    }
++
+ Q_SIGNALS:
+     void gotInfo(const FilePath& path, std::shared_ptr<const FileInfo>& info);
+ 
+@@ -39,6 +43,7 @@ class LIBFM_QT_API FileInfoJob : public Job {
+     FileInfoList results_;
+     FilePath commonDirPath_;
+     const std::shared_ptr<const HashSet> cutFilesHashSet_;
++    FilePath currentPath_;
+ };
+ 
+ } // namespace Fm
+diff --git a/src/core/gioptrs.h b/src/core/gioptrs.h
+index 401424b..ae22602 100644
+--- a/src/core/gioptrs.h
++++ b/src/core/gioptrs.h
+@@ -112,6 +112,10 @@ class GErrorPtr {
+         return err_;
+     }
+ 
++    const GError* operator->() const {
++        return err_;
++    }
++
+     bool operator == (const GErrorPtr& other) const {
+         return err_ == other.err_;
+     }
+diff --git a/src/filelauncher.cpp b/src/filelauncher.cpp
+index 5f667fc..ff14533 100644
+--- a/src/filelauncher.cpp
++++ b/src/filelauncher.cpp
+@@ -76,7 +76,7 @@ bool FileLauncher::openFolder(GAppLaunchContext *ctx, const FileInfoList &folder
+     return BasicFileLauncher::openFolder(ctx, folderInfos, err);
+ }
+ 
+-bool FileLauncher::showError(GAppLaunchContext* /*ctx*/, GErrorPtr &err, const FilePath &path, const FileInfoPtr &info) {
++bool FileLauncher::showError(GAppLaunchContext* /*ctx*/, const GErrorPtr &err, const FilePath &path, const FileInfoPtr &info) {
+     /* ask for mount if trying to launch unmounted path */
+     if(err->domain == G_IO_ERROR) {
+         if(path && err->code == G_IO_ERROR_NOT_MOUNTED) {
+diff --git a/src/filelauncher.h b/src/filelauncher.h
+index be5be5a..991a00a 100644
+--- a/src/filelauncher.h
++++ b/src/filelauncher.h
+@@ -43,7 +43,7 @@ class LIBFM_QT_API FileLauncher: public BasicFileLauncher {
+ 
+     bool openFolder(GAppLaunchContext* ctx, const FileInfoList& folderInfos, GErrorPtr& err) override;
+ 
+-    bool showError(GAppLaunchContext* ctx, GErrorPtr& err, const FilePath& path = FilePath{}, const FileInfoPtr& info = FileInfoPtr{}) override;
++    bool showError(GAppLaunchContext* ctx, const GErrorPtr &err, const FilePath& path = FilePath{}, const FileInfoPtr& info = FileInfoPtr{}) override;
+ 
+     ExecAction askExecFile(const FileInfoPtr& file) override;
+ 

diff --git a/x11-libs/libfm-qt/libfm-qt-0.13.1-r1.ebuild b/x11-libs/libfm-qt/libfm-qt-0.13.1-r1.ebuild
new file mode 100644
index 00000000000..95dea87773b
--- /dev/null
+++ b/x11-libs/libfm-qt/libfm-qt-0.13.1-r1.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils eapi7-ver
+
+DESCRIPTION="Qt port of libfm, a library providing components to build desktop file managers"
+HOMEPAGE="https://lxqt.org/"
+
+if [[ "${PV}" == "9999" ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/lxqt/${PN}.git"
+else
+	SRC_URI="https://downloads.lxqt.org/downloads/${PN}/${PV}/${P}.tar.xz"
+	KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+fi
+
+LICENSE="GPL-2+ LGPL-2.1+"
+SLOT="0/5"
+
+PATCHES=(
+	"${FILESDIR}/${P}-check-if-app-exists-before-opening.patch"
+	"${FILESDIR}/${P}-fix-smb-error.patch"
+	"${FILESDIR}/${P}-correctly-handle-mountable-types.patch"
+)
+
+RDEPEND="
+	dev-libs/glib:2
+	dev-qt/qtcore:5
+	dev-qt/qtgui:5
+	dev-qt/qtwidgets:5
+	dev-qt/qtx11extras:5
+	>=lxde-base/menu-cache-1.1.0
+	media-libs/libexif:=
+	>=x11-libs/libfm-1.2.0:=
+	x11-libs/libxcb:=
+"
+DEPEND="${RDEPEND}
+	dev-qt/linguist-tools:5
+	>=dev-util/lxqt-build-tools-0.5.0
+	virtual/pkgconfig
+"
+
+src_configure() {
+	local mycmakeargs=(
+		-DPULL_TRANSLATIONS=OFF
+	)
+	cmake-utils_src_configure
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-libs/libfm-qt/files/, x11-libs/libfm-qt/
@ 2019-05-25 21:13 Andreas Sturmlechner
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Sturmlechner @ 2019-05-25 21:13 UTC (permalink / raw
  To: gentoo-commits

commit:     a6bdca64f370f8d3421d8fc5d65feb9a6d121598
Author:     Jimi Huotari <chiitoo <AT> gentoo <DOT> org>
AuthorDate: Sat May 25 20:50:21 2019 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sat May 25 21:13:04 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a6bdca64

x11-libs/libfm-qt: patch issue with phantom desktop files

On some machines (slow enough?), visible desktop entries such as
'trash' would cause related temporary no longer existing files
being displayed on the desktop as well.

- https://github.com/lxqt/pcmanfm-qt/issues/944
- https://github.com/lxqt/libfm-qt/commit/f944be7d

Package-Manager: Portage-2.3.66, Repoman-2.3.12
Signed-off-by: Jimi Huotari <chiitoo <AT> gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/12108
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../libfm-qt-0.14.1-phantom-desktop-files.patch    | 109 +++++++++++++++++++++
 x11-libs/libfm-qt/libfm-qt-0.14.1-r2.ebuild        |  41 ++++++++
 2 files changed, 150 insertions(+)

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
new file mode 100644
index 00000000000..b9edab299cd
--- /dev/null
+++ b/x11-libs/libfm-qt/files/libfm-qt-0.14.1-phantom-desktop-files.patch
@@ -0,0 +1,109 @@
+From f944be7d2447d5c579a57fb5519ee5e2dece5871 Mon Sep 17 00:00:00 2001
+From: Tsu Jan <tsujan2000@gmail.com>
+Date: Sun, 21 Apr 2019 14:11:14 +0430
+Subject: [PATCH] Don't ignore creation-deletion sequences
+
+Fixes https://github.com/lxqt/pcmanfm-qt/issues/944
+
+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.
+
+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).
+---
+ src/core/folder.cpp | 60 +++++++++++++++++++++++----------------------
+ 1 file changed, 31 insertions(+), 29 deletions(-)
+
+diff --git a/src/core/folder.cpp b/src/core/folder.cpp
+index 6c2b27d..2385a8b 100644
+--- a/src/core/folder.cpp
++++ b/src/core/folder.cpp
+@@ -228,16 +228,6 @@ void Folder::onFileInfoFinished() {
+         return;
+     }
+ 
+-    // process the changes accumulated during this info job
+-    if(filesystem_info_pending // means a pending change; see "onFileSystemInfoFinished()"
+-       || !paths_to_update.empty() || !paths_to_add.empty() || !paths_to_del.empty()) {
+-        QTimer::singleShot(0, this, &Folder::processPendingChanges);
+-    }
+-    // there's no pending change at the moment; let the next one be processed
+-    else {
+-        has_idle_update_handler = false;
+-    }
+-
+     FileInfoList files_to_add;
+     FileInfoList files_to_delete;
+     std::vector<FileInfoPair> files_to_update;
+@@ -271,6 +261,16 @@ void Folder::onFileInfoFinished() {
+         Q_EMIT filesChanged(files_to_update);
+     }
+     Q_EMIT contentChanged();
++
++    // process the changes accumulated during this info job
++    if(filesystem_info_pending // means a pending change; see "onFileSystemInfoFinished()"
++       || !paths_to_update.empty() || !paths_to_add.empty() || !paths_to_del.empty()) {
++        QTimer::singleShot(0, this, &Folder::processPendingChanges);
++    }
++    // there's no pending change at the moment; let the next one be processed
++    else {
++        has_idle_update_handler = false;
++    }
+ }
+ 
+ void Folder::processPendingChanges() {
+@@ -314,21 +314,24 @@ void Folder::processPendingChanges() {
+     }
+ 
+     // process deletion
+-    if(!paths_to_del.empty()) {
+-        FileInfoList deleted_files;
+-        for(const auto &path: paths_to_del) {
+-            auto name = path.baseName();
+-            auto it = files_.find(name.get());
+-            if(it != files_.end()) {
+-                deleted_files.push_back(it->second);
+-                files_.erase(it);
+-            }
++    FileInfoList deleted_files;
++    auto path_it = paths_to_del.begin();
++    while(path_it != paths_to_del.end()) {
++        const auto& path = *path_it;
++        auto name = path.baseName();
++        auto it = files_.find(name.get());
++        if(it != files_.end()) {
++            deleted_files.push_back(it->second);
++            files_.erase(it);
++            path_it = paths_to_del.erase(path_it);
+         }
+-        if(!deleted_files.empty()) {
+-            Q_EMIT filesRemoved(deleted_files);
+-            Q_EMIT contentChanged();
++        else {
++            ++path_it;
+         }
+-        paths_to_del.clear();
++    }
++    if(!deleted_files.empty()) {
++        Q_EMIT filesRemoved(deleted_files);
++        Q_EMIT contentChanged();
+     }
+ 
+     if(pending_change_notify) {
+@@ -404,13 +407,12 @@ void Folder::eventFileDeleted(const FilePath& path) {
+     bool deleted = true;
+     // qDebug() << "delete " << path.baseName().get();
+     // G_LOCK(lists);
+-    if(std::find(paths_to_add.cbegin(), paths_to_add.cend(), path) != paths_to_add.cend()) {
+-        // if the file was going to be added, just remove it from the addition queue
+-        paths_to_add.erase(std::remove(paths_to_add.begin(), paths_to_add.end(), path), paths_to_add.cend());
+-    }
+-    else if(std::find(paths_to_del.cbegin(), paths_to_del.cend(), path) == paths_to_del.cend()) {
++    /* WARNING: If the file is in the addition queue, we shouldn not remove it from that queue
++       and ignore its deletion because it may have been added by the directory list job, in
++       which case, ignoring an addition-deletion sequence would result in a nonexistent file. */
++    if(std::find(paths_to_del.cbegin(), paths_to_del.cend(), path) == paths_to_del.cend()) {
+         paths_to_del.push_back(path);
+-        // the update queue should be cancelled for a file that is going to be deleted
++        // the update queue can be cancelled for a file that is going to be deleted
+         paths_to_update.erase(std::remove(paths_to_update.begin(), paths_to_update.end(), path), paths_to_update.cend());
+     }
+     else {

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
new file mode 100644
index 00000000000..54bea008481
--- /dev/null
+++ b/x11-libs/libfm-qt/libfm-qt-0.14.1-r2.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake-utils
+
+DESCRIPTION="Qt port of libfm, a library providing components to build desktop file managers"
+HOMEPAGE="https://lxqt.org/"
+
+if [[ "${PV}" == "9999" ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/lxqt/${PN}.git"
+else
+	SRC_URI="https://downloads.lxqt.org/downloads/${PN}/${PV}/${P}.tar.xz"
+	KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+fi
+
+LICENSE="GPL-2+ LGPL-2.1+"
+SLOT="0/5"
+
+BDEPEND="
+	dev-qt/linguist-tools:5
+	>=dev-util/lxqt-build-tools-0.6.0
+	virtual/pkgconfig
+"
+DEPEND="
+	dev-libs/glib:2
+	dev-qt/qtcore:5
+	dev-qt/qtgui:5
+	dev-qt/qtwidgets:5
+	dev-qt/qtx11extras:5
+	>=lxde-base/menu-cache-1.1.0
+	media-libs/libexif:=
+	x11-libs/libxcb:=
+"
+RDEPEND="${DEPEND}
+	!lxqt-base/lxqt-l10n
+"
+
+PATCHES="${FILESDIR}/${PN}-0.14.1-phantom-desktop-files.patch"


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-libs/libfm-qt/files/, x11-libs/libfm-qt/
@ 2021-03-26 19:43 Andreas Sturmlechner
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Sturmlechner @ 2021-03-26 19:43 UTC (permalink / raw
  To: gentoo-commits

commit:     de593959f8541954fa7cf92d84d371fec7d1f835
Author:     Jimi Huotari <chiitoo <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 22 10:38:33 2021 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Fri Mar 26 19:43:41 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de593959

x11-libs/libfm-qt: remove version 0.15.1

Package-Manager: Portage-3.0.17, Repoman-3.0.2
Signed-off-by: Jimi Huotari <chiitoo <AT> gentoo.org>
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 x11-libs/libfm-qt/Manifest                         |  1 -
 .../libfm-qt-0.15.1-update-runtime-colours.patch   | 57 ----------------------
 x11-libs/libfm-qt/libfm-qt-0.15.1-r1.ebuild        | 49 -------------------
 3 files changed, 107 deletions(-)

diff --git a/x11-libs/libfm-qt/Manifest b/x11-libs/libfm-qt/Manifest
index 22fe6c60e66..8917760ee76 100644
--- a/x11-libs/libfm-qt/Manifest
+++ b/x11-libs/libfm-qt/Manifest
@@ -1,2 +1 @@
-DIST libfm-qt-0.15.1.tar.xz 337396 BLAKE2B 619787039857f0b67245ff86f4c8de1b5305909bbf1dc07f20ab53f07a955d541853066a9011bb76d04a49006732ea23c4100e94fe3c61de77f1edbbbdef5854 SHA512 9bd3f61d830e4f7ba3e72d84e3ff1a07544f6f461d6eea7ecf2b31056020e08d47d83ef920b6e1a481a470dadfb995a6b3e3b57a13574d6abca617a84c71bdf5
 DIST libfm-qt-0.16.0.tar.xz 348548 BLAKE2B 41c52efc5b71d924c06d55a5b94e7f9a1c4feda0a664d83b0de906479bdb644260a68136720baeb1958a48b08019b72de34b6066f51c19e5c5fb65afcd9e903c SHA512 5de63408a641b0e77cb319952e428aee9cd35db9ec3e6726a8327ebc53f5641cf66b28dbabd96797c64a253b1e41421dbe05dcb9f4bc7941bd92676bbfa9cc84

diff --git a/x11-libs/libfm-qt/files/libfm-qt-0.15.1-update-runtime-colours.patch b/x11-libs/libfm-qt/files/libfm-qt-0.15.1-update-runtime-colours.patch
deleted file mode 100644
index 850cd16a05a..00000000000
--- a/x11-libs/libfm-qt/files/libfm-qt-0.15.1-update-runtime-colours.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From ecb0face63bfa593ce12caef4285d20cbf7f3f41 Mon Sep 17 00:00:00 2001
-From: Tsu Jan <tsujan2000@gmail.com>
-Date: Mon, 1 Jun 2020 23:33:37 +0430
-Subject: [PATCH] Update text color of places view if style changes in runtime
-
-Otherwise, if the style is switched between dark and light in runtime (which will soon be possible in LXQt), the text color will not change and might not have enough contrast with its background.
----
- src/sidepane.cpp | 14 ++++++++++++++
- src/sidepane.h   |  3 +++
- 2 files changed, 17 insertions(+)
-
-diff --git a/src/sidepane.cpp b/src/sidepane.cpp
-index 73e74e7..d45adf9 100644
---- a/src/sidepane.cpp
-+++ b/src/sidepane.cpp
-@@ -19,6 +19,7 @@
- 
- 
- #include "sidepane.h"
-+#include <QEvent>
- #include <QComboBox>
- #include <QVBoxLayout>
- #include <QHeaderView>
-@@ -51,6 +52,19 @@ SidePane::~SidePane() {
-     // qDebug("delete SidePane");
- }
- 
-+bool SidePane::event(QEvent* event) {
-+    // when the SidePane's style changes, we should set the text color of
-+    // PlacesView to its window text color again because the latter may have changed
-+    if(event->type() == QEvent::StyleChange && mode_ == ModePlaces) {
-+        if(PlacesView* placesView = static_cast<PlacesView*>(view_)) {
-+            QPalette p = placesView->palette();
-+            p.setColor(QPalette::Text, p.color(QPalette::WindowText));
-+            placesView->setPalette(p);
-+        }
-+    }
-+    return QWidget::event(event);
-+}
-+
- void SidePane::onComboCurrentIndexChanged(int current) {
-     if(current != mode_) {
-         setMode(Mode(current));
-diff --git a/src/sidepane.h b/src/sidepane.h
-index 7218f6a..79b27a9 100644
---- a/src/sidepane.h
-+++ b/src/sidepane.h
-@@ -111,6 +111,9 @@ class LIBFM_QT_API SidePane : public QWidget {
- 
-     void hiddenPlaceSet(const QString& str, bool hide);
- 
-+protected:
-+    bool event(QEvent* event) override;
-+
- protected Q_SLOTS:
-     void onComboCurrentIndexChanged(int current);
- 

diff --git a/x11-libs/libfm-qt/libfm-qt-0.15.1-r1.ebuild b/x11-libs/libfm-qt/libfm-qt-0.15.1-r1.ebuild
deleted file mode 100644
index f7b601350e6..00000000000
--- a/x11-libs/libfm-qt/libfm-qt-0.15.1-r1.ebuild
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit cmake xdg-utils
-
-DESCRIPTION="Qt Library for Building File Managers"
-HOMEPAGE="https://lxqt.github.io/"
-
-if [[ "${PV}" == "9999" ]]; then
-	inherit git-r3
-	EGIT_REPO_URI="https://github.com/lxqt/${PN}.git"
-else
-	SRC_URI="https://github.com/lxqt/${PN}/releases/download/${PV}/${P}.tar.xz"
-	KEYWORDS="amd64 ~arm ~arm64 ~ppc64 x86"
-fi
-
-LICENSE="BSD GPL-2+ LGPL-2.1+"
-SLOT="0/7"
-
-BDEPEND="
-	dev-qt/linguist-tools:5
-	>=dev-util/lxqt-build-tools-0.7.0
-	virtual/pkgconfig
-"
-DEPEND="
-	dev-libs/glib:2
-	dev-qt/qtcore:5
-	dev-qt/qtgui:5=
-	dev-qt/qtwidgets:5
-	dev-qt/qtx11extras:5
-	>=lxde-base/menu-cache-1.1.0:=
-	media-libs/libexif
-	x11-libs/libxcb
-"
-RDEPEND="${DEPEND}
-	!lxqt-base/lxqt-l10n
-"
-
-PATCHES=( "${FILESDIR}/${PN}-0.15.1-update-runtime-colours.patch" )
-
-pkg_postinst() {
-	xdg_mimeinfo_database_update
-}
-
-pkg_postrm() {
-	xdg_mimeinfo_database_update
-}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-26 19:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-26 19:43 [gentoo-commits] repo/gentoo:master commit in: x11-libs/libfm-qt/files/, x11-libs/libfm-qt/ Andreas Sturmlechner
  -- strict thread matches above, loose matches on Subject: below --
2019-05-25 21:13 Andreas Sturmlechner
2018-09-25 11:08 Jonathan Scruggs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox