From 32b3ed0a1362a4b0798ad71fac3450fb77cb7e41 Mon Sep 17 00:00:00 2001 From: Thomas Groman Date: Thu, 19 Sep 2019 00:41:48 -0700 Subject: merged from 0.6.7 codebase --- api/logic/launch/LaunchTask.h | 136 +++++++++++++++++++++--------------------- 1 file changed, 68 insertions(+), 68 deletions(-) (limited to 'api/logic/launch/LaunchTask.h') diff --git a/api/logic/launch/LaunchTask.h b/api/logic/launch/LaunchTask.h index 746d6d19..ee04bd9a 100644 --- a/api/logic/launch/LaunchTask.h +++ b/api/logic/launch/LaunchTask.h @@ -1,4 +1,4 @@ -/* Copyright 2013-2018 MultiMC Contributors +/* Copyright 2013-2019 MultiMC Contributors * * Authors: Orochimarufan * @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -28,98 +28,98 @@ class MULTIMC_LOGIC_EXPORT LaunchTask: public Task { - Q_OBJECT + Q_OBJECT protected: - explicit LaunchTask(InstancePtr instance); - void init(); + explicit LaunchTask(InstancePtr instance); + void init(); public: - enum State - { - NotStarted, - Running, - Waiting, - Failed, - Aborted, - Finished - }; + enum State + { + NotStarted, + Running, + Waiting, + Failed, + Aborted, + Finished + }; public: /* methods */ - static std::shared_ptr create(InstancePtr inst); - virtual ~LaunchTask() {}; + static shared_qobject_ptr create(InstancePtr inst); + virtual ~LaunchTask() {}; - void appendStep(std::shared_ptr step); - void prependStep(std::shared_ptr step); - void setCensorFilter(QMap filter); + void appendStep(shared_qobject_ptr step); + void prependStep(shared_qobject_ptr step); + void setCensorFilter(QMap filter); - InstancePtr instance() - { - return m_instance; - } + InstancePtr instance() + { + return m_instance; + } - void setPid(qint64 pid) - { - m_pid = pid; - } + void setPid(qint64 pid) + { + m_pid = pid; + } - qint64 pid() - { - return m_pid; - } + qint64 pid() + { + return m_pid; + } - /** - * @brief prepare the process for launch (for multi-stage launch) - */ - virtual void executeTask() override; + /** + * @brief prepare the process for launch (for multi-stage launch) + */ + virtual void executeTask() override; - /** - * @brief launch the armed instance - */ - void proceed(); + /** + * @brief launch the armed instance + */ + void proceed(); - /** - * @brief abort launch - */ - bool abort() override; + /** + * @brief abort launch + */ + bool abort() override; - bool canAbort() const override; + bool canAbort() const override; - shared_qobject_ptr getLogModel(); + shared_qobject_ptr getLogModel(); public: - QString substituteVariables(const QString &cmd) const; - QString censorPrivateInfo(QString in); + QString substituteVariables(const QString &cmd) const; + QString censorPrivateInfo(QString in); protected: /* methods */ - virtual void emitFailed(QString reason) override; - virtual void emitSucceeded() override; + virtual void emitFailed(QString reason) override; + virtual void emitSucceeded() override; signals: - /** - * @brief emitted when the launch preparations are done - */ - void readyForLaunch(); + /** + * @brief emitted when the launch preparations are done + */ + void readyForLaunch(); - void requestProgress(Task *task); + void requestProgress(Task *task); - void requestLogging(); + void requestLogging(); public slots: - void onLogLines(const QStringList& lines, MessageLevel::Enum defaultLevel = MessageLevel::MultiMC); - void onLogLine(QString line, MessageLevel::Enum defaultLevel = MessageLevel::MultiMC); - void onReadyForLaunch(); - void onStepFinished(); - void onProgressReportingRequested(); + void onLogLines(const QStringList& lines, MessageLevel::Enum defaultLevel = MessageLevel::MultiMC); + void onLogLine(QString line, MessageLevel::Enum defaultLevel = MessageLevel::MultiMC); + void onReadyForLaunch(); + void onStepFinished(); + void onProgressReportingRequested(); private: /*methods */ - void finalizeSteps(bool successful, const QString & error); + void finalizeSteps(bool successful, const QString & error); protected: /* data */ - InstancePtr m_instance; - shared_qobject_ptr m_logModel; - QList > m_steps; - QMap m_censorFilter; - int currentStep = -1; - State state = NotStarted; - qint64 m_pid = -1; + InstancePtr m_instance; + shared_qobject_ptr m_logModel; + QList > m_steps; + QMap m_censorFilter; + int currentStep = -1; + State state = NotStarted; + qint64 m_pid = -1; }; -- cgit v1.2.3