Skip to content

Commit 28555e3

Browse files
chore: Update copyright information and file structure in pzip and clipzipplugin
- Changed copyright headers in multiple files to reflect the new ownership by Uniontech Software Technology Co., Ltd. for the years 2025-2026. - Updated file includes from .hpp to .h for consistency across the pzip and clipzipplugin modules. - Introduced new files for archiving, extracting, and utility functions to enhance the pzip functionality. Log: Standardize copyright and improve file organization in pzip and clipzipplugin
1 parent 91664e2 commit 28555e3

7 files changed

Lines changed: 11 additions & 32 deletions

File tree

3rdparty/CMakeLists.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,13 @@ add_subdirectory(libzipplugin)
1616

1717
add_subdirectory(libminizipplugin)
1818

19-
# pzip 高性能并行压缩工具(仅 ARM + Qt6 环境启用)
20-
# 检查是否为 ARM 架构且 Qt6
21-
if((CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm") AND (QT_VERSION_MAJOR EQUAL 6))
22-
message(STATUS "ARM + Qt6 环境,启用 pzip 高性能压缩插件")
19+
# pzip 高性能并行压缩工具(仅 x86/ARM + Qt6 环境启用)
20+
if((CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm|x86_64|amd64") AND (QT_VERSION_MAJOR EQUAL 6))
21+
message(STATUS "x86/ARM + Qt6 环境,启用 pzip 高性能压缩插件")
2322
add_subdirectory(pzip)
2423
add_subdirectory(clipzipplugin)
2524
else()
26-
message(STATUS "非 ARM + Qt6 环境,使用默认 libzip 插件")
25+
message(STATUS "非 x86/ARM + Qt6 环境,使用默认 libzip 插件")
2726
endif()
2827

2928
##add_subdirectory(cliunarchiverplugin) #不可用

3rdparty/clipzipplugin/CMakeLists.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,25 @@
1-
# 定义 cmake 版本
21
cmake_minimum_required(VERSION 3.9.5)
32

4-
# 设置项目名称
53
set(LIB_NAME clipzipplugin)
64
project(${LIB_NAME})
75

8-
# 查找依赖关系的包信息
96
find_package(PkgConfig REQUIRED)
107
find_package(Qt${QT_DESIRED_VERSION} REQUIRED COMPONENTS Widgets)
118
find_package(KF${KF_VERSION_MAJOR}Codecs REQUIRED)
129

1310
include(FindPkgConfig)
1411

15-
# 指定头文件路径
1612
include_directories(${PROJECT_SOURCE_DIR})
1713
include_directories(${HFILES_OUTPUT_PATH})
1814

19-
# 链接库路径
2015
link_directories(${LIBRARY_OUTPUT_PATH})
2116

22-
# 源文件、头文件和资源文件
2317
file(GLOB_RECURSE c_files RELATIVE ${PROJECT_SOURCE_DIR} *.cpp)
2418
file(GLOB_RECURSE h_files RELATIVE ${PROJECT_SOURCE_DIR} *.h)
2519
file(GLOB_RECURSE json_files RELATIVE ${PROJECT_SOURCE_DIR} *.json)
2620

27-
# 生成动态库
2821
add_library(${LIB_NAME} SHARED ${c_files} ${json_files} ${h_files})
2922

30-
# 链接动静态库
3123
target_link_libraries(${LIB_NAME}
3224
Qt${QT_DESIRED_VERSION}::Widgets
3325
KF${KF_VERSION_MAJOR}::Codecs

3rdparty/pzip/CMakeLists.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,19 @@ cmake_minimum_required(VERSION 3.9.5)
44
set(PZIP_NAME pzip-tool)
55
project(${PZIP_NAME})
66

7-
# pzip 不需要 Qt,禁用 AUTOMOC
87
set(CMAKE_AUTOMOC OFF)
98
set(CMAKE_AUTORCC OFF)
109

11-
# C++17 标准
1210
set(CMAKE_CXX_STANDARD 17)
1311
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1412

15-
# 查找依赖
1613
find_package(PkgConfig REQUIRED)
1714
find_package(ZLIB REQUIRED)
1815
find_package(Threads REQUIRED)
1916

20-
# 头文件路径
2117
include_directories(${PROJECT_SOURCE_DIR}/include)
2218
include_directories(${ZLIB_INCLUDE_DIRS})
2319

24-
# 源文件
2520
set(PZIP_SOURCES
2621
src/archiver.cpp
2722
src/extractor.cpp
@@ -33,15 +28,12 @@ set(PZIP_SOURCES
3328
src/worker_pool.cpp
3429
)
3530

36-
# 编译成静态库
3731
add_library(pzip_core_lib STATIC ${PZIP_SOURCES})
3832
target_include_directories(pzip_core_lib PUBLIC ${PROJECT_SOURCE_DIR}/include)
3933
target_link_libraries(pzip_core_lib ${ZLIB_LIBRARIES} Threads::Threads)
4034

41-
# 强制使用 C++17(覆盖父项目的 C++11 设置)
4235
target_compile_features(pzip_core_lib PUBLIC cxx_std_17)
4336

44-
# 根据架构设置优化选项
4537
if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm")
4638
# ARM 架构优化
4739
target_compile_options(pzip_core_lib PRIVATE -O3 -ffast-math -funroll-loops)
@@ -50,17 +42,14 @@ else()
5042
target_compile_options(pzip_core_lib PRIVATE -O3 -march=native -ffast-math -funroll-loops)
5143
endif()
5244

53-
# 编译 pzip 可执行文件
5445
add_executable(pzip-bin cmd/pzip_main.cpp)
5546
target_link_libraries(pzip-bin pzip_core_lib)
5647
set_target_properties(pzip-bin PROPERTIES OUTPUT_NAME "pzip")
5748

58-
# 编译 punzip 可执行文件
5949
add_executable(punzip-bin cmd/punzip_main.cpp)
6050
target_link_libraries(punzip-bin pzip_core_lib)
6151
set_target_properties(punzip-bin PROPERTIES OUTPUT_NAME "punzip")
6252

63-
# 安装规则 - 安装到 deepin-compressor 的 lib 目录
6453
install(TARGETS pzip-bin punzip-bin
6554
RUNTIME DESTINATION lib/deepin-compressor
6655
)

3rdparty/pzip/cmd/pzip_main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ void printUsage(const char* progName) {
2121
std::cout << "pzip - Parallel ZIP Archiver v" << pzip::version() << "\n\n"
2222
<< "用法: " << progName << " [选项] <archive.zip> <文件或目录...>\n\n"
2323
<< "选项:\n"
24-
<< " -c, --concurrency <n> 设置并发线程数(默认: CPU 核心数\n"
25-
<< " -l, --level <0-9> 设置压缩级别(默认: 6\n"
24+
<< " -c, --concurrency <n> 设置并发线程数(默认: 全部 CPU 核心\n"
25+
<< " -l, --level <1-9> 设置压缩级别(默认: 1,最快\n"
2626
<< " -v, --verbose 显示详细信息\n"
2727
<< " -q, --quiet 静默模式\n"
2828
<< " -h, --help 显示帮助信息\n"
@@ -118,7 +118,7 @@ int main(int argc, char* argv[]) {
118118
std::cout << "创建压缩文件: " << archivePath << "\n";
119119
if (verbose) {
120120
std::cout << "并发线程数: " << (options.concurrency > 0 ? options.concurrency : std::thread::hardware_concurrency()) << "\n";
121-
std::cout << "压缩级别: " << (options.compressionLevel < 0 ? 6 : options.compressionLevel) << "\n";
121+
std::cout << "压缩级别: " << options.compressionLevel << "\n";
122122
}
123123
}
124124

3rdparty/pzip/include/pzip/archiver.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ namespace pzip {
1616
* @brief 压缩器选项
1717
*/
1818
struct ArchiverOptions {
19-
size_t concurrency = 0; // 并发数(0 = CPU 核心数
20-
int compressionLevel = -1; // 压缩级别(-1 = 默认,0-9
19+
size_t concurrency = 0; // 并发数(0 = 自动使用全部 CPU 核心
20+
int compressionLevel = 1; // 压缩级别(1 = 最快,默认值
2121
bool preservePermissions = true; // 保留文件权限
2222
ProgressCallback progress; // 进度回调
2323
};

CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ install(TARGETS bz2plugin DESTINATION ${COMPRESSOR_PLUGIN_PATH})
130130
install(TARGETS gzplugin DESTINATION ${COMPRESSOR_PLUGIN_PATH})
131131
install(TARGETS xzplugin DESTINATION ${COMPRESSOR_PLUGIN_PATH})
132132

133-
# pzip 高性能压缩插件(仅 ARM + Qt6 环境)
134-
if((CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm") AND (QT_VERSION_MAJOR EQUAL 6))
133+
# pzip 高性能压缩插件(仅 x86/ARM + Qt6 环境)
134+
if((CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm|x86_64|amd64") AND (QT_VERSION_MAJOR EQUAL 6))
135135
install(TARGETS clipzipplugin DESTINATION ${COMPRESSOR_PLUGIN_PATH})
136136
endif()
137-
File renamed without changes.

0 commit comments

Comments
 (0)