Move implementation to cpp file.

main
Teo Mrnjavac 11 years ago
parent 6881fdab6e
commit d1151d87cf

@ -21,12 +21,56 @@
namespace Calamares 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 ) Job::Job( QObject* parent )
: QObject( parent ) : QObject( parent )
{ {
} }
Job::~Job() Job::~Job()
{} {}
} // namespace Calamares } // namespace Calamares

@ -29,41 +29,22 @@ namespace Calamares {
class DLLEXPORT JobResult class DLLEXPORT JobResult
{ {
public: public:
operator bool() const operator bool() const;
{
return m_ok;
}
QString message() const QString message() const;
{
return m_message;
}
QString details() const QString details() const;
{
return m_details;
}
static JobResult ok() static JobResult ok();
{
return JobResult( true, QString(), QString() );
}
static JobResult error( const QString& message, const QString& details = QString() ) static JobResult error( const QString& message, const QString& details = QString() );
{
return JobResult( false, message, 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 ) JobResult( bool ok, const QString& message, const QString& details );
: m_ok( ok )
, m_message( message )
, m_details( details )
{}
}; };
class DLLEXPORT Job : public QObject class DLLEXPORT Job : public QObject

Loading…
Cancel
Save