forked from qt-creator/qt-creator
Utils/Archive: Add simple async API
So we can integrate it deeper into the plugin wizard. Change-Id: I7f7a9eb8e07d3eeab6a4ecf92161f7d04f5fa5c2 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -29,14 +29,29 @@
|
||||
|
||||
#include "fileutils.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QProcess>
|
||||
|
||||
namespace Utils {
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT Archive
|
||||
class QTCREATOR_UTILS_EXPORT Archive : public QObject
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(Utils::Archive)
|
||||
Q_OBJECT
|
||||
public:
|
||||
static bool supportsFile(const FilePath &filePath, QString *reason = nullptr);
|
||||
static bool unarchive(const FilePath &src, const FilePath &dest, QWidget *parent);
|
||||
static Archive *unarchive(const FilePath &src, const FilePath &dest);
|
||||
|
||||
void cancel();
|
||||
|
||||
signals:
|
||||
void outputReceived(const QString &output);
|
||||
void finished(bool success);
|
||||
|
||||
private:
|
||||
Archive() = default;
|
||||
|
||||
QProcess *m_process = nullptr;
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
|
||||
Reference in New Issue
Block a user