NOISSUE Revert all recent changes to NetAction and NetJob
This commit is contained in:
@ -42,7 +42,7 @@ void SequentialTask::subTaskFailed(const QString &msg)
|
||||
}
|
||||
void SequentialTask::subTaskStatus(const QString &msg)
|
||||
{
|
||||
setStatusText(msg);
|
||||
setStatus(msg);
|
||||
}
|
||||
void SequentialTask::subTaskProgress(qint64 current, qint64 total)
|
||||
{
|
||||
|
@ -21,12 +21,12 @@ Task::Task(QObject *parent) : QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
void Task::setStatusText(const QString &new_status)
|
||||
void Task::setStatus(const QString &new_status)
|
||||
{
|
||||
if(m_statusText != new_status)
|
||||
if(m_status != new_status)
|
||||
{
|
||||
m_statusText = new_status;
|
||||
emit status(m_statusText);
|
||||
m_status = new_status;
|
||||
emit status(m_status);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,16 +23,6 @@
|
||||
class MULTIMC_LOGIC_EXPORT Task : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum class Status
|
||||
{
|
||||
NotStarted,
|
||||
InProgress,
|
||||
Finished,
|
||||
Failed,
|
||||
Aborted,
|
||||
Failed_Proceed
|
||||
};
|
||||
public:
|
||||
explicit Task(QObject *parent = 0);
|
||||
virtual ~Task() {};
|
||||
@ -53,22 +43,19 @@ public:
|
||||
*/
|
||||
virtual QString failReason() const;
|
||||
|
||||
virtual bool canAbort() const
|
||||
virtual bool canAbort() const { return false; }
|
||||
|
||||
QString getStatus()
|
||||
{
|
||||
return false;
|
||||
return m_status;
|
||||
}
|
||||
|
||||
QString getStatusText()
|
||||
{
|
||||
return m_statusText;
|
||||
}
|
||||
|
||||
virtual qint64 getProgress()
|
||||
qint64 getProgress()
|
||||
{
|
||||
return m_progress;
|
||||
}
|
||||
|
||||
virtual qint64 getTotalProgress()
|
||||
qint64 getTotalProgress()
|
||||
{
|
||||
return m_progressTotal;
|
||||
}
|
||||
@ -81,12 +68,10 @@ signals:
|
||||
void failed(QString reason);
|
||||
void status(QString status);
|
||||
|
||||
public slots:
|
||||
public
|
||||
slots:
|
||||
virtual void start();
|
||||
virtual bool abort()
|
||||
{
|
||||
return false;
|
||||
};
|
||||
virtual bool abort() { return false; };
|
||||
|
||||
protected:
|
||||
virtual void executeTask() = 0;
|
||||
@ -96,18 +81,16 @@ protected slots:
|
||||
virtual void emitFailed(QString reason);
|
||||
|
||||
public slots:
|
||||
void setStatusText(const QString &status);
|
||||
void setStatus(const QString &status);
|
||||
void setProgress(qint64 current, qint64 total);
|
||||
|
||||
protected:
|
||||
// FIXME: replace these with the m_status from NetAction
|
||||
bool m_running = false;
|
||||
bool m_finished = false;
|
||||
bool m_succeeded = false;
|
||||
QString m_failReason = "";
|
||||
QString m_statusText;
|
||||
|
||||
qint64 m_progress = 0;
|
||||
qint64 m_progressTotal = 1;
|
||||
QString m_status;
|
||||
int m_progress = 0;
|
||||
int m_progressTotal = 100;
|
||||
};
|
||||
|
||||
|
@ -32,7 +32,7 @@ void ThreadTask::iternal_started()
|
||||
|
||||
void ThreadTask::iternal_status(QString status)
|
||||
{
|
||||
setStatusText(status);
|
||||
setStatus(status);
|
||||
}
|
||||
|
||||
void ThreadTask::iternal_succeeded()
|
||||
|
Reference in New Issue
Block a user