mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-13 07:35:41 +08:00
Rewrite 7z uncompressing to work on all supported platforms
On Windows we ship 7za.exe in our binaries. On MacOS we do the same, but the executable needs to be called with the full path. On Linux we don't ship anything but assume it to be available from the distribution.
This commit is contained in:
committed by
Klaus Basan
parent
2843e20d54
commit
659b78832e
@@ -16,19 +16,23 @@
|
||||
#include <QByteArray>
|
||||
#include <QStringList>
|
||||
|
||||
class QProcess;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
//! Compress utilities
|
||||
class BLACKMISC_EXPORT CCompressUtils
|
||||
{
|
||||
public:
|
||||
CCompressUtils() = delete;
|
||||
|
||||
//! Length header
|
||||
//! \remark 4 bytes -> 32bit
|
||||
static QByteArray lengthHeader(qint32 size);
|
||||
|
||||
//! Unzip my using 7zip
|
||||
//! \remark relies on external 7zip command line
|
||||
static bool zip7Uncompress(const QString &file, const QString &directory, bool wait, QStringList *stdOutAndError = nullptr);
|
||||
static bool zip7Uncompress(const QString &file, const QString &directory, QStringList *stdOutAndError = nullptr);
|
||||
|
||||
//! External program existing?
|
||||
//! \remark relies on external 7zip command line
|
||||
@@ -39,9 +43,10 @@ namespace BlackMisc
|
||||
static bool whichZip7(QStringList *stdOutAndError = nullptr);
|
||||
|
||||
private:
|
||||
//! Ctor
|
||||
CCompressUtils() {}
|
||||
static bool runZip7Process(QProcess *zipProcess, QStringList *stdOutAndError);
|
||||
|
||||
};
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
|
||||
|
||||
Reference in New Issue
Block a user