summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRagnar Thomsen <[email protected]>2015-05-31 13:32:16 +0200
committerRagnar Thomsen <[email protected]>2015-05-31 13:32:16 +0200
commit8b18fc24ee1d12cf4458df83678a5042a27e8924 (patch)
tree553ca7e535f16dcb9529ecd313472f7abaddccc4
parent0b315d81d31fa78fd219acfb2680209c2e114f57 (diff)
Job: Make QElapsedTimer a regular object and not a pointer
There is no need for the QElapsedTimer being a pointer. Also it was leaking due to a missing delete statement.
-rw-r--r--kerfuffle/jobs.cpp8
-rw-r--r--kerfuffle/jobs.h2
2 files changed, 3 insertions, 7 deletions
diff --git a/kerfuffle/jobs.cpp b/kerfuffle/jobs.cpp
index 253a225..9bef297 100644
--- a/kerfuffle/jobs.cpp
+++ b/kerfuffle/jobs.cpp
@@ -80,8 +80,6 @@ Job::Job(ReadOnlyArchiveInterface *interface, QObject *parent)
}
setCapabilities(KJob::Killable);
-
- jobTimer = new QElapsedTimer;
}
Job::~Job()
@@ -110,7 +108,7 @@ bool Job::wasCancelled() const
void Job::start()
{
- jobTimer->start();
+ jobTimer.start();
m_isRunning = true;
d->start();
}
@@ -168,7 +166,7 @@ void Job::onEntryRemoved(const QString & path)
void Job::onFinished(bool result)
{
- qCDebug(KERFUFFLE) << "Job finished, result:" << result << ", time:" << jobTimer->elapsed() << "ms";
+ qCDebug(KERFUFFLE) << "Job finished, result:" << result << ", time:" << jobTimer.elapsed() << "ms";
archiveInterface()->disconnect(this);
@@ -201,8 +199,6 @@ ListJob::ListJob(ReadOnlyArchiveInterface *interface, QObject *parent)
void ListJob::doWork()
{
-
-
emit description(this, i18n("Loading archive..."));
connectToArchiveInterfaceSignals();
bool ret = archiveInterface()->list();
diff --git a/kerfuffle/jobs.h b/kerfuffle/jobs.h
index aea43c6..55c4510 100644
--- a/kerfuffle/jobs.h
+++ b/kerfuffle/jobs.h
@@ -88,7 +88,7 @@ private:
bool m_isRunning;
bool m_wasCancelled;
- QElapsedTimer *jobTimer;
+ QElapsedTimer jobTimer;
class Private;
Private * const d;