Make JobResult inheritable and remove obsolete Status enum.
This commit is contained in:
parent
f3fa124f8d
commit
3170067089
@ -29,37 +29,33 @@ namespace Calamares {
|
|||||||
class DLLEXPORT JobResult
|
class DLLEXPORT JobResult
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
operator bool() const;
|
virtual ~JobResult() {}
|
||||||
|
|
||||||
QString message() const;
|
virtual operator bool() const;
|
||||||
void setMessage( const QString& message );
|
|
||||||
|
|
||||||
QString details() const;
|
virtual QString message() const;
|
||||||
void setDetails( const QString& details );
|
virtual void setMessage( const QString& message );
|
||||||
|
|
||||||
|
virtual QString details() const;
|
||||||
|
virtual void setDetails( const QString& details );
|
||||||
|
|
||||||
static JobResult ok();
|
static JobResult ok();
|
||||||
|
|
||||||
static JobResult error( const QString& message, const QString& details = QString() );
|
static JobResult error( const QString& message, const QString& details = QString() );
|
||||||
|
|
||||||
|
protected:
|
||||||
|
explicit JobResult( bool ok, const QString& message, const QString& details );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_ok;
|
bool m_ok;
|
||||||
QString m_message;
|
QString m_message;
|
||||||
QString m_details;
|
QString m_details;
|
||||||
|
|
||||||
JobResult( bool ok, const QString& message, const QString& details );
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DLLEXPORT Job : public QObject
|
class DLLEXPORT Job : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
enum State
|
|
||||||
{
|
|
||||||
Pending = 0,
|
|
||||||
Running,
|
|
||||||
Finished
|
|
||||||
};
|
|
||||||
|
|
||||||
explicit Job( QObject* parent = nullptr );
|
explicit Job( QObject* parent = nullptr );
|
||||||
virtual ~Job();
|
virtual ~Job();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user