diff --git a/0001-feat-safety-string-encrypt-plugin.patch b/0001-feat-safety-string-encrypt-plugin.patch new file mode 100644 index 0000000000000000000000000000000000000000..6f87bad7fa9efbf86f5cf8c32fde13cdc41a8bd7 --- /dev/null +++ b/0001-feat-safety-string-encrypt-plugin.patch @@ -0,0 +1,976 @@ +From eae92743f3113db8c5652b1bcfc917d0f650e355 Mon Sep 17 00:00:00 2001 +From: xust +Date: Mon, 17 Jun 2024 10:59:09 +0800 +Subject: [PATCH 1/3] feat: [safety] string encrypt plugin. + +1. daemon plugin provide public key and decryption; +2. dfm plugin do encrypt for user inputs; + +Log: as title. + +Bug: https://pms.uniontech.com/bug-view-259823.html +Bug: https://pms.uniontech.com/bug-view-259825.html +Change-Id: I89cb9714990129529cd28543727ab7f244c000ba +(cherry picked from commit 403ac8c7ae00bfa2a31245b2fcc3b6ecabf1e214) +--- + .reuse/dep5 | 2 +- + .../utils/usersharehelper.cpp | 11 ++- + src/plugins/daemon/CMakeLists.txt | 1 + + .../accesscontroldbus.cpp | 14 ++- + .../sharecontroldbus.cpp | 24 ++++- + .../daemonplugin-stringdecrypt/CMakeLists.txt | 50 ++++++++++ + .../opensslhandler.cpp | 80 ++++++++++++++++ + .../opensslhandler.h | 34 +++++++ + .../stringdecrypt.json | 14 +++ + .../stringdecrypt_adapter.cpp | 41 +++++++++ + .../stringdecrypt_adapter.h | 54 +++++++++++ + .../stringdecryptdbus.cpp | 26 ++++++ + .../stringdecryptdbus.h | 22 +++++ + .../stringdecryptdbus.xml | 8 ++ + .../stringdecryptplugin.cpp | 25 +++++ + .../stringdecryptplugin.h | 31 +++++++ + src/plugins/filemanager/CMakeLists.txt | 1 + + .../dialogs/dpcwidget/dpcconfirmwidget.cpp | 13 ++- + .../dfmplugin-stringencrypt/CMakeLists.txt | 50 ++++++++++ + .../opensslhandler.cpp | 92 +++++++++++++++++++ + .../dfmplugin-stringencrypt/opensslhandler.h | 28 ++++++ + .../stringencrypt.json | 14 +++ + .../stringencryptplugin.cpp | 23 +++++ + .../stringencryptplugin.h | 28 ++++++ + 24 files changed, 676 insertions(+), 10 deletions(-) + create mode 100644 src/plugins/daemon/daemonplugin-stringdecrypt/CMakeLists.txt + create mode 100644 src/plugins/daemon/daemonplugin-stringdecrypt/opensslhandler.cpp + create mode 100644 src/plugins/daemon/daemonplugin-stringdecrypt/opensslhandler.h + create mode 100644 src/plugins/daemon/daemonplugin-stringdecrypt/stringdecrypt.json + create mode 100644 src/plugins/daemon/daemonplugin-stringdecrypt/stringdecrypt_adapter.cpp + create mode 100644 src/plugins/daemon/daemonplugin-stringdecrypt/stringdecrypt_adapter.h + create mode 100644 src/plugins/daemon/daemonplugin-stringdecrypt/stringdecryptdbus.cpp + create mode 100644 src/plugins/daemon/daemonplugin-stringdecrypt/stringdecryptdbus.h + create mode 100644 src/plugins/daemon/daemonplugin-stringdecrypt/stringdecryptdbus.xml + create mode 100644 src/plugins/daemon/daemonplugin-stringdecrypt/stringdecryptplugin.cpp + create mode 100644 src/plugins/daemon/daemonplugin-stringdecrypt/stringdecryptplugin.h + create mode 100644 src/plugins/filemanager/dfmplugin-stringencrypt/CMakeLists.txt + create mode 100644 src/plugins/filemanager/dfmplugin-stringencrypt/opensslhandler.cpp + create mode 100644 src/plugins/filemanager/dfmplugin-stringencrypt/opensslhandler.h + create mode 100644 src/plugins/filemanager/dfmplugin-stringencrypt/stringencrypt.json + create mode 100644 src/plugins/filemanager/dfmplugin-stringencrypt/stringencryptplugin.cpp + create mode 100644 src/plugins/filemanager/dfmplugin-stringencrypt/stringencryptplugin.h + +diff --git a/.reuse/dep5 b/.reuse/dep5 +index 0aaecdc0f..09d891abd 100644 +--- a/.reuse/dep5 ++++ b/.reuse/dep5 +@@ -84,7 +84,7 @@ Copyright: 2020 Christian Boxdörfer + License: MIT + + # D-Bus interfaces and adaptors +-Files: src/*/*dbus_interface.* src/*/*dbus_adaptor.* src/*/dbus*/* src/plugins/daemon/daemonplugin-mountcontrol/private/mountcontrol_adapter.* src/plugins/desktop/ddplugin-background/appearance_interface.* ++Files: src/*/*dbus_interface.* src/*/*dbus_adaptor.* src/*/dbus*/* src/plugins/daemon/daemonplugin-mountcontrol/private/mountcontrol_adapter.* src/plugins/desktop/ddplugin-background/appearance_interface.* src/plugins/daemon/daemonplugin-stringdecrypt/stringdecrypt_adapter.* + Copyright: 2016 The Qt Company Ltd. + License: CC0-1.0 + +diff --git a/src/plugins/common/dfmplugin-dirshare/utils/usersharehelper.cpp b/src/plugins/common/dfmplugin-dirshare/utils/usersharehelper.cpp +index b474ee0a6..6f669006d 100644 +--- a/src/plugins/common/dfmplugin-dirshare/utils/usersharehelper.cpp ++++ b/src/plugins/common/dfmplugin-dirshare/utils/usersharehelper.cpp +@@ -30,6 +30,7 @@ + #include + #include + ++Q_DECLARE_METATYPE(QString *) + DFMBASE_USE_NAMESPACE + namespace dfmplugin_dirshare { + +@@ -139,7 +140,15 @@ bool UserShareHelper::share(const ShareInfo &info) + + void UserShareHelper::setSambaPasswd(const QString &userName, const QString &passwd) + { +- QDBusReply reply = userShareInter->call(DaemonServiceIFace::kFuncSetPasswd, userName, passwd); ++ QString encPass; ++ auto ret = dpfSlotChannel->push("dfmplugin_stringencrypt", "slot_OpenSSL_EncryptString", ++ passwd, &encPass); ++ if (ret != 0) { ++ fmWarning() << "cannot encrypt password!!!"; ++ DialogManagerInstance->showErrorDialog(tr("Error"), tr("Cannot encrypt password")); ++ return; ++ } ++ QDBusReply reply = userShareInter->call(DaemonServiceIFace::kFuncSetPasswd, userName, encPass); + bool result = reply.isValid() && reply.error().message().isEmpty(); + qInfo() << "Samba password set result :" << result << ",error msg:" << reply.error().message(); + +diff --git a/src/plugins/daemon/CMakeLists.txt b/src/plugins/daemon/CMakeLists.txt +index 237fe8eb4..ad76c20e2 100644 +--- a/src/plugins/daemon/CMakeLists.txt ++++ b/src/plugins/daemon/CMakeLists.txt +@@ -5,3 +5,4 @@ add_subdirectory(daemonplugin-accesscontrol) + add_subdirectory(daemonplugin-sharecontrol) + add_subdirectory(daemonplugin-anything) + add_subdirectory(daemonplugin-mountcontrol) ++add_subdirectory(daemonplugin-stringdecrypt) +diff --git a/src/plugins/daemon/daemonplugin-accesscontrol/accesscontroldbus.cpp b/src/plugins/daemon/daemonplugin-accesscontrol/accesscontroldbus.cpp +index af4fc7a44..40eea37f5 100644 +--- a/src/plugins/daemon/daemonplugin-accesscontrol/accesscontroldbus.cpp ++++ b/src/plugins/daemon/daemonplugin-accesscontrol/accesscontroldbus.cpp +@@ -7,6 +7,7 @@ + #include "polkit/policykithelper.h" + + #include ++#include + + #include + #include +@@ -21,6 +22,7 @@ + #include + #include + ++Q_DECLARE_METATYPE(QString *) + DFMBASE_USE_NAMESPACE + DAEMONPAC_USE_NAMESPACE + +@@ -212,8 +214,16 @@ void AccessControlDBus::ChangeDiskPassword(const QString &oldPwd, const QString + return; + } + +- const QByteArray &tmpOldPwd = oldPwd.toLocal8Bit(); +- const QByteArray &tmpNewPwd = newPwd.toLocal8Bit(); ++ QString oldPwdDec, newPwdDec; ++ int r = dpfSlotChannel->push("daemonplugin_stringdecrypt", "slot_OpenSSL_DecryptString", oldPwd, &oldPwdDec).toInt(); ++ r = dpfSlotChannel->push("daemonplugin_stringdecrypt", "slot_OpenSSL_DecryptString", newPwd, &newPwdDec).toInt(); ++ if (r != 0) { ++ fmCritical() << "cannot decrypt password!!!"; ++ return; ++ } ++ ++ const QByteArray &tmpOldPwd = oldPwdDec.toLocal8Bit(); ++ const QByteArray &tmpNewPwd = newPwdDec.toLocal8Bit(); + + int ret = kNoError; + QStringList successList; +diff --git a/src/plugins/daemon/daemonplugin-sharecontrol/sharecontroldbus.cpp b/src/plugins/daemon/daemonplugin-sharecontrol/sharecontroldbus.cpp +index 2499e4558..a74057af2 100644 +--- a/src/plugins/daemon/daemonplugin-sharecontrol/sharecontroldbus.cpp ++++ b/src/plugins/daemon/daemonplugin-sharecontrol/sharecontroldbus.cpp +@@ -6,12 +6,16 @@ + #include "polkit/policykithelper.h" + #include "dbusadapter/sharecontrol_adapter.h" + ++#include ++ + #include + #include + #include + #include + #include + ++Q_DECLARE_METATYPE(QString *) ++ + static constexpr char kUserShareObjPath[] { "/com/deepin/filemanager/daemon/UserShareManager" }; + static constexpr char kPolicyKitActionId[] { "com.deepin.filemanager.daemon.UserShareManager" }; + +@@ -71,18 +75,28 @@ bool ShareControlDBus::SetUserSharePassword(const QString &name, const QString & + return false; + } + +- qDebug() << name; // << passward; // log password? ++ ++ QString clearPasswd; ++ int ret = dpfSlotChannel->push("daemonplugin_stringdecrypt", "slot_OpenSSL_DecryptString", ++ passwd, &clearPasswd) ++ .toInt(); ++ if (ret != 0) { ++ fmWarning() << "cannot decrypt password!!!"; ++ return false; ++ } ++ + QStringList args; + args << "-a" << name << "-s"; + QProcess p; + p.start("smbpasswd", args); +- p.write(passwd.toStdString().c_str()); ++ p.write(clearPasswd.toStdString().c_str()); + p.write("\n"); +- p.write(passwd.toStdString().c_str()); ++ p.write(clearPasswd.toStdString().c_str()); + p.closeWriteChannel(); +- bool ret = p.waitForFinished(); ++ ++ bool r = p.waitForFinished(); + qDebug() << p.readAll() << p.readAllStandardError() << p.readAllStandardOutput(); +- return ret; ++ return r; + } + + bool ShareControlDBus::EnableSmbServices() +diff --git a/src/plugins/daemon/daemonplugin-stringdecrypt/CMakeLists.txt b/src/plugins/daemon/daemonplugin-stringdecrypt/CMakeLists.txt +new file mode 100644 +index 000000000..46c5b6cd2 +--- /dev/null ++++ b/src/plugins/daemon/daemonplugin-stringdecrypt/CMakeLists.txt +@@ -0,0 +1,50 @@ ++cmake_minimum_required(VERSION 3.10) ++ ++project(daemonplugin-stringdecrypt) ++ ++set(CMAKE_INCLUDE_CURRENT_DIR ON) ++ ++FILE(GLOB FILEOPERATIONS_FILES ++ "${CMAKE_CURRENT_SOURCE_DIR}/*.h" ++ "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" ++ "${CMAKE_CURRENT_SOURCE_DIR}/*/*.h" ++ "${CMAKE_CURRENT_SOURCE_DIR}/*/*.cpp" ++ "${CMAKE_CURRENT_SOURCE_DIR}/*.json" ++ "${CMAKE_CURRENT_SOURCE_DIR}/*.xml" ++ "${CMAKE_CURRENT_SOURCE_DIR}/*/*.policy" ++ ) ++ ++find_package(PkgConfig REQUIRED) ++pkg_check_modules(OpenSSL REQUIRED openssl) ++ ++add_library(${PROJECT_NAME} ++ SHARED ++ ${FILEOPERATIONS_FILES} ++) ++ ++set_target_properties(${PROJECT_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../../) ++ ++find_package(Qt5 COMPONENTS ++ DBus ++ REQUIRED ++) ++ ++target_link_libraries(${PROJECT_NAME} ++ DFM::framework ++ DFM::base ++ Qt5::DBus ++ ${OpenSSL_LIBRARIES} ++) ++ ++#install library file ++install(TARGETS ++ ${PROJECT_NAME} ++ LIBRARY ++ DESTINATION ++ ${DFM_PLUGIN_DAEMON_EDGE_DIR} ++) ++ ++# execute_process(COMMAND qdbuscpp2xml stringdecryptdbus.h -o ./stringdecryptdbus.xml ++# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) ++# execute_process(COMMAND qdbusxml2cpp -i stringdecryptdbus.h -c StringDecryptAdapter -l StringDecryptDBus -a stringdecrypt_adapter stringdecryptdbus.xml ++# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) +diff --git a/src/plugins/daemon/daemonplugin-stringdecrypt/opensslhandler.cpp b/src/plugins/daemon/daemonplugin-stringdecrypt/opensslhandler.cpp +new file mode 100644 +index 000000000..ec8d666be +--- /dev/null ++++ b/src/plugins/daemon/daemonplugin-stringdecrypt/opensslhandler.cpp +@@ -0,0 +1,80 @@ ++// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. ++// ++// SPDX-License-Identifier: GPL-3.0-or-later ++ ++#include "opensslhandler.h" ++ ++#include ++ ++using namespace daemonplugin_stringdecrypt; ++ ++OpenSSLHandler *OpenSSLHandler::instance() ++{ ++ static OpenSSLHandler ins; ++ return &ins; ++} ++ ++void OpenSSLHandler::initKeyPairs() ++{ ++ if (rsa) ++ return; ++ rsa = RSA_generate_key(2048, RSA_F4, nullptr, nullptr); ++ ++ BIO *bioPrivKey = BIO_new(BIO_s_mem()); ++ PEM_write_bio_RSAPrivateKey(bioPrivKey, rsa, nullptr, nullptr, 0, nullptr, nullptr); ++ char *privKeyBuf; ++ long privKeyLen = BIO_get_mem_data(bioPrivKey, &privKeyBuf); ++ auto privKey = QByteArray(privKeyBuf, privKeyLen); ++ BIO_free(bioPrivKey); ++ ++ BIO *bioPubKey = BIO_new(BIO_s_mem()); ++ PEM_write_bio_RSA_PUBKEY(bioPubKey, rsa); ++ char *pubKeyBuf; ++ long pubKeyLen = BIO_get_mem_data(bioPubKey, &pubKeyBuf); ++ auto pubKey = QByteArray(pubKeyBuf, pubKeyLen); ++ BIO_free(bioPubKey); ++ ++ keys = { pubKey, privKey }; ++} ++ ++QString OpenSSLHandler::pubKey() const ++{ ++ return keys.first; ++} ++ ++int OpenSSLHandler::decrypt(const QString &in, QString *out) ++{ ++ Q_ASSERT(rsa); ++ Q_ASSERT(out); ++ ++ QByteArray cipher = QByteArray::fromBase64(in.toLocal8Bit()); ++ ++ int rsaSize = RSA_size(rsa); ++ unsigned char *decrypted = new unsigned char[rsaSize]; ++ int decryptedLen = RSA_private_decrypt(cipher.length(), ++ reinterpret_cast(cipher.data()), ++ decrypted, ++ rsa, ++ RSA_PKCS1_PADDING); ++ ++ if (decryptedLen == -1) { ++ delete[] decrypted; ++ return -1; ++ } ++ ++ QByteArray source(reinterpret_cast(decrypted), decryptedLen); ++ *out = QString(source); ++ delete[] decrypted; ++ return 0; ++} ++ ++OpenSSLHandler::OpenSSLHandler(QObject *parent) ++{ ++} ++ ++OpenSSLHandler::~OpenSSLHandler() ++{ ++ if (rsa) ++ RSA_free(rsa); ++ rsa = nullptr; ++} +diff --git a/src/plugins/daemon/daemonplugin-stringdecrypt/opensslhandler.h b/src/plugins/daemon/daemonplugin-stringdecrypt/opensslhandler.h +new file mode 100644 +index 000000000..d2776370c +--- /dev/null ++++ b/src/plugins/daemon/daemonplugin-stringdecrypt/opensslhandler.h +@@ -0,0 +1,34 @@ ++// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. ++// ++// SPDX-License-Identifier: GPL-3.0-or-later ++#ifndef OPENSSLHANDLER_H ++#define OPENSSLHANDLER_H ++ ++#include ++ ++#include ++ ++namespace daemonplugin_stringdecrypt { ++ ++class OpenSSLHandler : public QObject ++{ ++ Q_OBJECT ++ ++public: ++ static OpenSSLHandler *instance(); ++ ++ void initKeyPairs(); ++ ++ QString pubKey() const; ++ int decrypt(const QString &in, QString *out); ++ ++private: ++ explicit OpenSSLHandler(QObject *parent = nullptr); ++ ~OpenSSLHandler(); ++ ++ RSA *rsa { nullptr }; ++ QPair keys; ++}; ++} ++ ++#endif // OPENSSLHANDLER_H +diff --git a/src/plugins/daemon/daemonplugin-stringdecrypt/stringdecrypt.json b/src/plugins/daemon/daemonplugin-stringdecrypt/stringdecrypt.json +new file mode 100644 +index 000000000..368898d5a +--- /dev/null ++++ b/src/plugins/daemon/daemonplugin-stringdecrypt/stringdecrypt.json +@@ -0,0 +1,14 @@ ++{ ++ "Name" : "daemonplugin-stringdecrypt", ++ "Version" : "1.0.0", ++ "CompatVersion" : "1.0.0", ++ "Vendor" : "The Uniontech Software Technology Co., Ltd.", ++ "Copyright" : "Copyright (C) 2024 Uniontech Software Technology Co., Ltd.", ++ "License" : [ ++ ], ++ "Category" : "", ++ "Description" : "The string decrypt plugin for the dde-file-manager-daemon.", ++ "UrlLink" : "https://www.uniontech.com", ++ "Depends" : [ ++ ] ++} +diff --git a/src/plugins/daemon/daemonplugin-stringdecrypt/stringdecrypt_adapter.cpp b/src/plugins/daemon/daemonplugin-stringdecrypt/stringdecrypt_adapter.cpp +new file mode 100644 +index 000000000..0555169be +--- /dev/null ++++ b/src/plugins/daemon/daemonplugin-stringdecrypt/stringdecrypt_adapter.cpp +@@ -0,0 +1,41 @@ ++/* ++ * This file was generated by qdbusxml2cpp version 0.8 ++ * Command line was: qdbusxml2cpp -i stringdecryptdbus.h -c StringDecryptAdapter -l StringDecryptDBus -a stringdecrypt_adapter stringdecryptdbus.xml ++ * ++ * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd. ++ * ++ * This is an auto-generated file. ++ * Do not edit! All changes made to it will be lost. ++ */ ++ ++#include "stringdecrypt_adapter.h" ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* ++ * Implementation of adaptor class StringDecryptAdapter ++ */ ++ ++StringDecryptAdapter::StringDecryptAdapter(StringDecryptDBus *parent) ++ : QDBusAbstractAdaptor(parent) ++{ ++ // constructor ++ setAutoRelaySignals(true); ++} ++ ++StringDecryptAdapter::~StringDecryptAdapter() ++{ ++ // destructor ++} ++ ++QString StringDecryptAdapter::PublicKey() ++{ ++ // handle method call com.deepin.filemanager.daemon.EncryptKeyHelper.PublicKey ++ return parent()->PublicKey(); ++} ++ +diff --git a/src/plugins/daemon/daemonplugin-stringdecrypt/stringdecrypt_adapter.h b/src/plugins/daemon/daemonplugin-stringdecrypt/stringdecrypt_adapter.h +new file mode 100644 +index 000000000..3c457c7ba +--- /dev/null ++++ b/src/plugins/daemon/daemonplugin-stringdecrypt/stringdecrypt_adapter.h +@@ -0,0 +1,54 @@ ++/* ++ * This file was generated by qdbusxml2cpp version 0.8 ++ * Command line was: qdbusxml2cpp -i stringdecryptdbus.h -c StringDecryptAdapter -l StringDecryptDBus -a stringdecrypt_adapter stringdecryptdbus.xml ++ * ++ * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd. ++ * ++ * This is an auto-generated file. ++ * This file may have been hand-edited. Look for HAND-EDIT comments ++ * before re-generating it. ++ */ ++ ++#ifndef STRINGDECRYPT_ADAPTER_H ++#define STRINGDECRYPT_ADAPTER_H ++ ++#include ++#include ++#include "stringdecryptdbus.h" ++QT_BEGIN_NAMESPACE ++class QByteArray; ++template class QList; ++template class QMap; ++class QString; ++class QStringList; ++class QVariant; ++QT_END_NAMESPACE ++ ++/* ++ * Adaptor class for interface com.deepin.filemanager.daemon.EncryptKeyHelper ++ */ ++class StringDecryptAdapter: public QDBusAbstractAdaptor ++{ ++ Q_OBJECT ++ Q_CLASSINFO("D-Bus Interface", "com.deepin.filemanager.daemon.EncryptKeyHelper") ++ Q_CLASSINFO("D-Bus Introspection", "" ++" \n" ++" \n" ++" \n" ++" \n" ++" \n" ++ "") ++public: ++ StringDecryptAdapter(StringDecryptDBus *parent); ++ virtual ~StringDecryptAdapter(); ++ ++ inline StringDecryptDBus *parent() const ++ { return static_cast(QObject::parent()); } ++ ++public: // PROPERTIES ++public Q_SLOTS: // METHODS ++ QString PublicKey(); ++Q_SIGNALS: // SIGNALS ++}; ++ ++#endif +diff --git a/src/plugins/daemon/daemonplugin-stringdecrypt/stringdecryptdbus.cpp b/src/plugins/daemon/daemonplugin-stringdecrypt/stringdecryptdbus.cpp +new file mode 100644 +index 000000000..e1e913093 +--- /dev/null ++++ b/src/plugins/daemon/daemonplugin-stringdecrypt/stringdecryptdbus.cpp +@@ -0,0 +1,26 @@ ++// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. ++// ++// SPDX-License-Identifier: GPL-3.0-or-later ++ ++#include "stringdecryptdbus.h" ++#include "stringdecrypt_adapter.h" ++#include "opensslhandler.h" ++ ++#include ++ ++StringDecryptDBus::StringDecryptDBus(QObject *parent) ++ : QObject(parent), QDBusContext() ++{ ++ QDBusConnection::systemBus() ++ .registerObject("/com/deepin/filemanager/daemon/EncryptKeyHelper", ++ this); ++ new StringDecryptAdapter(this); ++} ++ ++QString StringDecryptDBus::PublicKey() ++{ ++ return daemonplugin_stringdecrypt::OpenSSLHandler::instance() ++ ->pubKey() ++ .toLocal8Bit() ++ .toBase64(); ++} +diff --git a/src/plugins/daemon/daemonplugin-stringdecrypt/stringdecryptdbus.h b/src/plugins/daemon/daemonplugin-stringdecrypt/stringdecryptdbus.h +new file mode 100644 +index 000000000..b147e4e00 +--- /dev/null ++++ b/src/plugins/daemon/daemonplugin-stringdecrypt/stringdecryptdbus.h +@@ -0,0 +1,22 @@ ++// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. ++// ++// SPDX-License-Identifier: GPL-3.0-or-later ++#ifndef STRINGENCRYPTDBUS_H ++#define STRINGENCRYPTDBUS_H ++ ++#include ++#include ++ ++class StringDecryptDBus : public QObject, public QDBusContext ++{ ++ Q_OBJECT ++ Q_CLASSINFO("D-Bus Interface", "com.deepin.filemanager.daemon.EncryptKeyHelper") ++ ++public: ++ explicit StringDecryptDBus(QObject *parent = nullptr); ++ ++public Q_SLOTS: ++ QString PublicKey(); ++}; ++ ++#endif // STRINGENCRYPTDBUS_H +diff --git a/src/plugins/daemon/daemonplugin-stringdecrypt/stringdecryptdbus.xml b/src/plugins/daemon/daemonplugin-stringdecrypt/stringdecryptdbus.xml +new file mode 100644 +index 000000000..56dcced68 +--- /dev/null ++++ b/src/plugins/daemon/daemonplugin-stringdecrypt/stringdecryptdbus.xml +@@ -0,0 +1,8 @@ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/src/plugins/daemon/daemonplugin-stringdecrypt/stringdecryptplugin.cpp b/src/plugins/daemon/daemonplugin-stringdecrypt/stringdecryptplugin.cpp +new file mode 100644 +index 000000000..512c42733 +--- /dev/null ++++ b/src/plugins/daemon/daemonplugin-stringdecrypt/stringdecryptplugin.cpp +@@ -0,0 +1,25 @@ ++// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. ++// ++// SPDX-License-Identifier: GPL-3.0-or-later ++ ++#include "stringdecryptplugin.h" ++#include "opensslhandler.h" ++#include "stringdecryptdbus.h" ++ ++Q_DECLARE_METATYPE(QString *) ++ ++using namespace daemonplugin_stringdecrypt; ++ ++bool StringDecryptPlugin::start() ++{ ++ OpenSSLHandler::instance()->initKeyPairs(); ++ mng.reset(new StringDecryptDBus(this)); ++ bindEvents(); ++ return true; ++} ++ ++void StringDecryptPlugin::bindEvents() ++{ ++ dpfSlotChannel->connect("daemonplugin_stringdecrypt", "slot_OpenSSL_DecryptString", ++ OpenSSLHandler::instance(), &OpenSSLHandler::decrypt); ++} +diff --git a/src/plugins/daemon/daemonplugin-stringdecrypt/stringdecryptplugin.h b/src/plugins/daemon/daemonplugin-stringdecrypt/stringdecryptplugin.h +new file mode 100644 +index 000000000..6e03b559e +--- /dev/null ++++ b/src/plugins/daemon/daemonplugin-stringdecrypt/stringdecryptplugin.h +@@ -0,0 +1,31 @@ ++// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. ++// ++// SPDX-License-Identifier: GPL-3.0-or-later ++#ifndef STRINGENCRYPTPLUGIN_H ++#define STRINGENCRYPTPLUGIN_H ++ ++#include ++#include ++ ++class StringDecryptDBus; ++namespace daemonplugin_stringdecrypt { ++class StringDecryptPlugin : public DPF_NAMESPACE::Plugin ++{ ++ Q_OBJECT ++ Q_PLUGIN_METADATA(IID "org.deepin.plugin.daemon" FILE "stringdecrypt.json") ++ ++ DPF_EVENT_NAMESPACE(daemonplugin_stringdecrypt) ++ DPF_EVENT_REG_SLOT(slot_OpenSSL_DecryptString) ++ ++public: ++ virtual bool start() override; ++ ++private: ++ void bindEvents(); ++ ++private: ++ QScopedPointer mng; ++}; ++} ++ ++#endif // STRINGENCRYPTPLUGIN_H +diff --git a/src/plugins/filemanager/CMakeLists.txt b/src/plugins/filemanager/CMakeLists.txt +index bddc71659..eac800ff2 100644 +--- a/src/plugins/filemanager/CMakeLists.txt ++++ b/src/plugins/filemanager/CMakeLists.txt +@@ -16,3 +16,4 @@ add_subdirectory(dfmplugin-vault) + add_subdirectory(dfmplugin-myshares) + add_subdirectory(dfmplugin-smbbrowser) + add_subdirectory(dfmplugin-avfsbrowser) ++add_subdirectory(dfmplugin-stringencrypt) +diff --git a/src/plugins/filemanager/core/dfmplugin-titlebar/dialogs/dpcwidget/dpcconfirmwidget.cpp b/src/plugins/filemanager/core/dfmplugin-titlebar/dialogs/dpcwidget/dpcconfirmwidget.cpp +index ea57989ce..78b50630b 100644 +--- a/src/plugins/filemanager/core/dfmplugin-titlebar/dialogs/dpcwidget/dpcconfirmwidget.cpp ++++ b/src/plugins/filemanager/core/dfmplugin-titlebar/dialogs/dpcwidget/dpcconfirmwidget.cpp +@@ -4,7 +4,9 @@ + + #include "dpcconfirmwidget.h" + ++#include + #include ++#include + + #include + #include +@@ -23,6 +25,7 @@ + #include + #include + ++Q_DECLARE_METATYPE(QString *) + DCORE_USE_NAMESPACE + DFMBASE_USE_NAMESPACE + DWIDGET_USE_NAMESPACE +@@ -285,7 +288,15 @@ void DPCConfirmWidget::onSaveBtnClicked() + + if (accessControlInter->isValid()) { + setEnabled(false); +- accessControlInter->asyncCall(DaemonServiceIFace::kFuncChangePwd, oldPwdEdit->text(), newPwdEdit->text()); ++ QString oldPass(oldPwdEdit->text().trimmed()), newPass(newPwdEdit->text().trimmed()), ++ oldPassEnc, newPassEnc; ++ int ret = dpfSlotChannel->push("dfmplugin_stringencrypt", "slot_OpenSSL_EncryptString", oldPass, &oldPassEnc).toInt(); ++ ret = dpfSlotChannel->push("dfmplugin_stringencrypt", "slot_OpenSSL_EncryptString", newPass, &newPassEnc).toInt(); ++ if (ret != 0) { ++ DialogManagerInstance->showErrorDialog(tr("Error"), tr("Cannot encrypt password!")); ++ return; ++ } ++ accessControlInter->asyncCall(DaemonServiceIFace::kFuncChangePwd, oldPassEnc, newPassEnc); + } + } + +diff --git a/src/plugins/filemanager/dfmplugin-stringencrypt/CMakeLists.txt b/src/plugins/filemanager/dfmplugin-stringencrypt/CMakeLists.txt +new file mode 100644 +index 000000000..f25982635 +--- /dev/null ++++ b/src/plugins/filemanager/dfmplugin-stringencrypt/CMakeLists.txt +@@ -0,0 +1,50 @@ ++cmake_minimum_required(VERSION 3.10) ++ ++project(dfmplugin-stringencrypt) ++ ++set(CMAKE_INCLUDE_CURRENT_DIR ON) ++ ++FILE(GLOB FILEOPERATIONS_FILES ++ "${CMAKE_CURRENT_SOURCE_DIR}/*.h" ++ "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" ++ "${CMAKE_CURRENT_SOURCE_DIR}/*/*.h" ++ "${CMAKE_CURRENT_SOURCE_DIR}/*/*.cpp" ++ "${CMAKE_CURRENT_SOURCE_DIR}/*.json" ++ "${CMAKE_CURRENT_SOURCE_DIR}/*.xml" ++ "${CMAKE_CURRENT_SOURCE_DIR}/*/*.policy" ++ ) ++ ++find_package(PkgConfig REQUIRED) ++pkg_check_modules(OpenSSL REQUIRED openssl) ++ ++add_library(${PROJECT_NAME} ++ SHARED ++ ${FILEOPERATIONS_FILES} ++) ++ ++set_target_properties(${PROJECT_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../../) ++ ++find_package(Qt5 COMPONENTS ++ DBus ++ REQUIRED ++) ++ ++target_link_libraries(${PROJECT_NAME} ++ DFM::framework ++ DFM::base ++ Qt5::DBus ++ ${OpenSSL_LIBRARIES} ++) ++ ++#install library file ++install(TARGETS ++ ${PROJECT_NAME} ++ LIBRARY ++ DESTINATION ++ ${DFM_PLUGIN_FILEMANAGER_EDGE_DIR} ++) ++ ++# execute_process(COMMAND qdbuscpp2xml stringencryptdbus.h -o ./stringencryptdbus.xml ++# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) ++# execute_process(COMMAND qdbusxml2cpp -i stringencryptdbus.h -c StringEncryptAdapter -l StringEncryptDBus -a stringencrypt_adapter stringencryptdbus.xml ++# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) +diff --git a/src/plugins/filemanager/dfmplugin-stringencrypt/opensslhandler.cpp b/src/plugins/filemanager/dfmplugin-stringencrypt/opensslhandler.cpp +new file mode 100644 +index 000000000..cfba5fd4e +--- /dev/null ++++ b/src/plugins/filemanager/dfmplugin-stringencrypt/opensslhandler.cpp +@@ -0,0 +1,92 @@ ++// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. ++// ++// SPDX-License-Identifier: GPL-3.0-or-later ++ ++#include "opensslhandler.h" ++ ++#include ++#include ++ ++#include ++#include ++#include ++ ++#include ++ ++DFM_LOG_USE_CATEGORY(dfmplugin_stringencrypt) ++ ++using namespace dfmplugin_stringencrypt; ++ ++OpenSSLHandler *OpenSSLHandler::instance() ++{ ++ static OpenSSLHandler ins; ++ return &ins; ++} ++ ++int OpenSSLHandler::encrypt(const QString &in, QString *out) ++{ ++ const auto &&publicKey = pubKey(); ++ Q_ASSERT(!publicKey.isEmpty()); ++ Q_ASSERT(out); ++ ++ BIO *bio { nullptr }; ++ RSA *rsa { nullptr }; ++ unsigned char *cipherData { nullptr }; ++ ++ dfmbase::FinallyUtil finalClear([=] { ++ if (bio) BIO_free(bio); ++ if (rsa) RSA_free(rsa); ++ if (cipherData) delete[] cipherData; ++ }); ++ ++ bio = BIO_new(BIO_s_mem()); ++ BIO_write(bio, publicKey.toStdString().c_str(), publicKey.length()); ++ ++ rsa = PEM_read_bio_RSA_PUBKEY(bio, nullptr, nullptr, nullptr); ++ if (!rsa) { ++ fmWarning() << "cannot read rsa by pubkey"; ++ return -1; ++ } ++ ++ int rsaSize = RSA_size(rsa); ++ cipherData = new unsigned char[rsaSize]; ++ int result = RSA_public_encrypt(in.length(), ++ reinterpret_cast(in.toStdString().c_str()), ++ cipherData, ++ rsa, ++ RSA_PKCS1_PADDING); ++ ++ if (result == -1) { ++ fmWarning() << "cannot encrypt by pubkey"; ++ return result; ++ } ++ ++ QByteArray cipher(reinterpret_cast(cipherData), result); ++ *out = QString(cipher.toBase64()); ++ return 0; ++} ++ ++OpenSSLHandler::OpenSSLHandler(QObject *parent) ++{ ++} ++ ++OpenSSLHandler::~OpenSSLHandler() ++{ ++} ++ ++QString OpenSSLHandler::pubKey() ++{ ++ QDBusInterface iface("com.deepin.filemanager.daemon", ++ "/com/deepin/filemanager/daemon/EncryptKeyHelper", ++ "com.deepin.filemanager.daemon.EncryptKeyHelper", ++ QDBusConnection::systemBus()); ++ if (iface.isValid()) { ++ QDBusReply reply = iface.call("PublicKey"); ++ if (reply.isValid()) { ++ QByteArray b64Pk = reply.value().toLocal8Bit(); ++ return QByteArray::fromBase64(b64Pk); ++ } ++ } ++ fmWarning() << "dbus interface not valid or no public key returned"; ++ return ""; ++} +diff --git a/src/plugins/filemanager/dfmplugin-stringencrypt/opensslhandler.h b/src/plugins/filemanager/dfmplugin-stringencrypt/opensslhandler.h +new file mode 100644 +index 000000000..7ffe26460 +--- /dev/null ++++ b/src/plugins/filemanager/dfmplugin-stringencrypt/opensslhandler.h +@@ -0,0 +1,28 @@ ++// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. ++// ++// SPDX-License-Identifier: GPL-3.0-or-later ++#ifndef OPENSSLHANDLER_H ++#define OPENSSLHANDLER_H ++ ++#include ++ ++#include ++ ++namespace dfmplugin_stringencrypt { ++ ++class OpenSSLHandler : public QObject ++{ ++ Q_OBJECT ++ ++public: ++ static OpenSSLHandler *instance(); ++ int encrypt(const QString &in, QString *out); ++ ++private: ++ explicit OpenSSLHandler(QObject *parent = nullptr); ++ ~OpenSSLHandler(); ++ QString pubKey(); ++}; ++} ++ ++#endif // OPENSSLHANDLER_H +diff --git a/src/plugins/filemanager/dfmplugin-stringencrypt/stringencrypt.json b/src/plugins/filemanager/dfmplugin-stringencrypt/stringencrypt.json +new file mode 100644 +index 000000000..896839d40 +--- /dev/null ++++ b/src/plugins/filemanager/dfmplugin-stringencrypt/stringencrypt.json +@@ -0,0 +1,14 @@ ++{ ++ "Name" : "dfmplugin-stringencrypt", ++ "Version" : "1.0.0", ++ "CompatVersion" : "1.0.0", ++ "Vendor" : "The Uniontech Software Technology Co., Ltd.", ++ "Copyright" : "Copyright (C) 2024 Uniontech Software Technology Co., Ltd.", ++ "License" : [ ++ ], ++ "Category" : "", ++ "Description" : "The string encrypt plugin for the dde-file-manager.", ++ "UrlLink" : "https://www.uniontech.com", ++ "Depends" : [ ++ ] ++} +diff --git a/src/plugins/filemanager/dfmplugin-stringencrypt/stringencryptplugin.cpp b/src/plugins/filemanager/dfmplugin-stringencrypt/stringencryptplugin.cpp +new file mode 100644 +index 000000000..baffc4728 +--- /dev/null ++++ b/src/plugins/filemanager/dfmplugin-stringencrypt/stringencryptplugin.cpp +@@ -0,0 +1,23 @@ ++// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. ++// ++// SPDX-License-Identifier: GPL-3.0-or-later ++ ++#include "stringencryptplugin.h" ++#include "opensslhandler.h" ++ ++Q_DECLARE_METATYPE(QString *); ++ ++using namespace dfmplugin_stringencrypt; ++DFM_LOG_REISGER_CATEGORY(dfmplugin_stringencrypt) ++ ++bool StringEncryptPlugin::start() ++{ ++ bindEvents(); ++ return true; ++} ++ ++void StringEncryptPlugin::bindEvents() ++{ ++ dpfSlotChannel->connect("dfmplugin_stringencrypt", "slot_OpenSSL_EncryptString", ++ OpenSSLHandler::instance(), &OpenSSLHandler::encrypt); ++} +diff --git a/src/plugins/filemanager/dfmplugin-stringencrypt/stringencryptplugin.h b/src/plugins/filemanager/dfmplugin-stringencrypt/stringencryptplugin.h +new file mode 100644 +index 000000000..d014ce1b2 +--- /dev/null ++++ b/src/plugins/filemanager/dfmplugin-stringencrypt/stringencryptplugin.h +@@ -0,0 +1,28 @@ ++// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. ++// ++// SPDX-License-Identifier: GPL-3.0-or-later ++#ifndef STRINGENCRYPTPLUGIN_H ++#define STRINGENCRYPTPLUGIN_H ++ ++#include ++#include ++#include ++ ++namespace dfmplugin_stringencrypt { ++class StringEncryptPlugin : public DPF_NAMESPACE::Plugin ++{ ++ Q_OBJECT ++ Q_PLUGIN_METADATA(IID "org.deepin.plugin.filemanager" FILE "stringencrypt.json") ++ ++ DPF_EVENT_NAMESPACE(dfmplugin_stringencrypt) ++ DPF_EVENT_REG_SLOT(slot_OpenSSL_EncryptString) ++ ++public: ++ virtual bool start() override; ++ ++private: ++ void bindEvents(); ++}; ++} ++ ++#endif // STRINGENCRYPTPLUGIN_H +-- +2.43.4 + diff --git a/0001-feat-use-abspath-when-using-it-for-the-first.patch b/0001-feat-use-abspath-when-using-it-for-the-first.patch new file mode 100644 index 0000000000000000000000000000000000000000..44efbcded40e9bafcd14021d5302ce3209872c85 --- /dev/null +++ b/0001-feat-use-abspath-when-using-it-for-the-first.patch @@ -0,0 +1,31 @@ +From 96abdf90f5b8ad881968c8c928f814d631fc764f Mon Sep 17 00:00:00 2001 +From: liweigang +Date: Mon, 17 Jun 2024 05:28:42 +0000 +Subject: [PATCH] feat: use abspath when using it for the first + +Signed-off-by: liweigang +--- + src/apps/dde-file-manager/dde-property-dialog | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/src/apps/dde-file-manager/dde-property-dialog b/src/apps/dde-file-manager/dde-property-dialog +index bf8c704..2c8b32e 100755 +--- a/src/apps/dde-file-manager/dde-property-dialog ++++ b/src/apps/dde-file-manager/dde-property-dialog +@@ -14,6 +14,13 @@ processd=`ps ax -o 'cmd' |grep 'dde-file-manager -d$'`; + data="ZGRlLWZpbGUtbWFuYWdlcg==" + + if [[ "$process" == ""&&"$processd" == "" ]]; then ++ for path in "$@"; do ++ if [[ "$path" == /* ]]; then ++ abs_path=$abs_path" "$path ++ else ++ abs_path=$abs_path" "$(readlink -f "$path") ++ fi ++ done + dde-file-manager -p "$@"; + else + option="-p" +-- +2.45.1 + diff --git a/0001-fix-build-error.patch b/0001-fix-build-error.patch deleted file mode 100644 index f460724bdc986a995c8708aab8c608c27abf3a84..0000000000000000000000000000000000000000 --- a/0001-fix-build-error.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 30420e17378d6c2b2b557fd53e973f5a8ad8ad8d Mon Sep 17 00:00:00 2001 -From: liuzhilin -Date: Thu, 18 Apr 2024 09:58:54 +0800 -Subject: [PATCH] fix-build-error - ---- - src/dde-desktop/data/applications/dde-computer.desktop | 2 +- - src/dde-desktop/data/applications/dde-home.desktop | 2 +- - src/dde-desktop/data/applications/dde-trash.desktop | 2 +- - src/dde-file-manager/mips/dde-file-manager.desktop | 2 +- - 4 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/dde-desktop/data/applications/dde-computer.desktop b/src/dde-desktop/data/applications/dde-computer.desktop -index 7a2ff03..b8f6c5f 100644 ---- a/src/dde-desktop/data/applications/dde-computer.desktop -+++ b/src/dde-desktop/data/applications/dde-computer.desktop -@@ -5,7 +5,7 @@ Exec=gio open computer:/// - GenericName=Computer - Icon=computer - Name=Computer --OnlyShowIn=Deepin; -+##OnlyShowIn=Deepin; - Terminal=false - Type=Application - X-AppStream-Ignore=true -diff --git a/src/dde-desktop/data/applications/dde-home.desktop b/src/dde-desktop/data/applications/dde-home.desktop -index 0c0f35c..1a37a47 100644 ---- a/src/dde-desktop/data/applications/dde-home.desktop -+++ b/src/dde-desktop/data/applications/dde-home.desktop -@@ -6,7 +6,7 @@ GenericName=Home - Icon=user-home - Name=Home - NoDisplay=true --OnlyShowIn=Deepin; -+##OnlyShowIn=Deepin; - Terminal=false - Type=Application - X-AppStream-Ignore=true -diff --git a/src/dde-desktop/data/applications/dde-trash.desktop b/src/dde-desktop/data/applications/dde-trash.desktop -index f2524b6..c7b0c01 100644 ---- a/src/dde-desktop/data/applications/dde-trash.desktop -+++ b/src/dde-desktop/data/applications/dde-trash.desktop -@@ -5,7 +5,7 @@ Exec=gio open trash:/// - GenericName=Open Trash. - Icon=user-trash - Name=Trash --OnlyShowIn=Deepin; -+##OnlyShowIn=Deepin; - Terminal=false - Type=Application - X-AppStream-Ignore=true -diff --git a/src/dde-file-manager/mips/dde-file-manager.desktop b/src/dde-file-manager/mips/dde-file-manager.desktop -index 259d50e..4213f23 100644 ---- a/src/dde-file-manager/mips/dde-file-manager.desktop -+++ b/src/dde-file-manager/mips/dde-file-manager.desktop -@@ -7,7 +7,7 @@ GenericName=File Manager - Icon=dde-file-manager - MimeType=inode/directory; - Name=Deepin File Manager --OnlyShowIn=Deepin; -+##OnlyShowIn=Deepin; - StartupNotify=false - Terminal=false - Type=Application --- -2.39.3 - diff --git a/0001-hide-authorized-watermask.patch b/0001-hide-authorized-watermask.patch deleted file mode 100644 index a15639b340c85cd6932d941649a7656d1cae9364..0000000000000000000000000000000000000000 --- a/0001-hide-authorized-watermask.patch +++ /dev/null @@ -1,26 +0,0 @@ -From fca58228ea9d31e01dd6e24bee944cebf7df9622 Mon Sep 17 00:00:00 2001 -From: leeffo -Date: Wed, 2 Aug 2023 14:13:35 +0800 -Subject: [PATCH] hide authorized watermask - ---- - src/dde-desktop/view/watermaskframe.cpp | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/dde-desktop/view/watermaskframe.cpp b/src/dde-desktop/view/watermaskframe.cpp -index e36d97b..2d0e72a 100644 ---- a/src/dde-desktop/view/watermaskframe.cpp -+++ b/src/dde-desktop/view/watermaskframe.cpp -@@ -98,7 +98,8 @@ void WaterMaskFrame::stateChanged(int state, int prop) - return; - } - -- bool showSate = showLicenseState(); -+ //bool showSate = showLicenseState(); -+ bool showSate = 0; - bool cn = usingCn(); - qInfo() << "reply ActiveState is" << state << prop << "show" << showSate - << "cn" << cn << this; --- -2.20.1 - diff --git a/0001-property-dialog-Show-property-dialog-crash-in-server.patch b/0001-property-dialog-Show-property-dialog-crash-in-server.patch new file mode 100644 index 0000000000000000000000000000000000000000..b13f4aaabfa48925c748bba8fb322b7f4e2b8aa7 --- /dev/null +++ b/0001-property-dialog-Show-property-dialog-crash-in-server.patch @@ -0,0 +1,34 @@ +From 65ae389ff86e4aec75f71cb22d79087a6b7bc2d8 Mon Sep 17 00:00:00 2001 +From: liuzhilin +Date: Fri, 22 Dec 2023 16:44:09 +0800 +Subject: [PATCH] [property-dialog] Show property dialog crash in server + +--- + .../views/computerpropertydialog.cpp | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/plugins/common/core/dfmplugin-propertydialog/views/computerpropertydialog.cpp b/src/plugins/common/core/dfmplugin-propertydialog/views/computerpropertydialog.cpp +index decd52a..29ff523 100644 +--- a/src/plugins/common/core/dfmplugin-propertydialog/views/computerpropertydialog.cpp ++++ b/src/plugins/common/core/dfmplugin-propertydialog/views/computerpropertydialog.cpp +@@ -164,14 +164,14 @@ void ComputerPropertyDialog::closeEvent(QCloseEvent *event) + + static QString formatCap(qulonglong cap, const int size = 1024, quint8 precision = 1) + { +- static QString type[] { " B", " KB", " MB", " GB", " TB" }; ++ QStringList type { " B", " KB", " MB", " GB", " TB" }; + + qulonglong lc = cap; + double dc = cap; + double ds = size; + +- for (size_t p = 0; p < sizeof(type); ++p) { +- if (cap < pow(size, p + 1) || p == sizeof(type) - 1) { ++ for (int p = 0; p < type.size(); ++p) { ++ if (cap < pow(size, p + 1) || p == type.size() - 1) { + if (!precision) { + //! 内存总大小只能是整数所以当内存大小有小数时,就需要向上取整 + int mem = static_cast(ceil(lc / pow(size, p))); +-- +2.39.3 + diff --git a/0002-chore-compile-fmDebug-qDebug.patch b/0002-chore-compile-fmDebug-qDebug.patch new file mode 100644 index 0000000000000000000000000000000000000000..180e01cc319659736c70fb454a2b5bca38d9dd36 --- /dev/null +++ b/0002-chore-compile-fmDebug-qDebug.patch @@ -0,0 +1,63 @@ +From 8bc0d75a2db750d408e4463a5dedf48822a97424 Mon Sep 17 00:00:00 2001 +From: xust +Date: Tue, 25 Jun 2024 19:21:16 +0800 +Subject: [PATCH 2/3] chore: [compile] fmDebug -> qDebug + +as title. + +Log: as title. +Change-Id: I798d199742059518e413dc127b18c052be055154 +--- + .../common/dfmplugin-dirshare/utils/usersharehelper.cpp | 2 +- + .../daemon/daemonplugin-accesscontrol/accesscontroldbus.cpp | 2 +- + .../daemon/daemonplugin-sharecontrol/sharecontroldbus.cpp | 3 +-- + 3 files changed, 3 insertions(+), 4 deletions(-) + +diff --git a/src/plugins/common/dfmplugin-dirshare/utils/usersharehelper.cpp b/src/plugins/common/dfmplugin-dirshare/utils/usersharehelper.cpp +index 6f669006d..e599e2ec5 100644 +--- a/src/plugins/common/dfmplugin-dirshare/utils/usersharehelper.cpp ++++ b/src/plugins/common/dfmplugin-dirshare/utils/usersharehelper.cpp +@@ -144,7 +144,7 @@ void UserShareHelper::setSambaPasswd(const QString &userName, const QString &pas + auto ret = dpfSlotChannel->push("dfmplugin_stringencrypt", "slot_OpenSSL_EncryptString", + passwd, &encPass); + if (ret != 0) { +- fmWarning() << "cannot encrypt password!!!"; ++ qWarning() << "cannot encrypt password!!!"; + DialogManagerInstance->showErrorDialog(tr("Error"), tr("Cannot encrypt password")); + return; + } +diff --git a/src/plugins/daemon/daemonplugin-accesscontrol/accesscontroldbus.cpp b/src/plugins/daemon/daemonplugin-accesscontrol/accesscontroldbus.cpp +index 40eea37f5..8590da3aa 100644 +--- a/src/plugins/daemon/daemonplugin-accesscontrol/accesscontroldbus.cpp ++++ b/src/plugins/daemon/daemonplugin-accesscontrol/accesscontroldbus.cpp +@@ -218,7 +218,7 @@ void AccessControlDBus::ChangeDiskPassword(const QString &oldPwd, const QString + int r = dpfSlotChannel->push("daemonplugin_stringdecrypt", "slot_OpenSSL_DecryptString", oldPwd, &oldPwdDec).toInt(); + r = dpfSlotChannel->push("daemonplugin_stringdecrypt", "slot_OpenSSL_DecryptString", newPwd, &newPwdDec).toInt(); + if (r != 0) { +- fmCritical() << "cannot decrypt password!!!"; ++ qCritical() << "cannot decrypt password!!!"; + return; + } + +diff --git a/src/plugins/daemon/daemonplugin-sharecontrol/sharecontroldbus.cpp b/src/plugins/daemon/daemonplugin-sharecontrol/sharecontroldbus.cpp +index a74057af2..d25a956f0 100644 +--- a/src/plugins/daemon/daemonplugin-sharecontrol/sharecontroldbus.cpp ++++ b/src/plugins/daemon/daemonplugin-sharecontrol/sharecontroldbus.cpp +@@ -75,13 +75,12 @@ bool ShareControlDBus::SetUserSharePassword(const QString &name, const QString & + return false; + } + +- + QString clearPasswd; + int ret = dpfSlotChannel->push("daemonplugin_stringdecrypt", "slot_OpenSSL_DecryptString", + passwd, &clearPasswd) + .toInt(); + if (ret != 0) { +- fmWarning() << "cannot decrypt password!!!"; ++ qWarning() << "cannot decrypt password!!!"; + return false; + } + +-- +2.43.4 + diff --git a/0002-fix-fileinfo-Incorrect-icon-for-dde-desktop-s-file.patch b/0002-fix-fileinfo-Incorrect-icon-for-dde-desktop-s-file.patch new file mode 100644 index 0000000000000000000000000000000000000000..2c0cb26f347820dcf60b64e27511a709714153b8 --- /dev/null +++ b/0002-fix-fileinfo-Incorrect-icon-for-dde-desktop-s-file.patch @@ -0,0 +1,89 @@ +From 6e9b678d8bf9f2affcffd814d35bcf55d0d651d1 Mon Sep 17 00:00:00 2001 +From: liyigang +Date: Thu, 7 Sep 2023 17:09:44 +0800 +Subject: [PATCH 10143/10526] fix: [fileinfo]Incorrect icon for dde-desktop's + file + +When the desktop is a remote environment, when the file manager creates a new word document, it performs two actions, a touchfile, in writing the template information. In the absence of writing template information, the desktop's asynchronous file information query back icon is a text document, received a signal to change the file information in the go to refresh fileinfo, because at this time is caching the file attributes, so the return is not executed. Modification in the cache information is possible to perform asynchronous file query. + +Log: Incorrect icon for dde-desktop's file +Bug: https://pms.uniontech.com/bug-view-217907.html +--- + src/dfm-base/file/local/asyncfileinfo.cpp | 18 +++++++----------- + .../file/local/private/asyncfileinfo_p.h | 1 + + 2 files changed, 8 insertions(+), 11 deletions(-) + +diff --git a/src/dfm-base/file/local/asyncfileinfo.cpp b/src/dfm-base/file/local/asyncfileinfo.cpp +index 4dd38afd5..56c9669cf 100644 +--- a/src/dfm-base/file/local/asyncfileinfo.cpp ++++ b/src/dfm-base/file/local/asyncfileinfo.cpp +@@ -388,7 +388,7 @@ QVariantHash AsyncFileInfo::extraProperties() const + + QIcon AsyncFileInfo::fileIcon() + { +- if (d->cacheing) { ++ if (d->cacheing || d->cacheingAttributes) { + QIcon icon; + { // if already loaded thumb just return it. + QReadLocker rlk(&d->iconLock); +@@ -531,12 +531,10 @@ bool AsyncFileInfo::cacheAsyncAttributes() + if (d->tokenKey != quintptr(dfmFileInfo.data())) + return false; + +- if (d->cacheing) +- return false; +- if (!d->cacheing) +- d->cacheing = true; ++ if (!d->cacheingAttributes) ++ d->cacheingAttributes = true; + d->cacheAllAttributes(); +- d->cacheing = false; ++ d->cacheingAttributes = false; + return true; + } + +@@ -997,7 +995,6 @@ void AsyncFileInfoPrivate::cacheAllAttributes() + tmp.insert(AsyncFileInfo::AsyncAttributeID::kStandardSize, attribute(DFileInfo::AttributeID::kStandardSize)); + tmp.insert(AsyncFileInfo::AsyncAttributeID::kStandardFilePath, filePath()); + tmp.insert(AsyncFileInfo::AsyncAttributeID::kStandardParentPath, path()); +- auto tmpdfmfileinfo = dfmFileInfo; + tmp.insert(AsyncFileInfo::AsyncAttributeID::kStandardFileExists, DFile(q->fileUrl()).exists()); + // redirectedFileUrl + auto symlink = symLinkTarget(); +@@ -1033,7 +1030,6 @@ void AsyncFileInfoPrivate::cacheAllAttributes() + tmp.insert(AsyncFileInfo::AsyncAttributeID::kUnixInode, attribute(DFileInfo::AttributeID::kUnixInode)); + tmp.insert(AsyncFileInfo::AsyncAttributeID::kUnixUID, attribute(DFileInfo::AttributeID::kUnixUID)); + tmp.insert(AsyncFileInfo::AsyncAttributeID::kUnixGID, attribute(DFileInfo::AttributeID::kUnixGID)); +- tmp.insert(AsyncFileInfo::AsyncAttributeID::kAccessPermissions, QVariant::fromValue(dfmFileInfo->permissions())); + tmp.insert(AsyncFileInfo::AsyncAttributeID::kTimeCreated, attribute(DFileInfo::AttributeID::kTimeCreated)); + tmp.insert(AsyncFileInfo::AsyncAttributeID::kTimeChanged, attribute(DFileInfo::AttributeID::kTimeChanged)); + tmp.insert(AsyncFileInfo::AsyncAttributeID::kTimeModified, attribute(DFileInfo::AttributeID::kTimeModified)); +@@ -1042,10 +1038,10 @@ void AsyncFileInfoPrivate::cacheAllAttributes() + tmp.insert(AsyncFileInfo::AsyncAttributeID::kTimeChangedUsec, attribute(DFileInfo::AttributeID::kTimeChangedUsec)); + tmp.insert(AsyncFileInfo::AsyncAttributeID::kTimeModifiedUsec, attribute(DFileInfo::AttributeID::kTimeModifiedUsec)); + tmp.insert(AsyncFileInfo::AsyncAttributeID::kTimeAccessUsec, attribute(DFileInfo::AttributeID::kTimeAccessUsec)); +- if (tmpdfmfileinfo) +- tmp.insert(AsyncFileInfo::AsyncAttributeID::kAccessPermissions, QVariant::fromValue(dfmFileInfo->permissions())); +- + tmp.insert(AsyncFileInfo::AsyncAttributeID::kStandardFileType, QVariant::fromValue(fileType())); ++ auto tmpdfmfileinfo = dfmFileInfo; ++ if (tmpdfmfileinfo) ++ tmp.insert(AsyncFileInfo::AsyncAttributeID::kAccessPermissions, QVariant::fromValue(tmpdfmfileinfo->permissions())); + // GenericIconName + tmp.insert(AsyncFileInfo::AsyncAttributeID::kStandardContentType, attribute(DFileInfo::AttributeID::kStandardContentType)); + // iconname +diff --git a/src/dfm-base/file/local/private/asyncfileinfo_p.h b/src/dfm-base/file/local/private/asyncfileinfo_p.h +index c67b1c9e9..3f5a614bc 100644 +--- a/src/dfm-base/file/local/private/asyncfileinfo_p.h ++++ b/src/dfm-base/file/local/private/asyncfileinfo_p.h +@@ -33,6 +33,7 @@ public: + QMimeDatabase::MatchMode mimeTypeMode; + std::atomic_bool notInit { false }; + std::atomic_bool cacheing { false }; ++ std::atomic_bool cacheingAttributes { false }; + char memrySeat[5]; + QSharedPointer dfmFileInfo { nullptr }; // dfm文件的信息 + QVariantHash extraProperties; // 扩展属性列表 +-- +2.39.3 + diff --git a/0002-fix-undefined-std-array.patch b/0002-fix-undefined-std-array.patch deleted file mode 100644 index 5c543db1f54765a283a7ef201d399e4bfb687c94..0000000000000000000000000000000000000000 --- a/0002-fix-undefined-std-array.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 340b1be4850c8316ee858f597bcb729363f142b7 Mon Sep 17 00:00:00 2001 -From: leeffo -Date: Thu, 3 Aug 2023 10:15:30 +0800 -Subject: [PATCH] fix undefined std::array - ---- - .../dialogs/private/ddesktoprenamedialog_p.h | 1 + - src/dde-file-manager-lib/views/drenamebar.h | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/src/dde-file-manager-lib/dialogs/private/ddesktoprenamedialog_p.h b/src/dde-file-manager-lib/dialogs/private/ddesktoprenamedialog_p.h -index 80c5c20..f018762 100644 ---- a/src/dde-file-manager-lib/dialogs/private/ddesktoprenamedialog_p.h -+++ b/src/dde-file-manager-lib/dialogs/private/ddesktoprenamedialog_p.h -@@ -23,6 +23,7 @@ - #ifndef DDESKTOPRENAMEDIALOG_P_H - #define DDESKTOPRENAMEDIALOG_P_H - -+#include - #include - #include - #include -diff --git a/src/dde-file-manager-lib/views/drenamebar.h b/src/dde-file-manager-lib/views/drenamebar.h -index 45f3b09..b59fa8f 100644 ---- a/src/dde-file-manager-lib/views/drenamebar.h -+++ b/src/dde-file-manager-lib/views/drenamebar.h -@@ -26,6 +26,7 @@ - #define DRENAMEBAR_H - - -+#include - #include - #include - #include --- -2.20.1 - diff --git a/0003-chore-compile-compile-issue.patch b/0003-chore-compile-compile-issue.patch new file mode 100644 index 0000000000000000000000000000000000000000..a7ffa3ac82be3a3eb9bc70518fff8add68a953c9 --- /dev/null +++ b/0003-chore-compile-compile-issue.patch @@ -0,0 +1,89 @@ +From fed99dab0c51aaaad8699d231da3f4e2c407fea9 Mon Sep 17 00:00:00 2001 +From: xust +Date: Tue, 25 Jun 2024 19:56:37 +0800 +Subject: [PATCH 3/3] chore: [compile] compile issue. + +as title. + +Log: as title. +Change-Id: I64b28941a7c784605911bb7c857c07f0780a943e +--- + .../dfmplugin-stringencrypt/opensslhandler.cpp | 9 +++------ + .../dfmplugin-stringencrypt/stringencryptplugin.cpp | 1 - + .../dfmplugin-stringencrypt/stringencryptplugin.h | 1 - + 3 files changed, 3 insertions(+), 8 deletions(-) + +diff --git a/src/plugins/filemanager/dfmplugin-stringencrypt/opensslhandler.cpp b/src/plugins/filemanager/dfmplugin-stringencrypt/opensslhandler.cpp +index cfba5fd4e..255693aeb 100644 +--- a/src/plugins/filemanager/dfmplugin-stringencrypt/opensslhandler.cpp ++++ b/src/plugins/filemanager/dfmplugin-stringencrypt/opensslhandler.cpp +@@ -4,7 +4,6 @@ + + #include "opensslhandler.h" + +-#include + #include + + #include +@@ -13,8 +12,6 @@ + + #include + +-DFM_LOG_USE_CATEGORY(dfmplugin_stringencrypt) +- + using namespace dfmplugin_stringencrypt; + + OpenSSLHandler *OpenSSLHandler::instance() +@@ -44,7 +41,7 @@ int OpenSSLHandler::encrypt(const QString &in, QString *out) + + rsa = PEM_read_bio_RSA_PUBKEY(bio, nullptr, nullptr, nullptr); + if (!rsa) { +- fmWarning() << "cannot read rsa by pubkey"; ++ qWarning() << "cannot read rsa by pubkey"; + return -1; + } + +@@ -57,7 +54,7 @@ int OpenSSLHandler::encrypt(const QString &in, QString *out) + RSA_PKCS1_PADDING); + + if (result == -1) { +- fmWarning() << "cannot encrypt by pubkey"; ++ qWarning() << "cannot encrypt by pubkey"; + return result; + } + +@@ -87,6 +84,6 @@ QString OpenSSLHandler::pubKey() + return QByteArray::fromBase64(b64Pk); + } + } +- fmWarning() << "dbus interface not valid or no public key returned"; ++ qWarning() << "dbus interface not valid or no public key returned"; + return ""; + } +diff --git a/src/plugins/filemanager/dfmplugin-stringencrypt/stringencryptplugin.cpp b/src/plugins/filemanager/dfmplugin-stringencrypt/stringencryptplugin.cpp +index baffc4728..8fb1dac4d 100644 +--- a/src/plugins/filemanager/dfmplugin-stringencrypt/stringencryptplugin.cpp ++++ b/src/plugins/filemanager/dfmplugin-stringencrypt/stringencryptplugin.cpp +@@ -8,7 +8,6 @@ + Q_DECLARE_METATYPE(QString *); + + using namespace dfmplugin_stringencrypt; +-DFM_LOG_REISGER_CATEGORY(dfmplugin_stringencrypt) + + bool StringEncryptPlugin::start() + { +diff --git a/src/plugins/filemanager/dfmplugin-stringencrypt/stringencryptplugin.h b/src/plugins/filemanager/dfmplugin-stringencrypt/stringencryptplugin.h +index d014ce1b2..03d2079a2 100644 +--- a/src/plugins/filemanager/dfmplugin-stringencrypt/stringencryptplugin.h ++++ b/src/plugins/filemanager/dfmplugin-stringencrypt/stringencryptplugin.h +@@ -4,7 +4,6 @@ + #ifndef STRINGENCRYPTPLUGIN_H + #define STRINGENCRYPTPLUGIN_H + +-#include + #include + #include + +-- +2.43.4 + diff --git a/0003-fix-audit-log-isn-t-zh_cn.patch b/0003-fix-audit-log-isn-t-zh_cn.patch new file mode 100644 index 0000000000000000000000000000000000000000..cf8a203c2dcdcf482db40709328bf31aeea1a49f --- /dev/null +++ b/0003-fix-audit-log-isn-t-zh_cn.patch @@ -0,0 +1,1771 @@ +From 010fc5c983179dae6456685e9a8f4d88bc481aa6 Mon Sep 17 00:00:00 2001 +From: Zhang Sheng +Date: Thu, 21 Sep 2023 15:20:51 +0800 +Subject: [PATCH 10163/10526] fix: [audit] log isn't zh_cn + +Use zh_cn for burn files log + +Log: audit log +--- + .../dfmplugin-burn/utils/auditlogjob.cpp | 4 +- + translations/dde-file-manager.ts | 262 +++++++------- + translations/dde-file-manager_zh_CN.ts | 320 +++++++++--------- + 3 files changed, 296 insertions(+), 290 deletions(-) + +diff --git a/src/plugins/common/dfmplugin-burn/utils/auditlogjob.cpp b/src/plugins/common/dfmplugin-burn/utils/auditlogjob.cpp +index 74d56cf83..c405406e2 100644 +--- a/src/plugins/common/dfmplugin-burn/utils/auditlogjob.cpp ++++ b/src/plugins/common/dfmplugin-burn/utils/auditlogjob.cpp +@@ -149,10 +149,10 @@ void BurnFilesAuditLogJob::doLog(QDBusInterface &interface) + void BurnFilesAuditLogJob::writeLog(QDBusInterface &interface, const QString &discPath, const QString &nativePath, qint64 size) + { + static const QString kLogKey { "cdrecord" }; +- static const QString kLogTemplate { "ID=%1, DateTime=%2, Burner=%3, DiscType=%4, Result=%5, User=%6, FileName=%7, FileSize=%8, FileType=%9" }; ++ static const QString kLogTemplate { QObject::tr("ID=%1, DateTime=%2, Burner=%3, DiscType=%4, Result=%5, User=%6, FileName=%7, FileSize=%8, FileType=%9") }; + static const QString &kUserName { SysInfoUtils::getUser() }; + +- const QString &result { burnedSuccess ? "Success" : "Failed" }; ++ const QString &result { burnedSuccess ? QObject::tr("Success") : QObject::tr("Failed") }; + const QString &dateTime { QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss") }; + const QString &burner { AuditHelper::bunner(property(DeviceProperty::kDrive)) }; + const QString &discType { AuditHelper::opticalMedia(property(DeviceProperty::kMedia)) }; +diff --git a/translations/dde-file-manager.ts b/translations/dde-file-manager.ts +index d5f1da14b..3179c3e72 100644 +--- a/translations/dde-file-manager.ts ++++ b/translations/dde-file-manager.ts +@@ -17,12 +17,12 @@ + + Application + +- ++ + File Manager + File Manager + + +- ++ + File Manager is a powerful and easy-to-use file management tool, featured with searching, copying, trash, compression/decompression, file property and other useful functions. + File Manager is a powerful and easy-to-use file management tool, featured with searching, copying, trash, compression/decompression, file property and other useful functions. + +@@ -109,7 +109,7 @@ + + MimeTypeDisplayManager + +- ++ + Unknown + Unknown + +@@ -150,24 +150,24 @@ + If you want to be absolutely sure it is safe to continue, contact the system administrator. + + +- ++ + + + System Disk + System Disk + + +- ++ + Data Disk + Data Disk + + +- ++ + Blank %1 Disc + Blank %1 Disc + + +- ++ + + + +@@ -175,17 +175,17 @@ + Unknown + + +- ++ + %1 Drive + %1 Drive + + +- ++ + %1 Encrypted + %1 Encrypted + + +- ++ + %1 Volume + %1 Volume + +@@ -312,12 +312,12 @@ + %1 tasks in progress + + +- ++ + %1 item + %1 item + + +- ++ + %1 items + %1 items + +@@ -327,20 +327,20 @@ + Unable to find the original file + + +- ++ + + File has been moved or deleted + File has been moved or deleted + + +- ++ + +- ++ + You do not have permission to access this folder + You do not have permission to access this folder + + +- ++ + + You do not have permission to traverse files in it + You do not have permission to traverse files in it +@@ -889,14 +889,14 @@ + Bit + + +- ++ + + Access denied + Access denied + + + +- ++ + Confirm + button + Confirm +@@ -1140,8 +1140,8 @@ + Unknown error + + +- +- ++ ++ + Close + button + Close +@@ -1394,7 +1394,7 @@ + Edit address + + +- ++ + Unable to open items in the trash, please restore it first + Unable to open items in the trash, please restore it first + +@@ -1504,7 +1504,7 @@ + Searching... + + +- ++ + My Vault + My Vault + +@@ -1678,6 +1678,26 @@ + File is busy + File is busy + ++ ++ ++ Device disconnected ++ ++ ++ ++ ++ ID=%1, DateTime=%2, Burner=%3, DiscType=%4, Result=%5, User=%6, FileName=%7, FileSize=%8, FileType=%9 ++ ID=%1, DateTime=%2, Burner=%3, DiscType=%4, Result=%5, User=%6, FileName=%7, FileSize=%8, FileType=%9 ++ ++ ++ ++ Success ++ Success ++ ++ ++ ++ Failed ++ Failed ++ + + + ddplugin_canvas::CanvasMenuScene +@@ -3032,52 +3052,52 @@ + + dfmbase::SystemPathUtil + +- ++ + Home + Home + + +- ++ + Desktop + Desktop + + +- ++ + Videos + Videos + + +- ++ + Music + Music + + +- ++ + Pictures + Pictures + + +- ++ + Documents + Documents + + +- ++ + Downloads + Downloads + + +- ++ + Trash + Trash + + +- ++ + System Disk + System Disk + + +- ++ + Recent + Recent + +@@ -3095,87 +3115,87 @@ + create target file %1 Info failed in show conflict Info function! + + +- ++ + Time modified: %1 + Time modified: %1 + + +- +- In data statistics +- +- +- +- ++ + Original folder + Original folder + + +- ++ + Contains: %1 + Contains: %1 + + +- ++ + Original file + Original file + + +- ++ + Size: %1 + Size: %1 + + +- ++ + Target folder + Target folder + + +- ++ ++ In data statistics ... ++ ++ ++ ++ + Target file + Target file + + +- ++ + Syncing data + Syncing data + + +- ++ + Please wait + Please wait + + +- ++ + Keep both + button + Keep both + + +- ++ + Skip + button + Skip + + +- +- ++ ++ + Replace + button + Replace + + +- ++ + Do not ask again + Do not ask again + + +- ++ + Retry + button + Retry + + +- ++ + Merge + button + Merge +@@ -3189,7 +3209,7 @@ + Enter a password to protect shared folders + + +- ++ + Set a password on the shared folder for non-anonymous access + Set a password on the shared folder for non-anonymous access + +@@ -3248,38 +3268,38 @@ + + dfmplugin_burn::AbstractBurnJob + +- ++ + Burning disc %1, please wait... + Burning disc %1, please wait... + + +- ++ + Writing data... + Writing data... + + +- ++ + Verifying data... + Verifying data... + + +- +- ++ ++ + Data verification successful. + Data verification successful. + + +- ++ + Burn process completed + Burn process completed + + +- ++ + The device was not safely unmounted + The device was not safely unmounted + + +- ++ + Disk is busy, cannot unmount now + Disk is busy, cannot unmount now + +@@ -3297,28 +3317,10 @@ + Mount error: unsupported image format + + +- +- dfmplugin_burn::BurnFilesAuditLogJob +- +- +- ID=%1, DateTime=%2, Burner=%3, DiscType=%4, Result=%5, User=%6, FileName=%7, FileSize=%8, FileType=%9 +- ID=%1, DateTime=%2, Burner=%3, DiscType=%4, Result=%5, User=%6, FileName=%7, FileSize=%8, FileType=%9 +- +- +- +- Success +- Success +- +- +- +- Failed +- Failed +- +- + + dfmplugin_burn::BurnISOFilesJob + +- ++ + The file name or the path is too long. Please shorten the file name or the path and try again. + The file name or the path is too long. Please shorten the file name or the path and try again. + +@@ -3326,71 +3328,71 @@ + + dfmplugin_burn::BurnJobManager + +- ++ + OK + button + OK + + +- ++ + Disc erase failed + Disc erase failed + + +- ++ + Burn process failed + Burn process failed + + +- ++ + Data verification failed + Data verification failed + + +- ++ + %1: %2 + %1: %2 + + +- ++ + Show details + Show details + + +- ++ + Hide details + Hide details + + +- ++ + Error + Error + + +- ++ + Show details + button + Show details + + +- ++ + Confirm + button + Confirm + + +- ++ + View Image File + button + View Image File + + +- ++ + Image successfully created + Image successfully created + + +- ++ + Image creation failed + Image creation failed + +@@ -3441,7 +3443,7 @@ + + dfmplugin_burn::BurnUDFFilesJob + +- ++ + The file name or the path is too long. Please shorten the file name or the path and try again. + The file name or the path is too long. Please shorten the file name or the path and try again. + +@@ -3449,12 +3451,12 @@ + + dfmplugin_burn::DumpISOImageJob + +- ++ + Creating an ISO image + Creating an ISO image + + +- ++ + to %1 + to %1 + +@@ -3486,7 +3488,7 @@ + + dfmplugin_burn::EraseJob + +- ++ + Erasing disc %1, please wait... + Erasing disc %1, please wait... + +@@ -3559,22 +3561,22 @@ + Computer + + +- ++ + %1 is read-only. Do you want to enable read and write permissions for it? + + + +- ++ + Once enabled, read/write permission will be granted permanently + + + +- ++ + Cancel + Cancel + + +- ++ + Enable Now + + +@@ -3638,7 +3640,7 @@ + + dfmplugin_computer::ProtocolEntryFileEntity + +- ++ + + %1 on %2 + +@@ -4073,7 +4075,7 @@ + + + +- Copy or Cut File failed,cause: %1 ++ Copy or Cut File failed, cause: %1 + + + +@@ -4111,23 +4113,23 @@ + + + +- ++ + Failed to create the directory + Failed to create the directory + + +- ++ + Failed to create the file + + + +- ++ + link file error + + + +- +- ++ ++ + Failed to modify file permissions + + +@@ -4434,12 +4436,12 @@ + + dfmplugin_propertydialog::CloseAllDialog + +- ++ + Close all + Close all + + +- ++ + Total size: %1, %2 files + Total size: %1, %2 files + +@@ -4563,7 +4565,7 @@ + + + +- ++ + Allow to execute as program + Allow to execute as program + +@@ -4951,56 +4953,56 @@ + + dfmplugin_titlebar::ConnectToServerDialog + +- ++ + Connect to Server + Connect to Server + + +- +- +- ++ ++ ++ + Clear History + Clear History + + +- ++ + Unfavorite + Unfavorite + + +- ++ + Cancel + button + Cancel + + +- ++ + Connect + button + Connect + + +- ++ + Charset Encoding + + + +- ++ + Default + + + +- ++ + My Favorites + My Favorites + + +- ++ + No favorites yet + + + +- ++ + Favorite + Favorite + +@@ -5855,7 +5857,7 @@ + dfmplugin_vault::VaultHelper + + +- ++ + Vault + Vault + +@@ -5865,7 +5867,7 @@ + Vault not available because cryfs not installed! + + +- ++ + A task is in progress, so it cannot perform your operation + A task is in progress, so it cannot perform your operation + +@@ -5996,22 +5998,22 @@ + + dfmplugin_workspace::FileViewModel + +- ++ + Name + Name + + +- ++ + Time modified + Time modified + + +- ++ + Size + Size + + +- ++ + Type + Type + +diff --git a/translations/dde-file-manager_zh_CN.ts b/translations/dde-file-manager_zh_CN.ts +index a6659933b..605c6fb40 100644 +--- a/translations/dde-file-manager_zh_CN.ts ++++ b/translations/dde-file-manager_zh_CN.ts +@@ -1,4 +1,6 @@ +- ++ ++ ++ + + AccessControlDBus + +@@ -15,12 +17,12 @@ + + Application + +- ++ + File Manager + 文件管理器 + + +- ++ + File Manager is a powerful and easy-to-use file management tool, featured with searching, copying, trash, compression/decompression, file property and other useful functions. + 文件管理器是一款功能强大的文件管理工具,它包括搜索、复制、回收站、压缩/解压缩,文件属性等管理功能。 + +@@ -107,7 +109,7 @@ + + MimeTypeDisplayManager + +- ++ + Unknown + 未知 + +@@ -148,24 +150,24 @@ + 若想确认继续操作是否安全,请联系系统管理员。 + + +- ++ + + + System Disk + 系统盘 + + +- ++ + Data Disk + 数据盘 + + +- ++ + Blank %1 Disc + 空白%1光盘 + + +- ++ + + + +@@ -173,17 +175,17 @@ + 未知 + + +- ++ + %1 Drive + %1 驱动器 + + +- ++ + %1 Encrypted + %1 已加密 + + +- ++ + %1 Volume + %1 卷 + +@@ -310,12 +312,12 @@ + 有%1个任务正在进行 + + +- ++ + %1 item + %1 项 + + +- ++ + %1 items + %1 项 + +@@ -325,20 +327,20 @@ + 无法找到链接目标文件 + + +- ++ + + File has been moved or deleted + 文件已被移动或删除 + + +- ++ + +- ++ + You do not have permission to access this folder + 您没有权限访问该文件夹 + + +- ++ + + You do not have permission to traverse files in it + 您没有权限遍历子文件 +@@ -887,14 +889,14 @@ + + + +- ++ + + Access denied + 禁止访问 + + + +- ++ + Confirm + button + 确 定 +@@ -1138,8 +1140,8 @@ + 未知错误 + + +- +- ++ ++ + Close + button + 关 闭 +@@ -1392,7 +1394,7 @@ + 编辑地址 + + +- ++ + Unable to open items in the trash, please restore it first + 无法打开回收站中的项目,请先还原 + +@@ -1502,7 +1504,7 @@ + 正在搜索... + + +- ++ + My Vault + 我的保险箱 + +@@ -1676,6 +1678,26 @@ + File is busy + 文件繁忙 + ++ ++ ++ Device disconnected ++ ++ ++ ++ ++ ID=%1, DateTime=%2, Burner=%3, DiscType=%4, Result=%5, User=%6, FileName=%7, FileSize=%8, FileType=%9 ++ ID=%1, 刻录时间=%2, 刻录机型号=%3, 光盘属性=%4, 刻录状态=%5, 计算机账户=%6, 文件名称=%7, 文件大小=%8, 文件类型=%9 ++ ++ ++ ++ Success ++ 成功 ++ ++ ++ ++ Failed ++ 失败 ++ + + + ddplugin_canvas::CanvasMenuScene +@@ -3030,52 +3052,52 @@ + + dfmbase::SystemPathUtil + +- ++ + Home + 主目录 + + +- ++ + Desktop + 桌面 + + +- ++ + Videos + 视频 + + +- ++ + Music + 音乐 + + +- ++ + Pictures + 图片 + + +- ++ + Documents + 文档 + + +- ++ + Downloads + 下载 + + +- ++ + Trash + 回收站 + + +- ++ + System Disk + 系统盘 + + +- ++ + Recent + 最近使用 + +@@ -3093,87 +3115,87 @@ + 在显示冲突信息功能中创建目标文件%1信息失败! + + +- ++ + Time modified: %1 + 修改时间:%1 + + +- +- In data statistics +- +- +- +- ++ + Original folder + 原始文件夹 + + +- ++ + Contains: %1 + 个数:%1 + + +- ++ + Original file + 原始文件 + + +- ++ + Size: %1 + 大小:%1 + + +- ++ + Target folder + 目标文件夹 + + +- ++ ++ In data statistics ... ++ ++ ++ ++ + Target file + 目标文件 + + +- ++ + Syncing data + 数据同步中 + + +- ++ + Please wait + 请稍候 + + +- ++ + Keep both + button + 共 存 + + +- ++ + Skip + button + 跳 过 + + +- +- ++ ++ + Replace + button + 替 换 + + +- ++ + Do not ask again + 不再询问 + + +- ++ + Retry + button + 重 试 + + +- ++ + Merge + button + 合 并 +@@ -3187,7 +3209,7 @@ + 请输入共享密码 + + +- ++ + Set a password on the shared folder for non-anonymous access + 非匿名访问必须设置共享密码 + +@@ -3246,38 +3268,38 @@ + + dfmplugin_burn::AbstractBurnJob + +- ++ + Burning disc %1, please wait... + 正在刻录到%1,请稍候... + + +- ++ + Writing data... + 正在写入数据... + + +- ++ + Verifying data... + 正在校验数据... + + +- +- ++ ++ + Data verification successful. + 数据验证成功。 + + +- ++ + Burn process completed + 刻录完成 + + +- ++ + The device was not safely unmounted + 设备没有正常卸载 + + +- ++ + Disk is busy, cannot unmount now + 磁盘文件被占用,无法卸载 + +@@ -3295,28 +3317,10 @@ + 挂载错误,镜像文件格式不支持 + + +- +- dfmplugin_burn::BurnFilesAuditLogJob +- +- +- ID=%1, DateTime=%2, Burner=%3, DiscType=%4, Result=%5, User=%6, FileName=%7, FileSize=%8, FileType=%9 +- ID=%1, 刻录时间=%2, 刻录机型号=%3, 光盘属性=%4, 刻录状态=%5, 计算机账户=%6, 文件名称=%7, 文件大小=%8, 文件类型=%9 +- +- +- +- Success +- 成功 +- +- +- +- Failed +- 失败 +- +- + + dfmplugin_burn::BurnISOFilesJob + +- ++ + The file name or the path is too long. Please shorten the file name or the path and try again. + 文件名或路径太长,请调整命名或路径长度后重试 + +@@ -3324,71 +3328,71 @@ + + dfmplugin_burn::BurnJobManager + +- ++ + OK + button + 确 定 + + +- ++ + Disc erase failed + 擦除失败 + + +- ++ + Burn process failed + 刻录失败 + + +- ++ + Data verification failed + 数据校验失败 + + +- ++ + %1: %2 + %1:%2 + + +- ++ + Show details + 显示详情 + + +- ++ + Hide details + 隐藏详情 + + +- ++ + Error + 错误信息 + + +- ++ + Show details + button + 显示详情 + + +- ++ + Confirm + button + 确 定 + + +- ++ + View Image File + button + 查看镜像文件 + + +- ++ + Image successfully created + 镜像创建成功 + + +- ++ + Image creation failed + 镜像创建失败 + +@@ -3439,7 +3443,7 @@ + + dfmplugin_burn::BurnUDFFilesJob + +- ++ + The file name or the path is too long. Please shorten the file name or the path and try again. + 文件名或路径太长,请调整命名或路径长度后重试 + +@@ -3447,12 +3451,12 @@ + + dfmplugin_burn::DumpISOImageJob + +- ++ + Creating an ISO image + 正在创建镜像文件 + + +- ++ + to %1 + 到%1 + +@@ -3484,7 +3488,7 @@ + + dfmplugin_burn::EraseJob + +- ++ + Erasing disc %1, please wait... + 正在擦除%1,请稍候... + +@@ -3557,22 +3561,22 @@ + 计算机 + + +- ++ + %1 is read-only. Do you want to enable read and write permissions for it? + %1为只读权限,是否开启读写权限? + + +- ++ + Once enabled, read/write permission will be granted permanently + 开启后将永久获得读写权限 + + +- ++ + Cancel + 取 消 + + +- ++ + Enable Now + 确认开启 + +@@ -3636,7 +3640,7 @@ + + dfmplugin_computer::ProtocolEntryFileEntity + +- ++ + + %1 on %2 + %2 上的 %1 +@@ -3945,7 +3949,7 @@ + + + Failed to move the file %1 to trash +- ++ + + + +@@ -4022,7 +4026,7 @@ + + + Copy or Cut File failed! +- ++ + + + +@@ -4052,7 +4056,7 @@ + + + Failed to move the file %1 to trash, cause: %2 +- ++ + + + +@@ -4071,8 +4075,8 @@ + + + +- Copy or Cut File failed,cause: %1 +- ++ Copy or Cut File failed, cause: %1 ++ + + + +@@ -4109,23 +4113,23 @@ + 文件重命名错误 + + +- ++ + Failed to create the directory + 目录创建失败 + + +- ++ + Failed to create the file + 创建文件失败 + + +- ++ + link file error + 链接文件错误 + + +- +- ++ ++ + Failed to modify file permissions + 修改文件权限失败 + +@@ -4432,12 +4436,12 @@ + + dfmplugin_propertydialog::CloseAllDialog + +- ++ + Close all + 关闭全部 + + +- ++ + Total size: %1, %2 files + 总容量 %1,总文件数量 %2个 + +@@ -4561,7 +4565,7 @@ + + + +- ++ + Allow to execute as program + 允许以程序执行 + +@@ -4949,56 +4953,56 @@ + + dfmplugin_titlebar::ConnectToServerDialog + +- ++ + Connect to Server + 连接到服务器 + + +- +- +- ++ ++ ++ + Clear History + 清除最近使用的服务器 + + +- ++ + Unfavorite + 取消收藏 + + +- ++ + Cancel + button + 取 消 + + +- ++ + Connect + button + 连 接 + + +- ++ + Charset Encoding + 字符集编码 + + +- ++ + Default + 默认 + + +- ++ + My Favorites + 我收藏的服务器 + + +- ++ + No favorites yet + 暂无收藏 + + +- ++ + Favorite + 收藏 + +@@ -5853,7 +5857,7 @@ + dfmplugin_vault::VaultHelper + + +- ++ + Vault + 保险箱 + +@@ -5863,7 +5867,7 @@ + 因未安装cryfs,保险箱不可用 + + +- ++ + A task is in progress, so it cannot perform your operation + 当前有任务正在进行,无法执行此操作 + +@@ -5994,22 +5998,22 @@ + + dfmplugin_workspace::FileViewModel + +- ++ + Name + 名称 + + +- ++ + Time modified + 修改时间 + + +- ++ + Size + 大小 + + +- ++ + Type + 类型 + +@@ -6147,112 +6151,112 @@ + + + Available sizes: +- ++ + + + + Custom Size +- ++ + + + + Device Pixel Ratio: +- ++ + + + + Theme: +- ++ + + + + Light +- ++ + + + + Dark +- ++ + + + + Mode: +- ++ + + + + Normal +- ++ 正常视图 + + + + Disabled +- ++ + + + + Hovered +- ++ + + + + Pressed +- ++ + + + + Palette +- ++ + + + + Current mode icon does not support the palette +- ++ + + + + Foreground: +- ++ + + + + Background: +- ++ + + + + Highlight: +- ++ + + + + HighlightForeground: +- ++ + + + + Background Color: +- ++ + + + + White +- ++ + + + + Black +- ++ + + + + Transparent +- ++ + + + + Custom +- ++ + + + +@@ -6302,4 +6306,4 @@ + 未知专辑 + + +- +\ No newline at end of file ++ +-- +2.39.3 + diff --git a/0004-fix-io-After-sending-a-folder-to-the-desktop-with-s.patch b/0004-fix-io-After-sending-a-folder-to-the-desktop-with-s.patch new file mode 100644 index 0000000000000000000000000000000000000000..9da751d65ee1dc9032e28969f323e32b6a950314 --- /dev/null +++ b/0004-fix-io-After-sending-a-folder-to-the-desktop-with-s.patch @@ -0,0 +1,75 @@ +From a17984409863fda4cbc83f7765ad5d74ae237076 Mon Sep 17 00:00:00 2001 +From: liyigang +Date: Thu, 21 Sep 2023 13:33:04 +0800 +Subject: [PATCH 10164/10526] fix: [io]After sending a folder to the desktop + with smb service mounted, the link target file cannot be found when + previewing it with space. + +After reboot, it is not mounted, and when it is mounted again, the desktop does not listen to the protocol device, so it doesn't update the fileinfo. so there is something wrong with the attribute. + +Log: After sending a folder to the desktop with smb service mounted, the link target file cannot be found when previewing it with space. +Bug: https://pms.uniontech.com/bug-view-219383.html +--- + src/dfm-base/file/local/asyncfileinfo.cpp | 5 ++++- + .../filepreview/utils/previewdialogmanager.cpp | 10 ++++++++-- + .../core/ddplugin-canvas/model/fileinfomodel.cpp | 3 +++ + 3 files changed, 15 insertions(+), 3 deletions(-) + +diff --git a/src/dfm-base/file/local/asyncfileinfo.cpp b/src/dfm-base/file/local/asyncfileinfo.cpp +index 56c9669cf..1d7ad57d8 100644 +--- a/src/dfm-base/file/local/asyncfileinfo.cpp ++++ b/src/dfm-base/file/local/asyncfileinfo.cpp +@@ -618,8 +618,11 @@ QIcon AsyncFileInfoPrivate::defaultIcon() + const auto &&target = q->pathOf(PathInfoType::kSymLinkTarget); + if (!target.isEmpty() && target != q->pathOf(PathInfoType::kFilePath)) { + FileInfoPointer info = InfoFactory::create(QUrl::fromLocalFile(target)); +- if (info) ++ if (info) { ++ if (info->fileIcon().name() == "unknown") ++ info->customData(Global::ItemRoles::kItemFileRefreshIcon); + icon = info->fileIcon(); ++ } + } + } + +diff --git a/src/plugins/common/dfmplugin-preview/filepreview/utils/previewdialogmanager.cpp b/src/plugins/common/dfmplugin-preview/filepreview/utils/previewdialogmanager.cpp +index de35e1ab9..b4c012b2d 100644 +--- a/src/plugins/common/dfmplugin-preview/filepreview/utils/previewdialogmanager.cpp ++++ b/src/plugins/common/dfmplugin-preview/filepreview/utils/previewdialogmanager.cpp +@@ -44,11 +44,17 @@ void PreviewDialogManager::showPreviewDialog(const quint64 winId, const QList(targetUrl); +- if (!linkInfo || !linkInfo->exists()) { ++ dfmio::DFile file(targetUrl); ++ if (!file.exists()) { + hasInvalidSymlink = true; + continue; + } ++ ++ const FileInfoPointer linkInfo = InfoFactory::create(targetUrl); ++ if (linkInfo && !linkInfo->exists() && linkInfo->timeOf(TimeInfoType::kCreateTimeSecond) == 0) { ++ info->refresh(); ++ linkInfo->refresh(); ++ } + } + } + } +diff --git a/src/plugins/desktop/core/ddplugin-canvas/model/fileinfomodel.cpp b/src/plugins/desktop/core/ddplugin-canvas/model/fileinfomodel.cpp +index e3fe6a621..cf40ef026 100644 +--- a/src/plugins/desktop/core/ddplugin-canvas/model/fileinfomodel.cpp ++++ b/src/plugins/desktop/core/ddplugin-canvas/model/fileinfomodel.cpp +@@ -56,6 +56,9 @@ void FileInfoModelPrivate::resetData(const QList &urls) + QMap fileMaps; + for (const QUrl &child : urls) { + if (auto itemInfo = FileCreator->createFileInfo(child)) { ++ if (itemInfo->isAttributes(OptInfoType::kIsSymLink) && ++ !FileUtils::isLocalDevice(QUrl::fromLocalFile(itemInfo->pathOf(PathInfoType::kSymLinkTarget)))) ++ itemInfo->refresh(); + fileUrls.append(itemInfo->urlOf(UrlInfoType::kUrl)); + fileMaps.insert(itemInfo->urlOf(UrlInfoType::kUrl), itemInfo); + } +-- +2.39.3 + diff --git a/0004-mount-cannot-mount-a-erased-bd-re-disc.patch b/0004-mount-cannot-mount-a-erased-bd-re-disc.patch new file mode 100644 index 0000000000000000000000000000000000000000..9e22d3cb43a9a40ae624f9264eaec8cad0f6e788 --- /dev/null +++ b/0004-mount-cannot-mount-a-erased-bd-re-disc.patch @@ -0,0 +1,31 @@ +From 5d1efd93f85783a280e0c084282872ee87cca339 Mon Sep 17 00:00:00 2001 +From: zhangxianting +Date: Mon, 26 Aug 2024 17:17:33 +0800 +Subject: [PATCH] fix: [mount/optical] cannot mount a erased bd-re disc + +--- + src/dfm-base/base/device/deviceutils.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/dfm-base/base/device/deviceutils.cpp b/src/dfm-base/base/device/deviceutils.cpp +index cd2135b..d80fc45 100644 +--- a/src/dfm-base/base/device/deviceutils.cpp ++++ b/src/dfm-base/base/device/deviceutils.cpp +@@ -215,12 +215,12 @@ bool DeviceUtils::isWorkingOpticalDiscId(const QString &id) + + bool DeviceUtils::isBlankOpticalDisc(const QString &id) + { +- // for dvd+rw/dvd-rw disc, erase operation only overwrite some blocks which used to present filesystem, ++ // for dvd+rw/dvd-rw/bd-re disc, erase operation only overwrite some blocks which used to present filesystem, + // so the blank field is still false even if it can be write datas from the beginning, + auto &&map = DevProxyMng->queryBlockInfo(id); + bool isBlank { map[kOpticalBlank].toBool() }; + auto mediaType { static_cast(map[kOpticalMediaType].toUInt()) }; +- if (mediaType == MediaType::kDVD_PLUS_RW || mediaType == MediaType::kDVD_RW) ++ if (mediaType == MediaType::kDVD_PLUS_RW || mediaType == MediaType::kDVD_RW || mediaType == MediaType::kBD_RE) + isBlank |= map[kSizeTotal].toULongLong() == map[kSizeFree].toULongLong(); + + return isBlank; +-- +2.39.3 + diff --git a/0005-fix-workspace-Creating-a-wps-file-in-red-disk-space.patch b/0005-fix-workspace-Creating-a-wps-file-in-red-disk-space.patch new file mode 100644 index 0000000000000000000000000000000000000000..de6e078b00128e4d8cc20d4e052f0fd9fb65946a --- /dev/null +++ b/0005-fix-workspace-Creating-a-wps-file-in-red-disk-space.patch @@ -0,0 +1,220 @@ +From 0c4501f3c404f2758e6f10eac9422010865477e7 Mon Sep 17 00:00:00 2001 +From: liyigang +Date: Mon, 25 Sep 2023 20:36:44 +0800 +Subject: [PATCH 10167/10526] fix: [workspace]Creating a wps file in red disk + space doesn't show up, it needs to be refreshed before it shows up + +In the current interface, safely uninstalled the USB flash drive, did not remove the monitor, used the previous one, and has been using the monitor in the cache since then. This resulted in the files not being monitored. + +Log: Creating a wps file in red disk space doesn't show up, it needs to be refreshed before it shows up +Bug: https://pms.uniontech.com/bug-view-221223.html +--- + include/dfm-base/base/schemefactory.h | 2 +- + src/dfm-base/file/local/asyncfileinfo.cpp | 9 ++++++--- + src/dfm-base/file/local/asyncfileinfo.h | 3 ++- + src/dfm-base/interfaces/abstractfilewatcher.cpp | 2 +- + src/dfm-base/utils/fileinfohelper.cpp | 9 ++++++++- + src/dfm-base/utils/fileinfohelper.h | 1 + + .../core/dfmplugin-workspace/models/rootinfo.cpp | 15 +++++++++++++-- + .../core/dfmplugin-workspace/models/rootinfo.h | 1 + + .../utils/traversaldirthreadmanager.cpp | 3 ++- + 9 files changed, 35 insertions(+), 10 deletions(-) + +diff --git a/include/dfm-base/base/schemefactory.h b/include/dfm-base/base/schemefactory.h +index 71b95ea34..7ffbbdfef 100644 +--- a/include/dfm-base/base/schemefactory.h ++++ b/include/dfm-base/base/schemefactory.h +@@ -206,7 +206,7 @@ public: + QString *errorString = nullptr) + { + if (!url.isValid()) { +- qWarning() << "url is unvalid !!! url = " << url; ++ qWarning() << "url is invalid !!! url = " << url; + return nullptr; + } + +diff --git a/src/dfm-base/file/local/asyncfileinfo.cpp b/src/dfm-base/file/local/asyncfileinfo.cpp +index 1d7ad57d8..33e8f68a9 100644 +--- a/src/dfm-base/file/local/asyncfileinfo.cpp ++++ b/src/dfm-base/file/local/asyncfileinfo.cpp +@@ -524,18 +524,21 @@ void AsyncFileInfo::removeNotifyUrl(const QUrl &url, const QString &infoPtr) + d->notifyUrls.remove(url, infoPtr); + } + +-bool AsyncFileInfo::cacheAsyncAttributes() ++int AsyncFileInfo::cacheAsyncAttributes() + { + assert(qApp->thread() != QThread::currentThread()); + auto dfmFileInfo = d->dfmFileInfo; + if (d->tokenKey != quintptr(dfmFileInfo.data())) +- return false; ++ return -1; ++ ++ if (d->cacheingAttributes) ++ return 0; + + if (!d->cacheingAttributes) + d->cacheingAttributes = true; + d->cacheAllAttributes(); + d->cacheingAttributes = false; +- return true; ++ return 1; + } + + bool AsyncFileInfo::asyncQueryDfmFileInfo(int ioPriority, FileInfo::initQuerierAsyncCallback func, void *userData) +diff --git a/src/dfm-base/file/local/asyncfileinfo.h b/src/dfm-base/file/local/asyncfileinfo.h +index 7311dae88..d787d49e4 100644 +--- a/src/dfm-base/file/local/asyncfileinfo.h ++++ b/src/dfm-base/file/local/asyncfileinfo.h +@@ -182,7 +182,8 @@ public: + QMultiMap notifyUrls() const; + void setNotifyUrl(const QUrl &url, const QString &infoPtr); + void removeNotifyUrl(const QUrl &url, const QString &infoPtr); +- bool cacheAsyncAttributes(); ++ // less 0,cache fialed, equeal 0,another cache, bigger 0 cache success ++ int cacheAsyncAttributes(); + bool asyncQueryDfmFileInfo(int ioPriority = 0, initQuerierAsyncCallback func = nullptr, void *userData = nullptr); + }; + } +diff --git a/src/dfm-base/interfaces/abstractfilewatcher.cpp b/src/dfm-base/interfaces/abstractfilewatcher.cpp +index cc85f0fe4..7cddeb4e4 100644 +--- a/src/dfm-base/interfaces/abstractfilewatcher.cpp ++++ b/src/dfm-base/interfaces/abstractfilewatcher.cpp +@@ -108,7 +108,7 @@ bool AbstractFileWatcher::startWatcher() + bool AbstractFileWatcher::stopWatcher() + { + if (!d->started) +- return false; ++ return true; + + if (d->stop()) { + d->started = false; +diff --git a/src/dfm-base/utils/fileinfohelper.cpp b/src/dfm-base/utils/fileinfohelper.cpp +index c7658ee5b..5c7044032 100644 +--- a/src/dfm-base/utils/fileinfohelper.cpp ++++ b/src/dfm-base/utils/fileinfohelper.cpp +@@ -47,7 +47,14 @@ void FileInfoHelper::threadHandleDfmFileInfo(const QSharedPointer dfil + if (asyncInfo.isNull()) + return; + +- if (!asyncInfo->cacheAsyncAttributes()) ++ auto resluts = asyncInfo->cacheAsyncAttributes(); ++ ++ while (resluts == 0) { ++ QThread::msleep(50); ++ resluts = asyncInfo->cacheAsyncAttributes(); ++ } ++ ++ if (resluts < 0) + return; + + emit fileRefreshFinished(dfileInfo->fileUrl(), QString::number(quintptr(dfileInfo.data()), 16), false); +diff --git a/src/dfm-base/utils/fileinfohelper.h b/src/dfm-base/utils/fileinfohelper.h +index 6c153fd31..7302aeff7 100644 +--- a/src/dfm-base/utils/fileinfohelper.h ++++ b/src/dfm-base/utils/fileinfohelper.h +@@ -59,6 +59,7 @@ private: + QSharedPointer thread { nullptr }; + QSharedPointer worker { nullptr }; + std::atomic_bool stoped { false }; ++ DThreadList qureingInfo; + QThreadPool pool; + }; + } +diff --git a/src/plugins/filemanager/core/dfmplugin-workspace/models/rootinfo.cpp b/src/plugins/filemanager/core/dfmplugin-workspace/models/rootinfo.cpp +index c92b0ab45..79f94f1f3 100644 +--- a/src/plugins/filemanager/core/dfmplugin-workspace/models/rootinfo.cpp ++++ b/src/plugins/filemanager/core/dfmplugin-workspace/models/rootinfo.cpp +@@ -30,6 +30,7 @@ RootInfo::RootInfo(const QUrl &u, const bool canCache, QObject *parent) + + RootInfo::~RootInfo() + { ++ disconnect(); + cancelWatcherEvent = true; + watcherEventFuture.waitForFinished(); + for (const auto &thread : traversalThreads) { +@@ -93,6 +94,9 @@ void RootInfo::startWork(const QString &key, const bool getCache) + + void RootInfo::startWatcher() + { ++ if (needStartWatcher == false) ++ return; ++ needStartWatcher = false; + if (watcher) + watcher->disconnect(this); + +@@ -112,7 +116,7 @@ void RootInfo::startWatcher() + connect(watcher.data(), &AbstractFileWatcher::fileRename, + this, &RootInfo::dofileMoved); + +- watcher->startWatcher(); ++ watcher->restartWatcher(); + } + + int RootInfo::clearTraversalThread(const QString &key) +@@ -133,7 +137,8 @@ int RootInfo::clearTraversalThread(const QString &key) + if (thread->traversalThread->isRunning()) + traversaling = false; + thread->traversalThread->quit(); +- ++ if (traversalThreads.isEmpty()) ++ needStartWatcher = true; + return traversalThreads.count(); + } + +@@ -227,6 +232,8 @@ void RootInfo::doWatcherEvent() + if (event.second == kAddFile) + continue; + else if (event.second == kRmFile) { ++ emit InfoCacheController::instance().removeCacheFileInfo({ fileUrl }); ++ WatcherCache::instance().removeCacheWatcherByParent(fileUrl); + emit requestCloseTab(fileUrl); + break; + } +@@ -241,6 +248,8 @@ void RootInfo::doWatcherEvent() + updateChild(fileUrl); + } else { + removeChildren({ fileUrl }); ++ emit InfoCacheController::instance().removeCacheFileInfo({ fileUrl }); ++ WatcherCache::instance().removeCacheWatcherByParent(fileUrl); + emit requestCloseTab(fileUrl); + } + } +@@ -312,6 +321,8 @@ void RootInfo::handleTraversalSort(const QString &travseToken) + + void RootInfo::handleGetSourceData(const QString ¤tToken) + { ++ if (needStartWatcher) ++ startWatcher(); + QList newDatas = sourceDataList; + emit sourceDatas(currentToken, newDatas, originSortRole, originSortOrder, originMixSort, !traversaling); + } +diff --git a/src/plugins/filemanager/core/dfmplugin-workspace/models/rootinfo.h b/src/plugins/filemanager/core/dfmplugin-workspace/models/rootinfo.h +index b7160dc95..f13215d75 100644 +--- a/src/plugins/filemanager/core/dfmplugin-workspace/models/rootinfo.h ++++ b/src/plugins/filemanager/core/dfmplugin-workspace/models/rootinfo.h +@@ -143,6 +143,7 @@ private: + + QList discardedThread {}; + QList> threads {}; ++ std::atomic_bool needStartWatcher { true }; + }; + } + +diff --git a/src/plugins/filemanager/core/dfmplugin-workspace/utils/traversaldirthreadmanager.cpp b/src/plugins/filemanager/core/dfmplugin-workspace/utils/traversaldirthreadmanager.cpp +index ceb35efb7..bc7ff47aa 100644 +--- a/src/plugins/filemanager/core/dfmplugin-workspace/utils/traversaldirthreadmanager.cpp ++++ b/src/plugins/filemanager/core/dfmplugin-workspace/utils/traversaldirthreadmanager.cpp +@@ -114,7 +114,8 @@ int TraversalDirThreadManager::iteratorOneByOne(const QElapsedTimer &timere) + return 0; + } + +- Q_EMIT iteratorInitFinished(); ++ if (!future) ++ Q_EMIT iteratorInitFinished(); + + if (!timer) + timer = new QElapsedTimer(); +-- +2.39.3 + diff --git a/0006-fix-io-Non-empty-folders-in-virtual-paths-incorrect.patch b/0006-fix-io-Non-empty-folders-in-virtual-paths-incorrect.patch new file mode 100644 index 0000000000000000000000000000000000000000..1dedda78ffbcfbfebc01b594caaf88f3f79cc819 --- /dev/null +++ b/0006-fix-io-Non-empty-folders-in-virtual-paths-incorrect.patch @@ -0,0 +1,44 @@ +From 31dcc00e389da7b0539e2b0b36908f23baa43ad1 Mon Sep 17 00:00:00 2001 +From: liyigang +Date: Thu, 28 Sep 2023 14:29:26 +0800 +Subject: [PATCH 10182/10526] fix: [io]Non-empty folders in virtual paths, + incorrect file information statistics + +Virtual directory called fts, incorrect path. Need to use iterator to iteratively query the number of files + +Log: Non-empty folders in virtual paths, incorrect file information statistics +Bug: https://pms.uniontech.com/bug-view-221969.html +--- + src/dfm-base/utils/fileinfohelper.h | 1 - + src/dfm-base/utils/filestatisticsjob.cpp | 3 ++- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/dfm-base/utils/fileinfohelper.h b/src/dfm-base/utils/fileinfohelper.h +index 7302aeff7..6c153fd31 100644 +--- a/src/dfm-base/utils/fileinfohelper.h ++++ b/src/dfm-base/utils/fileinfohelper.h +@@ -59,7 +59,6 @@ private: + QSharedPointer thread { nullptr }; + QSharedPointer worker { nullptr }; + std::atomic_bool stoped { false }; +- DThreadList qureingInfo; + QThreadPool pool; + }; + } +diff --git a/src/dfm-base/utils/filestatisticsjob.cpp b/src/dfm-base/utils/filestatisticsjob.cpp +index 46059df36..12bb95a60 100644 +--- a/src/dfm-base/utils/filestatisticsjob.cpp ++++ b/src/dfm-base/utils/filestatisticsjob.cpp +@@ -561,7 +561,8 @@ void FileStatisticsJob::run() + d->sizeInfo.reset(new FileUtils::FilesSizeInfo()); + if (d->sourceUrlList.isEmpty()) + return; +- if (!FileUtils::isLocalDevice(d->sourceUrlList.first())) { ++ if (d->sourceUrlList.first().scheme() != Global::Scheme::kFile ++ || !FileUtils::isLocalDevice(d->sourceUrlList.first())) { + statistcsOtherFileSystem(); + return; + } +-- +2.39.3 + diff --git a/0007-fix-io-Select-different-disks-successively-to-right.patch b/0007-fix-io-Select-different-disks-successively-to-right.patch new file mode 100644 index 0000000000000000000000000000000000000000..236a83e0e274dea09b13c1acc73d224a70b3c701 --- /dev/null +++ b/0007-fix-io-Select-different-disks-successively-to-right.patch @@ -0,0 +1,369 @@ +From d9bfe2ed09884fcde03b904d75b25cc980ac9791 Mon Sep 17 00:00:00 2001 +From: liyigang +Date: Thu, 19 Oct 2023 20:06:20 +0800 +Subject: [PATCH 10206/10526] fix: [io]Select different disks successively to + right-click on them to view the properties, and open the second properties + window to stop the file statistics. + +When fts counts files, multiple threads count at the same time and fts quits. Delete fts statistics. + +Log: Select different disks successively to right-click on them to view the properties, and open the second properties window to stop the file statistics. +Bug: https://pms.uniontech.com/bug-view-224111.html +--- + src/dfm-base/utils/filestatisticsjob.cpp | 262 +++--------------- + src/dfm-base/utils/filestatisticsjob.h | 1 - + .../utils/private/filestatissticsjob_p.h | 6 - + 3 files changed, 39 insertions(+), 230 deletions(-) + +diff --git a/src/dfm-base/utils/filestatisticsjob.cpp b/src/dfm-base/utils/filestatisticsjob.cpp +index 12bb95a60..ad02b420b 100644 +--- a/src/dfm-base/utils/filestatisticsjob.cpp ++++ b/src/dfm-base/utils/filestatisticsjob.cpp +@@ -116,46 +116,7 @@ void FileStatisticsJobPrivate::processFile(const QUrl &url, const bool followLin + if (!checkInode(info)) + return; + +- if (info->isAttributes(OptInfoType::kIsFile)) { +- do { +- auto isSyslink = info->isAttributes(OptInfoType::kIsSymLink); +- if (isSyslink) { +- const auto &symLinkTargetUrl = QUrl::fromLocalFile(info->pathOf(PathInfoType::kSymLinkTarget)); +- if (sizeInfo->allFiles.contains(symLinkTargetUrl) || fileStatistics.contains(symLinkTargetUrl)) { +- return; +- } +- fileStatistics << symLinkTargetUrl; +- } +- +- // ###(zccrs): skip the file,os file +- if (UniversalUtils::urlEquals(info->urlOf(UrlInfoType::kUrl), QUrl::fromLocalFile("/proc/kcore")) +- || UniversalUtils::urlEquals(info->urlOf(UrlInfoType::kUrl), QUrl::fromLocalFile("/dev/core"))) { +- break; +- } +- //skip os file Shortcut +- if (info->isAttributes(OptInfoType::kIsSymLink) +- && (skipPath.contains(info->pathOf(PathInfoType::kSymLinkTarget)))) { +- break; +- } +- +- const FileInfo::FileType &type = info->fileType(); +- +- if (!checkFileType(type)) +- break; +- +- auto size = info->size(); +- if (size > 0) { +- totalSize += size; +- emitSizeChanged(); +- } +- // fix bug 30548 ,以为有些文件大小为0,文件夹为空,size也为零,重新计算显示大小 +- // fix bug 202007010033【文件管理器】【5.1.2.10-1】【sp2】复制软连接的文件,进度条显示1% +- // 判断文件是否是链接文件 +- totalProgressSize += (size <= 0 || isSyslink) ? FileUtils::getMemoryPageSize() : size; +- } while (false); +- +- ++filesCount; +- } else { ++ if (info->isAttributes(OptInfoType::kIsDir)) { + // fix bug 30548 ,以为有些文件大小为0,文件夹为空,size也为零,重新计算显示大小 + totalProgressSize += FileUtils::getMemoryPageSize(); + if (info->isAttributes(OptInfoType::kIsSymLink)) { +@@ -199,73 +160,53 @@ void FileStatisticsJobPrivate::processFile(const QUrl &url, const bool followLin + } + } + +- if (!fileHints.testFlag(FileStatisticsJob::kSingleDepth)) ++ if (!fileHints.testFlag(FileStatisticsJob::kSingleDepth) && info->isAttributes(OptInfoType::kIsDir)) + directoryQueue << url; ++ + } while (false); +- } else if (!fileHints.testFlag(FileStatisticsJob::kSingleDepth)) { ++ } else if (!fileHints.testFlag(FileStatisticsJob::kSingleDepth) && info->isAttributes(OptInfoType::kIsDir)) { + directoryQueue << url; + } +- } +-} +- +-void FileStatisticsJobPrivate::processFileByFts(const QUrl &url, const bool followLink) +-{ +- // The files counted are not counted +- if (sizeInfo->allFiles.contains(url)) +- return; +- +- char *paths[2] = { nullptr, nullptr }; +- paths[0] = strdup(url.path().toUtf8().toStdString().data()); +- auto openflags = fileHints.testFlag(FileStatisticsJob::kExcludeSourceFile) ? FTS_COMFOLLOW : 0; +- FTS *fts = fts_open(paths, openflags, nullptr); +- +- if (nullptr == fts) { +- qWarning() << "open file by fts failed ! url = " << url << ", case " << strerror(errno); +- return; +- } +- if (paths[0]) +- free(paths[0]); +- +- auto singleDepth = fileHints.testFlag(FileStatisticsJob::kSingleDepth); +- while (1) { +- FTSENT *ent = fts_read(fts); +- if (nullptr == ent) +- break; +- +- if (!stateCheck()) +- break; +- +- if (!checkInode(ent, fts)) +- continue; +- +- QUrl currentUrl = QUrl::fromLocalFile(ent->fts_path); +- +- if (fileHints.testFlag(FileStatisticsJob::kExcludeSourceFile) && currentUrl.path() == url.path()) +- continue; ++ } else { ++ do { ++ auto isSyslink = info->isAttributes(OptInfoType::kIsSymLink); ++ if (isSyslink) { ++ const auto &symLinkTargetUrl = QUrl::fromLocalFile(info->pathOf(PathInfoType::kSymLinkTarget)); ++ if (sizeInfo->allFiles.contains(symLinkTargetUrl) || fileStatistics.contains(symLinkTargetUrl)) { ++ return; ++ } ++ fileStatistics << symLinkTargetUrl; ++ } + +- sizeInfo->allFiles.append(currentUrl); ++ // ###(zccrs): skip the file,os file ++ if (UniversalUtils::urlEquals(info->urlOf(UrlInfoType::kUrl), QUrl::fromLocalFile("/proc/kcore")) ++ || UniversalUtils::urlEquals(info->urlOf(UrlInfoType::kUrl), QUrl::fromLocalFile("/dev/core"))) { ++ break; ++ } ++ //skip os file Shortcut ++ if (info->isAttributes(OptInfoType::kIsSymLink) ++ && (skipPath.contains(info->pathOf(PathInfoType::kSymLinkTarget)))) { ++ break; ++ } + +- auto isLink = S_ISLNK(ent->fts_statp->st_mode); +- if (isLink) { +- statisticSysLink(currentUrl, fts, ent, singleDepth, followLink); +- continue; +- } ++ const FileInfo::FileType &type = info->fileType(); + +- if (skipPath.contains(ent->fts_path)) { +- filesCount++; +- continue; +- } ++ if (!checkFileType(type)) ++ break; + +- if (!S_ISDIR(ent->fts_statp->st_mode)) { +- statisticFile(ent); +- continue; +- } ++ auto size = info->size(); ++ if (size > 0) { ++ totalSize += size; ++ emitSizeChanged(); ++ } ++ // fix bug 30548 ,以为有些文件大小为0,文件夹为空,size也为零,重新计算显示大小 ++ // fix bug 202007010033【文件管理器】【5.1.2.10-1】【sp2】复制软连接的文件,进度条显示1% ++ // 判断文件是否是链接文件 ++ totalProgressSize += (size <= 0 || isSyslink) ? FileUtils::getMemoryPageSize() : size; ++ } while (false); + +- statisticDir(url, fts, singleDepth, ent); ++ ++filesCount; + } +- +- if (fts) +- fts_close(fts); + } + + void FileStatisticsJobPrivate::emitSizeChanged() +@@ -326,94 +267,6 @@ bool FileStatisticsJobPrivate::checkFileType(const FileInfo::FileType &fileType) + return true; + } + +-FileInfo::FileType FileStatisticsJobPrivate::getFileType(const uint mode) +-{ +- FileInfo::FileType fileType { FileInfo::FileType::kUnknown }; +- if (S_ISDIR(mode)) +- fileType = FileInfo::FileType(FileInfo::FileType::kDirectory); +- else if (S_ISCHR(mode)) +- fileType = FileInfo::FileType(FileInfo::FileType::kCharDevice); +- else if (S_ISBLK(mode)) +- fileType = FileInfo::FileType(FileInfo::FileType::kBlockDevice); +- else if (S_ISFIFO(mode)) +- fileType = FileInfo::FileType(FileInfo::FileType::kFIFOFile); +- else if (S_ISSOCK(mode)) +- fileType = FileInfo::FileType(FileInfo::FileType::kSocketFile); +- else if (S_ISREG(mode)) +- fileType = FileInfo::FileType(FileInfo::FileType::kRegularFile); +- +- return fileType; +-} +- +-void FileStatisticsJobPrivate::statisticDir(const QUrl &url, FTS *fts, const bool singleDepth, FTSENT *ent) +-{ +- if (sizeInfo->dirSize == 0) { +- sizeInfo->dirSize = ent->fts_statp->st_size == 0 +- ? FileUtils::getMemoryPageSize() +- : static_cast(ent->fts_statp->st_size); +- } +- totalProgressSize += FileUtils::getMemoryPageSize(); +- ++directoryCount; +- if (singleDepth && QString(ent->fts_path) != url.path()) +- fts_set(fts, ent, FTS_SKIP); +-} +- +-void FileStatisticsJobPrivate::statisticFile(FTSENT *ent) +-{ +- const FileInfo::FileType &fileType = getFileType(ent->fts_statp->st_mode); +- if (!checkFileType(fileType)) +- return; +- filesCount++; +- totalSize += ent->fts_statp->st_size; +- totalProgressSize += ent->fts_statp->st_size <= 0 ? FileUtils::getMemoryPageSize() : ent->fts_statp->st_size; +-} +- +-void FileStatisticsJobPrivate::statisticSysLink(const QUrl ¤tUrl, FTS *fts, FTSENT *ent, const bool singleDepth, const bool followLink) +-{ +- if (!singleDepth) { +- if (S_ISDIR(ent->fts_statp->st_mode)) { +- directoryCount++; +- } else { +- filesCount++; +- } +- totalSize += ent->fts_statp->st_size; +- return; +- } +- auto info = InfoFactory::create(currentUrl, Global::CreateFileInfoType::kCreateFileInfoSync); +- if (!info) { +- filesCount++; +- return; +- } +- const auto &symLinkTargetUrl = QUrl::fromLocalFile(info->pathOf(PathInfoType::kSymLinkTarget)); +- if (sizeInfo->allFiles.contains(symLinkTargetUrl) || fileStatistics.contains(symLinkTargetUrl)) { +- return; +- } +- if (skipPath.contains(symLinkTargetUrl.path())) { +- filesCount++; +- return; +- } +- +- if (info->isAttributes(OptInfoType::kIsFile)) { +- const FileInfo::FileType &type = info->fileType(); +- if (!checkFileType(type)) +- return; +- +- totalProgressSize += FileUtils::getMemoryPageSize(); +- fileStatistics << symLinkTargetUrl; +- filesCount++; +- totalSize += info->size(); +- return; +- } +- +- ++directoryCount; +- if (singleDepth) +- return; +- +- fileStatistics << symLinkTargetUrl; +- if (followLink) +- fts_set(fts, ent, FTS_SYMFOLLOW); +-} +- + bool FileStatisticsJobPrivate::checkInode(const FileInfoPointer info) + { + auto fileInode = info->extendAttributes(ExtInfoType::kInode).toULongLong(); +@@ -431,20 +284,6 @@ bool FileStatisticsJobPrivate::checkInode(const FileInfoPointer info) + return true; + } + +-bool FileStatisticsJobPrivate::checkInode(FTSENT *ent, FTS *fts) +-{ +- auto fileInode = ent->fts_statp->st_ino; +- if (fileInode > 0) { +- if (inodelist.contains(fileInode)) { +- if (S_ISDIR(ent->fts_statp->st_mode)) +- fts_set(fts, ent, FTS_SKIP); +- return false; +- } +- inodelist.append(fileInode); +- } +- return true; +-} +- + FileStatisticsJob::FileStatisticsJob(QObject *parent) + : QThread(parent), d(new FileStatisticsJobPrivate(this)) + { +@@ -561,12 +400,7 @@ void FileStatisticsJob::run() + d->sizeInfo.reset(new FileUtils::FilesSizeInfo()); + if (d->sourceUrlList.isEmpty()) + return; +- if (d->sourceUrlList.first().scheme() != Global::Scheme::kFile +- || !FileUtils::isLocalDevice(d->sourceUrlList.first())) { +- statistcsOtherFileSystem(); +- return; +- } +- statistcsByFts(); ++ statistcsOtherFileSystem(); + } + + void FileStatisticsJob::setSizeInfo() +@@ -696,22 +530,4 @@ void FileStatisticsJob::statistcsOtherFileSystem() + d->setState(kStoppedState); + } + +-void FileStatisticsJob::statistcsByFts() +-{ +- Q_EMIT dataNotify(0, 0, 0); +- +- const bool followLink = !d->fileHints.testFlag(kNoFollowSymlink); +- +- for (const auto &url : d->sourceUrlList) { +- if (!d->stateCheck()) { +- d->setState(kStoppedState); +- setSizeInfo(); +- return; +- } +- +- d->processFileByFts(url, followLink); +- } +- d->setState(kStoppedState); +-} +- + } +diff --git a/src/dfm-base/utils/filestatisticsjob.h b/src/dfm-base/utils/filestatisticsjob.h +index bfda4af9d..a281cab4f 100644 +--- a/src/dfm-base/utils/filestatisticsjob.h ++++ b/src/dfm-base/utils/filestatisticsjob.h +@@ -83,7 +83,6 @@ private: + private: + void setSizeInfo(); + void statistcsOtherFileSystem(); +- void statistcsByFts(); + }; + + } +diff --git a/src/dfm-base/utils/private/filestatissticsjob_p.h b/src/dfm-base/utils/private/filestatissticsjob_p.h +index 73fdc6308..1cb3bb3c0 100644 +--- a/src/dfm-base/utils/private/filestatissticsjob_p.h ++++ b/src/dfm-base/utils/private/filestatissticsjob_p.h +@@ -25,16 +25,10 @@ public: + bool stateCheck(); + + void processFile(const QUrl &url, const bool followLink, QQueue &directoryQueue); +- void processFileByFts(const QUrl &url, const bool followLink); + void emitSizeChanged(); + int countFileCount(const char *name); + bool checkFileType(const FileInfo::FileType &fileType); +- FileInfo::FileType getFileType(const uint mode); +- void statisticDir(const QUrl &url, FTS *fts, const bool singleDepth, FTSENT *ent); +- void statisticFile(FTSENT *ent); +- void statisticSysLink(const QUrl ¤tUrl, FTS *fts, FTSENT *ent, const bool singleDepth, const bool followLink); + bool checkInode(const FileInfoPointer info); +- bool checkInode(FTSENT *ent, FTS *fts); + + FileStatisticsJob *q; + QTimer *notifyDataTimer; +-- +2.39.3 + diff --git a/0008-fix-Copying-a-large-number-of-empty-files-and-folde.patch b/0008-fix-Copying-a-large-number-of-empty-files-and-folde.patch new file mode 100644 index 0000000000000000000000000000000000000000..c8528d2fd52f4781618bc150960995db1e9ee9bf --- /dev/null +++ b/0008-fix-Copying-a-large-number-of-empty-files-and-folde.patch @@ -0,0 +1,97 @@ +From 88c1ec0af64b0b2a82761f47c60c8a21fae1d8a2 Mon Sep 17 00:00:00 2001 +From: liyigang +Date: Wed, 27 Dec 2023 17:27:42 +0800 +Subject: [PATCH 10435/10526] fix: Copying a large number of empty files and + folders on a USB drive causes the system to freeze + +It is because the efficiency of selecting a large number of files is low, and inserting items at this time will cause all events of QT to freeze. + +Log: Copying a large number of empty files and folders on a USB drive causes the system to freeze +Bug: https://pms.uniontech.com/bug-view-236699.html +--- + .../utils/selecthelper.cpp | 24 ++++++++----------- + .../dfmplugin-workspace/utils/selecthelper.h | 1 - + .../utils/workspacehelper.cpp | 2 +- + .../dfmplugin-workspace/views/fileview.cpp | 18 ++------------ + .../core/dfmplugin-workspace/views/fileview.h | 1 - + 5 files changed, 13 insertions(+), 33 deletions(-) + +diff --git a/src/plugins/filemanager/core/dfmplugin-workspace/utils/selecthelper.cpp b/src/plugins/filemanager/core/dfmplugin-workspace/utils/selecthelper.cpp +index 9c6ebdd76..ddcea730a 100644 +--- a/src/plugins/filemanager/core/dfmplugin-workspace/utils/selecthelper.cpp ++++ b/src/plugins/filemanager/core/dfmplugin-workspace/utils/selecthelper.cpp +@@ -103,29 +103,23 @@ void SelectHelper::selection(const QRect &rect, QItemSelectionModel::SelectionFl + + void SelectHelper::select(const QList &urls) + { +- QList indexes {}; +- for (const QUrl &url : urls) { +- const QModelIndex &index = view->model()->getIndexByUrl(url); +- indexes << index; +- } +- +- select(indexes); +-} ++ if (urls.isEmpty()) ++ return; + +-void SelectHelper::select(const QList &indexes) +-{ + QModelIndex firstIndex; + QModelIndex lastIndex; +- + const QModelIndex &root = view->rootIndex(); + view->selectionModel()->clearSelection(); +- view->setCurrentIndex(QModelIndex()); +- for (const QModelIndex &index : indexes) { ++ QList indexes {}; ++ QItemSelection selction; ++ for (const QUrl &url : urls) { ++ const QModelIndex &index = view->model()->getIndexByUrl(url); ++ + if (!index.isValid() || index == root) { + continue; + } + +- view->selectionModel()->select(index, QItemSelectionModel::Select); ++ selction.merge(QItemSelection(index,index), QItemSelectionModel::Select); + + if (!firstIndex.isValid()) + firstIndex = index; +@@ -133,6 +127,8 @@ void SelectHelper::select(const QList &indexes) + lastIndex = index; + } + ++ view->selectionModel()->select(selction, QItemSelectionModel::Select); ++ + if (lastIndex.isValid()) + view->selectionModel()->setCurrentIndex(lastIndex, QItemSelectionModel::Select); + +diff --git a/src/plugins/filemanager/core/dfmplugin-workspace/utils/selecthelper.h b/src/plugins/filemanager/core/dfmplugin-workspace/utils/selecthelper.h +index 3ef6e70bc..e44be8aa4 100644 +--- a/src/plugins/filemanager/core/dfmplugin-workspace/utils/selecthelper.h ++++ b/src/plugins/filemanager/core/dfmplugin-workspace/utils/selecthelper.h +@@ -29,7 +29,6 @@ public: + void setSelection(const QItemSelection &selection); + void selection(const QRect &rect, QItemSelectionModel::SelectionFlags flags); + void select(const QList &urls); +- void select(const QList &indexes); + + private: + void caculateSelection(const QRect &rect, QItemSelection *selection); +diff --git a/src/plugins/filemanager/core/dfmplugin-workspace/utils/workspacehelper.cpp b/src/plugins/filemanager/core/dfmplugin-workspace/utils/workspacehelper.cpp +index 3a93baca5..7b5dfca21 100644 +--- a/src/plugins/filemanager/core/dfmplugin-workspace/utils/workspacehelper.cpp ++++ b/src/plugins/filemanager/core/dfmplugin-workspace/utils/workspacehelper.cpp +@@ -347,7 +347,7 @@ QStringList WorkspaceHelper::getNameFilter(const quint64 windowId) + + void WorkspaceHelper::laterRequestSelectFiles(const QList &urls) + { +- QTimer::singleShot(qMax(urls.count() * (10 + urls.count() / 150), 200), this, [=] { ++ QTimer::singleShot(qMin(800, qMax(urls.count() * (10 + urls.count() / 150), 200)), this, [=] { + emit requestSelectFiles(urls); + }); + } +-- +2.39.3 + diff --git a/0009-fix-Copying-a-large-number-of-empty-files-and-folde.patch b/0009-fix-Copying-a-large-number-of-empty-files-and-folde.patch new file mode 100644 index 0000000000000000000000000000000000000000..075bc92724ee8cb468ad57d47370d8fa4afd19c5 --- /dev/null +++ b/0009-fix-Copying-a-large-number-of-empty-files-and-folde.patch @@ -0,0 +1,106 @@ +From f391947b75da0ef7fe7176ba6f4454b0420af0b9 Mon Sep 17 00:00:00 2001 +From: liyigang +Date: Wed, 27 Dec 2023 17:45:00 +0800 +Subject: [PATCH 10436/10526] fix: Copying a large number of empty files and + folders on the USB drive, with incorrect progress bar statistics + +The reason for the inaccurate data statistics here is that we calculated the size of the directory as 4096, but in the write statistics of the USB drive, we calculated the size by reading and writing how many block blocks were written. The size of the directory and the 0kb file were calculated as a numerical value in the USB drive, which caused our own calculated values to not match. When modifying the statistics size, we are copying thread blocking statistics and then using our own statistics method. + +Log: Copying a large number of empty files and folders on the USB drive, with incorrect progress bar statistics +Bug: https://pms.uniontech.com/bug-view-236707.html +--- + src/dfm-base/utils/filestatisticsjob.cpp | 8 +------- + .../fileoperationutils/abstractworker.cpp | 13 +++++++++---- + .../fileoperationutils/fileoperatebaseworker.cpp | 5 +++-- + 3 files changed, 13 insertions(+), 13 deletions(-) + +diff --git a/src/dfm-base/utils/filestatisticsjob.cpp b/src/dfm-base/utils/filestatisticsjob.cpp +index 4e2027e87..8e977a668 100644 +--- a/src/dfm-base/utils/filestatisticsjob.cpp ++++ b/src/dfm-base/utils/filestatisticsjob.cpp +@@ -407,7 +407,7 @@ void FileStatisticsJob::setSizeInfo() + { + d->sizeInfo->fileCount = static_cast(d->filesCount); + d->sizeInfo->totalSize = d->totalProgressSize; +- d->sizeInfo->dirSize = d->sizeInfo->dirSize == 0 ? FileUtils::getMemoryPageSize() : d->sizeInfo->dirSize; ++ d->sizeInfo->dirSize = FileUtils::getMemoryPageSize(); + } + + void FileStatisticsJob::statistcsOtherFileSystem() +@@ -466,12 +466,6 @@ void FileStatisticsJob::statistcsOtherFileSystem() + } + + if (info->isAttributes(OptInfoType::kIsDir)) { +- if (d->sizeInfo->dirSize == 0) { +- struct stat statInfo; +- +- if (0 == stat(info->urlOf(UrlInfoType::kUrl).path().toStdString().data(), &statInfo)) +- d->sizeInfo->dirSize = statInfo.st_size == 0 ? FileUtils::getMemoryPageSize() : static_cast(statInfo.st_size); +- } + directory_queue << url; + } + } +diff --git a/src/plugins/common/core/dfmplugin-fileoperations/fileoperations/fileoperationutils/abstractworker.cpp b/src/plugins/common/core/dfmplugin-fileoperations/fileoperations/fileoperationutils/abstractworker.cpp +index db87eef58..3775ffa39 100644 +--- a/src/plugins/common/core/dfmplugin-fileoperations/fileoperations/fileoperationutils/abstractworker.cpp ++++ b/src/plugins/common/core/dfmplugin-fileoperations/fileoperations/fileoperationutils/abstractworker.cpp +@@ -42,6 +42,7 @@ void AbstractWorker::setWorkArgs(const JobHandlePointer handle, const QListdirSize = FileUtils::getMemoryPageSize(); + this->handle = handle; + initHandleConnects(handle); + this->sourceUrls = sources; +@@ -194,17 +195,21 @@ bool AbstractWorker::statisticsFilesSize() + + if (isSourceFileLocal) { + const SizeInfoPointer &fileSizeInfo = FileOperationsUtils::statisticsFilesSize(sourceUrls, true); +- + allFilesList = fileSizeInfo->allFiles; + sourceFilesTotalSize = fileSizeInfo->totalSize; + workData->dirSize = fileSizeInfo->dirSize; + sourceFilesCount = fileSizeInfo->fileCount; + } else { + statisticsFilesSizeJob.reset(new DFMBASE_NAMESPACE::FileStatisticsJob()); +- connect(statisticsFilesSizeJob.data(), &DFMBASE_NAMESPACE::FileStatisticsJob::finished, +- this, &AbstractWorker::onStatisticsFilesSizeFinish, Qt::DirectConnection); +- connect(statisticsFilesSizeJob.data(), &DFMBASE_NAMESPACE::FileStatisticsJob::sizeChanged, this, &AbstractWorker::onStatisticsFilesSizeUpdate, Qt::DirectConnection); + statisticsFilesSizeJob->start(sourceUrls); ++ while(!statisticsFilesSizeJob->isFinished()) { ++ QThread::msleep(10); ++ } ++ const SizeInfoPointer &fileSizeInfo = statisticsFilesSizeJob->getFileSizeInfo(); ++ allFilesList = fileSizeInfo->allFiles; ++ sourceFilesTotalSize = fileSizeInfo->totalSize; ++ workData->dirSize = fileSizeInfo->dirSize; ++ sourceFilesCount = fileSizeInfo->fileCount; + } + return true; + } +diff --git a/src/plugins/common/core/dfmplugin-fileoperations/fileoperations/fileoperationutils/fileoperatebaseworker.cpp b/src/plugins/common/core/dfmplugin-fileoperations/fileoperations/fileoperationutils/fileoperatebaseworker.cpp +index c1f1e3e71..43505d916 100644 +--- a/src/plugins/common/core/dfmplugin-fileoperations/fileoperations/fileoperationutils/fileoperatebaseworker.cpp ++++ b/src/plugins/common/core/dfmplugin-fileoperations/fileoperations/fileoperationutils/fileoperatebaseworker.cpp +@@ -1152,7 +1152,7 @@ bool FileOperateBaseWorker::doCopyFile(const FileInfoPointer &fromInfo, const Fi + } else if (fromInfo->isAttributes(OptInfoType::kIsDir)) { + result = checkAndCopyDir(fromInfo, newTargetInfo, skip); + if (result || skip) +- workData->zeroOrlinkOrDirWriteSize += workData->dirSize; ++ workData->zeroOrlinkOrDirWriteSize += workData->dirSize <= 0 ? FileUtils::getMemoryPageSize() : workData->dirSize; + } else { + result = checkAndCopyFile(fromInfo, newTargetInfo, skip); + } +@@ -1324,7 +1324,8 @@ void FileOperateBaseWorker::determineCountProcessType() + + if (targetIsRemovable) { + workData->exBlockSyncEveryWrite = FileOperationsUtils::blockSync(); +- countWriteType = workData->exBlockSyncEveryWrite ? CountWriteSizeType::kCustomizeType : CountWriteSizeType::kWriteBlockType; ++ countWriteType = workData->exBlockSyncEveryWrite ? CountWriteSizeType::kCustomizeType ++ : CountWriteSizeType::kCustomizeType; + targetDeviceStartSectorsWritten = workData->exBlockSyncEveryWrite ? 0 : getSectorsWritten(); + + workData->isBlockDevice = true; +-- +2.39.3 + diff --git a/README.en.md b/README.en.md deleted file mode 100644 index b8513796530486ca618da51a7ba1eb87fa2f9c0c..0000000000000000000000000000000000000000 --- a/README.en.md +++ /dev/null @@ -1,86 +0,0 @@ -# dde-file-manager - -## Description -dde-file-manager is a powerful, easy-to-use file management tool. It follows the classic functions and layouts of traditional file managers, and on this basis simplifies user operations and adds many special functions. The clear navigation bar, intelligently recognized search box, diverse views and sorting make it easy for you to manage, classic and beyond, just to give you a better experience! - -## Software Architecture -Software architecture description - -## Installation - -```shell -dnf install dde-file-manager -``` - -## Instructions - -### Run dde-file-manager - -1. Click the launcher icon on the dock to enter the launcher interface. -2. Scroll the mouse wheel up or down to browse or search for the dde-file-manager icon , and click Run. -3. By right-clicking the dde-file-manager icon, you can: - - Click **Send to Desktop** to create a shortcut on the desktop. - - Click **Send to dock** to pin the app to the dock. - - Click **Add to startup** to add the application to the startup items to automatically run the application when the computer is turned on. - -> TIP: You can also use the shortcut **Super + E** to launch the dde-file-manager. - -### Close the dde-file-manager - -- In the dde-file-manager interface, click X to exit the dde-file-manager. -- Right-click the dde-file-manager icon on the taskbar and select **Close All** to exit the dde-file-manager. -- On the dde-file-manager interface, click the menu bar and select Exit to exit the dde-file-manager. - -### View shortcut keys - -In the dde-file-manager interface, use the shortcut keys **Ctrl + Shift + /** to open the shortcut key preview interface. Skilled use of shortcut keys will greatly improve your operational efficiency. - -![image-hot_key_en](./image/hot_key_en.png) - -## Basic Skills - -The dde-file-manager has basic file management functions, and it is very simple to create, copy, rename, and delete files (folders). - -### Create a new file - -#### New document - -1. In a blank area of the file manager, right-click. -2. Select **New Document**. -3. Select the type of new file from the drop-down menu. -4. Enter a name for the new file. - -![image-newdo_en](./image/newdo_en.png) - -#### New folder - -1. In a blank area of the file manager, right-click. -2. Select **New Folder**. -3. Enter a name for the new folder. - -### Rename file - -1. In the file manager interface, right-click the file. -2. Select **Rename**. -3. Enter the file name and press **Enter** or click in the blank area of the interface. - -![image-rename_en](./image/rename_en.png) - -> Tip: Check "Hide file extension when rename" in **Settings**, it can be more convenient to modify the file name - -## Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -## Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md deleted file mode 100644 index 90b8edc3f8e7ec47de7c285634afbc119d71663e..0000000000000000000000000000000000000000 --- a/README.md +++ /dev/null @@ -1,87 +0,0 @@ -# dde-file-manager - -## 介绍 -文件管理器是一款功能强大、简单易用的文件管理工具。它沿用了传统文件管理器的经典功能和布局,并在此基础上简化了用户操作,增加了很多特色功能。一目了然的导航栏、智能识别的搜索框、多样化的视图及排序让您管理起来得心应手,经典和超越,只为给您更好的体验! - -## 软件架构 -软件架构说明 - - -## 安装教程 - -```shell -dnf install dde-file-manager -``` - -## 使用说明 - -### 运行文件管理器 - -1. 单击任务栏上的启动器图标,进入启动器界面。 -2. 上下滚动鼠标滚轮浏览或通过搜索,找到文件管理器图标 ,单击运行。 -3. 右键单击文件管理器图标,您可以: - - 单击 **发送到桌面**,在桌面创建快捷方式。 - - 单击 **发送到任务栏**,将应用程序固定到任务栏。 - - 单击 **开机自动启动**,将应用程序添加到开机启动项,在电脑开机时自动运行该应用。 - -> 窍门:您也可以使用快捷键 **Super + E** 启动文件管理器。 - -### 关闭文件管理器 - -- 在文件管理器界面,单击 X,退出文件管理器。 -- 在任务栏右键单击文件管理器图标,选择 **关闭所有** ,退出文件管理器。 -- 在文件管理器界面,单击菜单栏,选择退出,退出文件管理器。 - -### 查看快捷键 - -在文件管理器界面,使用快捷键 **Ctrl + Shift + /** 打开快捷键预览界面。熟练地使用快捷键,将大大提升您的操作效率。 - -![image-hot_key](./image/hot_key.png) - -## 基本功能 - -文件管理器具备基本的文件管理功能,对文件(夹)进行新建、复制、重命名、删除等操作都非常简单。 - -### 新建文件 - -#### 新建文档 - -1. 在文件管理器空白区域,单击鼠标右键。 -2. 选择 **新建文档**。 -3. 在下拉菜单中选择新建文件的类型。 -4. 输入新建文件的名称。 - -![image-newdo](./image/newdo.png) - -#### 新建文件夹 - -1. 在文件管理器空白区域,单击鼠标右键。 -2. 选择 **新建文件夹**。 -3. 输入新建文件夹的名称。 - -### 重命名文件 - -1. 在文件管理器界面,右键单击文件。 -2. 选择 **重命名**。 -3. 输入文件名称,按 **Enter** 键或者单击界面空白区域。 - -![image-rename](./image/rename.png) - -> 窍门:在 **设置** 中勾选“重命名时隐藏文件扩展名”,能更方便地修改文件名称 - -## 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -## 码云特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目 -5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/dde-file-manager_5.7.8.1.orig.tar.xz b/dde-file-manager-6.0.31.tar.gz similarity index 71% rename from dde-file-manager_5.7.8.1.orig.tar.xz rename to dde-file-manager-6.0.31.tar.gz index 5ca1671f7fa5055df2253afa6028893b2055ecd5..763bc90dd4470f857478ac717d1aef627488443a 100644 Binary files a/dde-file-manager_5.7.8.1.orig.tar.xz and b/dde-file-manager-6.0.31.tar.gz differ diff --git a/dde-file-manager.spec b/dde-file-manager.spec index eb4a5830919a1215a7f6410af47b4f45cc1f90fc..36abf66ab718844593338489dc77dc0366bfe79e 100644 --- a/dde-file-manager.spec +++ b/dde-file-manager.spec @@ -1,19 +1,33 @@ Name: dde-file-manager -Version: 5.7.8.1 -Release: 3 +Version: 6.0.31 +Release: 1%{?dist}.10 Summary: Deepin File Manager License: GPLv3 URL: https://github.com/linuxdeepin/dde-file-manager -Source0: %{name}_%{version}.orig.tar.xz -Patch0: 0001-hide-authorized-watermask.patch -Patch1: 0002-fix-undefined-std-array.patch -Patch2: 0001-fix-build-error.patch +Source0: %{name}-%{version}.tar.gz + +Patch0001: 0001-property-dialog-Show-property-dialog-crash-in-server.patch +Patch0002: 0002-fix-fileinfo-Incorrect-icon-for-dde-desktop-s-file.patch +Patch0003: 0003-fix-audit-log-isn-t-zh_cn.patch +Patch0004: 0004-fix-io-After-sending-a-folder-to-the-desktop-with-s.patch +Patch0005: 0005-fix-workspace-Creating-a-wps-file-in-red-disk-space.patch +Patch0006: 0006-fix-io-Non-empty-folders-in-virtual-paths-incorrect.patch +Patch0007: 0007-fix-io-Select-different-disks-successively-to-right.patch +Patch0008: 0008-fix-Copying-a-large-number-of-empty-files-and-folde.patch +Patch0009: 0009-fix-Copying-a-large-number-of-empty-files-and-folde.patch +Patch0010: 0001-feat-use-abspath-when-using-it-for-the-first.patch +Patch0011: 0001-feat-safety-string-encrypt-plugin.patch +Patch0012: 0002-chore-compile-fmDebug-qDebug.patch +Patch0013: 0003-chore-compile-compile-issue.patch +Patch0014: 0004-mount-cannot-mount-a-erased-bd-re-disc.patch BuildRequires: gcc-c++ BuildRequires: desktop-file-utils BuildRequires: deepin-gettext-tools BuildRequires: dde-dock-devel BuildRequires: file-devel +#BuildRequires: jemalloc-devel +#BuildRequires: cmake(KF5Codecs) BuildRequires: pkgconfig(atk) BuildRequires: dtkgui-devel BuildRequires: pkgconfig(dtkwidget) >= 5.1 @@ -47,16 +61,24 @@ BuildRequires: openssl-devel BuildRequires: libqtxdg-devel BuildRequires: libmediainfo-devel BuildRequires: kf5-kcodecs-devel +#BuildRequires: libudisks2-qt5-devel BuildRequires: lucene++-devel BuildRequires: htmlcxx-devel BuildRequires: libgsf-devel BuildRequires: mimetic-devel BuildRequires: boost-devel -BuildRequires: deepin-anything-devel -BuildRequires: deepin-anything-server -BuildRequires: pcre-devel +%ifarch %{ix86} x86_64 +BuildRequires: deepin-anything-devel deepin-anything-server +%endif BuildRequires: docparser-devel BuildRequires: cryptsetup-devel +BuildRequires: cmake +BuildRequires: cmake-rpm-macros +BuildRequires: libdfm-burn-devel +BuildRequires: libdfm-io-devel +BuildRequires: libdfm-mount-devel +BuildRequires: deepin-pdfium-devel + # run command by QProcess #Requires: deepin-shortcut-viewer @@ -66,8 +88,11 @@ Requires: dde-desktop Requires: jemalloc Requires: libglvnd-glx Requires: libdde-file-manager -Requires: deepin-anything-dkms -Requires: deepin-anything-server +Requires: cryfs +Requires: dlnfs +%ifarch %{ix86} x86_64 +Requires: deepin-anything-dkms deepin-anything-server +%endif #Requires: gvfs-client #Requires: samba #Requires: xdg-user-dirs @@ -80,6 +105,9 @@ File manager front end of Deepin OS. %package devel Summary: Development package for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: libdfm-io-devel +Requires: libdfm-mount-devel +Requires: libdfm-burn-devel %description devel Header files and libraries for %{name}. @@ -95,8 +123,9 @@ Requires: libzen Requires: udisks2-qt5 Requires: taglib Requires: libgio-qt +%ifarch %{ix86} x86_64 Requires: deepin-anything-libs - +%endif %description -n libdde-file-manager DDE File Manager library. @@ -120,26 +149,48 @@ Deepin desktop environment - desktop module. %prep %setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 +%patch0001 -p1 +%patch0002 -p1 +%patch0003 -p1 +%patch0004 -p1 +%patch0005 -p1 +%patch0006 -p1 +%patch0007 -p1 +%patch0008 -p1 +%patch0009 -p1 +%patch0010 -p1 +%patch0011 -p1 +%patch0012 -p1 +%patch0013 -p1 +%patch0014 -p1 # fix file permissions find -type f -perm 775 -exec chmod 644 {} \; #sed -i '/target.path/s|lib|%{_lib}|' src/dde-dock-plugins/disk-mount/disk-mount.pro -sed -i '/deepin-daemon/s|lib|libexec|' src/dde-zone/mainwindow.h -sed -i 's|lib/gvfs|libexec|' src/%{name}-lib/gvfs/networkmanager.cpp +#sed -i '/deepin-daemon/s|lib|libexec|' src/dde-zone/mainwindow.h +#sed -i 's|lib/gvfs|libexec|' src/%{name}-lib/gvfs/networkmanager.cpp #sed -i 's|%{_datadir}|%{_libdir}|' dde-sharefiles/appbase.pri -sed -i 's|/lib/dde-dock/plugins|/lib64/dde-dock/plugins|' src/dde-dock-plugins/disk-mount/disk-mount.pro +#%ifnarch i686 +#sed -i 's|/lib/dde-dock/plugins|/lib64/dde-dock/plugins|' src/dde-dock-plugins/disk-mount/disk-mount.pro +#%endif %build export PATH=%{_qt5_bindir}:$PATH -%qmake_qt5 PREFIX=%{_prefix} QMAKE_CFLAGS_ISYSTEM= CONFIG+="DISABLE_FFMPEG" DEFINES+="VERSION=%{version}" filemanager.pro +%cmake -B build -DCMAKE_INSTALL_PREFIX=%{_prefix} -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir} +cd build %make_build %install +cd build %make_install INSTALL_ROOT=%{buildroot} +%post +cp %{_sysconfdir}/X11/Xsession.d/99dfm-dlnfs-automount %{_sysconfdir}/X11/xinit/xinitrc.d/ +df -h | grep boot | awk '{print $1}' | xargs -i blkid {} | awk '{print $2}' | awk -F '=' '{print $2}' |xargs -i echo "ENV{ID_FS_UUID}==\"{}\", ENV{UDISKS_IGNORE}=\"1\"" >> /etc/udev/rules.d/80-udisks-installer.rules + +%postun +rm -rf /etc/udev/rules.d/80-udisks-installer.rules + %check desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop desktop-file-validate %{buildroot}%{_datadir}/applications/dde-computer.desktop ||: @@ -154,124 +205,145 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/dde-home.desktop ||: %config(noreplace) %{_sysconfdir}/dbus-1/system.d/com.deepin.filemanager.daemon.conf %{_bindir}/%{name} %{_bindir}/%{name}-daemon -%{_bindir}/%{name}-pkexec -%ifnarch x86_64 riscv64 -%{_bindir}/*.sh -%{_sysconfdir}/xdg/autostart/dde-file-manager-autostart.desktop -%endif -%{_bindir}/dde-property-dialog -%{_bindir}/dde-select-dialog-wayland +%attr(755,root,root)%{_bindir}/%{name}-pkexec +%{_bindir}/%{name}-server +%attr(755,root,root)%{_bindir}/dde-property-dialog +%{_bindir}/dde-file-dialog %{_bindir}/dde-select-dialog-x11 -/usr/lib/systemd/system/dde-filemanager-daemon.service - -%{_datadir}/applications/dde-open.desktop +%{_bindir}/dde-select-dialog-wayland +%{_sysconfdir}/xdg/autostart/dde-filemanager-server.desktop +%{_libdir}/%{name}/plugins/filemanager-core/*.so %{_datadir}/applications/%{name}.desktop +%{_datadir}/applications/dde-open.desktop +%{_datadir}/%{name}/translations/*.qm +%{_prefix}/lib/systemd/system/dde-filemanager-daemon.service +%{_prefix}/lib/systemd/user/dde-filemanager-server.service %{_datadir}/dbus-1/interfaces/com.deepin.filemanager.filedialog.xml %{_datadir}/dbus-1/interfaces/com.deepin.filemanager.filedialogmanager.xml %{_datadir}/dbus-1/services/com.deepin.filemanager.filedialog.service %{_datadir}/dbus-1/services/com.deepin.filemanager.filedialog_wayland.service %{_datadir}/dbus-1/services/com.deepin.filemanager.filedialog_x11.service -%{_datadir}/dbus-1/services/org.freedesktop.FileManager.service +%{_datadir}/dbus-1/services/org.deepin.filemanager.server.service %{_datadir}/dbus-1/system-services/com.deepin.filemanager.daemon.service -%{_datadir}/polkit-1/actions/com.deepin.filemanager.daemon.policy -%{_datadir}/polkit-1/actions/com.deepin.pkexec.dde-file-manager.policy %{_datadir}/deepin-manual/manual-assets/application/dde-file-manager -%{_datadir}/applications/context-menus/.readme -%{_libdir}/%{name}/plugins/extensions/.readme -%{_datadir}/%{name}/extensions/appEntry/.readme +%{_datadir}/polkit-1/actions/com.deepin.filemanager*.policy +%{_datadir}/polkit-1/actions/com.deepin.pkexec.dde-file-manager.policy +%{_sysconfdir}/X11/Xsession.d/99dfm-dlnfs-automount +%{_sysconfdir}/deepin/%{name}/dfm-dlnfs-automount +%{_libdir}/%{name}/plugins/common-edge/*.so +%{_libdir}/%{name}/plugins/daemon-edge/*.so +%{_libdir}/%{name}/plugins/filemanager-edge/*.so +%{_libdir}/%{name}/plugins/previews/*.so +%{_datadir}/mime/packages/dtk-dci.xml +%{_libdir}/%{name}/plugins/server-edge/*.so + %files -n libdde-file-manager -%{_libdir}/dde-file-manager/plugins/previews/libdde-image-preview-plugin.so -%{_libdir}/dde-file-manager/plugins/previews/libdde-music-preview-plugin.so -%{_libdir}/dde-file-manager/plugins/previews/libdde-pdf-preview-plugin.so -%{_libdir}/dde-file-manager/plugins/previews/libdde-text-preview-plugin.so -%{_libdir}/dde-file-manager/plugins/extensions/libdde-eetrust-emblem-plugin.so -%{_libdir}/libdde-file-manager.so.1.8.2 -%{_datadir}/dsg/configs/org.deepin.dde.file-manager/org.deepin.dde.file-manager.json -%{_datadir}/dde-file-manager/mimetypeassociations/mimetypeassociations.json -%{_datadir}/dde-file-manager/mimetypes/archive.mimetype -%{_datadir}/dde-file-manager/mimetypes/audio.mimetype -%{_datadir}/dde-file-manager/mimetypes/backup.mimetype -%{_datadir}/dde-file-manager/mimetypes/executable.mimetype -%{_datadir}/dde-file-manager/mimetypes/image.mimetype -%{_datadir}/dde-file-manager/mimetypes/text.mimetype -%{_datadir}/dde-file-manager/mimetypes/video.mimetype -%{_datadir}/dde-file-manager/templates/newDoc.wps -%{_datadir}/dde-file-manager/templates/newExcel.et -%{_datadir}/dde-file-manager/templates/newPowerPoint.dps -%{_datadir}/dde-file-manager/templates/newDoc.doc -%{_datadir}/dde-file-manager/templates/newExcel.xls -%{_datadir}/dde-file-manager/templates/newPowerPoint.ppt -%{_datadir}/dde-file-manager/templates/newTxt.txt -%{_datadir}/dde-file-manager/translations/ -%{_datadir}/deepin/dde-file-manager/oem-menuextensions/.readme -%{_datadir}/glib-2.0/schemas/com.deepin.dde.filemanager.gschema.xml -%{_datadir}/icons/hicolor/scalable/apps/dde-file-manager.svg -%{_libdir}/libdde-file-manager.so.1 -%{_libdir}/libdde-file-manager.so.1.8 -%{_libdir}/libdfm-extension.so.1 -%{_libdir}/libdfm-extension.so.1.8 -%{_libdir}/libdfm-extension.so.1.8.2 -%ifarch x86_64 -%{_libdir}/deepin-anything-server-lib/plugins/handlers/libdde-anythingmonitor.so -%endif +%{_libdir}/libdfm-base.so* +%{_libdir}/libdfm-framework.so* +%{_libdir}/%{name}/plugins/common-core/*.so +%{_libdir}/%{name}/tools/* +%{_datadir}/%{name}/templates/* +%{_datadir}/%{name}/mimetypes/*.mimetype +%{_datadir}/%{name}/mimetypeassociations/*.json +%{_datadir}/glib-2.0/schemas/*.filemanager.gschema.xml +%{_datadir}/deepin/%{name}/oem-menuextensions/.readme +%{_datadir}/applications/context-menus/.readme +%{_datadir}/%{name}/extensions/appEntry/.readme +%{_datadir}/dsg/configs/org.deepin.dde.file-manager/*.json +%{_libdir}//libdfm-extension.so* +%{_libdir}/%{name}/plugins/extensions/.readme +%{_libdir}/%{name}/plugins/previews/*.json %files -n dde-disk-mount-plugin -%{_libdir}/dde-dock/plugins/system-trays/libdde-disk-mount-plugin.so -%{_datadir}/dde-disk-mount-plugin/translations -%{_datadir}/glib-2.0/schemas/com.deepin.dde.dock.module.disk-mount.gschema.xml +%{_prefix}/lib/dde-dock/plugins/system-trays/libdde-disk-mount-plugin.so +%{_datadir}/glib-2.0/schemas/*.disk-mount.gschema.xml %files devel -%{_includedir}/%{name}/ +%{_includedir}/dfm-base/ +%{_includedir}/dfm-framework/ +%{_libdir}/pkgconfig/dfm-base.pc +%{_libdir}/cmake/dfm-base/*.cmake +%{_libdir}/pkgconfig/dfm-framework.pc +%{_libdir}/cmake/dfm-framework/*.cmake +%{_libdir}/libdfm-base.so +%{_libdir}/libdfm-extension.so +%{_libdir}/libdfm-framework.so %{_includedir}/dfm-extension/ -%{_libdir}/pkgconfig/%{name}.pc %{_libdir}/pkgconfig/dfm-extension.pc -%{_libdir}/lib%{name}.so -%{_libdir}/libdfm-extension.so +%{_libdir}/cmake/dfm-extension/*.cmake %files -n dde-desktop %{_bindir}/dde-desktop +%{_libdir}/%{name}/plugins/desktop-core/*.so +%{_libdir}/%{name}/plugins/desktop-edge/*.so %{_datadir}/applications/dde-computer.desktop %{_datadir}/applications/dde-home.desktop %{_datadir}/applications/dde-trash.desktop -%dir %{_datadir}/dde-desktop -%{_datadir}/dde-desktop/translations/ %{_datadir}/dbus-1/services/com.deepin.dde.desktop.service +%{_datadir}/dbus-1/services/org.freedesktop.FileManager.service %changelog -* Tue Apr 23 2024 misaka00251 - 5.7.8.1-3 -- Fix build on riscv64 +* Mon Aug 26 2024 zhangxianting - 6.0.31-1.10 +- fix: [mount/optical] cannot mount a erased bd-re disc(bugid:268053) + +* Tue Jun 25 2024 liweigang - 6.0.31-1.09 +- fix: fix bug(bugid:259825) +- fix: fix bug(bugid:259823) + +* Mon Jun 17 2024 liweigang - 6.0.31-1.08 +- fix: use abspath when using it for the first(bugid:258019) + +* Fri Jun 07 2024 liweigang - 6.0.31-1.07 +- fix: disable qWarning qDebug(bugid:258019) + +* Fri Feb 23 2024 haomimi - 6.0.31-1.06 +- fix: copy cut error in NTFS format USB (bugid:235155) + +* Fri Dec 22 2023 liuzhilin - 6.0.31-1.05 +- fix: property-dialog-Show-property-dialog-crash-in-server(bugid:228681) + +* Tue Dec 19 2023 hanshuang - 6.0.31-1.04 +- fix: remove dde-file-manager show partitions boot (bugid:188107) + +* Fri Dec 01 2023 maqi - 6.0.31-1.03 +- fix: change the position of 99dfm-dlnfs-automount for automatic loading(bugid:227789) + +* Tue Nov 07 2023 liuzhilin - 6.0.31-1.01 +- fix: fix dde-property-dialog permission(bugid:226865) + +* Mon Oct 09 2023 liweigang - 6.0.31-1 +- update: update to version 6.0.31 + +* Wed Jun 14 2023 liweigang - 5.7.8.1-2 +- rebuild: rebuild -* Wed Apr 17 2024 liuzhilin - 5.7.8.1-2 -- fix build error +* Mon Apr 17 2023 liweigang - 5.7.8.1-1 +- update: update to 5.7.8.1(support GB18030) -* Tue Aug 15 2023 leeffo - 5.7.8.1-1 -- upgrade to version 5.7.8.1 +* Mon Mar 13 2023 yuxiaojun - 5.7.6-4 +- feat: show not permitted translate to chinese -* Wed Mar 29 2023 liweiganga - 5.2.63-1 -- update: update to 5.2.63 +* Thu Mar 02 2023 yuxiaojun - 5.7.6-3 +- feat: [mount] show not permitted in some mount cases. -* Fri Nov 11 2022 liweiganga - 5.2.39-5 -- add BR pcre-devel +* Thu Mar 02 2023 liweigang - 5.7.6-2 +- feat: fix sort error(bug:188315) -* Fri Aug 05 2022 liweiganga - 5.2.39-4 -- delete authorized watermask +* Wed Mar 1 2023 tianying - 5.7.6-1.03 +- update: update version only -* Tue Aug 02 2022 liweiganga - 5.2.39-3 -- add requires +* Fri Feb 10 2023 tianying - 5.7.6-1.02 +- fix: fallback version -* Tue Jul 26 2022 liweiganga - 5.2.39-2 -- modify cryfs Requires to Recommends +* Thu Feb 9 2023 tianying - 5.7.6-1.01 +- fix: fix the spelling problem of the audit interface -* Mon Jul 18 2022 konglidong - 5.2.39-1 -- update version to 5.2.39 +* Tue Jan 10 2023 liweigang - 5.7.6-1 +- update: update to 5.7.6 -* Thu Jul 08 2021 weidong - 5.2.0.56-10 -- Update 5.2.0.56. +* Fri Jun 10 2022 liweigang - 5.2.63-8.01 +- build: supprt ppc64le and loongarch64 -* Tue Sep 8 2020 chenbo pan - 5.1.2.3-9 -- fix compile error -* Mon Aug 17 2020 chenbo pan - 5.1.2.3-8 -- fix spec name -* Thu Jul 30 2020 openEuler Buildteam - 5.1.2.3-7 -- Package init +* Fri Jun 10 2022 uoser - 5.2.63-8 +- package init diff --git a/dde-file-manager.yaml b/dde-file-manager.yaml deleted file mode 100644 index d7e6e50d2ff05a75695e8de30d3cf8cc62ddcf78..0000000000000000000000000000000000000000 --- a/dde-file-manager.yaml +++ /dev/null @@ -1,4 +0,0 @@ -version_control: github -src_repo: linuxdeepin/dde-file-manager -tag_prefix: ^v -seperator: . diff --git a/image/hot_key.png b/image/hot_key.png deleted file mode 100644 index 1e3c2c12fc79d6fa7f92de18d85fb732bb331713..0000000000000000000000000000000000000000 Binary files a/image/hot_key.png and /dev/null differ diff --git a/image/hot_key_en.png b/image/hot_key_en.png deleted file mode 100644 index 0befd3a2e0cd588888b421e749d3d0773cc58ad8..0000000000000000000000000000000000000000 Binary files a/image/hot_key_en.png and /dev/null differ diff --git a/image/newdo.png b/image/newdo.png deleted file mode 100644 index adea46a9c13413b6e878f668b5062eb45b7160ed..0000000000000000000000000000000000000000 Binary files a/image/newdo.png and /dev/null differ diff --git a/image/newdo_en.png b/image/newdo_en.png deleted file mode 100644 index 94f3ae413cf2924512a4939757e499122651dce9..0000000000000000000000000000000000000000 Binary files a/image/newdo_en.png and /dev/null differ diff --git a/image/rename.png b/image/rename.png deleted file mode 100644 index c63ee57026fc28a6d0f0c72abde4ca34975504ce..0000000000000000000000000000000000000000 Binary files a/image/rename.png and /dev/null differ diff --git a/image/rename_en.png b/image/rename_en.png deleted file mode 100644 index 2089bdd07c91584079b5a236f4ea117184b94b97..0000000000000000000000000000000000000000 Binary files a/image/rename_en.png and /dev/null differ