From f8650e3965582a57c3d0ccb5f234e6229051b16a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 26 Apr 2015 23:04:50 +0200 Subject: NOISSUE eliminate ProgressProvider --- logic/java/JavaCheckerJob.cpp | 2 +- logic/java/JavaCheckerJob.h | 20 ++++++++++---------- logic/java/JavaVersionList.cpp | 4 ++-- logic/java/JavaVersionList.h | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) (limited to 'logic/java') diff --git a/logic/java/JavaCheckerJob.cpp b/logic/java/JavaCheckerJob.cpp index 149024c0..bf4271c2 100644 --- a/logic/java/JavaCheckerJob.cpp +++ b/logic/java/JavaCheckerJob.cpp @@ -33,7 +33,7 @@ void JavaCheckerJob::partFinished(JavaCheckResult result) } } -void JavaCheckerJob::start() +void JavaCheckerJob::executeTask() { qDebug() << m_job_name.toLocal8Bit() << " started."; m_running = true; diff --git a/logic/java/JavaCheckerJob.h b/logic/java/JavaCheckerJob.h index a98d88cd..84b6fc6f 100644 --- a/logic/java/JavaCheckerJob.h +++ b/logic/java/JavaCheckerJob.h @@ -18,16 +18,16 @@ #include #include #include "JavaChecker.h" -#include "tasks/ProgressProvider.h" +#include "tasks/Task.h" class JavaCheckerJob; typedef std::shared_ptr 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); -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 javacheckers; diff --git a/logic/java/JavaVersionList.cpp b/logic/java/JavaVersionList.cpp index bb5f025f..72fa6dc8 100644 --- a/logic/java/JavaVersionList.cpp +++ b/logic/java/JavaVersionList.cpp @@ -178,7 +178,7 @@ void JavaListLoadTask::executeTask() m_job = std::shared_ptr(new JavaCheckerJob("Java detection")); connect(m_job.get(), SIGNAL(finished(QList)), this, SLOT(javaCheckerFinished(QList))); - 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); diff --git a/logic/java/JavaVersionList.h b/logic/java/JavaVersionList.h index 820bd5a6..0117ea76 100644 --- a/logic/java/JavaVersionList.h +++ b/logic/java/JavaVersionList.h @@ -87,7 +87,7 @@ public: virtual void executeTask(); public slots: void javaCheckerFinished(QList results); - void checkerProgress(int current, int total); + void checkerProgress(qint64 current, qint64 total); protected: std::shared_ptr m_job; -- cgit v1.2.3