Unify 7zip CompressedArchive interface for Windows and Unix.

This works on macos.
This commit is contained in:
Luis Ángel San Martín Rodríguez
2023-07-17 19:53:21 +02:00
parent c3a2eb63b5
commit 7bc42ba1c0
5 changed files with 169 additions and 418 deletions

View File

@ -3,11 +3,6 @@
#include <QObject>
#ifdef Q_OS_UNIX
#include "libp7zip/CPP/7zip/ICoder.h"
#include "libp7zip/CPP/Common/MyCom.h"
#endif
class ExtractDelegate;
class QLibrary;
@ -19,32 +14,13 @@ struct SevenZipInterface;
class MyCodecs;
#ifdef Q_OS_UNIX
class CompressedArchive : public QObject, public ICompressCodecsInfo, public CMyUnknownImp
#else
class CompressedArchive : public QObject
#endif
{
Q_OBJECT
public:
explicit CompressedArchive(const QString &filePath, QObject *parent = 0);
~CompressedArchive();
#ifdef Q_OS_UNIX
MY_UNKNOWN_IMP
STDMETHOD(GetNumMethods)
(UInt32 *numMethods);
STDMETHOD(GetProperty)
(UInt32 index, PROPID propID, PROPVARIANT *value);
STDMETHOD(CreateDecoder)
(UInt32 index, const GUID *iid, void **coder);
STDMETHOD(CreateEncoder)
(UInt32 index, const GUID *iid, void **coder);
bool isRar;
#endif
signals:
public slots:
@ -60,9 +36,6 @@ private:
SevenZipInterface *szInterface;
QLibrary *sevenzLib;
#ifdef Q_OS_UNIX
QLibrary *rarLib;
#endif
bool loadFunctions();
bool tools;
bool valid;