OSDN Git Service

Bump x265 version.
[x264-launcher/x264-launcher.git] / src / win_updater.h
index 1668695..cdc8bd0 100644 (file)
@@ -1,6 +1,6 @@
 ///////////////////////////////////////////////////////////////////////////////
 // Simple x264 Launcher
-// Copyright (C) 2004-2014 LoRd_MuldeR <MuldeR2@GMX.de>
+// Copyright (C) 2004-2016 LoRd_MuldeR <MuldeR2@GMX.de>
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
@@ -22,9 +22,9 @@
 #pragma once
 
 #include <QDialog>
+#include <QMap>
 
 class QMovie;
-class UpdateCheckThread;
 class SysinfoModel;
 
 namespace Ui
@@ -32,6 +32,11 @@ namespace Ui
        class UpdaterDialog;
 }
 
+namespace MUtils
+{
+       class UpdateChecker;
+}
+
 class UpdaterDialog : public QDialog
 {
        Q_OBJECT
@@ -40,7 +45,16 @@ public:
        UpdaterDialog(QWidget *parent, const SysinfoModel *sysinfo, const char *const updateUrl);
        ~UpdaterDialog(void);
 
+       typedef struct
+       {
+               const char* name;
+               const char* hash;
+               const bool  exec;
+       }
+       binary_t;
+
        static const int READY_TO_INSTALL_UPDATE = 42;
+       static const binary_t BINARIES[];
 
        inline bool getSuccess(void) { return m_success; }
 
@@ -63,8 +77,9 @@ private slots:
 private:
        Ui::UpdaterDialog *const ui;
 
-       bool checkBinaries(QString &wgetBin, QString &gpgvBin);
+       bool checkBinaries();
        bool checkFileHash(const QString &filePath, const char *expectedHash);
+       void cleanFiles(void);
 
        const SysinfoModel *const m_sysinfo;
        const char *const m_updateUrl;
@@ -72,11 +87,11 @@ private:
        bool m_firstShow;
        bool m_success;
 
-       QMovie *m_animator;
-       UpdateCheckThread *m_thread;
+       QScopedPointer<QMovie> m_animator;
+       QScopedPointer<MUtils::UpdateChecker> m_thread;
+
        unsigned long m_updaterProcess;
        QStringList m_logFile;
-       QString m_keysFile;
-       QString m_wupdFile;
+       QMap<QString,QString> m_binaries;
        int m_status;
 };