From 973fb83019f0fb2073e0a632347f7cc39a56e8dd Mon Sep 17 00:00:00 2001 From: Rik Mills Date: Sun, 9 Jun 2019 22:40:42 +0100 Subject: [PATCH] merge with debian and release to eoan --- debian/changelog | 22 +++ debian/libfm-qt6.symbols | 2 + debian/patches/series | 1 + .../workaround-missed-file-monitoring.patch | 143 ++++++++++++++++++ 4 files changed, 168 insertions(+) create mode 100644 debian/patches/workaround-missed-file-monitoring.patch diff --git a/debian/changelog b/debian/changelog index 6f7ba51..a5b37ab 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,25 @@ +libfm-qt (0.14.1-9ubuntu1) eoan; urgency=medium + + * Merge from Debian unstable. Remaining changes: + - debian/control: + + Update Vcs-* and maintainer for maintaining by Lubuntu. + + Add Breaks/Replaces on old libfm-qt-l10n. + - debian/libfmqt-qt6.symbols + + Retain and update Lubuntu generated symbols file. + - debian/patches: fix-metadata-for-trusting-executables.patch + + Fix metadata for trusting executables. Use Ubuntu standard for + trusting executables. + + -- Rik Mills Sun, 09 Jun 2019 22:20:26 +0100 + +libfm-qt (0.14.1-9) unstable; urgency=medium + + * Added upstream patch workaround-missed-file-monitoring.patch + (Closes: #926803) + * Added two new symbols - internal use only + + -- Alf Gaida Sat, 08 Jun 2019 16:39:11 +0200 + libfm-qt (0.14.1-8ubuntu1) eoan; urgency=medium * Merge from Debian unstable. Remaining changes: diff --git a/debian/libfm-qt6.symbols b/debian/libfm-qt6.symbols index fd5d808..8acb904 100644 --- a/debian/libfm-qt6.symbols +++ b/debian/libfm-qt6.symbols @@ -1119,6 +1119,8 @@ libfm-qt.so.6 libfm-qt6 #MINVER# (c++)"Fm::uidFromName(QString)@Base" 0.10.0 (c++)"Fm::uidToName(unsigned int)@Base" 0.10.0 (c++)"Fm::uriExists(char const*)@Base" 0.10.0 + _ZN2Fm6Folder10findByPathERKNS_8FilePathE@Base 0.14.1 + _ZNK2Fm6Folder14hasFileMonitorEv@Base 0.14.1 (optional=templinst)_ZNSt6vectorI18QRegularExpressionSaIS0_EE17_M_realloc_insertIJS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_@Base 0.14.1 createFileDialogHelper@Base 0.13.2~ fm_config@Base 0.13.1~ diff --git a/debian/patches/series b/debian/patches/series index 4627866..dbe41e9 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -3,3 +3,4 @@ fix-smb-recursive-copy.patch fix-license-headers.patch dont-ignore-crea-del-sequences.patch workaround-glib-recursive-moving-error.patch +workaround-missed-file-monitoring.patch diff --git a/debian/patches/workaround-missed-file-monitoring.patch b/debian/patches/workaround-missed-file-monitoring.patch new file mode 100644 index 0000000..5be3811 --- /dev/null +++ b/debian/patches/workaround-missed-file-monitoring.patch @@ -0,0 +1,143 @@ +Description: Realod folder after transfer job if it lacks file monitoring + Closes https://github.com/lxqt/pcmanfm-qt/issues/933 and closes + https://github.com/lxqt/libfm-qt/issues/280. After a file transfer job is + finished inside a directory, if it is the path of an open folder that lacks + file monitoring, this patch reloads its corresponding folder. In this way, the + lack of file monitoring is partially compensated for. + Please note that this doesn't work with `search://` because the files inside + `search://` don't belong to it. By covering file creation, renaming, moving + from one shared folder to another and deleting after trying to move into Trash. + +Last-Update: 2019-06-08 + +--- libfm-qt-0.14.1.orig/src/core/folder.cpp ++++ libfm-qt-0.14.1/src/core/folder.cpp +@@ -112,6 +112,20 @@ std::shared_ptr Folder::fromPath + return folder; + } + ++// static ++// Checks if this is the path of a folder in use. ++std::shared_ptr Folder::findByPath(const FilePath& path) { ++ std::lock_guard lock{mutex_}; ++ auto it = cache_.find(path); ++ if(it != cache_.end()) { ++ auto folder = it->second.lock(); ++ if(folder) { ++ return folder; ++ } ++ } ++ return nullptr; ++} ++ + bool Folder::makeDirectory(const char* /*name*/, GError** /*error*/) { + // TODO: + // FIXME: what the API is used for in the original libfm C API? +@@ -142,6 +156,10 @@ bool Folder::isEmpty() const { + return files_.empty(); + } + ++bool Folder::hasFileMonitor() const { ++ return (dirMonitor_ != nullptr); ++} ++ + FileInfoList Folder::files() const { + FileInfoList ret; + ret.reserve(files_.size()); +--- libfm-qt-0.14.1.orig/src/core/folder.h ++++ libfm-qt-0.14.1/src/core/folder.h +@@ -56,6 +56,8 @@ public: + + static std::shared_ptr fromPath(const FilePath& path); + ++ static std::shared_ptr findByPath(const FilePath& path); ++ + bool makeDirectory(const char* name, GError** error); + + void queryFilesystemInfo(); +@@ -74,6 +76,8 @@ public: + + bool isEmpty() const; + ++ bool hasFileMonitor() const; ++ + FileInfoList files() const; + + const FilePath& path() const; +--- libfm-qt-0.14.1.orig/src/fileoperation.cpp ++++ libfm-qt-0.14.1/src/fileoperation.cpp +@@ -298,6 +298,8 @@ void FileOperation::onJobFinish() { + } + Q_EMIT finished(); + ++ bool tryReload = true; ++ + // special handling for trash job + if(type_ == Trash && !job_->isCancelled()) { + auto trashJob = static_cast(job_); +@@ -313,6 +315,26 @@ void FileOperation::onJobFinish() { + "Do you want to delete them instead?")) == QMessageBox::Yes) { + deleteFiles(std::move(unsupportedFiles), false); + } ++ tryReload = false; ++ } ++ } ++ ++ // reload the containing folder if it is in use but does not have a file monitor ++ if(tryReload) { ++ if(!srcPaths_.empty() && (type_ == Trash || type_ == Delete || type_ == Move)) { ++ auto parent_path = srcPaths_[0].parent(); ++ if(parent_path != destPath_) { // otherwise, it will be done below ++ auto folder = Fm::Folder::findByPath(parent_path); ++ if(folder && folder->isValid() && folder->isLoaded() && !folder->hasFileMonitor()) { ++ folder->reload(); ++ } ++ } ++ } ++ if(destPath_) { ++ auto folder = Fm::Folder::findByPath(destPath_); ++ if(folder && folder->isValid() && folder->isLoaded() && !folder->hasFileMonitor()) { ++ folder->reload(); ++ } + } + } + +--- libfm-qt-0.14.1.orig/src/utilities.cpp ++++ libfm-qt-0.14.1/src/utilities.cpp +@@ -157,7 +157,8 @@ bool isCurrentPidClipboardData(const QMi + } + + bool changeFileName(const Fm::FilePath& filePath, const QString& newName, QWidget* parent, bool showMessage) { +- auto dest = filePath.parent().child(newName.toLocal8Bit().constData()); ++ auto parent_path = filePath.parent(); ++ auto dest = parent_path.child(newName.toLocal8Bit().constData()); + Fm::GErrorPtr err; + if(!g_file_move(filePath.gfile().get(), dest.gfile().get(), + GFileCopyFlags(G_FILE_COPY_ALL_METADATA | +@@ -170,6 +171,13 @@ bool changeFileName(const Fm::FilePath& + } + return false; + } ++ ++ // reload the containing folder if it is in use but does not have a file monitor ++ auto folder = Fm::Folder::findByPath(parent_path); ++ if(folder && folder->isValid() && folder->isLoaded() && !folder->hasFileMonitor()) { ++ folder->reload(); ++ } ++ + return true; + } + +@@ -263,6 +271,12 @@ _retry: + + QMessageBox::critical(parent ? parent->window() : nullptr, QObject::tr("Error"), err.message()); + } ++ else { // reload the containing folder if it is in use but does not have a file monitor ++ auto folder = Fm::Folder::findByPath(parentDir); ++ if(folder && folder->isValid() && folder->isLoaded() && !folder->hasFileMonitor()) { ++ folder->reload(); ++ } ++ } + } + + uid_t uidFromName(QString name) {