NOISSUE eliminate ProgressProvider

This commit is contained in:
Petr Mrázek
2015-04-26 23:04:50 +02:00
parent 84549ed807
commit f8650e3965
32 changed files with 80 additions and 123 deletions

View File

@ -33,7 +33,7 @@ void JavaCheckerJob::partFinished(JavaCheckResult result)
}
}
void JavaCheckerJob::start()
void JavaCheckerJob::executeTask()
{
qDebug() << m_job_name.toLocal8Bit() << " started.";
m_running = true;

View File

@ -18,16 +18,16 @@
#include <QtNetwork>
#include <QLabel>
#include "JavaChecker.h"
#include "tasks/ProgressProvider.h"
#include "tasks/Task.h"
class JavaCheckerJob;
typedef std::shared_ptr<JavaCheckerJob> JavaCheckerJobPtr;
class JavaCheckerJob : public ProgressProvider
class JavaCheckerJob : public Task
{
Q_OBJECT
public:
explicit JavaCheckerJob(QString job_name) : ProgressProvider(), m_job_name(job_name) {};
explicit JavaCheckerJob(QString job_name) : Task(), m_job_name(job_name) {};
bool addJavaCheckerAction(JavaCheckerPtr base)
{
@ -66,17 +66,17 @@ public:
signals:
void started();
void progress(int current, int total);
void finished(QList<JavaCheckResult>);
public
slots:
virtual void start();
// FIXME: implement
public slots:
virtual void abort() {};
private
slots:
private slots:
void partFinished(JavaCheckResult result);
protected:
virtual void executeTask() override;
private:
QString m_job_name;
QList<JavaCheckerPtr> javacheckers;

View File

@ -178,7 +178,7 @@ void JavaListLoadTask::executeTask()
m_job = std::shared_ptr<JavaCheckerJob>(new JavaCheckerJob("Java detection"));
connect(m_job.get(), SIGNAL(finished(QList<JavaCheckResult>)), this, SLOT(javaCheckerFinished(QList<JavaCheckResult>)));
connect(m_job.get(), SIGNAL(progress(int, int)), this, SLOT(checkerProgress(int, int)));
connect(m_job.get(), SIGNAL(progress(qint64,qint64)), this, SLOT(checkerProgress(qint64, qint64)));
qDebug() << "Probing the following Java paths: ";
int id = 0;
@ -197,7 +197,7 @@ void JavaListLoadTask::executeTask()
m_job->start();
}
void JavaListLoadTask::checkerProgress(int current, int total)
void JavaListLoadTask::checkerProgress(qint64 current, qint64 total)
{
float progress = (current * 100.0) / total;
this->setProgress((int) progress);

View File

@ -87,7 +87,7 @@ public:
virtual void executeTask();
public slots:
void javaCheckerFinished(QList<JavaCheckResult> results);
void checkerProgress(int current, int total);
void checkerProgress(qint64 current, qint64 total);
protected:
std::shared_ptr<JavaCheckerJob> m_job;