OSDN Git Service

Updated copyright year.
[x264-launcher/x264-launcher.git] / src / thread_binaries.h
index 8b258f4..f08b8e1 100644 (file)
@@ -1,6 +1,6 @@
 ///////////////////////////////////////////////////////////////////////////////
 // Simple x264 Launcher
-// Copyright (C) 2004-2019 LoRd_MuldeR <MuldeR2@GMX.de>
+// Copyright (C) 2004-2022 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
 
 #pragma once
 
-#include <QThread>
+#include "thread_startup.h"
+
+//Qt
 #include <QMutex>
 
 class QLibrary;
 class SysinfoModel;
 class QFile;
 
-class BinariesCheckThread : public QThread
+class BinariesCheckThread : public StarupThread
 {
        Q_OBJECT
 
 public:
-       static bool check(SysinfoModel *sysinfo);
+       static bool check(const SysinfoModel *const sysinfo, QString *const failedPath = NULL);
 
 protected:
        BinariesCheckThread(const SysinfoModel *const sysinfo);
        ~BinariesCheckThread(void);
-
-       int getSuccess(void) { return m_success; }
-       bool getException(void) { return m_exception; }
-
-private slots:
-       void start(Priority priority = InheritPriority) { QThread::start(priority); }
+       
+       const QString& getFailedPath(void) { return m_failedPath; }
 
 private:
-       volatile bool m_exception;
-       volatile bool m_success;
+       QString m_failedPath;
        const SysinfoModel *const m_sysinfo;
 
        static const size_t MAX_BINARIES = 32;
@@ -57,8 +54,6 @@ private:
        //Entry point
        virtual void run(void);
 
-       //Functions
-       static void checkBinaries1(volatile bool &success, const SysinfoModel *const sysinfo, volatile bool *exception);
-       static void checkBinaries2(volatile bool &success, const SysinfoModel *const sysinfo, volatile bool *exception);
-       static void checkBinaries3(volatile bool &success, const SysinfoModel *const sysinfo);
+       //Thread main
+       virtual int threadMain(void);
 };