source: calamares/trunk/fuentes/src/libcalamares/Job.cpp @ 7538

Last change on this file since 7538 was 7538, checked in by kbut, 18 months ago

sync with github

File size: 1.9 KB
RevLine 
[7538]1/* === This file is part of Calamares - <https://github.com/calamares> ===
2 *
3 *   Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
4 *
5 *   Calamares is free software: you can redistribute it and/or modify
6 *   it under the terms of the GNU General Public License as published by
7 *   the Free Software Foundation, either version 3 of the License, or
8 *   (at your option) any later version.
9 *
10 *   Calamares is distributed in the hope that it will be useful,
11 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
12 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 *   GNU General Public License for more details.
14 *
15 *   You should have received a copy of the GNU General Public License
16 *   along with Calamares. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#include "Job.h"
20
21namespace Calamares
22{
23
24JobResult::JobResult( JobResult&& rhs ) :
25      m_ok( rhs.m_ok )
26    , m_message( std::move( rhs.m_message ) )
27    , m_details( std::move( rhs.m_details ) )
28{
29}
30
31JobResult::operator bool() const
32{
33    return m_ok;
34}
35
36
37QString
38JobResult::message() const
39{
40    return m_message;
41}
42
43
44void
45JobResult::setMessage( const QString& message )
46{
47    m_message = message;
48}
49
50
51QString
52JobResult::details() const
53{
54    return m_details;
55}
56
57
58void
59JobResult::setDetails( const QString& details )
60{
61    m_details = details;
62}
63
64JobResult
65JobResult::ok()
66{
67    return JobResult( true, QString(), QString() );
68}
69
70
71JobResult
72JobResult::error( const QString& message, const QString& details )
73{
74    return JobResult( false, message, details );
75}
76
77
78JobResult::JobResult( bool ok, const QString& message, const QString& details )
79    : m_ok( ok )
80    , m_message( message )
81    , m_details( details )
82{}
83
84
85Job::Job( QObject* parent )
86    : QObject( parent )
87{
88}
89
90
91Job::~Job()
92{}
93
94
95QString
96Job::prettyDescription() const
97{
98    return QString();
99}
100
101
102QString
103Job::prettyStatusMessage() const
104{
105    return QString();
106}
107
108
109} // namespace Calamares
Note: See TracBrowser for help on using the repository browser.