diff --git a/src/libcalamares/Job.cpp b/src/libcalamares/Job.cpp index 8d122d393..9e32ff47f 100644 --- a/src/libcalamares/Job.cpp +++ b/src/libcalamares/Job.cpp @@ -21,12 +21,56 @@ namespace Calamares { + +Calamares::JobResult::operator bool() const +{ + return m_ok; +} + + +QString +JobResult::message() const +{ + return m_message; +} + + +QString +JobResult::details() const +{ + return m_details; +} + + +JobResult +JobResult::ok() +{ + return JobResult( true, QString(), QString() ); +} + + +JobResult +JobResult::error( const QString& message, const QString& details ) +{ + return JobResult( false, message, details ); +} + + +JobResult::JobResult( bool ok, const QString& message, const QString& details ) + : m_ok( ok ) + , m_message( message ) + , m_details( details ) +{} + + Job::Job( QObject* parent ) : QObject( parent ) { } + Job::~Job() {} + } // namespace Calamares diff --git a/src/libcalamares/Job.h b/src/libcalamares/Job.h index 94e71a5fc..7ecc13ee3 100644 --- a/src/libcalamares/Job.h +++ b/src/libcalamares/Job.h @@ -29,41 +29,22 @@ namespace Calamares { class DLLEXPORT JobResult { public: - operator bool() const - { - return m_ok; - } + operator bool() const; - QString message() const - { - return m_message; - } + QString message() const; - QString details() const - { - return m_details; - } + QString details() const; - static JobResult ok() - { - return JobResult( true, QString(), QString() ); - } + static JobResult ok(); - static JobResult error( const QString& message, const QString& details = QString() ) - { - return JobResult( false, message, details ); - } + static JobResult error( const QString& message, const QString& details = QString() ); private: bool m_ok; QString m_message; QString m_details; - JobResult( bool ok, const QString& message, const QString& details ) - : m_ok( ok ) - , m_message( message ) - , m_details( details ) - {} + JobResult( bool ok, const QString& message, const QString& details ); }; class DLLEXPORT Job : public QObject