diff options
| author | Al <26797547+Al12rs@users.noreply.github.com> | 2020-06-07 03:44:05 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-07 03:44:05 -0700 |
| commit | bf055e804879c0a74750c7b60dbeababeafd3a23 (patch) | |
| tree | 75f47a25da8c8045dd195f42c8c218acb425d3db /src/installationmanager.h | |
| parent | 226b2b1843bbf41581757f44f8a2f4728f0a4b19 (diff) | |
| parent | 0ad56591fd9581aa9195f854ac3fc1b40d5b1802 (diff) | |
Merge pull request #1101 from Holt59/archive-lib-modification
Archive lib refactoring
Diffstat (limited to 'src/installationmanager.h')
| -rw-r--r-- | src/installationmanager.h | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/src/installationmanager.h b/src/installationmanager.h index cb355641..1d94151f 100644 --- a/src/installationmanager.h +++ b/src/installationmanager.h @@ -189,14 +189,6 @@ public: private: - void queryPassword(QString *password); - void updateProgress(float percentage); - void updateProgressFile(const QString &fileName); - void report7ZipError(const QString &errorMessage); - - // Recursive worker function for mapToArchive (takes raw reference for "speed"). - bool unpackSingleFile(const QString &fileName); - MOBase::IPluginInstaller::EInstallResult doInstall(MOBase::GuessedValue<QString> &modName, QString gameName, int modID, const QString &version, const QString &newestVersion, int categoryID, int fileCategoryID, const QString &repository); @@ -212,10 +204,29 @@ private: void postInstallCleanup(); +private slots: + + /** + * @brief Query user for password and update the m_Password field. + */ + void queryPassword(); + signals: - void progressUpdate(float percentage); - void progressUpdate(QString const fileName); + /** + * @brief Emitted when a password is requested from the archive wrapper. + */ + void passwordRequested(); + + /** + * @brief Progress update from the extraction. + */ + void progressUpdate(int percentage); + + /** + * @brief File change update from the extraction. + */ + void progressFileChange(QString const& value); private: @@ -244,7 +255,7 @@ private: * @return true if the extraction was successful, false if the extraciton was * cancelled. If an error occured, an exception is thrown. */ - bool extractFiles(QDir extractPath); + bool extractFiles(QString extractPath, QString title, bool showFilenames); private: @@ -258,18 +269,14 @@ private: std::vector<MOBase::IPluginInstaller*> m_Installers; std::set<QString, CaseInsensitive> m_SupportedExtensions; - Archive *m_ArchiveHandler; + // Archive management: + std::unique_ptr<Archive> m_ArchiveHandler; QString m_CurrentFile; - QString m_ErrorMessage; + QString m_Password; // Map from entries in the tree that is used by the installer and absolute // paths to temporary files: std::map<std::shared_ptr<const MOBase::FileTreeEntry>, QString> m_CreatedFiles; - - QProgressDialog *m_InstallationProgress { nullptr }; - int m_Progress; - QString m_ProgressFile; - std::set<QString> m_TempFilesToDelete; QString m_URL; |
