菜鸟 glade求救i

软件名:qop. Qt Output Parser for tar, zip, unzip, unrar,7z with compressing/extracting progress indicator.
用于显示tar,zip,unzip,unrar,7z这些工具进行压缩解压时的进度,与tar结合使用的工具如gzip,xz等也可以处理。
平台支持:windows(Qt4), Linux(Qt4, tested on ubuntu 10.04), motorola ezx(Qt2, tested on ROKR E6)

project is here: http://qt-apps.org/content/show.php/qop?content=132430
这是我在qt-apps上的第一个程序。

原理:其实就是分析压缩解压工具的终端输出来计算进度并对其他量进行估计。暂时没有想到更好的办法。
缺点:当前显示的是之前一个文件处理完毕时的信息,而不是正在处理的文件的信息。没办法,因为是读取一行输出后才进行显示。无法与终端进行交互
bug: windows 下取消后7z进程无法结束

usage: qop [-t parserFor] [-ns] [-h] [-m] [-T totalSteps] [files...]
-m: 另开一个进程来计算进度条总步长.
-h: help
-n: 设置总步长为文件数.
-s: 设置总步长为文件大小(默认).
-T steps: 设置总步长值.
-t parser: 通常为压缩解压工具的名字, 如tar, zip, unzip, unrar. 如果xz, lzop等结合tar使用, parser为tar. 缺省值 -t tar
-c: 处理完毕自动关闭窗口

例子:
代码:
tar zcvvf honey.tgz honey |qop hon* -m
tar --use=xz -cvvf honey.txz honey |qop honey
zip -ryv -9 -FS honey.zip honey |qop honey -m -t zip
unzip -o honey.zip |qop -T `unzip -Z -t honey.unzip | sed 's/\(.*\) files.*/\1/'` -t unzip
7z x -y test.7z |qop -t7z -T $((`7z l test.7z |sed -n '$s/\(.*\), \(.*\)folders/\2/p'`+`7z l test.7z |sed -n '$s/\(.*\) \(.*\)files.*/\2/p'`))
#7z的那个计算文件和文件夹总数的谁来写的更简洁些?输出为                                2833677      1029657  75 files, 7 folders


编译注意事项:
编译ezx版本时让QCounterThread 继承 QObject and QThread, 因为QThread在Qt2中没有继承QThread.

大家觉得好用的话给我的project点下good! thx!

求助:如何显示tar或tar.xxx包中的总文件数?用于解压时设置总步长
附件:
文件注释: E6手机上

qop-ezx.png [ 15.04 KiB | 被浏览 13 次 ]
文件注释: ubuntu 上

qop-ubuntu.png [ 45.21 KiB | 被浏览 13 次 ]

文件注释: windows上的效果

qop-win.png [ 57.26 KiB | 被浏览 13 次 ]

作者: novesky   发布时间: 2010-09-15

作者: photor   发布时间: 2010-09-15