diff options
author | kh1 <karsten.heimrich@nokia.com> | 2011-10-04 12:46:04 +0200 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@nokia.com> | 2011-10-04 13:52:21 +0200 |
commit | f06c311b10bc33a64249db7be331a8f9267c2ddb (patch) | |
tree | 0854acbbe3335ed24cc44a9fc503b104ebef5924 /installerbuilder/installerbase/installerbase_p.h | |
parent | 763a7c5e63423935568a6414b84b9762ec32f603 (diff) |
Implement mechanism to update the maintenace tool.
Have an option to update the maintenace tool without using
the full installer binary. This can be used as fallback in
case the updater/ package manger won't start anymore.
Change-Id: I36be195203cb0172484d739c9f14a2e073ab7792
Reviewed-on: http://codereview.qt-project.org/5885
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Karsten Heimrich <karsten.heimrich@nokia.com>
Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>
Diffstat (limited to 'installerbuilder/installerbase/installerbase_p.h')
-rw-r--r-- | installerbuilder/installerbase/installerbase_p.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/installerbuilder/installerbase/installerbase_p.h b/installerbuilder/installerbase/installerbase_p.h index d896c8061..94d405766 100644 --- a/installerbuilder/installerbase/installerbase_p.h +++ b/installerbuilder/installerbase/installerbase_p.h @@ -33,6 +33,12 @@ #include <QtCore/QThread> #include <QtGui/QApplication> +namespace KDUpdater { + class FileDownloader; +} +class QFile; + + class Sleep : public QThread { public: @@ -47,7 +53,25 @@ class InstallerBase : public QObject Q_OBJECT; public: + InstallerBase(QObject *parent = 0); + ~InstallerBase(); + + int replaceMaintenanceToolBinary(QStringList arguments); static void showVersion(int &argc, char **argv, const QString &version); + +private slots: + void downloadStarted(); + void downloadFinished(); + void downloadProgress(double progress); + void downloadAborted(const QString& error); + +private: + void deferredRename(const QString &source, const QString &target); + void writeMaintenanceBinary(const QString &target, QFile *const source, qint64 size); + +private: + volatile bool m_downloadFinished; + QScopedPointer<KDUpdater::FileDownloader> m_downloader; }; class MyCoreApplication : public QCoreApplication |