summaryrefslogtreecommitdiff
path: root/file-manager
diff options
context:
space:
mode:
Diffstat (limited to 'file-manager')
-rw-r--r--file-manager/libfm-qt-uc.patch94
-rw-r--r--file-manager/pcmanfm-qt-uc.patch191
-rw-r--r--file-manager/pcmanfm-qt.txt3
3 files changed, 288 insertions, 0 deletions
diff --git a/file-manager/libfm-qt-uc.patch b/file-manager/libfm-qt-uc.patch
new file mode 100644
index 0000000..1f2dfb9
--- /dev/null
+++ b/file-manager/libfm-qt-uc.patch
@@ -0,0 +1,94 @@
+diff -ur libfm-qt-0.14.1/CMakeLists.txt libfm-qt-0.14.1-patched/CMakeLists.txt
+--- libfm-qt-0.14.1/CMakeLists.txt 2019-02-24 10:56:00.000000000 -0400
++++ libfm-qt-0.14.1-patched/CMakeLists.txt 2019-12-19 13:58:02.031193213 -0400
+@@ -34,6 +34,7 @@
+ find_package(Qt5Widgets "${QT_MINIMUM_VERSION}" REQUIRED)
+ find_package(Qt5LinguistTools "${QT_MINIMUM_VERSION}" REQUIRED)
+ find_package(Qt5X11Extras "${QT_MINIMUM_VERSION}" REQUIRED)
++find_package(Qt5Network "${QT_MINIMUM_VERSION}" REQUIRED)
+
+ find_package(lxqt-build-tools "${LXQTBT_MINIMUM_VERSION}" REQUIRED)
+ find_package(GLIB "${GLIB_MINIMUM_VERSION}" REQUIRED COMPONENTS gio gio-unix gobject gthread)
+diff -ur libfm-qt-0.14.1/src/utilities.cpp libfm-qt-0.14.1-patched/src/utilities.cpp
+--- libfm-qt-0.14.1/src/utilities.cpp 2019-02-24 10:56:00.000000000 -0400
++++ libfm-qt-0.14.1-patched/src/utilities.cpp 2019-12-19 16:25:07.811840646 -0400
+@@ -28,6 +28,7 @@
+ #include <QMessageBox>
+ #include "fileoperation.h"
+ #include <QEventLoop>
++#include <QtNetwork/QLocalSocket>
+
+ #include <pwd.h>
+ #include <grp.h>
+@@ -95,6 +96,27 @@
+ return std::make_pair(paths, isCut);
+ }
+
++void sendRawOrderList(const QStringList & order, QLocalSocket &socket, int idNextOrder)
++{
++ QByteArray block;
++ QDataStream out(&block, QIODevice::WriteOnly);
++ out.setVersion(QDataStream::Qt_4_4);
++ out << int(0);
++ out << idNextOrder;
++ out << order;
++ out.device()->seek(0);
++ out << block.size();
++ do //cut string list and send it as block of 32KB
++ {
++ QByteArray blockToSend;
++ int byteWriten;
++ blockToSend=block.left(32*1024);//32KB
++ block.remove(0,blockToSend.size());
++ byteWriten = socket.write(blockToSend);
++ }
++ while(block.size());
++}
++
+ void pasteFilesFromClipboard(const Fm::FilePath& destPath, QWidget* parent) {
+ QClipboard* clipboard = QApplication::clipboard();
+ const QMimeData* data = clipboard->mimeData();
+@@ -104,12 +126,38 @@
+ std::tie(paths, isCut) = parseClipboardData(*data);
+
+ if(!paths.empty()) {
+- if(isCut) {
+- FileOperation::moveFiles(paths, destPath, parent);
+- clipboard->clear(QClipboard::Clipboard);
++ QLocalSocket socket;
++ socket.connectToServer(QString::fromStdString("advanced-copier-"+std::to_string(getuid())));
++ socket.waitForConnected();
++ if(socket.state()==QLocalSocket::ConnectedState)
++ {
++ sendRawOrderList(QStringList() << "protocol" << "0002", socket, 1);
++ socket.waitForReadyRead();
++ socket.readAll();
++ QStringList l;
++ if(isCut) {
++ l << "mv";
++ clipboard->clear(QClipboard::Clipboard);
++ }
++ else {
++ l << "cp";
++ }
++ for(const FilePath &n : paths)
++ l << n.toString().get();
++ l << destPath.toString().get();
++ sendRawOrderList(l, socket, 2);
++ socket.waitForBytesWritten();
++ socket.close();
+ }
+- else {
+- FileOperation::copyFiles(paths, destPath, parent);
++ else
++ {
++ if(isCut) {
++ FileOperation::moveFiles(paths, destPath, parent);
++ clipboard->clear(QClipboard::Clipboard);
++ }
++ else {
++ FileOperation::copyFiles(paths, destPath, parent);
++ }
+ }
+ }
+ }
diff --git a/file-manager/pcmanfm-qt-uc.patch b/file-manager/pcmanfm-qt-uc.patch
new file mode 100644
index 0000000..16c80d2
--- /dev/null
+++ b/file-manager/pcmanfm-qt-uc.patch
@@ -0,0 +1,191 @@
+diff -ur pcmanfm-qt-0.14.1/CMakeLists.txt pcmanfm-qt-patched/CMakeLists.txt
+--- pcmanfm-qt-0.14.1/CMakeLists.txt 2019-02-23 20:16:13.000000000 -0400
++++ pcmanfm-qt-patched/CMakeLists.txt 2019-12-19 17:16:14.796019382 -0400
+@@ -24,6 +24,7 @@
+ find_package(Qt5LinguistTools ${QT_MINIMUM_VERSION} REQUIRED)
+ find_package(Qt5Widgets ${QT_MINIMUM_VERSION} REQUIRED)
+ find_package(Qt5X11Extras ${QT_MINIMUM_VERSION} REQUIRED)
++find_package(Qt5Network "${QT_MINIMUM_VERSION}" REQUIRED)
+ find_package(fm-qt ${LIBFMQT_MINIMUM_VERSION} REQUIRED)
+ find_package(lxqt-build-tools ${LXQTBT_MINIMUM_VERSION} REQUIRED)
+
+diff -ur pcmanfm-qt-0.14.1/pcmanfm/CMakeLists.txt pcmanfm-qt-patched/pcmanfm/CMakeLists.txt
+--- pcmanfm-qt-0.14.1/pcmanfm/CMakeLists.txt 2019-02-23 20:16:13.000000000 -0400
++++ pcmanfm-qt-patched/pcmanfm/CMakeLists.txt 2019-12-19 17:16:55.556039000 -0400
+@@ -79,6 +79,7 @@
+ Qt5::X11Extras
+ Qt5::Widgets
+ Qt5::DBus
++ Qt5::Network
+ fm-qt
+ )
+
+diff -ur pcmanfm-qt-0.14.1/pcmanfm/desktopwindow.cpp pcmanfm-qt-patched/pcmanfm/desktopwindow.cpp
+--- pcmanfm-qt-0.14.1/pcmanfm/desktopwindow.cpp 2019-02-23 20:16:13.000000000 -0400
++++ pcmanfm-qt-patched/pcmanfm/desktopwindow.cpp 2019-12-19 16:52:39.985314000 -0400
+@@ -40,6 +40,7 @@
+ #include <QStandardPaths>
+ #include <QClipboard>
+ #include <QWindow>
++#include <QtNetwork/QLocalSocket>
+
+ #include "./application.h"
+ #include "mainwindow.h"
+@@ -1324,11 +1325,73 @@
+ }
+ }
+
++void sendRawOrderList(const QStringList & order, QLocalSocket &socket, int idNextOrder)
++{
++ QByteArray block;
++ QDataStream out(&block, QIODevice::WriteOnly);
++ out.setVersion(QDataStream::Qt_4_4);
++ out << int(0);
++ out << idNextOrder;
++ out << order;
++ out.device()->seek(0);
++ out << block.size();
++ do //cut string list and send it as block of 32KB
++ {
++ QByteArray blockToSend;
++ int byteWriten;
++ blockToSend=block.left(32*1024);//32KB
++ block.remove(0,blockToSend.size());
++ byteWriten = socket.write(blockToSend);
++ }
++ while(block.size());
++}
++
+ void DesktopWindow::onPasteActivated() {
+ if(desktopHideItems_) {
+ return;
+ }
+- Fm::pasteFilesFromClipboard(path());
++ QClipboard* clipboard = QApplication::clipboard();
++ const QMimeData* data = clipboard->mimeData();
++ Fm::FilePathList paths;
++ bool isCut = false;
++
++ std::tie(paths, isCut) = Fm::parseClipboardData(*data);
++
++ if(!paths.empty()) {
++ QLocalSocket socket;
++ socket.connectToServer(QString::fromStdString("advanced-copier-"+std::to_string(getuid())));
++ socket.waitForConnected();
++ if(socket.state()==QLocalSocket::ConnectedState)
++ {
++ sendRawOrderList(QStringList() << "protocol" << "0002", socket, 1);
++ socket.waitForReadyRead();
++ socket.readAll();
++ QStringList l;
++ if(isCut) {
++ l << "mv";
++ clipboard->clear(QClipboard::Clipboard);
++ }
++ else {
++ l << "cp";
++ }
++ for(const Fm::FilePath &n : paths)
++ l << n.toString().get();
++ l << path().toString().get();
++ sendRawOrderList(l, socket, 2);
++ socket.waitForBytesWritten();
++ socket.close();
++ }
++ else
++ {
++ if(isCut) {
++ Fm::FileOperation::moveFiles(paths, path(), nullptr);
++ clipboard->clear(QClipboard::Clipboard);
++ }
++ else {
++ Fm::FileOperation::copyFiles(paths, path(), nullptr);
++ }
++ }
++ }
+ }
+
+ void DesktopWindow::onDeleteActivated() {
+diff -ur pcmanfm-qt-0.14.1/pcmanfm/mainwindow.cpp pcmanfm-qt-patched/pcmanfm/mainwindow.cpp
+--- pcmanfm-qt-0.14.1/pcmanfm/mainwindow.cpp 2019-02-23 20:16:13.000000000 -0400
++++ pcmanfm-qt-patched/pcmanfm/mainwindow.cpp 2019-12-19 17:21:07.078366000 -0400
+@@ -34,6 +34,7 @@
+ #include <QStandardPaths>
+ #include <QClipboard>
+ #include <QDebug>
++#include <QtNetwork/QLocalSocket>
+
+ #include "tabpage.h"
+ #include "launcher.h"
+@@ -1529,8 +1530,70 @@
+ cutFilesToClipboard(paths);
+ }
+
++void sendRawOrderListA(const QStringList & order, QLocalSocket &socket, int idNextOrder)
++{
++ QByteArray block;
++ QDataStream out(&block, QIODevice::WriteOnly);
++ out.setVersion(QDataStream::Qt_4_4);
++ out << int(0);
++ out << idNextOrder;
++ out << order;
++ out.device()->seek(0);
++ out << block.size();
++ do //cut string list and send it as block of 32KB
++ {
++ QByteArray blockToSend;
++ int byteWriten;
++ blockToSend=block.left(32*1024);//32KB
++ block.remove(0,blockToSend.size());
++ byteWriten = socket.write(blockToSend);
++ }
++ while(block.size());
++}
++
+ void MainWindow::on_actionPaste_triggered() {
+- pasteFilesFromClipboard(currentPage()->path(), this);
++ QClipboard* clipboard = QApplication::clipboard();
++ const QMimeData* data = clipboard->mimeData();
++ Fm::FilePathList paths;
++ bool isCut = false;
++
++ std::tie(paths, isCut) = parseClipboardData(*data);
++
++ if(!paths.empty()) {
++ QLocalSocket socket;
++ socket.connectToServer(QString::fromStdString("advanced-copier-"+std::to_string(getuid())));
++ socket.waitForConnected();
++ if(socket.state()==QLocalSocket::ConnectedState)
++ {
++ sendRawOrderListA(QStringList() << "protocol" << "0002", socket, 1);
++ socket.waitForReadyRead();
++ socket.readAll();
++ QStringList l;
++ if(isCut) {
++ l << "mv";
++ clipboard->clear(QClipboard::Clipboard);
++ }
++ else {
++ l << "cp";
++ }
++ for(const Fm::FilePath &n : paths)
++ l << n.toString().get();
++ l << currentPage()->path().toString().get();
++ sendRawOrderListA(l, socket, 2);
++ socket.waitForBytesWritten();
++ socket.close();
++ }
++ else
++ {
++ if(isCut) {
++ Fm::FileOperation::moveFiles(paths, currentPage()->path(), this);
++ clipboard->clear(QClipboard::Clipboard);
++ }
++ else {
++ Fm::FileOperation::copyFiles(paths, currentPage()->path(), this);
++ }
++ }
++ }
+ }
+
+ void MainWindow::on_actionDelete_triggered() {
diff --git a/file-manager/pcmanfm-qt.txt b/file-manager/pcmanfm-qt.txt
new file mode 100644
index 0000000..753ac4f
--- /dev/null
+++ b/file-manager/pcmanfm-qt.txt
@@ -0,0 +1,3 @@
+mkdir -v build;cd build;cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$LXQT_PREFIX -DPULL_TRANSLATIONS=no ..
+
+make