diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2020-09-26 17:51:33 +0200 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2020-09-27 09:28:21 +0200 |
commit | f1f72ff8df68e190a43a56d14dfc820d1e58d96b (patch) | |
tree | c6859d79e193b6ab71c33546c9a3409f473e25db /rbutil/rbutilqt/base/zipinstaller.h | |
parent | 9d8bcbeb2abf0593ae9d804d038c3821693e7131 (diff) | |
download | rockbox-f1f72ff8df68e190a43a56d14dfc820d1e58d96b.tar.gz rockbox-f1f72ff8df68e190a43a56d14dfc820d1e58d96b.zip |
rbutil: Code cleanup.
- Fix naming.
- Remove non-functional functionality to set cache folder.
- Use URL filename part when copying the file if target filename is not set.
Change-Id: Ic9af59300f06d4309c6a4c9542d4f6079dd841c3
Diffstat (limited to 'rbutil/rbutilqt/base/zipinstaller.h')
-rw-r--r-- | rbutil/rbutilqt/base/zipinstaller.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/rbutil/rbutilqt/base/zipinstaller.h b/rbutil/rbutilqt/base/zipinstaller.h index 97a5156ee8..59a0f785d9 100644 --- a/rbutil/rbutilqt/base/zipinstaller.h +++ b/rbutil/rbutilqt/base/zipinstaller.h @@ -28,11 +28,15 @@ #include "httpget.h" #include "Logger.h" +/** Install a file or zip. + * Downloads file(s) from a given URL, and installs by either extracting or + * copying it to the target path set by setMountpoint(). + */ class ZipInstaller : public QObject { Q_OBJECT public: - ZipInstaller(QObject* parent) ; + ZipInstaller(QObject* parent); ~ZipInstaller(){} void install(void); void setMountPoint(QString mountpoint) {m_mountpoint = mountpoint;} @@ -44,11 +48,12 @@ public: { m_verlist = QStringList(v); LOG_INFO() << m_verlist;} void setLogVersion(QStringList v) { m_verlist = v; LOG_INFO() << m_verlist;} + /** Change between copy and unzip mode. */ void setUnzip(bool i) { m_unzip = i; } + /** Set target filename for copy mode. + * If not set the filename part of the download URL is used. */ void setTarget(QString t) { m_target = t; } - void setCache(QDir c) { m_cache = c; m_usecache = true; }; - void setCache(bool c) { m_usecache = c; }; - void setCache(QString c) { m_cache = QDir(c); m_usecache = true; } + void setCache(bool c) { m_usecache = c; } public slots: void abort(void); @@ -70,8 +75,7 @@ private: QStringList m_urllist, m_loglist, m_verlist; bool m_unzip; QString m_target; - int runner; - QDir m_cache; + int m_runner; bool m_usecache; HttpGet *m_getter; |