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:
Eike Ziller
2020-06-08 09:35:25 +02:00
parent 7cedde2a0a
commit 18ee72ac3f
2 changed files with 93 additions and 26 deletions

View File

@@ -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